diff --git a/.yarn/patches/@metamask-snaps-sdk-npm-4.4.1-f1f7bb22cb.patch b/.yarn/patches/@metamask-snaps-sdk-npm-4.4.1-f1f7bb22cb.patch new file mode 100644 index 00000000000..0dae7848a68 --- /dev/null +++ b/.yarn/patches/@metamask-snaps-sdk-npm-4.4.1-f1f7bb22cb.patch @@ -0,0 +1,86 @@ +diff --git a/dist/index.js.map b/dist/index.js.map +index da7feadc6949b1fc3ebe7239b4f25db8583c47aa..e146a5978b99b12d9b717e5233099ca4027a3d64 100644 +--- a/dist/index.js.map ++++ b/dist/index.js.map +@@ -1 +1 @@ +-{"version":3,"sources":["../src/index.ts","../src/errors.ts","../src/internals/error-wrappers.ts","../src/internals/errors.ts","../src/internals/structs.ts","../src/internals/jsx.ts","../src/internals/svg.ts","../src/error-wrappers.ts","../src/images.ts","../src/ui/components/address.ts","../src/ui/builder.ts","../src/ui/nodes.ts","../src/ui/components/copyable.ts","../src/ui/components/divider.ts","../src/ui/components/heading.ts","../src/ui/components/image.ts","../src/ui/components/panel.ts","../src/ui/components/button.ts","../src/ui/components/form.ts","../src/ui/components/input.ts","../src/ui/components/row.ts","../src/ui/components/text.ts","../src/ui/components/spinner.ts","../src/ui/component.ts","../src/types/handlers/transaction.ts","../src/types/handlers/user-input.ts","../src/types/methods/dialog.ts","../src/types/methods/get-file.ts","../src/types/methods/manage-state.ts","../src/types/methods/notify.ts","../src/types/interface.ts","../src/jsx/validation.ts"],"sourcesContent":["// Only internals that are used by other Snaps packages should be exported here.\nexport type { EnumToUnion } from './internals';\nexport {\n getErrorData,\n getErrorMessage,\n getErrorStack,\n SNAP_ERROR_CODE,\n SNAP_ERROR_MESSAGE,\n literal,\n union,\n enumValue,\n parseSvg,\n isSvg,\n} from './internals';\n\n// Re-exported from `@metamask/utils` for convenience.\nexport type {\n Json,\n JsonRpcError,\n JsonRpcRequest,\n JsonRpcParams,\n} from '@metamask/utils';\nexport { assert } from '@metamask/utils';\n\nexport * from './errors';\nexport * from './error-wrappers';\nexport * from './images';\nexport * from './types';\nexport * from './ui';\n","import type { Json, JsonRpcError } from '@metamask/utils';\n\nimport {\n getErrorCode,\n getErrorData,\n getErrorMessage,\n SNAP_ERROR_CODE,\n SNAP_ERROR_MESSAGE,\n} from './internals';\n\n/**\n * A generic error which can be thrown by a Snap, without it causing the Snap to\n * crash.\n */\nexport class SnapError extends Error {\n readonly #code: number;\n\n readonly #message: string;\n\n readonly #data?: Record;\n\n readonly #stack?: string;\n\n /**\n * Create a new `SnapError`.\n *\n * @param error - The error to create the `SnapError` from. If this is a\n * `string`, it will be used as the error message. If this is an `Error`, its\n * `message` property will be used as the error message. If this is a\n * `JsonRpcError`, its `message` property will be used as the error message\n * and its `code` property will be used as the error code. Otherwise, the\n * error will be converted to a string and used as the error message.\n * @param data - Additional data to include in the error. This will be merged\n * with the error data, if any.\n */\n constructor(\n error: string | Error | JsonRpcError,\n data: Record = {},\n ) {\n const message = getErrorMessage(error);\n super(message);\n\n this.#message = message;\n this.#code = getErrorCode(error);\n\n const mergedData = { ...getErrorData(error), ...data };\n if (Object.keys(mergedData).length > 0) {\n this.#data = mergedData;\n }\n\n this.#stack = super.stack;\n }\n\n /**\n * The error name.\n *\n * @returns The error name.\n */\n get name() {\n return 'SnapError';\n }\n\n /**\n * The error code.\n *\n * @returns The error code.\n */\n get code() {\n return this.#code;\n }\n\n /**\n * The error message.\n *\n * @returns The error message.\n */\n // This line is covered, but Jest doesn't pick it up for some reason.\n /* istanbul ignore next */\n get message() {\n return this.#message;\n }\n\n /**\n * Additional data for the error.\n *\n * @returns Additional data for the error.\n */\n get data() {\n return this.#data;\n }\n\n /**\n * The error stack.\n *\n * @returns The error stack.\n */\n // This line is covered, but Jest doesn't pick it up for some reason.\n /* istanbul ignore next */\n get stack() {\n return this.#stack;\n }\n\n /**\n * Convert the error to a JSON object.\n *\n * @returns The JSON object.\n */\n toJSON(): SerializedSnapError {\n return {\n code: SNAP_ERROR_CODE,\n message: SNAP_ERROR_MESSAGE,\n data: {\n cause: {\n code: this.code,\n message: this.message,\n stack: this.stack,\n ...(this.data ? { data: this.data } : {}),\n },\n },\n };\n }\n\n /**\n * Serialize the error to a JSON object. This is called by\n * `@metamask/rpc-errors` when serializing the error.\n *\n * @returns The JSON object.\n */\n serialize() {\n return this.toJSON();\n }\n}\n\n/**\n * A serialized {@link SnapError}. It's JSON-serializable, so it can be sent\n * over the RPC. The original error is wrapped in the `cause` property.\n *\n * @property code - The error code. This is always `-31002`.\n * @property message - The error message. This is always `'Snap Error'`.\n * @property data - The error data.\n * @property data.cause - The cause of the error.\n * @property data.cause.code - The error code.\n * @property data.cause.message - The error message.\n * @property data.cause.stack - The error stack.\n * @property data.cause.data - Additional data for the error.\n * @see SnapError\n */\nexport type SerializedSnapError = {\n code: typeof SNAP_ERROR_CODE;\n message: typeof SNAP_ERROR_MESSAGE;\n data: {\n cause: JsonRpcError;\n };\n};\n","import type { rpcErrors } from '@metamask/rpc-errors';\nimport type { Json } from '@metamask/utils';\n\nimport { SnapError } from '../errors';\n\nexport type JsonRpcErrorFunction = typeof rpcErrors.parse;\n\n/**\n * Create a `SnapError` class from an error function from\n * `@metamask/rpc-errors`. This is useful for creating custom error classes\n * which can be thrown by a Snap.\n *\n * The created class will inherit the message, code, and data properties from\n * the error function.\n *\n * @param fn - The error function to create the class from.\n * @returns The created `SnapError` class.\n */\nexport function createSnapError(fn: JsonRpcErrorFunction) {\n return class SnapJsonRpcError extends SnapError {\n /**\n * Create a new `SnapJsonRpcError` from a message.\n *\n * @param message - The message to create the error from.\n */\n constructor(message?: string);\n\n /**\n * Create a new `SnapJsonRpcError` from data.\n *\n * @param data - The data to create the error from.\n */\n constructor(data?: Record);\n\n /**\n * Create a new `SnapJsonRpcError` from a message and data.\n *\n * @param message - The message to create the error from.\n * @param data - The data to create the error from.\n */\n constructor(\n message?: string | Record,\n data?: Record,\n );\n\n /**\n * Create a new `SnapJsonRpcError` from a message and data.\n *\n * @param message - The message to create the error from.\n * @param data - The data to create the error from.\n */\n constructor(\n message?: string | Record,\n data?: Record,\n ) {\n if (typeof message === 'object') {\n const error = fn();\n super({\n code: error.code,\n message: error.message,\n data: message,\n });\n\n return;\n }\n\n const error = fn(message);\n super({\n code: error.code,\n message: error.message,\n data,\n });\n }\n };\n}\n","import { hasProperty, isObject, isValidJson } from '@metamask/utils';\n\nexport const SNAP_ERROR_CODE = -31002;\nexport const SNAP_ERROR_MESSAGE = 'Snap Error';\n\n/**\n * Get the error message from an unknown error type.\n *\n * - If the error is an object with a `message` property, return the message.\n * - Otherwise, return the error converted to a string.\n *\n * @param error - The error to get the message from.\n * @returns The error message.\n * @internal\n */\nexport function getErrorMessage(error: unknown) {\n if (\n isObject(error) &&\n hasProperty(error, 'message') &&\n typeof error.message === 'string'\n ) {\n return error.message;\n }\n\n return String(error);\n}\n\n/**\n * Get the error stack from an unknown error type.\n *\n * @param error - The error to get the stack from.\n * @returns The error stack, or undefined if the error does not have a valid\n * stack.\n * @internal\n */\nexport function getErrorStack(error: unknown) {\n if (\n isObject(error) &&\n hasProperty(error, 'stack') &&\n typeof error.stack === 'string'\n ) {\n return error.stack;\n }\n\n return undefined;\n}\n\n/**\n * Get the error code from an unknown error type.\n *\n * @param error - The error to get the code from.\n * @returns The error code, or `-32603` if the error does not have a valid code.\n * @internal\n */\nexport function getErrorCode(error: unknown) {\n if (\n isObject(error) &&\n hasProperty(error, 'code') &&\n typeof error.code === 'number' &&\n Number.isInteger(error.code)\n ) {\n return error.code;\n }\n\n return -32603;\n}\n\n/**\n * Get the error data from an unknown error type.\n *\n * @param error - The error to get the data from.\n * @returns The error data, or an empty object if the error does not have valid\n * data.\n * @internal\n */\nexport function getErrorData(error: unknown) {\n if (\n isObject(error) &&\n hasProperty(error, 'data') &&\n typeof error.data === 'object' &&\n error.data !== null &&\n isValidJson(error.data) &&\n !Array.isArray(error.data)\n ) {\n return error.data;\n }\n\n return {};\n}\n","import type { Infer } from 'superstruct';\nimport {\n Struct,\n define,\n literal as superstructLiteral,\n union as superstructUnion,\n} from 'superstruct';\nimport type { AnyStruct, InferStructTuple } from 'superstruct/dist/utils';\n\nimport type { EnumToUnion } from './helpers';\n\n/**\n * A wrapper of `superstruct`'s `literal` struct that also defines the name of\n * the struct as the literal value.\n *\n * This is useful for improving the error messages returned by `superstruct`.\n * For example, instead of returning an error like:\n *\n * ```\n * Expected the value to satisfy a union of `literal | literal`, but received: \\\"baz\\\"\n * ```\n *\n * This struct will return an error like:\n *\n * ```\n * Expected the value to satisfy a union of `\"foo\" | \"bar\"`, but received: \\\"baz\\\"\n * ```\n *\n * @param value - The literal value.\n * @returns The `superstruct` struct, which validates that the value is equal\n * to the literal value.\n */\nexport function literal(value: Type) {\n return define(\n JSON.stringify(value),\n superstructLiteral(value).validator,\n );\n}\n\n/**\n * A wrapper of `superstruct`'s `union` struct that also defines the schema as\n * the union of the schemas of the structs.\n *\n * This is useful for improving the error messages returned by `superstruct`.\n *\n * @param structs - The structs to union.\n * @param structs.\"0\" - The first struct.\n * @param structs.\"1\" - The remaining structs.\n * @returns The `superstruct` struct, which validates that the value satisfies\n * one of the structs.\n */\nexport function union([\n head,\n ...tail\n]: [head: Head, ...tail: Tail]): Struct<\n Infer | InferStructTuple[number],\n [head: Head, ...tail: Tail]\n> {\n const struct = superstructUnion([head, ...tail]);\n\n return new Struct({\n ...struct,\n schema: [head, ...tail],\n });\n}\n\n/**\n * Superstruct struct for validating an enum value. This allows using both the\n * enum string values and the enum itself as values.\n *\n * @param constant - The enum to validate against.\n * @returns The superstruct struct.\n */\nexport function enumValue(\n constant: Type,\n): Struct, null> {\n return literal(constant as EnumToUnion);\n}\n","import type { Infer, Struct } from 'superstruct';\nimport type {\n AnyStruct,\n EnumSchema,\n InferStructTuple,\n IsExactMatch,\n IsMatch,\n IsRecord,\n IsTuple,\n UnionToIntersection,\n} from 'superstruct/dist/utils';\n\nimport type { EmptyObject } from '../types';\nimport { union } from './structs';\n\n/**\n * Check if a type is a union. Infers `true` if it is a union, otherwise\n * `false`.\n */\ntype IsUnion = [Type] extends [UnionToIntersection] ? false : true;\n\n/**\n * Get a struct schema for a type.\n *\n * This is copied from `superstruct` but fixes some issues with the original\n * implementation.\n */\ntype StructSchema = IsUnion extends true\n ? null\n : [Type] extends [EmptyObject]\n ? EmptyObject\n : [Type] extends [string | undefined | null]\n ? [Type] extends [`0x${string}`]\n ? null\n : [Type] extends [IsMatch]\n ? null\n : [Type] extends [IsUnion]\n ? EnumSchema\n : Type\n : [Type] extends [number | undefined | null]\n ? [Type] extends [IsMatch]\n ? null\n : [Type] extends [IsUnion]\n ? EnumSchema\n : Type\n : [Type] extends [boolean]\n ? [Type] extends [IsExactMatch]\n ? null\n : Type\n : Type extends\n | bigint\n | symbol\n | undefined\n | null\n // eslint-disable-next-line @typescript-eslint/ban-types\n | Function\n | Date\n | Error\n | RegExp\n | Map\n | WeakMap\n | Set\n | WeakSet\n | Promise\n ? null\n : Type extends (infer E)[]\n ? Type extends IsTuple\n ? null\n : Struct\n : Type extends object\n ? Type extends IsRecord\n ? null\n : {\n [InnerKey in keyof Type]: Describe;\n }\n : null;\n\n/**\n * Describe a struct type.\n */\nexport type Describe = Struct>;\n\n/**\n * Create a union struct that uses `null` for the schema type, for better\n * compatibility with `Describe`.\n *\n * @param structs - The structs to union.\n * @returns The `superstruct` struct, which validates that the value satisfies\n * one of the structs.\n */\nexport function nullUnion(\n structs: [head: Head, ...tail: Tail],\n) {\n return union(structs) as unknown as Struct<\n Infer | InferStructTuple[number],\n null\n >;\n}\n","import { assert, hasProperty, isObject } from '@metamask/utils';\nimport { XMLParser } from 'fast-xml-parser';\n\n/**\n * Parse and validate a string as an SVG.\n *\n * @param svg - An SVG string.\n * @returns The SVG, its attributes and children in an object format.\n */\nexport function parseSvg(svg: string) {\n try {\n const trimmed = svg.trim();\n\n assert(trimmed.length > 0);\n\n const parser = new XMLParser({\n ignoreAttributes: false,\n parseAttributeValue: true,\n });\n const parsed = parser.parse(trimmed, true);\n\n assert(hasProperty(parsed, 'svg'));\n\n // Empty SVGs are not returned as objects\n if (!isObject(parsed.svg)) {\n return {};\n }\n\n return parsed.svg;\n } catch {\n throw new Error('Snap icon must be a valid SVG.');\n }\n}\n\n/**\n * Validate that a string is a valid SVG.\n *\n * @param svg - An SVG string.\n * @returns True if the SVG is valid otherwise false.\n */\nexport function isSvg(svg: string) {\n try {\n parseSvg(svg);\n return true;\n } catch {\n return false;\n }\n}\n","import { providerErrors, rpcErrors } from '@metamask/rpc-errors';\n\nimport { createSnapError } from './internals';\n\n/**\n * A JSON-RPC 2.0 Internal (-32603) error.\n *\n * This can be thrown by a Snap to indicate that an internal error occurred,\n * without crashing the Snap.\n *\n * @see https://www.jsonrpc.org/specification#error_object\n */\nexport const InternalError = createSnapError(rpcErrors.internal);\n\n/**\n * An Ethereum JSON-RPC Invalid Input (-32000) error.\n *\n * This can be thrown by a Snap to indicate that the input to a method is\n * invalid, without crashing the Snap.\n *\n * @see https://eips.ethereum.org/EIPS/eip-1474#error-codes\n */\nexport const InvalidInputError = createSnapError(rpcErrors.invalidInput);\n\n/**\n * A JSON-RPC 2.0 Invalid Params (-32602) error.\n *\n * This can be thrown by a Snap to indicate that the parameters to a method are\n * invalid, without crashing the Snap.\n *\n * @see https://www.jsonrpc.org/specification#error_object\n */\nexport const InvalidParamsError = createSnapError(rpcErrors.invalidParams);\n\n/**\n * A JSON-RPC 2.0 Invalid Request (-32600) error.\n *\n * This can be thrown by a Snap to indicate that the request is invalid, without\n * crashing the Snap.\n *\n * @see https://www.jsonrpc.org/specification#error_object\n */\nexport const InvalidRequestError = createSnapError(rpcErrors.invalidRequest);\n\n/**\n * An Ethereum JSON-RPC Limit Exceeded (-32005) error.\n *\n * This can be thrown by a Snap to indicate that a limit has been exceeded,\n * without crashing the Snap.\n *\n * @see https://eips.ethereum.org/EIPS/eip-1474#error-codes\n */\nexport const LimitExceededError = createSnapError(rpcErrors.limitExceeded);\n\n/**\n * An Ethereum JSON-RPC Method Not Found (-32601) error.\n *\n * This can be thrown by a Snap to indicate that a method does not exist,\n * without crashing the Snap.\n *\n * @see https://eips.ethereum.org/EIPS/eip-1474#error-codes\n */\nexport const MethodNotFoundError = createSnapError(rpcErrors.methodNotFound);\n\n/**\n * An Ethereum JSON-RPC Method Not Supported (-32004) error.\n *\n * This can be thrown by a Snap to indicate that a method is not supported,\n * without crashing the Snap.\n */\nexport const MethodNotSupportedError = createSnapError(\n rpcErrors.methodNotSupported,\n);\n\n/**\n * A JSON-RPC 2.0 Parse (-32700) error.\n *\n * This can be thrown by a Snap to indicate that a request is not valid JSON,\n * without crashing the Snap.\n *\n * @see https://www.jsonrpc.org/specification#error_object\n */\nexport const ParseError = createSnapError(rpcErrors.parse);\n\n/**\n * An Ethereum JSON-RPC Resource Not Found (-32001) error.\n *\n * This can be thrown by a Snap to indicate that a resource does not exist,\n * without crashing the Snap.\n *\n * @see https://eips.ethereum.org/EIPS/eip-1474#error-codes\n */\nexport const ResourceNotFoundError = createSnapError(\n rpcErrors.resourceNotFound,\n);\n\n/**\n * An Ethereum JSON-RPC Resource Unavailable (-32002) error.\n *\n * This can be thrown by a Snap to indicate that a resource is unavailable,\n * without crashing the Snap.\n *\n * @see https://eips.ethereum.org/EIPS/eip-1474#error-codes\n */\nexport const ResourceUnavailableError = createSnapError(\n rpcErrors.resourceUnavailable,\n);\n\n/**\n * An Ethereum JSON-RPC Transaction Rejected (-32003) error.\n *\n * This can be thrown by a Snap to indicate that a transaction was rejected,\n * without crashing the Snap.\n *\n * @see https://eips.ethereum.org/EIPS/eip-1474#error-codes\n */\nexport const TransactionRejected = createSnapError(\n rpcErrors.transactionRejected,\n);\n\n/**\n * An Ethereum Provider Chain Disconnected (4901) error.\n *\n * This can be thrown by a Snap to indicate that the provider is disconnected\n * from the requested chain, without crashing the Snap.\n *\n * @see https://eips.ethereum.org/EIPS/eip-1193#provider-errors\n */\nexport const ChainDisconnectedError = createSnapError(\n providerErrors.chainDisconnected,\n);\n\n/**\n * An Ethereum Provider Disconnected (4900) error.\n *\n * This can be thrown by a Snap to indicate that the provider is disconnected,\n * without crashing the Snap.\n *\n * @see https://eips.ethereum.org/EIPS/eip-1193#provider-errors\n */\nexport const DisconnectedError = createSnapError(providerErrors.disconnected);\n\n/**\n * An Ethereum Provider Unauthorized (4100) error.\n *\n * This can be thrown by a Snap to indicate that the requested method / account\n * is not authorized by the user, without crashing the Snap.\n */\nexport const UnauthorizedError = createSnapError(providerErrors.unauthorized);\n\n/**\n * An Ethereum Provider Unsupported Method (4200) error.\n *\n * This can be thrown by a Snap to indicate that the requested method is not\n * supported by the provider, without crashing the Snap.\n *\n * @see https://eips.ethereum.org/EIPS/eip-1193#provider-errors\n */\nexport const UnsupportedMethodError = createSnapError(\n providerErrors.unsupportedMethod,\n);\n\n/**\n * An Ethereum Provider User Rejected Request (4001) error.\n *\n * This can be thrown by a Snap to indicate that the user rejected the request,\n * without crashing the Snap.\n *\n * @see https://eips.ethereum.org/EIPS/eip-1193#provider-errors\n */\nexport const UserRejectedRequestError = createSnapError(\n providerErrors.userRejectedRequest,\n);\n","import { assert, bytesToBase64 } from '@metamask/utils';\n\nimport { image } from './ui';\n\n/**\n * Get raw image data from a URL.\n *\n * @param url - The URL to get the image data from.\n * @param options - The options to use when fetching the image data. This is\n * passed directly to `fetch`.\n * @returns A promise that resolves to the image data as a blob.\n */\nasync function getRawImageData(url: string, options?: RequestInit) {\n if (typeof fetch !== 'function') {\n throw new Error(\n `Failed to fetch image data from \"${url}\": Using this function requires the \"endowment:network-access\" permission.`,\n );\n }\n\n return fetch(url, options).then(async (response) => {\n if (!response.ok) {\n throw new Error(\n `Failed to fetch image data from \"${url}\": ${response.status} ${response.statusText}`,\n );\n }\n\n const blob = await response.blob();\n assert(\n blob.type === 'image/jpeg' || blob.type === 'image/png',\n 'Expected image data to be a JPEG or PNG image.',\n );\n\n return blob;\n });\n}\n\n/**\n * Get image data as data-string from a URL. This is useful for embedding images\n * inside of SVGs. Only JPEG and PNG images are supported.\n *\n * Note: This function uses `fetch` to get the image data. This means that using\n * it requires the `endowment:network-access` permission.\n *\n * @example\n * const imageData = await getImageData('https://cataas.com/cat');\n * const svg = `\n * \n * \n * \n * `;\n *\n * // Render the SVG in a Snap UI.\n * const ui = image(svg);\n * @param url - The URL to get the image data from.\n * @param options - The options to use when fetching the image data. This is\n * passed directly to `fetch`.\n * @returns A promise that resolves to the image data as a data-string.\n */\nexport async function getImageData(url: string, options?: RequestInit) {\n const blob = await getRawImageData(url, options);\n const bytes = new Uint8Array(await blob.arrayBuffer());\n\n return `data:${blob.type};base64,${bytesToBase64(bytes)}`;\n}\n\n/**\n * Options for getting an SVG image element from a URL.\n *\n * @property width - The width of the image.\n * @property height - The height of the image. If this is not provided, the\n * width will be used as the height.\n * @property request - The options to use when fetching the image data. This is\n * passed directly to `fetch`.\n */\nexport type ImageOptions = {\n width: number;\n height?: number;\n request?: RequestInit;\n};\n\n/**\n * Get an image component from a URL. This is useful for embedding images inside\n * Snap UIs. Only JPEG and PNG images are supported.\n *\n * Note: This function uses `fetch` to get the image data. This means that using\n * it requires the `endowment:network-access` permission.\n *\n * @example\n * const component = await getImage('https://cataas.com/cat');\n *\n * return await snap.request({\n * method: 'snap_dialog',\n * params: {\n * type: 'alert',\n * content: panel([\n * component,\n * ]),\n * },\n * });\n * @param url - The URL to get the image data from.\n * @param options - The options to use when fetching and rendering the image.\n * @param options.width - The width of the image.\n * @param options.height - The height of the image. If this is not provided, the\n * width will be used as the height.\n * @param options.request - The options to use when fetching the image data.\n * This is passed directly to `fetch`.\n * @returns A promise that resolves to the image data as an image component.\n */\nexport async function getImageComponent(\n url: string,\n { width, height = width, request }: ImageOptions,\n) {\n assert(\n typeof width === 'number' && width > 0,\n 'Expected width to be a number greater than 0.',\n );\n\n assert(\n typeof height === 'number' && height > 0,\n 'Expected height to be a number greater than 0.',\n );\n\n const imageData = await getImageData(url, request);\n const size = `width=\"${width}\" height=\"${height}\"`;\n\n return image(\n ``,\n );\n}\n","import { HexChecksumAddressStruct } from '@metamask/utils';\nimport type { Infer } from 'superstruct';\nimport { assign, literal, object } from 'superstruct';\n\nimport { createBuilder } from '../builder';\nimport { LiteralStruct, NodeType } from '../nodes';\n\nexport const AddressStruct = assign(\n LiteralStruct,\n object({\n type: literal(NodeType.Address),\n value: HexChecksumAddressStruct,\n }),\n);\n\n/**\n * A address node, that renders an EVM-like address and its icon.\n *\n * @property type - The type of the node. Must be the string `address`.\n * @property value - The address in hexadecimal, including 0x.\n */\nexport type Address = Infer;\n\n/**\n * Create an {@link Address} node.\n *\n * @param args - The node arguments. This can either be a string, or an object\n * with the `value` property.\n * @param args.value - The address to be rendered.\n * @returns The address node as an object.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * const node = address({ value: '0x4bbeeb066ed09b7aed07bf39eee0460dfa261520' });\n * const node = address('0x4bbeeb066ed09b7aed07bf39eee0460dfa261520');\n */\nexport const address = createBuilder(NodeType.Address, AddressStruct, [\n 'value',\n]);\n","import { assertStruct, isPlainObject } from '@metamask/utils';\nimport type { Struct } from 'superstruct';\n\nimport type { Component } from './components';\nimport type { NodeType } from './nodes';\n\n/**\n * A function that builds a {@link Component}. This infers the proper args type\n * from the given node.\n *\n * @internal\n */\ntype NodeBuilder = Omit<\n Node,\n 'type'\n> extends Record\n ? (...args: []) => Node\n : (...args: [Omit] | NodeArrayType) => Node;\n\n/**\n * Map from an array of node keys to the corresponding array type.\n *\n * @example\n * type Node = { type: 'node'; a: string; b: number; c: boolean };\n * type Keys = ['a', 'b', 'c'];\n *\n * type NodeArray = NodeArrayType; // [string, number, boolean]\n * @internal\n */\ntype NodeArrayType = {\n [Key in keyof Keys]: Node[Keys[Key]];\n};\n\n/**\n * A function that returns a function to \"build\" a {@link Component}. It infers\n * the type of the component from the given struct, and performs validation on\n * the created component.\n *\n * The returned function can handle the node arguments in two ways:\n * 1. As a single object, with the keys corresponding to the node's properties,\n * excluding the `type` property.\n * 2. As an array of arguments, with the order corresponding to the given keys.\n *\n * @param type - The type of the component to build.\n * @param struct - The struct to use to validate the component.\n * @param keys - The keys of the component to use as arguments to the builder.\n * The order of the keys determines the order of the arguments.\n * @returns A function that builds a component of the given type.\n * @internal\n */\nexport function createBuilder<\n Node extends Component,\n Keys extends (keyof Node)[] = [],\n>(\n type: NodeType,\n struct: Struct,\n keys: Keys = [] as unknown as Keys,\n): NodeBuilder {\n return (...args: [Omit] | NodeArrayType | []) => {\n // Node passed as a single object.\n if (args.length === 1 && isPlainObject(args[0])) {\n const node = { ...args[0], type };\n\n // The user could be passing invalid values to the builder, so we need to\n // validate them as per the component's struct.\n assertStruct(node, struct, `Invalid ${type} component`);\n return node;\n }\n\n // Node passed as an array of arguments.\n const node = keys.reduce>(\n (partialNode, key, index) => {\n if (args[index] !== undefined) {\n return {\n ...partialNode,\n [key]: args[index],\n };\n }\n\n return partialNode;\n },\n { type },\n );\n\n // The user could be passing invalid values to the builder, so we need to\n // validate them as per the component's struct.\n assertStruct(node, struct, `Invalid ${type} component`);\n return node;\n };\n}\n","import type { Infer } from 'superstruct';\nimport { assign, object, string, unknown } from 'superstruct';\n\n/**\n * The supported node types. This is based on SIP-7.\n *\n * @see https://metamask.github.io/SIPs/SIPS/sip-7\n */\nexport enum NodeType {\n Copyable = 'copyable',\n Divider = 'divider',\n Heading = 'heading',\n Panel = 'panel',\n Spinner = 'spinner',\n // eslint-disable-next-line @typescript-eslint/no-shadow\n Text = 'text',\n Image = 'image',\n Row = 'row',\n Address = 'address',\n Button = 'button',\n Input = 'input',\n Form = 'form',\n}\n\n/**\n * @internal\n */\nexport const NodeStruct = object({\n type: string(),\n});\n\n/**\n * The base node type. All nodes extend this type.\n *\n * @property type - The type of the node. See {@link NodeType} for the supported\n * node types.\n * @internal\n */\nexport type Node = Infer;\n\n/**\n * @internal\n */\nexport const LiteralStruct = assign(\n NodeStruct,\n object({\n value: unknown(),\n }),\n);\n\n/**\n * A node with a value. This is used for nodes that render a value, such as\n * {@link Text}.\n *\n * @property type - The type of the node.\n * @property value - The value of the node. The type of the value depends on the\n * node type.\n * @internal\n */\nexport type Literal = Infer;\n","import type { Infer } from 'superstruct';\nimport {\n assign,\n boolean,\n literal,\n object,\n optional,\n string,\n} from 'superstruct';\n\nimport { createBuilder } from '../builder';\nimport { LiteralStruct, NodeType } from '../nodes';\n\nexport const CopyableStruct = assign(\n LiteralStruct,\n object({\n type: literal(NodeType.Copyable),\n value: string(),\n sensitive: optional(boolean()),\n }),\n);\n\n/**\n * Text that can be copied to the clipboard. It can optionally be marked as\n * sensitive, in which case it will only be displayed to the user after clicking\n * on the component.\n *\n * @property type - The type of the node. Must be the string `copyable`.\n * @property value - The text to be copied.\n * @property sensitive - Whether the value is sensitive or not. Sensitive values\n * are only displayed to the user after clicking on the component. Defaults to\n * false.\n */\nexport type Copyable = Infer;\n\n/**\n * Create a {@link Copyable} component.\n *\n * @param args - The node arguments. This can either be a string, or an object\n * with the `text` property.\n * @param args.value - The text to be copied.\n * @param args.sensitive - Whether the value is sensitive or not. Sensitive\n * values are only displayed to the user after clicking on the component.\n * Defaults to false.\n * @returns A {@link Copyable} component.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * const node = copyable('Hello, world!');\n * const node = copyable({ value: 'Hello, world!' });\n */\nexport const copyable = createBuilder(NodeType.Copyable, CopyableStruct, [\n 'value',\n 'sensitive',\n]);\n","import type { Infer } from 'superstruct';\nimport { assign, literal, object } from 'superstruct';\n\nimport { createBuilder } from '../builder';\nimport { NodeStruct, NodeType } from '../nodes';\n\nexport const DividerStruct = assign(\n NodeStruct,\n object({\n type: literal(NodeType.Divider),\n }),\n);\n\n/**\n * A divider node, that renders a line between other nodes.\n */\nexport type Divider = Infer;\n\n/**\n * Create a {@link Divider} node.\n *\n * @returns The divider node as object.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * const node = divider();\n */\nexport const divider = createBuilder(NodeType.Divider, DividerStruct);\n","import type { Infer } from 'superstruct';\nimport { assign, literal, object, string } from 'superstruct';\n\nimport { createBuilder } from '../builder';\nimport { LiteralStruct, NodeType } from '../nodes';\n\nexport const HeadingStruct = assign(\n LiteralStruct,\n object({\n type: literal(NodeType.Heading),\n value: string(),\n }),\n);\n\n/**\n * A heading node, that renders the text as a heading. The level of the heading\n * is determined by the depth of the heading in the document.\n *\n * @property type - The type of the node, must be the string 'text'.\n * @property value - The text content of the node, either as plain text, or as a\n * markdown string.\n */\nexport type Heading = Infer;\n\n/**\n * Create a {@link Heading} node.\n *\n * @param args - The node arguments. This can either be a string, or an object\n * with the `value` property.\n * @param args.value - The heading text.\n * @returns The heading node as object.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * const node = heading({ value: 'Hello, world!' });\n * const node = heading('Hello, world!');\n */\nexport const heading = createBuilder(NodeType.Heading, HeadingStruct, [\n 'value',\n]);\n","import type { Infer } from 'superstruct';\nimport { assign, literal, object, refine, string } from 'superstruct';\n\nimport { isSvg } from '../../internals';\nimport { createBuilder } from '../builder';\nimport { NodeStruct, NodeType } from '../nodes';\n\n/**\n * Get a Struct that validates a string as a valid SVG.\n *\n * @returns A Struct that validates a string as a valid SVG.\n * @internal\n */\nexport function svg() {\n return refine(string(), 'SVG', (value) => {\n if (!isSvg(value)) {\n return 'Value is not a valid SVG.';\n }\n\n return true;\n });\n}\n\nexport const ImageStruct = assign(\n NodeStruct,\n object({\n type: literal(NodeType.Image),\n value: svg(),\n }),\n);\n\n/**\n * An image node, that renders an SVG image.\n *\n * @property type - The type of the node. Must be the string `image`.\n * @property value - The SVG image to be rendered.\n */\nexport type Image = Infer;\n\n/**\n * Create an {@link Image} node.\n *\n * @param args - The node arguments. This can either be a string, or an object\n * with the `value` property.\n * @param args.value - The SVG image to be rendered. Must be a valid SVG string.\n * @returns The image node as object. Other image formats are supported by\n * embedding them as data URLs in the SVG.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * const node = image({ value: '' });\n * const node = image('');\n */\nexport const image = createBuilder(NodeType.Image, ImageStruct, ['value']);\n","import type { Infer, Struct } from 'superstruct';\nimport { array, assign, lazy, literal, object, union } from 'superstruct';\n\nimport { createBuilder } from '../builder';\nimport { NodeStruct, NodeType } from '../nodes';\nimport { AddressStruct } from './address';\nimport { ButtonStruct } from './button';\nimport { CopyableStruct } from './copyable';\nimport { DividerStruct } from './divider';\nimport { FormStruct } from './form';\nimport { HeadingStruct } from './heading';\nimport { ImageStruct } from './image';\nimport { InputStruct } from './input';\nimport { RowStruct } from './row';\nimport { SpinnerStruct } from './spinner';\nimport { TextStruct } from './text';\n\n/**\n * @internal\n */\nexport const ParentStruct = assign(\n NodeStruct,\n object({\n // This node references itself indirectly, so we need to use `lazy()`.\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n children: array(lazy(() => ComponentStruct)),\n }),\n);\n\n/**\n * A node which supports child nodes. This is used for nodes that render their\n * children, such as {@link Panel}.\n *\n * @property type - The type of the node.\n * @property children - The children of the node\n * @internal\n */\nexport type Parent = Infer;\n\n/**\n * @internal\n */\nexport const PanelStruct: Struct = assign(\n ParentStruct,\n object({\n type: literal(NodeType.Panel),\n }),\n);\n\n/**\n * A panel node, which renders its children.\n *\n * @property type - The type of the node, must be the string 'text'.\n * @property value - The text content of the node, either as plain text, or as a\n * markdown string.\n */\n// This node references itself indirectly, so it cannot be inferred.\nexport type Panel = {\n type: NodeType.Panel;\n children: Component[];\n};\n\n/**\n * Create a {@link Panel} node.\n *\n * @param args - The node arguments. This can be either an array of children, or\n * an object with a `children` property.\n * @param args.children - The child nodes of the panel. This can be any valid\n * {@link Component}.\n * @returns The panel node as object.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * const node = panel({\n * children: [\n * heading({ text: 'Hello, world!' }),\n * text({ text: 'This is a panel.' }),\n * ],\n * });\n *\n * const node = panel([\n * heading('Hello, world!'),\n * text('This is a panel.'),\n * ]);\n */\nexport const panel = createBuilder(NodeType.Panel, PanelStruct, ['children']);\n\n// This is defined separately from `Component` to avoid circular dependencies.\nexport const ComponentStruct = union([\n CopyableStruct,\n DividerStruct,\n HeadingStruct,\n ImageStruct,\n PanelStruct,\n SpinnerStruct,\n TextStruct,\n RowStruct,\n AddressStruct,\n InputStruct,\n FormStruct,\n ButtonStruct,\n]);\n\n/**\n * All supported component types.\n */\nexport type Component = Infer;\n","import type { Infer } from 'superstruct';\nimport { assign, literal, object, optional, string, union } from 'superstruct';\n\nimport { enumValue } from '../../internals';\nimport { createBuilder } from '../builder';\nimport { LiteralStruct, NodeType } from '../nodes';\n\nexport enum ButtonVariant {\n Primary = 'primary',\n Secondary = 'secondary',\n}\n\nexport enum ButtonType {\n Button = 'button',\n Submit = 'submit',\n}\n\nexport const ButtonStruct = assign(\n LiteralStruct,\n object({\n type: literal(NodeType.Button),\n value: string(),\n variant: optional(\n union([\n enumValue(ButtonVariant.Primary),\n enumValue(ButtonVariant.Secondary),\n ]),\n ),\n buttonType: optional(\n union([enumValue(ButtonType.Button), enumValue(ButtonType.Submit)]),\n ),\n name: optional(string()),\n }),\n);\n\n/**\n * A button node, that renders either a primary or a secondary button.\n *\n * @property type - The type of the node, must be the string 'button'.\n * @property variant - The style variant of the node, must be either 'primary' or 'secondary'.\n * @property value - The text content of the node as plain text.\n * @property buttonType - The type of the button, must be either 'button' or 'submit'.\n * @property name - An optional name to identify the button.\n */\nexport type Button = Infer;\n\n/**\n * Create a {@link Button} node.\n *\n * @param args - The node arguments. This can be either a string, or an object\n * with a `value` property. A set of optional properties can be passed.\n * @param args.variant - The optional variant of the button.\n * @param args.value - The text content of the node.\n * @param args.name - The optional name of the button.\n * @returns The text node as object.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * ```typescript\n * const node = button({ variant: 'primary', text: 'Hello, world!', name: 'myButton' });\n * const node = button('Hello, world!', 'button', 'myButton', 'primary');\n * const node = button('Hello, world!');\n * ```\n */\nexport const button = createBuilder(NodeType.Button, ButtonStruct, [\n 'value',\n 'buttonType',\n 'name',\n 'variant',\n]);\n","import type { Infer } from 'superstruct';\nimport { array, assign, literal, object, string, union } from 'superstruct';\n\nimport { createBuilder } from '../builder';\nimport { NodeStruct, NodeType } from '../nodes';\nimport { ButtonStruct } from './button';\nimport { InputStruct } from './input';\n\nexport const FormComponentStruct = union([InputStruct, ButtonStruct]);\n\n/**\n * The subset of nodes allowed as children in the {@link Form} node.\n */\nexport type FormComponent = Infer;\n\nexport const FormStruct = assign(\n NodeStruct,\n object({\n type: literal(NodeType.Form),\n children: array(FormComponentStruct),\n name: string(),\n }),\n);\n\n/**\n * A form node that takes children {@link FormComponent} nodes and renders a form.\n *\n * @property type - The type of the node. Must be the string `form`.\n * @property children - The children of the node. Only {@link FormComponent} nodes are allowed.\n * @property name - The form name used to identify it.\n */\nexport type Form = Infer;\n\n/**\n * Create a {@link Form} node.\n *\n * @param args - The node arguments. This can be either an array of children and a string, or\n * an object with a `name` and `children` property.\n * @param args.name - The form name used to identify it.\n * @param args.children - The child nodes of the form. This can be any valid\n * {@link FormComponent}.\n * @returns The form node as object.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * const node = form({\n * name: 'myForm',\n * children: [\n * input({ name: 'myInput' }),\n * button({ value: 'Hello, world!' }),\n * ],\n * });\n *\n * const node = form('myForm', [input('myInput'), button('Hello, world!')]);\n */\nexport const form = createBuilder(NodeType.Form, FormStruct, [\n 'name',\n 'children',\n]);\n","import type { Infer } from 'superstruct';\nimport { assign, literal, object, optional, string, union } from 'superstruct';\n\nimport { enumValue } from '../../internals';\nimport { createBuilder } from '../builder';\nimport { LiteralStruct, NodeType } from '../nodes';\n\n/**\n * This replicates the available input types from the metamask extension.\n * https://github.com/MetaMask/metamask-extension/develop/ui/components/component-library/input/input.constants.js\n */\nexport enum InputType {\n /* eslint-disable @typescript-eslint/no-shadow */\n Text = 'text',\n Number = 'number',\n /* eslint-enable @typescript-eslint/no-shadow */\n Password = 'password',\n}\n\nexport const InputStruct = assign(\n LiteralStruct,\n object({\n type: literal(NodeType.Input),\n value: optional(string()),\n name: string(),\n inputType: optional(\n union([\n enumValue(InputType.Text),\n enumValue(InputType.Password),\n enumValue(InputType.Number),\n ]),\n ),\n placeholder: optional(string()),\n label: optional(string()),\n error: optional(string()),\n }),\n);\n\n/**\n * An input node, that renders an input.\n *\n * @property type - The type of the node, must be the string 'input'.\n * @property name - The name for the input.\n * @property value - The value of the input.\n * @property inputType - An optional type, either `text`, `password` or `number`.\n * @property placeholder - An optional input placeholder.\n * @property label - An optional input label.\n * @property error - An optional error text.\n */\nexport type Input = Infer;\n\n/**\n * Create a {@link Input} node.\n *\n * @param args - The node arguments. This can either be a name and an optional variant, value and placeholder or an object\n * with the properties: `inputType`, `value`, `variant`, `placeholder` and `name`.\n * @param args.name - The name for the input.\n * @param args.value - The value of the input.\n * @param args.inputType - An optional type, either `text`, `password` or `number`.\n * @param args.placeholder - An optional input placeholder.\n * @param args.label - An optional input label.\n * @param args.error - An optional error text.\n * @returns The input node as an object.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * const node = input('myInput');\n * const node = input('myInput', InputType.Text, 'my placeholder', 'myValue', 'myLabel');\n * const node = input({ name: 'myInput' });\n * const node = input({name: 'myInput', value: 'myValue', inputType: InputType.Password, placeholder: 'placeholder'})\n */\nexport const input = createBuilder(NodeType.Input, InputStruct, [\n 'name',\n 'inputType',\n 'placeholder',\n 'value',\n 'label',\n]);\n","import type { Infer } from 'superstruct';\nimport { assign, literal, object, string, optional, union } from 'superstruct';\n\nimport { enumValue } from '../../internals';\nimport { createBuilder } from '../builder';\nimport { LiteralStruct, NodeType } from '../nodes';\nimport { AddressStruct } from './address';\nimport { ImageStruct } from './image';\nimport { TextStruct } from './text';\n\nexport enum RowVariant {\n Default = 'default',\n Critical = 'critical',\n Warning = 'warning',\n}\n\n// A subset of components made available to the row\nconst RowComponentStruct = union([ImageStruct, TextStruct, AddressStruct]);\n\nexport const RowStruct = assign(\n LiteralStruct,\n object({\n type: literal(NodeType.Row),\n variant: optional(\n union([\n enumValue(RowVariant.Default),\n enumValue(RowVariant.Critical),\n enumValue(RowVariant.Warning),\n ]),\n ),\n label: string(),\n value: RowComponentStruct,\n }),\n);\n\n/**\n * A row node, that renders a row with a label and a value.\n *\n * @property type - The type of the node. Must be the string `row`.\n * @property label - The label for the row.\n * @property value - A sub component to be rendered\n * on one side of the row.\n * @property variant - Optional variant for styling.\n */\nexport type Row = Infer;\n\n/**\n * Create a {@link Row} node.\n *\n * @param args - The node arguments. This can either be a string, a component and an optional variant or an object\n * with the properties: `label`, `value` and `variant`.\n * @param args.label - The label for the row.\n * @param args.value - Another component, is currently limited to `image`, `text` and `address`.\n * @param args.variant - An optional variant, either `default`, `warning` or `critical`.\n * @returns The row node as an object.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * const node = row({ label: 'Address', value: address('0x4bbeeb066ed09b7aed07bf39eee0460dfa261520') });\n * const node = row({ label: 'Address', value: address('0x4bbeeb066ed09b7aed07bf39eee0460dfa261520'), variant: RowVariant.Warning });\n * const node = row('Address', address('0x4bbeeb066ed09b7aed07bf39eee0460dfa261520'));\n * const node = row('Address', address('0x4bbeeb066ed09b7aed07bf39eee0460dfa261520'), RowVariant.Warning);\n */\nexport const row = createBuilder(NodeType.Row, RowStruct, [\n 'label',\n 'value',\n 'variant',\n]);\n","import type { Infer } from 'superstruct';\nimport {\n assign,\n boolean,\n literal,\n object,\n optional,\n string,\n} from 'superstruct';\n\nimport { createBuilder } from '../builder';\nimport { LiteralStruct, NodeType } from '../nodes';\n\nexport const TextStruct = assign(\n LiteralStruct,\n object({\n type: literal(NodeType.Text),\n value: string(),\n markdown: optional(boolean()),\n }),\n);\n\n/**\n * A text node, that renders the text as one or more paragraphs.\n *\n * @property type - The type of the node, must be the string 'text'.\n * @property value - The text content of the node, either as plain text, or as a\n * markdown string.\n * @property markdown - A flag to enable/disable markdown, if nothing is specified\n * markdown will be enabled.\n */\nexport type Text = Infer;\n\n/**\n * Create a {@link Text} node.\n *\n * @param args - The node arguments. This can be either a string\n * and a boolean, or an object with a `value` property\n * and an optional `markdown` property.\n * @param args.value - The text content of the node.\n * @param args.markdown - An optional flag to enable or disable markdown. This\n * is enabled by default.\n * @returns The text node as object.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * const node = text({ value: 'Hello, world!' });\n * const node = text('Hello, world!');\n * const node = text({ value: 'Hello, world!', markdown: false });\n * const node = text('Hello, world!', false);\n */\nexport const text = createBuilder(NodeType.Text, TextStruct, [\n 'value',\n 'markdown',\n]);\n","import type { Infer } from 'superstruct';\nimport { assign, literal, object } from 'superstruct';\n\nimport { createBuilder } from '../builder';\nimport { NodeStruct, NodeType } from '../nodes';\n\nexport const SpinnerStruct = assign(\n NodeStruct,\n object({\n type: literal(NodeType.Spinner),\n }),\n);\n\n/**\n * A spinner node, that renders a spinner, either as a full-screen overlay, or\n * inline when nested inside a {@link Panel}.\n */\nexport type Spinner = Infer;\n\n/**\n * Create a {@link Spinner} node.\n *\n * @returns The spinner node as object.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * const node = spinner();\n */\nexport const spinner = createBuilder(NodeType.Spinner, SpinnerStruct);\n","import { assertStruct } from '@metamask/utils';\nimport { is } from 'superstruct';\n\nimport { ComponentStruct } from './components';\nimport type { Component } from './components';\n\n/**\n * Check if the given value is a {@link Component}. This performs recursive\n * validation of the component's children (if any).\n *\n * @param value - The value to check.\n * @returns `true` if the value is a {@link Component}, `false` otherwise.\n */\nexport function isComponent(value: unknown): value is Component {\n return is(value, ComponentStruct);\n}\n\n/**\n * Assert that the given value is a {@link Component}. This performs recursive\n * validation of the component's children (if any).\n *\n * @param value - The value to check.\n * @throws If the value is not a {@link Component}.\n */\nexport function assertIsComponent(value: unknown): asserts value is Component {\n assertStruct(value, ComponentStruct, 'Invalid component');\n}\n","import type { ComponentOrElement } from '..';\nimport type { EnumToUnion } from '../../internals';\nimport type { ChainId } from '../caip';\n\n/**\n * The severity level of content being returned from a transaction insight.\n * Currently only one level is supported:\n *\n * - `critical` - The transaction is critical and should not be submitted by the\n * user.\n */\nexport enum SeverityLevel {\n Critical = 'critical',\n}\n\n/**\n * An EIP-1559 (type 2) transaction object.\n *\n * @property from - The address the transaction is being sent from.\n * @property to - The address the transaction is being sent to.\n * @property nonce - The nonce of the transaction.\n * @property value - The value of the transaction.\n * @property data - The data of the transaction.\n * @property gas - The gas limit of the transaction.\n * @property maxFeePerGas - The maximum fee per gas of the transaction.\n * @property maxPriorityFeePerGas - The maximum priority fee per gas of the\n * transaction.\n * @property estimateSuggested - The suggested gas price for the transaction.\n * @property estimateUsed - The gas price used for the transaction.\n * @see https://eips.ethereum.org/EIPS/eip-1559\n */\nexport type EIP1559Transaction = {\n from: string;\n to: string;\n nonce: string;\n value: string;\n data: string;\n gas: string;\n maxFeePerGas: string;\n maxPriorityFeePerGas: string;\n estimateSuggested: string;\n estimateUsed: string;\n};\n\n/**\n * A legacy (type \"0\") transaction object.\n *\n * @property from - The address the transaction is being sent from.\n * @property to - The address the transaction is being sent to.\n * @property nonce - The nonce of the transaction.\n * @property value - The value of the transaction.\n * @property data - The data of the transaction.\n * @property gas - The gas limit of the transaction.\n * @property gasPrice - The gas price of the transaction.\n * @property estimateSuggested - The suggested gas price for the transaction.\n * @property estimateUsed - The gas price used for the transaction.\n */\nexport type LegacyTransaction = {\n from: string;\n to: string;\n nonce: string;\n value: string;\n data: string;\n gas: string;\n gasPrice: string;\n estimateSuggested: string;\n estimateUsed: string;\n};\n\n/**\n * A transaction object. This can be either an EIP-1559 transaction or a legacy\n * transaction.\n *\n * @see EIP1559Transaction\n * @see LegacyTransaction\n */\nexport type Transaction = EIP1559Transaction | LegacyTransaction;\n\n/**\n * The `onTransaction` handler. This is called whenever a transaction is\n * submitted to the snap. It can return insights about the transaction, which\n * will be displayed to the user.\n *\n * Note that using this handler requires the `endowment:transaction-insights`\n * permission.\n *\n * @param args - The request arguments.\n * @param args.transaction - The transaction object, containing the address,\n * value, data, and other properties of the transaction.\n * @param args.chainId - The CAIP-2 {@link ChainId} of the network the\n * transaction is being submitted to.\n * @param args.transactionOrigin - The origin of the transaction. This is the\n * URL of the website that submitted the transaction. This is only available if\n * the Snap has enabled the `allowTransactionOrigin` option in the\n * `endowment:transaction-insight` permission.\n * @returns An object containing insights about the transaction. See\n * {@link OnTransactionResponse}. Can also return `null` if no insights are\n * available.\n */\nexport type OnTransactionHandler = (args: {\n transaction: Transaction;\n chainId: ChainId;\n transactionOrigin?: string;\n}) => Promise;\n\n/**\n * The response from a Snap's `onTransaction` handler.\n *\n * @property component - A custom UI component, that will be shown in MetaMask.\n * @property id - A Snap interface ID.\n * @property severity - The severity level of the content. Currently only one\n * level is supported: `critical`.\n */\nexport type OnTransactionResponse =\n | {\n content: ComponentOrElement;\n severity?: EnumToUnion;\n }\n | {\n id: string;\n severity?: EnumToUnion;\n };\n","import type { Infer } from 'superstruct';\nimport {\n assign,\n literal,\n nullable,\n object,\n optional,\n record,\n string,\n union,\n} from 'superstruct';\n\nimport type { InterfaceContext } from '../interface';\n\n/**\n * The type of user input event fired.\n * Currently only three events are supported:\n *\n * - `ButtonClickEvent` - A button has been clicked in the UI.\n * - `FormSubmitEvent` - A Form has been submitted in the UI.\n * - `InputChangeEvent` - The value of an input field has changed in the UI.\n */\nexport enum UserInputEventType {\n ButtonClickEvent = 'ButtonClickEvent',\n FormSubmitEvent = 'FormSubmitEvent',\n InputChangeEvent = 'InputChangeEvent',\n}\n\nexport const GenericEventStruct = object({\n type: string(),\n name: optional(string()),\n});\n\nexport const ButtonClickEventStruct = assign(\n GenericEventStruct,\n object({\n type: literal(UserInputEventType.ButtonClickEvent),\n name: optional(string()),\n }),\n);\n\nexport const FormSubmitEventStruct = assign(\n GenericEventStruct,\n object({\n type: literal(UserInputEventType.FormSubmitEvent),\n value: record(string(), nullable(string())),\n name: string(),\n }),\n);\n\nexport const InputChangeEventStruct = assign(\n GenericEventStruct,\n object({\n type: literal(UserInputEventType.InputChangeEvent),\n name: string(),\n value: string(),\n }),\n);\n\nexport const UserInputEventStruct = union([\n ButtonClickEventStruct,\n FormSubmitEventStruct,\n InputChangeEventStruct,\n]);\n\n/**\n * A user input event fired in the UI. This is passed to the params of the `onUserInput` handler.\n *\n * @property type - The type of event fired. See {@link UserInputEventType} for the different types.\n * @property name - The component name that fired the event. It is optional for an {@link UserInputEventType.ButtonClickEvent}.\n * @property value - The value associated with the event. Only available when an {@link UserInputEventType.FormSubmitEvent} is fired.\n * It contains the form values submitted.\n */\nexport type UserInputEvent = Infer;\n\n/**\n * The `onUserInput` handler. This is called when an user input event is fired in the UI.\n *\n * @param args - The user input event.\n * @param args.id - The user interface id.\n * @param args.event - The {@link UserInputEvent} object, containing the data about the fired event.\n */\nexport type OnUserInputHandler = (args: {\n id: string;\n event: UserInputEvent;\n context: InterfaceContext | null;\n}) => Promise;\n","import type { ComponentOrElement } from '..';\nimport type { EnumToUnion } from '../../internals';\n\n/**\n * The type of dialog to display.\n *\n * - `alert` - A dialog with a single button.\n * - `confirmation` - A dialog with two buttons, one to confirm and one to\n * cancel.\n * - `prompt` - A dialog with two buttons and a text input.\n */\nexport enum DialogType {\n Alert = 'alert',\n Confirmation = 'confirmation',\n Prompt = 'prompt',\n}\n\n/**\n * An alert dialog.\n *\n * @property type - The type of dialog. Must be `alert`.\n * @property content - The content to display in the dialog.\n * @property id - The Snap interface ID.\n */\nexport type AlertDialog =\n | {\n type: EnumToUnion;\n content: ComponentOrElement;\n }\n | {\n type: EnumToUnion;\n id: string;\n };\n\n/**\n * A confirmation dialog.\n *\n * @property type - The type of dialog. Must be `confirmation`.\n * @property content - The content to display in the dialog.\n * @property id - The Snap interface ID.\n */\nexport type ConfirmationDialog =\n | {\n type: EnumToUnion;\n content: ComponentOrElement;\n }\n | {\n type: EnumToUnion;\n id: string;\n };\n\n/**\n * A prompt dialog.\n *\n * @property type - The type of dialog. Must be `prompt`.\n * @property content - The content to display in the dialog.\n * @property id - The Snap interface ID.\n * @property placeholder - An optional placeholder text to display in the text\n * input.\n */\nexport type PromptDialog =\n | {\n type: EnumToUnion;\n content: ComponentOrElement;\n placeholder?: string;\n }\n | {\n type: EnumToUnion;\n id: string;\n placeholder?: string;\n };\n\n/**\n * The request parameters for the `snap_dialog` method.\n *\n * @property type - The type of dialog to display.\n * @property content - The content to display in the dialog.\n * @property id - The Snap interface ID.\n * @property placeholder - The placeholder text to display in the dialog. Only\n * applicable for the `prompt` dialog.\n */\nexport type DialogParams = AlertDialog | ConfirmationDialog | PromptDialog;\n\n/**\n * The result returned by the `snap_dialog` method.\n *\n * - If the dialog is an `alert`, the result is `null`.\n * - If the dialog is a `confirmation`, the result is a boolean indicating\n * whether the user confirmed the dialog.\n * - If the dialog is a `prompt`, the result is the value entered by\n * the user.\n */\nexport type DialogResult = null | boolean | string;\n","import type { EnumToUnion } from '../../internals';\n\n/**\n * The encoding to use when retrieving the file. Defaults to `Base64`.\n */\nexport enum AuxiliaryFileEncoding {\n Base64 = 'base64',\n Hex = 'hex',\n Utf8 = 'utf8',\n}\n\n/**\n * The request parameters for the `snap_getFile` method.\n *\n * @property path - The path to the file to retrieve.\n * @property encoding - The encoding to use when retrieving the file.\n */\nexport type GetFileParams = {\n path: string;\n encoding?: EnumToUnion;\n};\n\n/**\n * The result returned by the `snap_getFile` method.\n */\nexport type GetFileResult = string;\n","import type { Json } from '@metamask/utils';\n\nimport type { EnumToUnion } from '../../internals';\n\n/**\n * The operations that can be performed on the state.\n */\nexport enum ManageStateOperation {\n ClearState = 'clear',\n GetState = 'get',\n UpdateState = 'update',\n}\n\n/**\n * The clear state operation, which clears the state.\n *\n * @property operation - The operation to perform on the state. Must be `clear`.\n * @property encrypted - Whether to use the separate encrypted state, or the\n * unencrypted state. Defaults to the encrypted state. Encrypted state can only\n * be used if the extension is unlocked, while unencrypted state can be used\n * whether the extension is locked or unlocked.\n */\nexport type ClearStateOperation = {\n operation: EnumToUnion;\n encrypted?: boolean;\n};\n\n/**\n * The get state operation, which retrieves the state.\n *\n * @property operation - The operation to perform on the state. Must be `get`.\n * @property encrypted - Whether to use the separate encrypted state, or the\n * unencrypted state. Defaults to the encrypted state. Encrypted state can only\n * be used if the extension is unlocked, while unencrypted state can be used\n * whether the extension is locked or unlocked.\n */\nexport type GetStateOperation = {\n operation: EnumToUnion;\n encrypted?: boolean;\n};\n\n/**\n * The update state operation, which updates the state.\n *\n * @property operation - The operation to perform on the state. Must be\n * `update`.\n * @property encrypted - Whether to use the separate encrypted state, or the\n * unencrypted state. Defaults to the encrypted state. Encrypted state can only\n * be used if the extension is unlocked, while unencrypted state can be used\n * whether the extension is locked or unlocked.\n * @property newState - The new state to set.\n */\nexport type UpdateStateOperation = {\n operation: EnumToUnion;\n encrypted?: boolean;\n newState: Record;\n};\n\n/**\n * The request parameters for the `snap_manageState` method.\n *\n * @property operation - The operation to perform on the state.\n * @property encrypted - Whether to use the separate encrypted state, or the\n * unencrypted state. Defaults to the encrypted state.\n * @property newState - The new state to set. Only applicable for the `set`\n * operation.\n */\nexport type ManageStateParams =\n | ClearStateOperation\n | GetStateOperation\n | UpdateStateOperation;\n\n/**\n * The result returned by the `snap_manageState` method.\n *\n * If the operation is `get`, the result is the state. Otherwise, the result is\n * `null`.\n */\nexport type ManageStateResult = Record | null;\n","import type { EnumToUnion } from '../../internals';\n\n/**\n * The types of notifications that can be displayed.\n *\n * - `InApp` - A notification that is displayed in by the MetaMask extension.\n * - `Native` - A notification that is displayed by the operating system.\n */\nexport enum NotificationType {\n InApp = 'inApp',\n Native = 'native',\n}\n\n/**\n * The request parameters for the `snap_notify` method.\n *\n * @property type - The type of notification to display.\n * @property message - The message to display in the notification.\n */\nexport type NotifyParams = {\n type: EnumToUnion;\n message: string;\n};\n\n/**\n * The result returned by the `snap_notify` method.\n *\n * This method does not return anything.\n */\nexport type NotifyResult = null;\n","import { JsonStruct } from '@metamask/utils';\nimport type { Infer } from 'superstruct';\nimport { nullable, record, string, union } from 'superstruct';\n\nimport type { JSXElement } from '../jsx';\nimport { RootJSXElementStruct } from '../jsx';\nimport type { Component } from '../ui';\nimport { ComponentStruct } from '../ui';\n\n/**\n * To avoid typing problems with the interface state when manipulating it we have to differentiate the state of\n * a form (that will be contained inside the root state) and the root state since a key in the root stat can contain\n * either the value of an input or a sub-state of a form.\n */\n\nexport const FormStateStruct = record(string(), nullable(string()));\n\nexport const InterfaceStateStruct = record(\n string(),\n union([FormStateStruct, nullable(string())]),\n);\n\nexport type FormState = Infer;\nexport type InterfaceState = Infer;\n\nexport type ComponentOrElement = Component | JSXElement;\nexport const ComponentOrElementStruct = union([\n ComponentStruct,\n RootJSXElementStruct,\n]);\n\nexport const InterfaceContextStruct = record(string(), JsonStruct);\nexport type InterfaceContext = Infer;\n","import {\n hasProperty,\n HexChecksumAddressStruct,\n isPlainObject,\n JsonStruct,\n} from '@metamask/utils';\nimport type { Struct } from 'superstruct';\nimport {\n is,\n boolean,\n optional,\n array,\n lazy,\n nullable,\n number,\n object,\n record,\n string,\n tuple,\n} from 'superstruct';\nimport type { ObjectSchema } from 'superstruct/dist/utils';\n\nimport type { Describe } from '../internals';\nimport { literal, nullUnion } from '../internals';\nimport type { EmptyObject } from '../types';\nimport type {\n GenericSnapElement,\n JsonObject,\n Key,\n MaybeArray,\n SnapElement,\n StringElement,\n} from './component';\nimport type {\n AddressElement,\n BoldElement,\n BoxElement,\n ButtonElement,\n CopyableElement,\n DividerElement,\n DropdownElement,\n OptionElement,\n FieldElement,\n FormElement,\n HeadingElement,\n ImageElement,\n InputElement,\n ItalicElement,\n JSXElement,\n LinkElement,\n RowElement,\n SpinnerElement,\n StandardFormattingElement,\n TextElement,\n ValueElement,\n} from './components';\n\n/**\n * A struct for the {@link Key} type.\n */\nexport const KeyStruct: Describe = nullUnion([string(), number()]);\n\n/**\n * A struct for the {@link StringElement} type.\n */\nexport const StringElementStruct: Describe = maybeArray(\n string(),\n);\n\n/**\n * A struct for the {@link GenericSnapElement} type.\n */\nexport const ElementStruct: Describe = object({\n type: string(),\n props: record(string(), JsonStruct),\n key: nullable(KeyStruct),\n});\n\n/**\n * A helper function for creating a struct for a {@link MaybeArray} type.\n *\n * @param struct - The struct for the maybe array type.\n * @returns The struct for the maybe array type.\n */\nfunction maybeArray(\n struct: Struct,\n): Struct, any> {\n return nullUnion([struct, array(struct)]);\n}\n\n/**\n * A helper function for creating a struct for a JSX element.\n *\n * @param name - The name of the element.\n * @param props - The props of the element.\n * @returns The struct for the element.\n */\nfunction element(\n name: Name,\n props: Props = {} as Props,\n) {\n return object({\n type: literal(name) as unknown as Struct,\n props: object(props),\n key: nullable(KeyStruct),\n });\n}\n\n/**\n * A struct for the {@link ButtonElement} type.\n */\nexport const ButtonStruct: Describe = element('Button', {\n children: StringElementStruct,\n name: optional(string()),\n type: optional(nullUnion([literal('button'), literal('submit')])),\n variant: optional(nullUnion([literal('primary'), literal('destructive')])),\n disabled: optional(boolean()),\n});\n\n/**\n * A struct for the {@link InputElement} type.\n */\nexport const InputStruct: Describe = element('Input', {\n name: string(),\n type: optional(\n nullUnion([literal('text'), literal('password'), literal('number')]),\n ),\n value: optional(string()),\n placeholder: optional(string()),\n});\n\n/**\n * A struct for the {@link OptionElement} type.\n */\nexport const OptionStruct: Describe = element('Option', {\n value: string(),\n children: string(),\n});\n\n/**\n * A struct for the {@link DropdownElement} type.\n */\nexport const DropdownStruct: Describe = element('Dropdown', {\n name: string(),\n value: optional(string()),\n children: maybeArray(OptionStruct),\n});\n\n/**\n * A struct for the {@link FieldElement} type.\n */\nexport const FieldStruct: Describe = element('Field', {\n label: optional(string()),\n error: optional(string()),\n children: nullUnion([\n tuple([InputStruct, ButtonStruct]),\n InputStruct,\n DropdownStruct,\n ]),\n});\n\n/**\n * A struct for the {@link FormElement} type.\n */\nexport const FormStruct: Describe = element('Form', {\n children: maybeArray(nullUnion([FieldStruct, ButtonStruct])),\n name: string(),\n});\n\n/**\n * A struct for the {@link BoldElement} type.\n */\nexport const BoldStruct: Describe = element('Bold', {\n children: maybeArray(\n nullable(\n nullUnion([\n string(),\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n lazy(() => ItalicStruct) as unknown as Struct<\n SnapElement\n >,\n ]),\n ),\n ),\n});\n\n/**\n * A struct for the {@link ItalicElement} type.\n */\nexport const ItalicStruct: Describe = element('Italic', {\n children: maybeArray(\n nullable(\n nullUnion([\n string(),\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n lazy(() => BoldStruct) as unknown as Struct<\n SnapElement\n >,\n ]),\n ),\n ),\n});\n\nexport const FormattingStruct: Describe = nullUnion([\n BoldStruct,\n ItalicStruct,\n]);\n\n/**\n * A struct for the {@link AddressElement} type.\n */\nexport const AddressStruct: Describe = element('Address', {\n address: HexChecksumAddressStruct,\n});\n\n/**\n * A struct for the {@link BoxElement} type.\n */\nexport const BoxStruct: Describe = element('Box', {\n children: maybeArray(\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n nullable(lazy(() => BoxChildStruct)),\n ) as unknown as Struct, null>,\n direction: optional(nullUnion([literal('horizontal'), literal('vertical')])),\n alignment: optional(\n nullUnion([\n literal('start'),\n literal('center'),\n literal('end'),\n literal('space-between'),\n literal('space-around'),\n ]),\n ),\n});\n\n/**\n * A struct for the {@link CopyableElement} type.\n */\nexport const CopyableStruct: Describe = element('Copyable', {\n value: string(),\n sensitive: optional(boolean()),\n});\n\n/**\n * A struct for the {@link DividerElement} type.\n */\nexport const DividerStruct: Describe = element('Divider');\n\n/**\n * A struct for the {@link ValueElement} type.\n */\nexport const ValueStruct: Describe = element('Value', {\n value: string(),\n extra: string(),\n});\n\n/**\n * A struct for the {@link HeadingElement} type.\n */\nexport const HeadingStruct: Describe = element('Heading', {\n children: StringElementStruct,\n});\n\n/**\n * A struct for the {@link ImageElement} type.\n */\nexport const ImageStruct: Describe = element('Image', {\n src: string(),\n alt: optional(string()),\n});\n\n/**\n * A struct for the {@link LinkElement} type.\n */\nexport const LinkStruct: Describe = element('Link', {\n href: string(),\n children: maybeArray(nullable(nullUnion([FormattingStruct, string()]))),\n});\n\n/**\n * A struct for the {@link TextElement} type.\n */\nexport const TextStruct: Describe = element('Text', {\n children: maybeArray(\n nullable(nullUnion([string(), BoldStruct, ItalicStruct, LinkStruct])),\n ),\n});\n\n/**\n * A struct for the {@link RowElement} type.\n */\nexport const RowStruct: Describe = element('Row', {\n label: string(),\n children: nullUnion([AddressStruct, ImageStruct, TextStruct, ValueStruct]),\n variant: optional(\n nullUnion([literal('default'), literal('warning'), literal('error')]),\n ),\n});\n\n/**\n * A struct for the {@link SpinnerElement} type.\n */\nexport const SpinnerStruct: Describe = element('Spinner');\n\n/**\n * A subset of JSX elements that are allowed as children of the Box component.\n * This set should include all components, except components that need to be nested\n * in another component (e.g. Field must be contained in a Form).\n */\nexport const BoxChildStruct = nullUnion([\n ButtonStruct,\n InputStruct,\n FormStruct,\n BoldStruct,\n ItalicStruct,\n AddressStruct,\n BoxStruct,\n CopyableStruct,\n DividerStruct,\n HeadingStruct,\n ImageStruct,\n LinkStruct,\n RowStruct,\n SpinnerStruct,\n TextStruct,\n DropdownStruct,\n]);\n\n/**\n * For now, the allowed JSX elements at the root are the same as the allowed\n * children of the Box component.\n */\nexport const RootJSXElementStruct = BoxChildStruct;\n\n/**\n * A struct for the {@link JSXElement} type.\n */\nexport const JSXElementStruct: Describe = nullUnion([\n ButtonStruct,\n InputStruct,\n FieldStruct,\n FormStruct,\n BoldStruct,\n ItalicStruct,\n AddressStruct,\n BoxStruct,\n CopyableStruct,\n DividerStruct,\n HeadingStruct,\n ImageStruct,\n LinkStruct,\n RowStruct,\n SpinnerStruct,\n TextStruct,\n DropdownStruct,\n OptionStruct,\n ValueStruct,\n]);\n\n/**\n * Check if a value is a JSX element.\n *\n * @param value - The value to check.\n * @returns True if the value is a JSX element, false otherwise.\n */\nexport function isJSXElement(value: unknown): value is JSXElement {\n return is(value, JSXElementStruct);\n}\n\n/**\n * Check if a value is a JSX element, without validating all of its contents.\n * This is useful when you want to validate the structure of a value, but not\n * all the children.\n *\n * This should only be used when you are sure that the value is safe to use,\n * i.e., after using {@link isJSXElement}.\n *\n * @param value - The value to check.\n * @returns True if the value is a JSX element, false otherwise.\n */\nexport function isJSXElementUnsafe(value: unknown): value is JSXElement {\n return (\n isPlainObject(value) &&\n hasProperty(value, 'type') &&\n hasProperty(value, 'props') &&\n hasProperty(value, 'key')\n );\n}\n\n/**\n * Assert that a value is a JSX element.\n *\n * @param value - The value to check.\n * @throws If the value is not a JSX element.\n */\nexport function assertJSXElement(value: unknown): asserts value is JSXElement {\n // TODO: We should use the error parsing utils from `snaps-utils` to improve\n // the error messages. It currently includes colours and potentially other\n // formatting that we might not want to include in the SDK.\n if (!isJSXElement(value)) {\n throw new Error(\n `Expected a JSX element, but received ${JSON.stringify(\n value,\n )}. Please refer to the documentation for the supported JSX elements and their props.`,\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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AAAA,QACR,+BAAS,UAAU,KAAC,6BAAO,GAAG,YAAY,cAAc,UAAU,CAAC,CAAC;AAAA,EACtE;AACF,CAAC;AAKM,IAAMC,aAAkC,QAAQ,OAAO;AAAA,EAC5D,WAAO,6BAAO;AAAA,EACd,UAAU,UAAU,CAACN,gBAAeI,cAAaC,aAAY,WAAW,CAAC;AAAA,EACzE,aAAS;AAAA,IACP,UAAU,CAAC,QAAQ,SAAS,GAAG,QAAQ,SAAS,GAAG,QAAQ,OAAO,CAAC,CAAC;AAAA,EACtE;AACF,CAAC;AAKM,IAAME,iBAA0C,QAAQ,SAAS;AAOjE,IAAM,iBAAiB,UAAU;AAAA,EACtCV;AAAA,EACAC;AAAA,EACAC;AAAA,EACA;AAAA,EACA;AAAA,EACAC;AAAA,EACA;AAAA,EACAC;AAAA,EACAC;AAAA,EACAC;AAAA,EACAC;AAAA,EACA;AAAA,EACAE;AAAA,EACAC;AAAA,EACAF;AAAA,EACA;AACF,CAAC;AAMM,IAAM,uBAAuB;AAK7B,IAAM,mBAAyC,UAAU;AAAA,EAC9DR;AAAA,EACAC;AAAA,EACA;AAAA,EACAC;AAAA,EACA;AAAA,EACA;AAAA,EACAC;AAAA,EACA;AAAA,EACAC;AAAA,EACAC;AAAA,EACAC;AAAA,EACAC;AAAA,EACA;AAAA,EACAE;AAAA,EACAC;AAAA,EACAF;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;;;ADtVM,IAAM,sBAAkB,iCAAO,6BAAO,OAAG,mCAAS,6BAAO,CAAC,CAAC;AAE3D,IAAM,2BAAuB;AAAA,MAClC,6BAAO;AAAA,MACP,4BAAM,CAAC,qBAAiB,mCAAS,6BAAO,CAAC,CAAC,CAAC;AAC7C;AAMO,IAAM,+BAA2B,4BAAM;AAAA,EAC5C;AAAA,EACA;AACF,CAAC;AAEM,IAAM,6BAAyB,iCAAO,6BAAO,GAAG,wBAAU;","names":["error","superstructLiteral","superstructUnion","import_utils","svg","import_utils","import_utils","import_utils","import_superstruct","import_utils","node","import_superstruct","NodeType","import_superstruct","import_superstruct","import_superstruct","import_superstruct","import_superstruct","import_superstruct","ButtonVariant","ButtonType","import_superstruct","import_superstruct","InputType","import_superstruct","import_superstruct","RowVariant","import_superstruct","import_utils","import_superstruct","SeverityLevel","import_superstruct","UserInputEventType","DialogType","AuxiliaryFileEncoding","ManageStateOperation","NotificationType","import_utils","import_superstruct","import_utils","import_superstruct","ButtonStruct","InputStruct","FormStruct","AddressStruct","CopyableStruct","DividerStruct","HeadingStruct","ImageStruct","TextStruct","RowStruct","SpinnerStruct"]} +\ No newline at end of file ++{"version":3,"sources":["../src/index.ts","../src/errors.ts","../src/internals/error-wrappers.ts","../src/internals/errors.ts","../src/internals/structs.ts","../src/internals/jsx.ts","../src/internals/svg.ts","../src/error-wrappers.ts","../src/images.ts","../src/ui/components/address.ts","../src/ui/builder.ts","../src/ui/nodes.ts","../src/ui/components/copyable.ts","../src/ui/components/divider.ts","../src/ui/components/heading.ts","../src/ui/components/image.ts","../src/ui/components/panel.ts","../src/ui/components/button.ts","../src/ui/components/form.ts","../src/ui/components/input.ts","../src/ui/components/row.ts","../src/ui/components/text.ts","../src/ui/components/spinner.ts","../src/ui/component.ts","../src/types/handlers/transaction.ts","../src/types/handlers/user-input.ts","../src/types/methods/dialog.ts","../src/types/methods/get-file.ts","../src/types/methods/manage-state.ts","../src/types/methods/notify.ts","../src/types/interface.ts","../src/jsx/validation.ts"],"sourcesContent":["// Only internals that are used by other Snaps packages should be exported here.\nexport type { EnumToUnion } from './internals';\nexport {\n getErrorData,\n getErrorMessage,\n getErrorStack,\n SNAP_ERROR_CODE,\n SNAP_ERROR_MESSAGE,\n literal,\n union,\n enumValue,\n parseSvg,\n isSvg,\n} from './internals';\n\n// Re-exported from `@metamask/utils` for convenience.\nexport type {\n Json,\n JsonRpcError,\n JsonRpcRequest,\n JsonRpcParams,\n} from '@metamask/utils';\nexport { assert } from '@metamask/utils';\n\nexport * from './errors';\nexport * from './error-wrappers';\nexport * from './images';\nexport * from './types';\nexport * from './ui';\n","import type { Json, JsonRpcError } from '@metamask/utils';\n\nimport {\n getErrorCode,\n getErrorData,\n getErrorMessage,\n SNAP_ERROR_CODE,\n SNAP_ERROR_MESSAGE,\n} from './internals';\n\n/**\n * A generic error which can be thrown by a Snap, without it causing the Snap to\n * crash.\n */\nexport class SnapError extends Error {\n readonly #code: number;\n\n readonly #message: string;\n\n readonly #data?: Record;\n\n readonly #stack?: string;\n\n /**\n * Create a new `SnapError`.\n *\n * @param error - The error to create the `SnapError` from. If this is a\n * `string`, it will be used as the error message. If this is an `Error`, its\n * `message` property will be used as the error message. If this is a\n * `JsonRpcError`, its `message` property will be used as the error message\n * and its `code` property will be used as the error code. Otherwise, the\n * error will be converted to a string and used as the error message.\n * @param data - Additional data to include in the error. This will be merged\n * with the error data, if any.\n */\n constructor(\n error: string | Error | JsonRpcError,\n data: Record = {},\n ) {\n const message = getErrorMessage(error);\n super(message);\n\n this.#message = message;\n this.#code = getErrorCode(error);\n\n const mergedData = { ...getErrorData(error), ...data };\n if (Object.keys(mergedData).length > 0) {\n this.#data = mergedData;\n }\n\n this.#stack = super.stack;\n }\n\n /**\n * The error name.\n *\n * @returns The error name.\n */\n get name() {\n return 'SnapError';\n }\n\n /**\n * The error code.\n *\n * @returns The error code.\n */\n get code() {\n return this.#code;\n }\n\n /**\n * The error message.\n *\n * @returns The error message.\n */\n // This line is covered, but Jest doesn't pick it up for some reason.\n /* istanbul ignore next */\n get message() {\n return this.#message;\n }\n\n /**\n * Additional data for the error.\n *\n * @returns Additional data for the error.\n */\n get data() {\n return this.#data;\n }\n\n /**\n * The error stack.\n *\n * @returns The error stack.\n */\n // This line is covered, but Jest doesn't pick it up for some reason.\n /* istanbul ignore next */\n get stack() {\n return this.#stack;\n }\n\n /**\n * Convert the error to a JSON object.\n *\n * @returns The JSON object.\n */\n toJSON(): SerializedSnapError {\n return {\n code: SNAP_ERROR_CODE,\n message: SNAP_ERROR_MESSAGE,\n data: {\n cause: {\n code: this.code,\n message: this.message,\n stack: this.stack,\n ...(this.data ? { data: this.data } : {}),\n },\n },\n };\n }\n\n /**\n * Serialize the error to a JSON object. This is called by\n * `@metamask/rpc-errors` when serializing the error.\n *\n * @returns The JSON object.\n */\n serialize() {\n return this.toJSON();\n }\n}\n\n/**\n * A serialized {@link SnapError}. It's JSON-serializable, so it can be sent\n * over the RPC. The original error is wrapped in the `cause` property.\n *\n * @property code - The error code. This is always `-31002`.\n * @property message - The error message. This is always `'Snap Error'`.\n * @property data - The error data.\n * @property data.cause - The cause of the error.\n * @property data.cause.code - The error code.\n * @property data.cause.message - The error message.\n * @property data.cause.stack - The error stack.\n * @property data.cause.data - Additional data for the error.\n * @see SnapError\n */\nexport type SerializedSnapError = {\n code: typeof SNAP_ERROR_CODE;\n message: typeof SNAP_ERROR_MESSAGE;\n data: {\n cause: JsonRpcError;\n };\n};\n","import type { rpcErrors } from '@metamask/rpc-errors';\nimport type { Json } from '@metamask/utils';\n\nimport { SnapError } from '../errors';\n\nexport type JsonRpcErrorFunction = typeof rpcErrors.parse;\n\n/**\n * Create a `SnapError` class from an error function from\n * `@metamask/rpc-errors`. This is useful for creating custom error classes\n * which can be thrown by a Snap.\n *\n * The created class will inherit the message, code, and data properties from\n * the error function.\n *\n * @param fn - The error function to create the class from.\n * @returns The created `SnapError` class.\n */\nexport function createSnapError(fn: JsonRpcErrorFunction) {\n return class SnapJsonRpcError extends SnapError {\n /**\n * Create a new `SnapJsonRpcError` from a message.\n *\n * @param message - The message to create the error from.\n */\n constructor(message?: string);\n\n /**\n * Create a new `SnapJsonRpcError` from data.\n *\n * @param data - The data to create the error from.\n */\n constructor(data?: Record);\n\n /**\n * Create a new `SnapJsonRpcError` from a message and data.\n *\n * @param message - The message to create the error from.\n * @param data - The data to create the error from.\n */\n constructor(\n message?: string | Record,\n data?: Record,\n );\n\n /**\n * Create a new `SnapJsonRpcError` from a message and data.\n *\n * @param message - The message to create the error from.\n * @param data - The data to create the error from.\n */\n constructor(\n message?: string | Record,\n data?: Record,\n ) {\n if (typeof message === 'object') {\n const error = fn();\n super({\n code: error.code,\n message: error.message,\n data: message,\n });\n\n return;\n }\n\n const error = fn(message);\n super({\n code: error.code,\n message: error.message,\n data,\n });\n }\n };\n}\n","import { hasProperty, isObject, isValidJson } from '@metamask/utils';\n\nexport const SNAP_ERROR_CODE = -31002;\nexport const SNAP_ERROR_MESSAGE = 'Snap Error';\n\n/**\n * Get the error message from an unknown error type.\n *\n * - If the error is an object with a `message` property, return the message.\n * - Otherwise, return the error converted to a string.\n *\n * @param error - The error to get the message from.\n * @returns The error message.\n * @internal\n */\nexport function getErrorMessage(error: unknown) {\n if (\n isObject(error) &&\n hasProperty(error, 'message') &&\n typeof error.message === 'string'\n ) {\n return error.message;\n }\n\n return String(error);\n}\n\n/**\n * Get the error stack from an unknown error type.\n *\n * @param error - The error to get the stack from.\n * @returns The error stack, or undefined if the error does not have a valid\n * stack.\n * @internal\n */\nexport function getErrorStack(error: unknown) {\n if (\n isObject(error) &&\n hasProperty(error, 'stack') &&\n typeof error.stack === 'string'\n ) {\n return error.stack;\n }\n\n return undefined;\n}\n\n/**\n * Get the error code from an unknown error type.\n *\n * @param error - The error to get the code from.\n * @returns The error code, or `-32603` if the error does not have a valid code.\n * @internal\n */\nexport function getErrorCode(error: unknown) {\n if (\n isObject(error) &&\n hasProperty(error, 'code') &&\n typeof error.code === 'number' &&\n Number.isInteger(error.code)\n ) {\n return error.code;\n }\n\n return -32603;\n}\n\n/**\n * Get the error data from an unknown error type.\n *\n * @param error - The error to get the data from.\n * @returns The error data, or an empty object if the error does not have valid\n * data.\n * @internal\n */\nexport function getErrorData(error: unknown) {\n if (\n isObject(error) &&\n hasProperty(error, 'data') &&\n typeof error.data === 'object' &&\n error.data !== null &&\n isValidJson(error.data) &&\n !Array.isArray(error.data)\n ) {\n return error.data;\n }\n\n return {};\n}\n","import type { Infer } from 'superstruct';\nimport {\n Struct,\n define,\n literal as superstructLiteral,\n union as superstructUnion,\n} from 'superstruct';\nimport type { AnyStruct, InferStructTuple } from 'superstruct';\n\nimport type { EnumToUnion } from './helpers';\n\n/**\n * A wrapper of `superstruct`'s `literal` struct that also defines the name of\n * the struct as the literal value.\n *\n * This is useful for improving the error messages returned by `superstruct`.\n * For example, instead of returning an error like:\n *\n * ```\n * Expected the value to satisfy a union of `literal | literal`, but received: \\\"baz\\\"\n * ```\n *\n * This struct will return an error like:\n *\n * ```\n * Expected the value to satisfy a union of `\"foo\" | \"bar\"`, but received: \\\"baz\\\"\n * ```\n *\n * @param value - The literal value.\n * @returns The `superstruct` struct, which validates that the value is equal\n * to the literal value.\n */\nexport function literal(value: Type) {\n return define(\n JSON.stringify(value),\n superstructLiteral(value).validator,\n );\n}\n\n/**\n * A wrapper of `superstruct`'s `union` struct that also defines the schema as\n * the union of the schemas of the structs.\n *\n * This is useful for improving the error messages returned by `superstruct`.\n *\n * @param structs - The structs to union.\n * @param structs.\"0\" - The first struct.\n * @param structs.\"1\" - The remaining structs.\n * @returns The `superstruct` struct, which validates that the value satisfies\n * one of the structs.\n */\nexport function union([\n head,\n ...tail\n]: [head: Head, ...tail: Tail]): Struct<\n Infer | InferStructTuple[number],\n [head: Head, ...tail: Tail]\n> {\n const struct = superstructUnion([head, ...tail]);\n\n return new Struct({\n ...struct,\n schema: [head, ...tail],\n });\n}\n\n/**\n * Superstruct struct for validating an enum value. This allows using both the\n * enum string values and the enum itself as values.\n *\n * @param constant - The enum to validate against.\n * @returns The superstruct struct.\n */\nexport function enumValue(\n constant: Type,\n): Struct, null> {\n return literal(constant as EnumToUnion);\n}\n","import type { Infer, Struct } from 'superstruct';\nimport type {\n AnyStruct,\n EnumSchema,\n InferStructTuple,\n IsExactMatch,\n IsMatch,\n IsRecord,\n IsTuple,\n UnionToIntersection,\n} from 'superstruct';\n\nimport type { EmptyObject } from '../types';\nimport { union } from './structs';\n\n/**\n * Check if a type is a union. Infers `true` if it is a union, otherwise\n * `false`.\n */\ntype IsUnion = [Type] extends [UnionToIntersection] ? false : true;\n\n/**\n * Get a struct schema for a type.\n *\n * This is copied from `superstruct` but fixes some issues with the original\n * implementation.\n */\ntype StructSchema = IsUnion extends true\n ? null\n : [Type] extends [EmptyObject]\n ? EmptyObject\n : [Type] extends [string | undefined | null]\n ? [Type] extends [`0x${string}`]\n ? null\n : [Type] extends [IsMatch]\n ? null\n : [Type] extends [IsUnion]\n ? EnumSchema\n : Type\n : [Type] extends [number | undefined | null]\n ? [Type] extends [IsMatch]\n ? null\n : [Type] extends [IsUnion]\n ? EnumSchema\n : Type\n : [Type] extends [boolean]\n ? [Type] extends [IsExactMatch]\n ? null\n : Type\n : Type extends\n | bigint\n | symbol\n | undefined\n | null\n // eslint-disable-next-line @typescript-eslint/ban-types\n | Function\n | Date\n | Error\n | RegExp\n | Map\n | WeakMap\n | Set\n | WeakSet\n | Promise\n ? null\n : Type extends (infer E)[]\n ? Type extends IsTuple\n ? null\n : Struct\n : Type extends object\n ? Type extends IsRecord\n ? null\n : {\n [InnerKey in keyof Type]: Describe;\n }\n : null;\n\n/**\n * Describe a struct type.\n */\nexport type Describe = Struct>;\n\n/**\n * Create a union struct that uses `null` for the schema type, for better\n * compatibility with `Describe`.\n *\n * @param structs - The structs to union.\n * @returns The `superstruct` struct, which validates that the value satisfies\n * one of the structs.\n */\nexport function nullUnion(\n structs: [head: Head, ...tail: Tail],\n) {\n return union(structs) as unknown as Struct<\n Infer | InferStructTuple[number],\n null\n >;\n}\n","import { assert, hasProperty, isObject } from '@metamask/utils';\nimport { XMLParser } from 'fast-xml-parser';\n\n/**\n * Parse and validate a string as an SVG.\n *\n * @param svg - An SVG string.\n * @returns The SVG, its attributes and children in an object format.\n */\nexport function parseSvg(svg: string) {\n try {\n const trimmed = svg.trim();\n\n assert(trimmed.length > 0);\n\n const parser = new XMLParser({\n ignoreAttributes: false,\n parseAttributeValue: true,\n });\n const parsed = parser.parse(trimmed, true);\n\n assert(hasProperty(parsed, 'svg'));\n\n // Empty SVGs are not returned as objects\n if (!isObject(parsed.svg)) {\n return {};\n }\n\n return parsed.svg;\n } catch {\n throw new Error('Snap icon must be a valid SVG.');\n }\n}\n\n/**\n * Validate that a string is a valid SVG.\n *\n * @param svg - An SVG string.\n * @returns True if the SVG is valid otherwise false.\n */\nexport function isSvg(svg: string) {\n try {\n parseSvg(svg);\n return true;\n } catch {\n return false;\n }\n}\n","import { providerErrors, rpcErrors } from '@metamask/rpc-errors';\n\nimport { createSnapError } from './internals';\n\n/**\n * A JSON-RPC 2.0 Internal (-32603) error.\n *\n * This can be thrown by a Snap to indicate that an internal error occurred,\n * without crashing the Snap.\n *\n * @see https://www.jsonrpc.org/specification#error_object\n */\nexport const InternalError = createSnapError(rpcErrors.internal);\n\n/**\n * An Ethereum JSON-RPC Invalid Input (-32000) error.\n *\n * This can be thrown by a Snap to indicate that the input to a method is\n * invalid, without crashing the Snap.\n *\n * @see https://eips.ethereum.org/EIPS/eip-1474#error-codes\n */\nexport const InvalidInputError = createSnapError(rpcErrors.invalidInput);\n\n/**\n * A JSON-RPC 2.0 Invalid Params (-32602) error.\n *\n * This can be thrown by a Snap to indicate that the parameters to a method are\n * invalid, without crashing the Snap.\n *\n * @see https://www.jsonrpc.org/specification#error_object\n */\nexport const InvalidParamsError = createSnapError(rpcErrors.invalidParams);\n\n/**\n * A JSON-RPC 2.0 Invalid Request (-32600) error.\n *\n * This can be thrown by a Snap to indicate that the request is invalid, without\n * crashing the Snap.\n *\n * @see https://www.jsonrpc.org/specification#error_object\n */\nexport const InvalidRequestError = createSnapError(rpcErrors.invalidRequest);\n\n/**\n * An Ethereum JSON-RPC Limit Exceeded (-32005) error.\n *\n * This can be thrown by a Snap to indicate that a limit has been exceeded,\n * without crashing the Snap.\n *\n * @see https://eips.ethereum.org/EIPS/eip-1474#error-codes\n */\nexport const LimitExceededError = createSnapError(rpcErrors.limitExceeded);\n\n/**\n * An Ethereum JSON-RPC Method Not Found (-32601) error.\n *\n * This can be thrown by a Snap to indicate that a method does not exist,\n * without crashing the Snap.\n *\n * @see https://eips.ethereum.org/EIPS/eip-1474#error-codes\n */\nexport const MethodNotFoundError = createSnapError(rpcErrors.methodNotFound);\n\n/**\n * An Ethereum JSON-RPC Method Not Supported (-32004) error.\n *\n * This can be thrown by a Snap to indicate that a method is not supported,\n * without crashing the Snap.\n */\nexport const MethodNotSupportedError = createSnapError(\n rpcErrors.methodNotSupported,\n);\n\n/**\n * A JSON-RPC 2.0 Parse (-32700) error.\n *\n * This can be thrown by a Snap to indicate that a request is not valid JSON,\n * without crashing the Snap.\n *\n * @see https://www.jsonrpc.org/specification#error_object\n */\nexport const ParseError = createSnapError(rpcErrors.parse);\n\n/**\n * An Ethereum JSON-RPC Resource Not Found (-32001) error.\n *\n * This can be thrown by a Snap to indicate that a resource does not exist,\n * without crashing the Snap.\n *\n * @see https://eips.ethereum.org/EIPS/eip-1474#error-codes\n */\nexport const ResourceNotFoundError = createSnapError(\n rpcErrors.resourceNotFound,\n);\n\n/**\n * An Ethereum JSON-RPC Resource Unavailable (-32002) error.\n *\n * This can be thrown by a Snap to indicate that a resource is unavailable,\n * without crashing the Snap.\n *\n * @see https://eips.ethereum.org/EIPS/eip-1474#error-codes\n */\nexport const ResourceUnavailableError = createSnapError(\n rpcErrors.resourceUnavailable,\n);\n\n/**\n * An Ethereum JSON-RPC Transaction Rejected (-32003) error.\n *\n * This can be thrown by a Snap to indicate that a transaction was rejected,\n * without crashing the Snap.\n *\n * @see https://eips.ethereum.org/EIPS/eip-1474#error-codes\n */\nexport const TransactionRejected = createSnapError(\n rpcErrors.transactionRejected,\n);\n\n/**\n * An Ethereum Provider Chain Disconnected (4901) error.\n *\n * This can be thrown by a Snap to indicate that the provider is disconnected\n * from the requested chain, without crashing the Snap.\n *\n * @see https://eips.ethereum.org/EIPS/eip-1193#provider-errors\n */\nexport const ChainDisconnectedError = createSnapError(\n providerErrors.chainDisconnected,\n);\n\n/**\n * An Ethereum Provider Disconnected (4900) error.\n *\n * This can be thrown by a Snap to indicate that the provider is disconnected,\n * without crashing the Snap.\n *\n * @see https://eips.ethereum.org/EIPS/eip-1193#provider-errors\n */\nexport const DisconnectedError = createSnapError(providerErrors.disconnected);\n\n/**\n * An Ethereum Provider Unauthorized (4100) error.\n *\n * This can be thrown by a Snap to indicate that the requested method / account\n * is not authorized by the user, without crashing the Snap.\n */\nexport const UnauthorizedError = createSnapError(providerErrors.unauthorized);\n\n/**\n * An Ethereum Provider Unsupported Method (4200) error.\n *\n * This can be thrown by a Snap to indicate that the requested method is not\n * supported by the provider, without crashing the Snap.\n *\n * @see https://eips.ethereum.org/EIPS/eip-1193#provider-errors\n */\nexport const UnsupportedMethodError = createSnapError(\n providerErrors.unsupportedMethod,\n);\n\n/**\n * An Ethereum Provider User Rejected Request (4001) error.\n *\n * This can be thrown by a Snap to indicate that the user rejected the request,\n * without crashing the Snap.\n *\n * @see https://eips.ethereum.org/EIPS/eip-1193#provider-errors\n */\nexport const UserRejectedRequestError = createSnapError(\n providerErrors.userRejectedRequest,\n);\n","import { assert, bytesToBase64 } from '@metamask/utils';\n\nimport { image } from './ui';\n\n/**\n * Get raw image data from a URL.\n *\n * @param url - The URL to get the image data from.\n * @param options - The options to use when fetching the image data. This is\n * passed directly to `fetch`.\n * @returns A promise that resolves to the image data as a blob.\n */\nasync function getRawImageData(url: string, options?: RequestInit) {\n if (typeof fetch !== 'function') {\n throw new Error(\n `Failed to fetch image data from \"${url}\": Using this function requires the \"endowment:network-access\" permission.`,\n );\n }\n\n return fetch(url, options).then(async (response) => {\n if (!response.ok) {\n throw new Error(\n `Failed to fetch image data from \"${url}\": ${response.status} ${response.statusText}`,\n );\n }\n\n const blob = await response.blob();\n assert(\n blob.type === 'image/jpeg' || blob.type === 'image/png',\n 'Expected image data to be a JPEG or PNG image.',\n );\n\n return blob;\n });\n}\n\n/**\n * Get image data as data-string from a URL. This is useful for embedding images\n * inside of SVGs. Only JPEG and PNG images are supported.\n *\n * Note: This function uses `fetch` to get the image data. This means that using\n * it requires the `endowment:network-access` permission.\n *\n * @example\n * const imageData = await getImageData('https://cataas.com/cat');\n * const svg = `\n * \n * \n * \n * `;\n *\n * // Render the SVG in a Snap UI.\n * const ui = image(svg);\n * @param url - The URL to get the image data from.\n * @param options - The options to use when fetching the image data. This is\n * passed directly to `fetch`.\n * @returns A promise that resolves to the image data as a data-string.\n */\nexport async function getImageData(url: string, options?: RequestInit) {\n const blob = await getRawImageData(url, options);\n const bytes = new Uint8Array(await blob.arrayBuffer());\n\n return `data:${blob.type};base64,${bytesToBase64(bytes)}`;\n}\n\n/**\n * Options for getting an SVG image element from a URL.\n *\n * @property width - The width of the image.\n * @property height - The height of the image. If this is not provided, the\n * width will be used as the height.\n * @property request - The options to use when fetching the image data. This is\n * passed directly to `fetch`.\n */\nexport type ImageOptions = {\n width: number;\n height?: number;\n request?: RequestInit;\n};\n\n/**\n * Get an image component from a URL. This is useful for embedding images inside\n * Snap UIs. Only JPEG and PNG images are supported.\n *\n * Note: This function uses `fetch` to get the image data. This means that using\n * it requires the `endowment:network-access` permission.\n *\n * @example\n * const component = await getImage('https://cataas.com/cat');\n *\n * return await snap.request({\n * method: 'snap_dialog',\n * params: {\n * type: 'alert',\n * content: panel([\n * component,\n * ]),\n * },\n * });\n * @param url - The URL to get the image data from.\n * @param options - The options to use when fetching and rendering the image.\n * @param options.width - The width of the image.\n * @param options.height - The height of the image. If this is not provided, the\n * width will be used as the height.\n * @param options.request - The options to use when fetching the image data.\n * This is passed directly to `fetch`.\n * @returns A promise that resolves to the image data as an image component.\n */\nexport async function getImageComponent(\n url: string,\n { width, height = width, request }: ImageOptions,\n) {\n assert(\n typeof width === 'number' && width > 0,\n 'Expected width to be a number greater than 0.',\n );\n\n assert(\n typeof height === 'number' && height > 0,\n 'Expected height to be a number greater than 0.',\n );\n\n const imageData = await getImageData(url, request);\n const size = `width=\"${width}\" height=\"${height}\"`;\n\n return image(\n ``,\n );\n}\n","import { HexChecksumAddressStruct } from '@metamask/utils';\nimport type { Infer } from 'superstruct';\nimport { assign, literal, object } from 'superstruct';\n\nimport { createBuilder } from '../builder';\nimport { LiteralStruct, NodeType } from '../nodes';\n\nexport const AddressStruct = assign(\n LiteralStruct,\n object({\n type: literal(NodeType.Address),\n value: HexChecksumAddressStruct,\n }),\n);\n\n/**\n * A address node, that renders an EVM-like address and its icon.\n *\n * @property type - The type of the node. Must be the string `address`.\n * @property value - The address in hexadecimal, including 0x.\n */\nexport type Address = Infer;\n\n/**\n * Create an {@link Address} node.\n *\n * @param args - The node arguments. This can either be a string, or an object\n * with the `value` property.\n * @param args.value - The address to be rendered.\n * @returns The address node as an object.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * const node = address({ value: '0x4bbeeb066ed09b7aed07bf39eee0460dfa261520' });\n * const node = address('0x4bbeeb066ed09b7aed07bf39eee0460dfa261520');\n */\nexport const address = createBuilder(NodeType.Address, AddressStruct, [\n 'value',\n]);\n","import { assertStruct, isPlainObject } from '@metamask/utils';\nimport type { Struct } from 'superstruct';\n\nimport type { Component } from './components';\nimport type { NodeType } from './nodes';\n\n/**\n * A function that builds a {@link Component}. This infers the proper args type\n * from the given node.\n *\n * @internal\n */\ntype NodeBuilder = Omit<\n Node,\n 'type'\n> extends Record\n ? (...args: []) => Node\n : (...args: [Omit] | NodeArrayType) => Node;\n\n/**\n * Map from an array of node keys to the corresponding array type.\n *\n * @example\n * type Node = { type: 'node'; a: string; b: number; c: boolean };\n * type Keys = ['a', 'b', 'c'];\n *\n * type NodeArray = NodeArrayType; // [string, number, boolean]\n * @internal\n */\ntype NodeArrayType = {\n [Key in keyof Keys]: Node[Keys[Key]];\n};\n\n/**\n * A function that returns a function to \"build\" a {@link Component}. It infers\n * the type of the component from the given struct, and performs validation on\n * the created component.\n *\n * The returned function can handle the node arguments in two ways:\n * 1. As a single object, with the keys corresponding to the node's properties,\n * excluding the `type` property.\n * 2. As an array of arguments, with the order corresponding to the given keys.\n *\n * @param type - The type of the component to build.\n * @param struct - The struct to use to validate the component.\n * @param keys - The keys of the component to use as arguments to the builder.\n * The order of the keys determines the order of the arguments.\n * @returns A function that builds a component of the given type.\n * @internal\n */\nexport function createBuilder<\n Node extends Component,\n Keys extends (keyof Node)[] = [],\n>(\n type: NodeType,\n struct: Struct,\n keys: Keys = [] as unknown as Keys,\n): NodeBuilder {\n return (...args: [Omit] | NodeArrayType | []) => {\n // Node passed as a single object.\n if (args.length === 1 && isPlainObject(args[0])) {\n const node = { ...args[0], type };\n\n // The user could be passing invalid values to the builder, so we need to\n // validate them as per the component's struct.\n assertStruct(node, struct, `Invalid ${type} component`);\n return node;\n }\n\n // Node passed as an array of arguments.\n const node = keys.reduce>(\n (partialNode, key, index) => {\n if (args[index] !== undefined) {\n return {\n ...partialNode,\n [key]: args[index],\n };\n }\n\n return partialNode;\n },\n { type },\n );\n\n // The user could be passing invalid values to the builder, so we need to\n // validate them as per the component's struct.\n assertStruct(node, struct, `Invalid ${type} component`);\n return node;\n };\n}\n","import type { Infer } from 'superstruct';\nimport { assign, object, string, unknown } from 'superstruct';\n\n/**\n * The supported node types. This is based on SIP-7.\n *\n * @see https://metamask.github.io/SIPs/SIPS/sip-7\n */\nexport enum NodeType {\n Copyable = 'copyable',\n Divider = 'divider',\n Heading = 'heading',\n Panel = 'panel',\n Spinner = 'spinner',\n // eslint-disable-next-line @typescript-eslint/no-shadow\n Text = 'text',\n Image = 'image',\n Row = 'row',\n Address = 'address',\n Button = 'button',\n Input = 'input',\n Form = 'form',\n}\n\n/**\n * @internal\n */\nexport const NodeStruct = object({\n type: string(),\n});\n\n/**\n * The base node type. All nodes extend this type.\n *\n * @property type - The type of the node. See {@link NodeType} for the supported\n * node types.\n * @internal\n */\nexport type Node = Infer;\n\n/**\n * @internal\n */\nexport const LiteralStruct = assign(\n NodeStruct,\n object({\n value: unknown(),\n }),\n);\n\n/**\n * A node with a value. This is used for nodes that render a value, such as\n * {@link Text}.\n *\n * @property type - The type of the node.\n * @property value - The value of the node. The type of the value depends on the\n * node type.\n * @internal\n */\nexport type Literal = Infer;\n","import type { Infer } from 'superstruct';\nimport {\n assign,\n boolean,\n literal,\n object,\n optional,\n string,\n} from 'superstruct';\n\nimport { createBuilder } from '../builder';\nimport { LiteralStruct, NodeType } from '../nodes';\n\nexport const CopyableStruct = assign(\n LiteralStruct,\n object({\n type: literal(NodeType.Copyable),\n value: string(),\n sensitive: optional(boolean()),\n }),\n);\n\n/**\n * Text that can be copied to the clipboard. It can optionally be marked as\n * sensitive, in which case it will only be displayed to the user after clicking\n * on the component.\n *\n * @property type - The type of the node. Must be the string `copyable`.\n * @property value - The text to be copied.\n * @property sensitive - Whether the value is sensitive or not. Sensitive values\n * are only displayed to the user after clicking on the component. Defaults to\n * false.\n */\nexport type Copyable = Infer;\n\n/**\n * Create a {@link Copyable} component.\n *\n * @param args - The node arguments. This can either be a string, or an object\n * with the `text` property.\n * @param args.value - The text to be copied.\n * @param args.sensitive - Whether the value is sensitive or not. Sensitive\n * values are only displayed to the user after clicking on the component.\n * Defaults to false.\n * @returns A {@link Copyable} component.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * const node = copyable('Hello, world!');\n * const node = copyable({ value: 'Hello, world!' });\n */\nexport const copyable = createBuilder(NodeType.Copyable, CopyableStruct, [\n 'value',\n 'sensitive',\n]);\n","import type { Infer } from 'superstruct';\nimport { assign, literal, object } from 'superstruct';\n\nimport { createBuilder } from '../builder';\nimport { NodeStruct, NodeType } from '../nodes';\n\nexport const DividerStruct = assign(\n NodeStruct,\n object({\n type: literal(NodeType.Divider),\n }),\n);\n\n/**\n * A divider node, that renders a line between other nodes.\n */\nexport type Divider = Infer;\n\n/**\n * Create a {@link Divider} node.\n *\n * @returns The divider node as object.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * const node = divider();\n */\nexport const divider = createBuilder(NodeType.Divider, DividerStruct);\n","import type { Infer } from 'superstruct';\nimport { assign, literal, object, string } from 'superstruct';\n\nimport { createBuilder } from '../builder';\nimport { LiteralStruct, NodeType } from '../nodes';\n\nexport const HeadingStruct = assign(\n LiteralStruct,\n object({\n type: literal(NodeType.Heading),\n value: string(),\n }),\n);\n\n/**\n * A heading node, that renders the text as a heading. The level of the heading\n * is determined by the depth of the heading in the document.\n *\n * @property type - The type of the node, must be the string 'text'.\n * @property value - The text content of the node, either as plain text, or as a\n * markdown string.\n */\nexport type Heading = Infer;\n\n/**\n * Create a {@link Heading} node.\n *\n * @param args - The node arguments. This can either be a string, or an object\n * with the `value` property.\n * @param args.value - The heading text.\n * @returns The heading node as object.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * const node = heading({ value: 'Hello, world!' });\n * const node = heading('Hello, world!');\n */\nexport const heading = createBuilder(NodeType.Heading, HeadingStruct, [\n 'value',\n]);\n","import type { Infer } from 'superstruct';\nimport { assign, literal, object, refine, string } from 'superstruct';\n\nimport { isSvg } from '../../internals';\nimport { createBuilder } from '../builder';\nimport { NodeStruct, NodeType } from '../nodes';\n\n/**\n * Get a Struct that validates a string as a valid SVG.\n *\n * @returns A Struct that validates a string as a valid SVG.\n * @internal\n */\nexport function svg() {\n return refine(string(), 'SVG', (value) => {\n if (!isSvg(value)) {\n return 'Value is not a valid SVG.';\n }\n\n return true;\n });\n}\n\nexport const ImageStruct = assign(\n NodeStruct,\n object({\n type: literal(NodeType.Image),\n value: svg(),\n }),\n);\n\n/**\n * An image node, that renders an SVG image.\n *\n * @property type - The type of the node. Must be the string `image`.\n * @property value - The SVG image to be rendered.\n */\nexport type Image = Infer;\n\n/**\n * Create an {@link Image} node.\n *\n * @param args - The node arguments. This can either be a string, or an object\n * with the `value` property.\n * @param args.value - The SVG image to be rendered. Must be a valid SVG string.\n * @returns The image node as object. Other image formats are supported by\n * embedding them as data URLs in the SVG.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * const node = image({ value: '' });\n * const node = image('');\n */\nexport const image = createBuilder(NodeType.Image, ImageStruct, ['value']);\n","import type { Infer, Struct } from 'superstruct';\nimport { array, assign, lazy, literal, object, union } from 'superstruct';\n\nimport { createBuilder } from '../builder';\nimport { NodeStruct, NodeType } from '../nodes';\nimport { AddressStruct } from './address';\nimport { ButtonStruct } from './button';\nimport { CopyableStruct } from './copyable';\nimport { DividerStruct } from './divider';\nimport { FormStruct } from './form';\nimport { HeadingStruct } from './heading';\nimport { ImageStruct } from './image';\nimport { InputStruct } from './input';\nimport { RowStruct } from './row';\nimport { SpinnerStruct } from './spinner';\nimport { TextStruct } from './text';\n\n/**\n * @internal\n */\nexport const ParentStruct = assign(\n NodeStruct,\n object({\n // This node references itself indirectly, so we need to use `lazy()`.\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n children: array(lazy(() => ComponentStruct)),\n }),\n);\n\n/**\n * A node which supports child nodes. This is used for nodes that render their\n * children, such as {@link Panel}.\n *\n * @property type - The type of the node.\n * @property children - The children of the node\n * @internal\n */\nexport type Parent = Infer;\n\n/**\n * @internal\n */\nexport const PanelStruct: Struct = assign(\n ParentStruct,\n object({\n type: literal(NodeType.Panel),\n }),\n);\n\n/**\n * A panel node, which renders its children.\n *\n * @property type - The type of the node, must be the string 'text'.\n * @property value - The text content of the node, either as plain text, or as a\n * markdown string.\n */\n// This node references itself indirectly, so it cannot be inferred.\nexport type Panel = {\n type: NodeType.Panel;\n children: Component[];\n};\n\n/**\n * Create a {@link Panel} node.\n *\n * @param args - The node arguments. This can be either an array of children, or\n * an object with a `children` property.\n * @param args.children - The child nodes of the panel. This can be any valid\n * {@link Component}.\n * @returns The panel node as object.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * const node = panel({\n * children: [\n * heading({ text: 'Hello, world!' }),\n * text({ text: 'This is a panel.' }),\n * ],\n * });\n *\n * const node = panel([\n * heading('Hello, world!'),\n * text('This is a panel.'),\n * ]);\n */\nexport const panel = createBuilder(NodeType.Panel, PanelStruct, ['children']);\n\n// This is defined separately from `Component` to avoid circular dependencies.\nexport const ComponentStruct = union([\n CopyableStruct,\n DividerStruct,\n HeadingStruct,\n ImageStruct,\n PanelStruct,\n SpinnerStruct,\n TextStruct,\n RowStruct,\n AddressStruct,\n InputStruct,\n FormStruct,\n ButtonStruct,\n]);\n\n/**\n * All supported component types.\n */\nexport type Component = Infer;\n","import type { Infer } from 'superstruct';\nimport { assign, literal, object, optional, string, union } from 'superstruct';\n\nimport { enumValue } from '../../internals';\nimport { createBuilder } from '../builder';\nimport { LiteralStruct, NodeType } from '../nodes';\n\nexport enum ButtonVariant {\n Primary = 'primary',\n Secondary = 'secondary',\n}\n\nexport enum ButtonType {\n Button = 'button',\n Submit = 'submit',\n}\n\nexport const ButtonStruct = assign(\n LiteralStruct,\n object({\n type: literal(NodeType.Button),\n value: string(),\n variant: optional(\n union([\n enumValue(ButtonVariant.Primary),\n enumValue(ButtonVariant.Secondary),\n ]),\n ),\n buttonType: optional(\n union([enumValue(ButtonType.Button), enumValue(ButtonType.Submit)]),\n ),\n name: optional(string()),\n }),\n);\n\n/**\n * A button node, that renders either a primary or a secondary button.\n *\n * @property type - The type of the node, must be the string 'button'.\n * @property variant - The style variant of the node, must be either 'primary' or 'secondary'.\n * @property value - The text content of the node as plain text.\n * @property buttonType - The type of the button, must be either 'button' or 'submit'.\n * @property name - An optional name to identify the button.\n */\nexport type Button = Infer;\n\n/**\n * Create a {@link Button} node.\n *\n * @param args - The node arguments. This can be either a string, or an object\n * with a `value` property. A set of optional properties can be passed.\n * @param args.variant - The optional variant of the button.\n * @param args.value - The text content of the node.\n * @param args.name - The optional name of the button.\n * @returns The text node as object.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * ```typescript\n * const node = button({ variant: 'primary', text: 'Hello, world!', name: 'myButton' });\n * const node = button('Hello, world!', 'button', 'myButton', 'primary');\n * const node = button('Hello, world!');\n * ```\n */\nexport const button = createBuilder(NodeType.Button, ButtonStruct, [\n 'value',\n 'buttonType',\n 'name',\n 'variant',\n]);\n","import type { Infer } from 'superstruct';\nimport { array, assign, literal, object, string, union } from 'superstruct';\n\nimport { createBuilder } from '../builder';\nimport { NodeStruct, NodeType } from '../nodes';\nimport { ButtonStruct } from './button';\nimport { InputStruct } from './input';\n\nexport const FormComponentStruct = union([InputStruct, ButtonStruct]);\n\n/**\n * The subset of nodes allowed as children in the {@link Form} node.\n */\nexport type FormComponent = Infer;\n\nexport const FormStruct = assign(\n NodeStruct,\n object({\n type: literal(NodeType.Form),\n children: array(FormComponentStruct),\n name: string(),\n }),\n);\n\n/**\n * A form node that takes children {@link FormComponent} nodes and renders a form.\n *\n * @property type - The type of the node. Must be the string `form`.\n * @property children - The children of the node. Only {@link FormComponent} nodes are allowed.\n * @property name - The form name used to identify it.\n */\nexport type Form = Infer;\n\n/**\n * Create a {@link Form} node.\n *\n * @param args - The node arguments. This can be either an array of children and a string, or\n * an object with a `name` and `children` property.\n * @param args.name - The form name used to identify it.\n * @param args.children - The child nodes of the form. This can be any valid\n * {@link FormComponent}.\n * @returns The form node as object.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * const node = form({\n * name: 'myForm',\n * children: [\n * input({ name: 'myInput' }),\n * button({ value: 'Hello, world!' }),\n * ],\n * });\n *\n * const node = form('myForm', [input('myInput'), button('Hello, world!')]);\n */\nexport const form = createBuilder(NodeType.Form, FormStruct, [\n 'name',\n 'children',\n]);\n","import type { Infer } from 'superstruct';\nimport { assign, literal, object, optional, string, union } from 'superstruct';\n\nimport { enumValue } from '../../internals';\nimport { createBuilder } from '../builder';\nimport { LiteralStruct, NodeType } from '../nodes';\n\n/**\n * This replicates the available input types from the metamask extension.\n * https://github.com/MetaMask/metamask-extension/develop/ui/components/component-library/input/input.constants.js\n */\nexport enum InputType {\n /* eslint-disable @typescript-eslint/no-shadow */\n Text = 'text',\n Number = 'number',\n /* eslint-enable @typescript-eslint/no-shadow */\n Password = 'password',\n}\n\nexport const InputStruct = assign(\n LiteralStruct,\n object({\n type: literal(NodeType.Input),\n value: optional(string()),\n name: string(),\n inputType: optional(\n union([\n enumValue(InputType.Text),\n enumValue(InputType.Password),\n enumValue(InputType.Number),\n ]),\n ),\n placeholder: optional(string()),\n label: optional(string()),\n error: optional(string()),\n }),\n);\n\n/**\n * An input node, that renders an input.\n *\n * @property type - The type of the node, must be the string 'input'.\n * @property name - The name for the input.\n * @property value - The value of the input.\n * @property inputType - An optional type, either `text`, `password` or `number`.\n * @property placeholder - An optional input placeholder.\n * @property label - An optional input label.\n * @property error - An optional error text.\n */\nexport type Input = Infer;\n\n/**\n * Create a {@link Input} node.\n *\n * @param args - The node arguments. This can either be a name and an optional variant, value and placeholder or an object\n * with the properties: `inputType`, `value`, `variant`, `placeholder` and `name`.\n * @param args.name - The name for the input.\n * @param args.value - The value of the input.\n * @param args.inputType - An optional type, either `text`, `password` or `number`.\n * @param args.placeholder - An optional input placeholder.\n * @param args.label - An optional input label.\n * @param args.error - An optional error text.\n * @returns The input node as an object.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * const node = input('myInput');\n * const node = input('myInput', InputType.Text, 'my placeholder', 'myValue', 'myLabel');\n * const node = input({ name: 'myInput' });\n * const node = input({name: 'myInput', value: 'myValue', inputType: InputType.Password, placeholder: 'placeholder'})\n */\nexport const input = createBuilder(NodeType.Input, InputStruct, [\n 'name',\n 'inputType',\n 'placeholder',\n 'value',\n 'label',\n]);\n","import type { Infer } from 'superstruct';\nimport { assign, literal, object, string, optional, union } from 'superstruct';\n\nimport { enumValue } from '../../internals';\nimport { createBuilder } from '../builder';\nimport { LiteralStruct, NodeType } from '../nodes';\nimport { AddressStruct } from './address';\nimport { ImageStruct } from './image';\nimport { TextStruct } from './text';\n\nexport enum RowVariant {\n Default = 'default',\n Critical = 'critical',\n Warning = 'warning',\n}\n\n// A subset of components made available to the row\nconst RowComponentStruct = union([ImageStruct, TextStruct, AddressStruct]);\n\nexport const RowStruct = assign(\n LiteralStruct,\n object({\n type: literal(NodeType.Row),\n variant: optional(\n union([\n enumValue(RowVariant.Default),\n enumValue(RowVariant.Critical),\n enumValue(RowVariant.Warning),\n ]),\n ),\n label: string(),\n value: RowComponentStruct,\n }),\n);\n\n/**\n * A row node, that renders a row with a label and a value.\n *\n * @property type - The type of the node. Must be the string `row`.\n * @property label - The label for the row.\n * @property value - A sub component to be rendered\n * on one side of the row.\n * @property variant - Optional variant for styling.\n */\nexport type Row = Infer;\n\n/**\n * Create a {@link Row} node.\n *\n * @param args - The node arguments. This can either be a string, a component and an optional variant or an object\n * with the properties: `label`, `value` and `variant`.\n * @param args.label - The label for the row.\n * @param args.value - Another component, is currently limited to `image`, `text` and `address`.\n * @param args.variant - An optional variant, either `default`, `warning` or `critical`.\n * @returns The row node as an object.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * const node = row({ label: 'Address', value: address('0x4bbeeb066ed09b7aed07bf39eee0460dfa261520') });\n * const node = row({ label: 'Address', value: address('0x4bbeeb066ed09b7aed07bf39eee0460dfa261520'), variant: RowVariant.Warning });\n * const node = row('Address', address('0x4bbeeb066ed09b7aed07bf39eee0460dfa261520'));\n * const node = row('Address', address('0x4bbeeb066ed09b7aed07bf39eee0460dfa261520'), RowVariant.Warning);\n */\nexport const row = createBuilder(NodeType.Row, RowStruct, [\n 'label',\n 'value',\n 'variant',\n]);\n","import type { Infer } from 'superstruct';\nimport {\n assign,\n boolean,\n literal,\n object,\n optional,\n string,\n} from 'superstruct';\n\nimport { createBuilder } from '../builder';\nimport { LiteralStruct, NodeType } from '../nodes';\n\nexport const TextStruct = assign(\n LiteralStruct,\n object({\n type: literal(NodeType.Text),\n value: string(),\n markdown: optional(boolean()),\n }),\n);\n\n/**\n * A text node, that renders the text as one or more paragraphs.\n *\n * @property type - The type of the node, must be the string 'text'.\n * @property value - The text content of the node, either as plain text, or as a\n * markdown string.\n * @property markdown - A flag to enable/disable markdown, if nothing is specified\n * markdown will be enabled.\n */\nexport type Text = Infer;\n\n/**\n * Create a {@link Text} node.\n *\n * @param args - The node arguments. This can be either a string\n * and a boolean, or an object with a `value` property\n * and an optional `markdown` property.\n * @param args.value - The text content of the node.\n * @param args.markdown - An optional flag to enable or disable markdown. This\n * is enabled by default.\n * @returns The text node as object.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * const node = text({ value: 'Hello, world!' });\n * const node = text('Hello, world!');\n * const node = text({ value: 'Hello, world!', markdown: false });\n * const node = text('Hello, world!', false);\n */\nexport const text = createBuilder(NodeType.Text, TextStruct, [\n 'value',\n 'markdown',\n]);\n","import type { Infer } from 'superstruct';\nimport { assign, literal, object } from 'superstruct';\n\nimport { createBuilder } from '../builder';\nimport { NodeStruct, NodeType } from '../nodes';\n\nexport const SpinnerStruct = assign(\n NodeStruct,\n object({\n type: literal(NodeType.Spinner),\n }),\n);\n\n/**\n * A spinner node, that renders a spinner, either as a full-screen overlay, or\n * inline when nested inside a {@link Panel}.\n */\nexport type Spinner = Infer;\n\n/**\n * Create a {@link Spinner} node.\n *\n * @returns The spinner node as object.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * const node = spinner();\n */\nexport const spinner = createBuilder(NodeType.Spinner, SpinnerStruct);\n","import { assertStruct } from '@metamask/utils';\nimport { is } from 'superstruct';\n\nimport { ComponentStruct } from './components';\nimport type { Component } from './components';\n\n/**\n * Check if the given value is a {@link Component}. This performs recursive\n * validation of the component's children (if any).\n *\n * @param value - The value to check.\n * @returns `true` if the value is a {@link Component}, `false` otherwise.\n */\nexport function isComponent(value: unknown): value is Component {\n return is(value, ComponentStruct);\n}\n\n/**\n * Assert that the given value is a {@link Component}. This performs recursive\n * validation of the component's children (if any).\n *\n * @param value - The value to check.\n * @throws If the value is not a {@link Component}.\n */\nexport function assertIsComponent(value: unknown): asserts value is Component {\n assertStruct(value, ComponentStruct, 'Invalid component');\n}\n","import type { ComponentOrElement } from '..';\nimport type { EnumToUnion } from '../../internals';\nimport type { ChainId } from '../caip';\n\n/**\n * The severity level of content being returned from a transaction insight.\n * Currently only one level is supported:\n *\n * - `critical` - The transaction is critical and should not be submitted by the\n * user.\n */\nexport enum SeverityLevel {\n Critical = 'critical',\n}\n\n/**\n * An EIP-1559 (type 2) transaction object.\n *\n * @property from - The address the transaction is being sent from.\n * @property to - The address the transaction is being sent to.\n * @property nonce - The nonce of the transaction.\n * @property value - The value of the transaction.\n * @property data - The data of the transaction.\n * @property gas - The gas limit of the transaction.\n * @property maxFeePerGas - The maximum fee per gas of the transaction.\n * @property maxPriorityFeePerGas - The maximum priority fee per gas of the\n * transaction.\n * @property estimateSuggested - The suggested gas price for the transaction.\n * @property estimateUsed - The gas price used for the transaction.\n * @see https://eips.ethereum.org/EIPS/eip-1559\n */\nexport type EIP1559Transaction = {\n from: string;\n to: string;\n nonce: string;\n value: string;\n data: string;\n gas: string;\n maxFeePerGas: string;\n maxPriorityFeePerGas: string;\n estimateSuggested: string;\n estimateUsed: string;\n};\n\n/**\n * A legacy (type \"0\") transaction object.\n *\n * @property from - The address the transaction is being sent from.\n * @property to - The address the transaction is being sent to.\n * @property nonce - The nonce of the transaction.\n * @property value - The value of the transaction.\n * @property data - The data of the transaction.\n * @property gas - The gas limit of the transaction.\n * @property gasPrice - The gas price of the transaction.\n * @property estimateSuggested - The suggested gas price for the transaction.\n * @property estimateUsed - The gas price used for the transaction.\n */\nexport type LegacyTransaction = {\n from: string;\n to: string;\n nonce: string;\n value: string;\n data: string;\n gas: string;\n gasPrice: string;\n estimateSuggested: string;\n estimateUsed: string;\n};\n\n/**\n * A transaction object. This can be either an EIP-1559 transaction or a legacy\n * transaction.\n *\n * @see EIP1559Transaction\n * @see LegacyTransaction\n */\nexport type Transaction = EIP1559Transaction | LegacyTransaction;\n\n/**\n * The `onTransaction` handler. This is called whenever a transaction is\n * submitted to the snap. It can return insights about the transaction, which\n * will be displayed to the user.\n *\n * Note that using this handler requires the `endowment:transaction-insights`\n * permission.\n *\n * @param args - The request arguments.\n * @param args.transaction - The transaction object, containing the address,\n * value, data, and other properties of the transaction.\n * @param args.chainId - The CAIP-2 {@link ChainId} of the network the\n * transaction is being submitted to.\n * @param args.transactionOrigin - The origin of the transaction. This is the\n * URL of the website that submitted the transaction. This is only available if\n * the Snap has enabled the `allowTransactionOrigin` option in the\n * `endowment:transaction-insight` permission.\n * @returns An object containing insights about the transaction. See\n * {@link OnTransactionResponse}. Can also return `null` if no insights are\n * available.\n */\nexport type OnTransactionHandler = (args: {\n transaction: Transaction;\n chainId: ChainId;\n transactionOrigin?: string;\n}) => Promise;\n\n/**\n * The response from a Snap's `onTransaction` handler.\n *\n * @property component - A custom UI component, that will be shown in MetaMask.\n * @property id - A Snap interface ID.\n * @property severity - The severity level of the content. Currently only one\n * level is supported: `critical`.\n */\nexport type OnTransactionResponse =\n | {\n content: ComponentOrElement;\n severity?: EnumToUnion;\n }\n | {\n id: string;\n severity?: EnumToUnion;\n };\n","import type { Infer } from 'superstruct';\nimport {\n assign,\n literal,\n nullable,\n object,\n optional,\n record,\n string,\n union,\n} from 'superstruct';\n\nimport type { InterfaceContext } from '../interface';\n\n/**\n * The type of user input event fired.\n * Currently only three events are supported:\n *\n * - `ButtonClickEvent` - A button has been clicked in the UI.\n * - `FormSubmitEvent` - A Form has been submitted in the UI.\n * - `InputChangeEvent` - The value of an input field has changed in the UI.\n */\nexport enum UserInputEventType {\n ButtonClickEvent = 'ButtonClickEvent',\n FormSubmitEvent = 'FormSubmitEvent',\n InputChangeEvent = 'InputChangeEvent',\n}\n\nexport const GenericEventStruct = object({\n type: string(),\n name: optional(string()),\n});\n\nexport const ButtonClickEventStruct = assign(\n GenericEventStruct,\n object({\n type: literal(UserInputEventType.ButtonClickEvent),\n name: optional(string()),\n }),\n);\n\nexport const FormSubmitEventStruct = assign(\n GenericEventStruct,\n object({\n type: literal(UserInputEventType.FormSubmitEvent),\n value: record(string(), nullable(string())),\n name: string(),\n }),\n);\n\nexport const InputChangeEventStruct = assign(\n GenericEventStruct,\n object({\n type: literal(UserInputEventType.InputChangeEvent),\n name: string(),\n value: string(),\n }),\n);\n\nexport const UserInputEventStruct = union([\n ButtonClickEventStruct,\n FormSubmitEventStruct,\n InputChangeEventStruct,\n]);\n\n/**\n * A user input event fired in the UI. This is passed to the params of the `onUserInput` handler.\n *\n * @property type - The type of event fired. See {@link UserInputEventType} for the different types.\n * @property name - The component name that fired the event. It is optional for an {@link UserInputEventType.ButtonClickEvent}.\n * @property value - The value associated with the event. Only available when an {@link UserInputEventType.FormSubmitEvent} is fired.\n * It contains the form values submitted.\n */\nexport type UserInputEvent = Infer;\n\n/**\n * The `onUserInput` handler. This is called when an user input event is fired in the UI.\n *\n * @param args - The user input event.\n * @param args.id - The user interface id.\n * @param args.event - The {@link UserInputEvent} object, containing the data about the fired event.\n */\nexport type OnUserInputHandler = (args: {\n id: string;\n event: UserInputEvent;\n context: InterfaceContext | null;\n}) => Promise;\n","import type { ComponentOrElement } from '..';\nimport type { EnumToUnion } from '../../internals';\n\n/**\n * The type of dialog to display.\n *\n * - `alert` - A dialog with a single button.\n * - `confirmation` - A dialog with two buttons, one to confirm and one to\n * cancel.\n * - `prompt` - A dialog with two buttons and a text input.\n */\nexport enum DialogType {\n Alert = 'alert',\n Confirmation = 'confirmation',\n Prompt = 'prompt',\n}\n\n/**\n * An alert dialog.\n *\n * @property type - The type of dialog. Must be `alert`.\n * @property content - The content to display in the dialog.\n * @property id - The Snap interface ID.\n */\nexport type AlertDialog =\n | {\n type: EnumToUnion;\n content: ComponentOrElement;\n }\n | {\n type: EnumToUnion;\n id: string;\n };\n\n/**\n * A confirmation dialog.\n *\n * @property type - The type of dialog. Must be `confirmation`.\n * @property content - The content to display in the dialog.\n * @property id - The Snap interface ID.\n */\nexport type ConfirmationDialog =\n | {\n type: EnumToUnion;\n content: ComponentOrElement;\n }\n | {\n type: EnumToUnion;\n id: string;\n };\n\n/**\n * A prompt dialog.\n *\n * @property type - The type of dialog. Must be `prompt`.\n * @property content - The content to display in the dialog.\n * @property id - The Snap interface ID.\n * @property placeholder - An optional placeholder text to display in the text\n * input.\n */\nexport type PromptDialog =\n | {\n type: EnumToUnion;\n content: ComponentOrElement;\n placeholder?: string;\n }\n | {\n type: EnumToUnion;\n id: string;\n placeholder?: string;\n };\n\n/**\n * The request parameters for the `snap_dialog` method.\n *\n * @property type - The type of dialog to display.\n * @property content - The content to display in the dialog.\n * @property id - The Snap interface ID.\n * @property placeholder - The placeholder text to display in the dialog. Only\n * applicable for the `prompt` dialog.\n */\nexport type DialogParams = AlertDialog | ConfirmationDialog | PromptDialog;\n\n/**\n * The result returned by the `snap_dialog` method.\n *\n * - If the dialog is an `alert`, the result is `null`.\n * - If the dialog is a `confirmation`, the result is a boolean indicating\n * whether the user confirmed the dialog.\n * - If the dialog is a `prompt`, the result is the value entered by\n * the user.\n */\nexport type DialogResult = null | boolean | string;\n","import type { EnumToUnion } from '../../internals';\n\n/**\n * The encoding to use when retrieving the file. Defaults to `Base64`.\n */\nexport enum AuxiliaryFileEncoding {\n Base64 = 'base64',\n Hex = 'hex',\n Utf8 = 'utf8',\n}\n\n/**\n * The request parameters for the `snap_getFile` method.\n *\n * @property path - The path to the file to retrieve.\n * @property encoding - The encoding to use when retrieving the file.\n */\nexport type GetFileParams = {\n path: string;\n encoding?: EnumToUnion;\n};\n\n/**\n * The result returned by the `snap_getFile` method.\n */\nexport type GetFileResult = string;\n","import type { Json } from '@metamask/utils';\n\nimport type { EnumToUnion } from '../../internals';\n\n/**\n * The operations that can be performed on the state.\n */\nexport enum ManageStateOperation {\n ClearState = 'clear',\n GetState = 'get',\n UpdateState = 'update',\n}\n\n/**\n * The clear state operation, which clears the state.\n *\n * @property operation - The operation to perform on the state. Must be `clear`.\n * @property encrypted - Whether to use the separate encrypted state, or the\n * unencrypted state. Defaults to the encrypted state. Encrypted state can only\n * be used if the extension is unlocked, while unencrypted state can be used\n * whether the extension is locked or unlocked.\n */\nexport type ClearStateOperation = {\n operation: EnumToUnion;\n encrypted?: boolean;\n};\n\n/**\n * The get state operation, which retrieves the state.\n *\n * @property operation - The operation to perform on the state. Must be `get`.\n * @property encrypted - Whether to use the separate encrypted state, or the\n * unencrypted state. Defaults to the encrypted state. Encrypted state can only\n * be used if the extension is unlocked, while unencrypted state can be used\n * whether the extension is locked or unlocked.\n */\nexport type GetStateOperation = {\n operation: EnumToUnion;\n encrypted?: boolean;\n};\n\n/**\n * The update state operation, which updates the state.\n *\n * @property operation - The operation to perform on the state. Must be\n * `update`.\n * @property encrypted - Whether to use the separate encrypted state, or the\n * unencrypted state. Defaults to the encrypted state. Encrypted state can only\n * be used if the extension is unlocked, while unencrypted state can be used\n * whether the extension is locked or unlocked.\n * @property newState - The new state to set.\n */\nexport type UpdateStateOperation = {\n operation: EnumToUnion;\n encrypted?: boolean;\n newState: Record;\n};\n\n/**\n * The request parameters for the `snap_manageState` method.\n *\n * @property operation - The operation to perform on the state.\n * @property encrypted - Whether to use the separate encrypted state, or the\n * unencrypted state. Defaults to the encrypted state.\n * @property newState - The new state to set. Only applicable for the `set`\n * operation.\n */\nexport type ManageStateParams =\n | ClearStateOperation\n | GetStateOperation\n | UpdateStateOperation;\n\n/**\n * The result returned by the `snap_manageState` method.\n *\n * If the operation is `get`, the result is the state. Otherwise, the result is\n * `null`.\n */\nexport type ManageStateResult = Record | null;\n","import type { EnumToUnion } from '../../internals';\n\n/**\n * The types of notifications that can be displayed.\n *\n * - `InApp` - A notification that is displayed in by the MetaMask extension.\n * - `Native` - A notification that is displayed by the operating system.\n */\nexport enum NotificationType {\n InApp = 'inApp',\n Native = 'native',\n}\n\n/**\n * The request parameters for the `snap_notify` method.\n *\n * @property type - The type of notification to display.\n * @property message - The message to display in the notification.\n */\nexport type NotifyParams = {\n type: EnumToUnion;\n message: string;\n};\n\n/**\n * The result returned by the `snap_notify` method.\n *\n * This method does not return anything.\n */\nexport type NotifyResult = null;\n","import { JsonStruct } from '@metamask/utils';\nimport type { Infer } from 'superstruct';\nimport { nullable, record, string, union } from 'superstruct';\n\nimport type { JSXElement } from '../jsx';\nimport { RootJSXElementStruct } from '../jsx';\nimport type { Component } from '../ui';\nimport { ComponentStruct } from '../ui';\n\n/**\n * To avoid typing problems with the interface state when manipulating it we have to differentiate the state of\n * a form (that will be contained inside the root state) and the root state since a key in the root stat can contain\n * either the value of an input or a sub-state of a form.\n */\n\nexport const FormStateStruct = record(string(), nullable(string()));\n\nexport const InterfaceStateStruct = record(\n string(),\n union([FormStateStruct, nullable(string())]),\n);\n\nexport type FormState = Infer;\nexport type InterfaceState = Infer;\n\nexport type ComponentOrElement = Component | JSXElement;\nexport const ComponentOrElementStruct = union([\n ComponentStruct,\n RootJSXElementStruct,\n]);\n\nexport const InterfaceContextStruct = record(string(), JsonStruct);\nexport type InterfaceContext = Infer;\n","import {\n hasProperty,\n HexChecksumAddressStruct,\n isPlainObject,\n JsonStruct,\n} from '@metamask/utils';\nimport type { Struct } from 'superstruct';\nimport {\n is,\n boolean,\n optional,\n array,\n lazy,\n nullable,\n number,\n object,\n record,\n string,\n tuple,\n} from 'superstruct';\nimport type { ObjectSchema } from 'superstruct';\n\nimport type { Describe } from '../internals';\nimport { literal, nullUnion } from '../internals';\nimport type { EmptyObject } from '../types';\nimport type {\n GenericSnapElement,\n JsonObject,\n Key,\n MaybeArray,\n SnapElement,\n StringElement,\n} from './component';\nimport type {\n AddressElement,\n BoldElement,\n BoxElement,\n ButtonElement,\n CopyableElement,\n DividerElement,\n DropdownElement,\n OptionElement,\n FieldElement,\n FormElement,\n HeadingElement,\n ImageElement,\n InputElement,\n ItalicElement,\n JSXElement,\n LinkElement,\n RowElement,\n SpinnerElement,\n StandardFormattingElement,\n TextElement,\n ValueElement,\n} from './components';\n\n/**\n * A struct for the {@link Key} type.\n */\nexport const KeyStruct: Describe = nullUnion([string(), number()]);\n\n/**\n * A struct for the {@link StringElement} type.\n */\nexport const StringElementStruct: Describe = maybeArray(\n string(),\n);\n\n/**\n * A struct for the {@link GenericSnapElement} type.\n */\nexport const ElementStruct: Describe = object({\n type: string(),\n props: record(string(), JsonStruct),\n key: nullable(KeyStruct),\n});\n\n/**\n * A helper function for creating a struct for a {@link MaybeArray} type.\n *\n * @param struct - The struct for the maybe array type.\n * @returns The struct for the maybe array type.\n */\nfunction maybeArray(\n struct: Struct,\n): Struct, any> {\n return nullUnion([struct, array(struct)]);\n}\n\n/**\n * A helper function for creating a struct for a JSX element.\n *\n * @param name - The name of the element.\n * @param props - The props of the element.\n * @returns The struct for the element.\n */\nfunction element(\n name: Name,\n props: Props = {} as Props,\n) {\n return object({\n type: literal(name) as unknown as Struct,\n props: object(props),\n key: nullable(KeyStruct),\n });\n}\n\n/**\n * A struct for the {@link ButtonElement} type.\n */\nexport const ButtonStruct: Describe = element('Button', {\n children: StringElementStruct,\n name: optional(string()),\n type: optional(nullUnion([literal('button'), literal('submit')])),\n variant: optional(nullUnion([literal('primary'), literal('destructive')])),\n disabled: optional(boolean()),\n});\n\n/**\n * A struct for the {@link InputElement} type.\n */\nexport const InputStruct: Describe = element('Input', {\n name: string(),\n type: optional(\n nullUnion([literal('text'), literal('password'), literal('number')]),\n ),\n value: optional(string()),\n placeholder: optional(string()),\n});\n\n/**\n * A struct for the {@link OptionElement} type.\n */\nexport const OptionStruct: Describe = element('Option', {\n value: string(),\n children: string(),\n});\n\n/**\n * A struct for the {@link DropdownElement} type.\n */\nexport const DropdownStruct: Describe = element('Dropdown', {\n name: string(),\n value: optional(string()),\n children: maybeArray(OptionStruct),\n});\n\n/**\n * A struct for the {@link FieldElement} type.\n */\nexport const FieldStruct: Describe = element('Field', {\n label: optional(string()),\n error: optional(string()),\n children: nullUnion([\n tuple([InputStruct, ButtonStruct]),\n InputStruct,\n DropdownStruct,\n ]),\n});\n\n/**\n * A struct for the {@link FormElement} type.\n */\nexport const FormStruct: Describe = element('Form', {\n children: maybeArray(nullUnion([FieldStruct, ButtonStruct])),\n name: string(),\n});\n\n/**\n * A struct for the {@link BoldElement} type.\n */\nexport const BoldStruct: Describe = element('Bold', {\n children: maybeArray(\n nullable(\n nullUnion([\n string(),\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n lazy(() => ItalicStruct) as unknown as Struct<\n SnapElement\n >,\n ]),\n ),\n ),\n});\n\n/**\n * A struct for the {@link ItalicElement} type.\n */\nexport const ItalicStruct: Describe = element('Italic', {\n children: maybeArray(\n nullable(\n nullUnion([\n string(),\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n lazy(() => BoldStruct) as unknown as Struct<\n SnapElement\n >,\n ]),\n ),\n ),\n});\n\nexport const FormattingStruct: Describe = nullUnion([\n BoldStruct,\n ItalicStruct,\n]);\n\n/**\n * A struct for the {@link AddressElement} type.\n */\nexport const AddressStruct: Describe = element('Address', {\n address: HexChecksumAddressStruct,\n});\n\n/**\n * A struct for the {@link BoxElement} type.\n */\nexport const BoxStruct: Describe = element('Box', {\n children: maybeArray(\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n nullable(lazy(() => BoxChildStruct)),\n ) as unknown as Struct, null>,\n direction: optional(nullUnion([literal('horizontal'), literal('vertical')])),\n alignment: optional(\n nullUnion([\n literal('start'),\n literal('center'),\n literal('end'),\n literal('space-between'),\n literal('space-around'),\n ]),\n ),\n});\n\n/**\n * A struct for the {@link CopyableElement} type.\n */\nexport const CopyableStruct: Describe = element('Copyable', {\n value: string(),\n sensitive: optional(boolean()),\n});\n\n/**\n * A struct for the {@link DividerElement} type.\n */\nexport const DividerStruct: Describe = element('Divider');\n\n/**\n * A struct for the {@link ValueElement} type.\n */\nexport const ValueStruct: Describe = element('Value', {\n value: string(),\n extra: string(),\n});\n\n/**\n * A struct for the {@link HeadingElement} type.\n */\nexport const HeadingStruct: Describe = element('Heading', {\n children: StringElementStruct,\n});\n\n/**\n * A struct for the {@link ImageElement} type.\n */\nexport const ImageStruct: Describe = element('Image', {\n src: string(),\n alt: optional(string()),\n});\n\n/**\n * A struct for the {@link LinkElement} type.\n */\nexport const LinkStruct: Describe = element('Link', {\n href: string(),\n children: maybeArray(nullable(nullUnion([FormattingStruct, string()]))),\n});\n\n/**\n * A struct for the {@link TextElement} type.\n */\nexport const TextStruct: Describe = element('Text', {\n children: maybeArray(\n nullable(nullUnion([string(), BoldStruct, ItalicStruct, LinkStruct])),\n ),\n});\n\n/**\n * A struct for the {@link RowElement} type.\n */\nexport const RowStruct: Describe = element('Row', {\n label: string(),\n children: nullUnion([AddressStruct, ImageStruct, TextStruct, ValueStruct]),\n variant: optional(\n nullUnion([literal('default'), literal('warning'), literal('error')]),\n ),\n});\n\n/**\n * A struct for the {@link SpinnerElement} type.\n */\nexport const SpinnerStruct: Describe = element('Spinner');\n\n/**\n * A subset of JSX elements that are allowed as children of the Box component.\n * This set should include all components, except components that need to be nested\n * in another component (e.g. Field must be contained in a Form).\n */\nexport const BoxChildStruct = nullUnion([\n ButtonStruct,\n InputStruct,\n FormStruct,\n BoldStruct,\n ItalicStruct,\n AddressStruct,\n BoxStruct,\n CopyableStruct,\n DividerStruct,\n HeadingStruct,\n ImageStruct,\n LinkStruct,\n RowStruct,\n SpinnerStruct,\n TextStruct,\n DropdownStruct,\n]);\n\n/**\n * For now, the allowed JSX elements at the root are the same as the allowed\n * children of the Box component.\n */\nexport const RootJSXElementStruct = BoxChildStruct;\n\n/**\n * A struct for the {@link JSXElement} type.\n */\nexport const JSXElementStruct: Describe = nullUnion([\n ButtonStruct,\n InputStruct,\n FieldStruct,\n FormStruct,\n BoldStruct,\n ItalicStruct,\n AddressStruct,\n BoxStruct,\n CopyableStruct,\n DividerStruct,\n HeadingStruct,\n ImageStruct,\n LinkStruct,\n RowStruct,\n SpinnerStruct,\n TextStruct,\n DropdownStruct,\n OptionStruct,\n ValueStruct,\n]);\n\n/**\n * Check if a value is a JSX element.\n *\n * @param value - The value to check.\n * @returns True if the value is a JSX element, false otherwise.\n */\nexport function isJSXElement(value: unknown): value is JSXElement {\n return is(value, JSXElementStruct);\n}\n\n/**\n * Check if a value is a JSX element, without validating all of its contents.\n * This is useful when you want to validate the structure of a value, but not\n * all the children.\n *\n * This should only be used when you are sure that the value is safe to use,\n * i.e., after using {@link isJSXElement}.\n *\n * @param value - The value to check.\n * @returns True if the value is a JSX element, false otherwise.\n */\nexport function isJSXElementUnsafe(value: unknown): value is JSXElement {\n return (\n isPlainObject(value) &&\n hasProperty(value, 'type') &&\n hasProperty(value, 'props') &&\n hasProperty(value, 'key')\n );\n}\n\n/**\n * Assert that a value is a JSX element.\n *\n * @param value - The value to check.\n * @throws If the value is not a JSX element.\n */\nexport function assertJSXElement(value: unknown): asserts value is JSXElement {\n // TODO: We should use the error parsing utils from `snaps-utils` to improve\n // the error messages. It currently includes colours and potentially other\n // formatting that we might not want to include in the SDK.\n if (!isJSXElement(value)) {\n throw new Error(\n `Expected a JSX element, but received ${JSON.stringify(\n value,\n )}. Please refer to the documentation for the supported JSX elements and their props.`,\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAcO,IAAM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AAU,KAAC,6BAAO,GAAG,YAAY,cAAc,UAAU,CAAC,CAAC;AAAA,EACtE;AACF,CAAC;AAKM,IAAMC,aAAkC,QAAQ,OAAO;AAAA,EAC5D,WAAO,6BAAO;AAAA,EACd,UAAU,UAAU,CAACN,gBAAeI,cAAaC,aAAY,WAAW,CAAC;AAAA,EACzE,aAAS;AAAA,IACP,UAAU,CAAC,QAAQ,SAAS,GAAG,QAAQ,SAAS,GAAG,QAAQ,OAAO,CAAC,CAAC;AAAA,EACtE;AACF,CAAC;AAKM,IAAME,iBAA0C,QAAQ,SAAS;AAOjE,IAAM,iBAAiB,UAAU;AAAA,EACtCV;AAAA,EACAC;AAAA,EACAC;AAAA,EACA;AAAA,EACA;AAAA,EACAC;AAAA,EACA;AAAA,EACAC;AAAA,EACAC;AAAA,EACAC;AAAA,EACAC;AAAA,EACA;AAAA,EACAE;AAAA,EACAC;AAAA,EACAF;AAAA,EACA;AACF,CAAC;AAMM,IAAM,uBAAuB;AAK7B,IAAM,mBAAyC,UAAU;AAAA,EAC9DR;AAAA,EACAC;AAAA,EACA;AAAA,EACAC;AAAA,EACA;AAAA,EACA;AAAA,EACAC;AAAA,EACA;AAAA,EACAC;AAAA,EACAC;AAAA,EACAC;AAAA,EACAC;AAAA,EACA;AAAA,EACAE;AAAA,EACAC;AAAA,EACAF;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;;;ADtVM,IAAM,sBAAkB,iCAAO,6BAAO,OAAG,mCAAS,6BAAO,CAAC,CAAC;AAE3D,IAAM,2BAAuB;AAAA,MAClC,6BAAO;AAAA,MACP,4BAAM,CAAC,qBAAiB,mCAAS,6BAAO,CAAC,CAAC,CAAC;AAC7C;AAMO,IAAM,+BAA2B,4BAAM;AAAA,EAC5C;AAAA,EACA;AACF,CAAC;AAEM,IAAM,6BAAyB,iCAAO,6BAAO,GAAG,wBAAU;","names":["error","superstructLiteral","superstructUnion","import_utils","svg","import_utils","import_utils","import_utils","import_superstruct","import_utils","node","import_superstruct","NodeType","import_superstruct","import_superstruct","import_superstruct","import_superstruct","import_superstruct","import_superstruct","ButtonVariant","ButtonType","import_superstruct","import_superstruct","InputType","import_superstruct","import_superstruct","RowVariant","import_superstruct","import_utils","import_superstruct","SeverityLevel","import_superstruct","UserInputEventType","DialogType","AuxiliaryFileEncoding","ManageStateOperation","NotificationType","import_utils","import_superstruct","import_utils","import_superstruct","ButtonStruct","InputStruct","FormStruct","AddressStruct","CopyableStruct","DividerStruct","HeadingStruct","ImageStruct","TextStruct","RowStruct","SpinnerStruct"]} +\ No newline at end of file +diff --git a/dist/index.mjs.map b/dist/index.mjs.map +index 6771a643c5401d86a99a6ebcc5301082de0b36c7..23de547d78e851c5e73d3c73c5c80ab5290a41bc 100644 +--- a/dist/index.mjs.map ++++ b/dist/index.mjs.map +@@ -1 +1 @@ +-{"version":3,"sources":["../src/errors.ts","../src/internals/error-wrappers.ts","../src/internals/errors.ts","../src/internals/structs.ts","../src/internals/jsx.ts","../src/internals/svg.ts","../src/index.ts","../src/error-wrappers.ts","../src/images.ts","../src/ui/components/address.ts","../src/ui/builder.ts","../src/ui/nodes.ts","../src/ui/components/copyable.ts","../src/ui/components/divider.ts","../src/ui/components/heading.ts","../src/ui/components/image.ts","../src/ui/components/panel.ts","../src/ui/components/button.ts","../src/ui/components/form.ts","../src/ui/components/input.ts","../src/ui/components/row.ts","../src/ui/components/text.ts","../src/ui/components/spinner.ts","../src/ui/component.ts","../src/types/handlers/transaction.ts","../src/types/handlers/user-input.ts","../src/types/methods/dialog.ts","../src/types/methods/get-file.ts","../src/types/methods/manage-state.ts","../src/types/methods/notify.ts","../src/types/interface.ts","../src/jsx/validation.ts"],"sourcesContent":["import type { Json, JsonRpcError } from '@metamask/utils';\n\nimport {\n getErrorCode,\n getErrorData,\n getErrorMessage,\n SNAP_ERROR_CODE,\n SNAP_ERROR_MESSAGE,\n} from './internals';\n\n/**\n * A generic error which can be thrown by a Snap, without it causing the Snap to\n * crash.\n */\nexport class SnapError extends Error {\n readonly #code: number;\n\n readonly #message: string;\n\n readonly #data?: Record;\n\n readonly #stack?: string;\n\n /**\n * Create a new `SnapError`.\n *\n * @param error - The error to create the `SnapError` from. If this is a\n * `string`, it will be used as the error message. If this is an `Error`, its\n * `message` property will be used as the error message. If this is a\n * `JsonRpcError`, its `message` property will be used as the error message\n * and its `code` property will be used as the error code. Otherwise, the\n * error will be converted to a string and used as the error message.\n * @param data - Additional data to include in the error. This will be merged\n * with the error data, if any.\n */\n constructor(\n error: string | Error | JsonRpcError,\n data: Record = {},\n ) {\n const message = getErrorMessage(error);\n super(message);\n\n this.#message = message;\n this.#code = getErrorCode(error);\n\n const mergedData = { ...getErrorData(error), ...data };\n if (Object.keys(mergedData).length > 0) {\n this.#data = mergedData;\n }\n\n this.#stack = super.stack;\n }\n\n /**\n * The error name.\n *\n * @returns The error name.\n */\n get name() {\n return 'SnapError';\n }\n\n /**\n * The error code.\n *\n * @returns The error code.\n */\n get code() {\n return this.#code;\n }\n\n /**\n * The error message.\n *\n * @returns The error message.\n */\n // This line is covered, but Jest doesn't pick it up for some reason.\n /* istanbul ignore next */\n get message() {\n return this.#message;\n }\n\n /**\n * Additional data for the error.\n *\n * @returns Additional data for the error.\n */\n get data() {\n return this.#data;\n }\n\n /**\n * The error stack.\n *\n * @returns The error stack.\n */\n // This line is covered, but Jest doesn't pick it up for some reason.\n /* istanbul ignore next */\n get stack() {\n return this.#stack;\n }\n\n /**\n * Convert the error to a JSON object.\n *\n * @returns The JSON object.\n */\n toJSON(): SerializedSnapError {\n return {\n code: SNAP_ERROR_CODE,\n message: SNAP_ERROR_MESSAGE,\n data: {\n cause: {\n code: this.code,\n message: this.message,\n stack: this.stack,\n ...(this.data ? { data: this.data } : {}),\n },\n },\n };\n }\n\n /**\n * Serialize the error to a JSON object. This is called by\n * `@metamask/rpc-errors` when serializing the error.\n *\n * @returns The JSON object.\n */\n serialize() {\n return this.toJSON();\n }\n}\n\n/**\n * A serialized {@link SnapError}. It's JSON-serializable, so it can be sent\n * over the RPC. The original error is wrapped in the `cause` property.\n *\n * @property code - The error code. This is always `-31002`.\n * @property message - The error message. This is always `'Snap Error'`.\n * @property data - The error data.\n * @property data.cause - The cause of the error.\n * @property data.cause.code - The error code.\n * @property data.cause.message - The error message.\n * @property data.cause.stack - The error stack.\n * @property data.cause.data - Additional data for the error.\n * @see SnapError\n */\nexport type SerializedSnapError = {\n code: typeof SNAP_ERROR_CODE;\n message: typeof SNAP_ERROR_MESSAGE;\n data: {\n cause: JsonRpcError;\n };\n};\n","import type { rpcErrors } from '@metamask/rpc-errors';\nimport type { Json } from '@metamask/utils';\n\nimport { SnapError } from '../errors';\n\nexport type JsonRpcErrorFunction = typeof rpcErrors.parse;\n\n/**\n * Create a `SnapError` class from an error function from\n * `@metamask/rpc-errors`. This is useful for creating custom error classes\n * which can be thrown by a Snap.\n *\n * The created class will inherit the message, code, and data properties from\n * the error function.\n *\n * @param fn - The error function to create the class from.\n * @returns The created `SnapError` class.\n */\nexport function createSnapError(fn: JsonRpcErrorFunction) {\n return class SnapJsonRpcError extends SnapError {\n /**\n * Create a new `SnapJsonRpcError` from a message.\n *\n * @param message - The message to create the error from.\n */\n constructor(message?: string);\n\n /**\n * Create a new `SnapJsonRpcError` from data.\n *\n * @param data - The data to create the error from.\n */\n constructor(data?: Record);\n\n /**\n * Create a new `SnapJsonRpcError` from a message and data.\n *\n * @param message - The message to create the error from.\n * @param data - The data to create the error from.\n */\n constructor(\n message?: string | Record,\n data?: Record,\n );\n\n /**\n * Create a new `SnapJsonRpcError` from a message and data.\n *\n * @param message - The message to create the error from.\n * @param data - The data to create the error from.\n */\n constructor(\n message?: string | Record,\n data?: Record,\n ) {\n if (typeof message === 'object') {\n const error = fn();\n super({\n code: error.code,\n message: error.message,\n data: message,\n });\n\n return;\n }\n\n const error = fn(message);\n super({\n code: error.code,\n message: error.message,\n data,\n });\n }\n };\n}\n","import { hasProperty, isObject, isValidJson } from '@metamask/utils';\n\nexport const SNAP_ERROR_CODE = -31002;\nexport const SNAP_ERROR_MESSAGE = 'Snap Error';\n\n/**\n * Get the error message from an unknown error type.\n *\n * - If the error is an object with a `message` property, return the message.\n * - Otherwise, return the error converted to a string.\n *\n * @param error - The error to get the message from.\n * @returns The error message.\n * @internal\n */\nexport function getErrorMessage(error: unknown) {\n if (\n isObject(error) &&\n hasProperty(error, 'message') &&\n typeof error.message === 'string'\n ) {\n return error.message;\n }\n\n return String(error);\n}\n\n/**\n * Get the error stack from an unknown error type.\n *\n * @param error - The error to get the stack from.\n * @returns The error stack, or undefined if the error does not have a valid\n * stack.\n * @internal\n */\nexport function getErrorStack(error: unknown) {\n if (\n isObject(error) &&\n hasProperty(error, 'stack') &&\n typeof error.stack === 'string'\n ) {\n return error.stack;\n }\n\n return undefined;\n}\n\n/**\n * Get the error code from an unknown error type.\n *\n * @param error - The error to get the code from.\n * @returns The error code, or `-32603` if the error does not have a valid code.\n * @internal\n */\nexport function getErrorCode(error: unknown) {\n if (\n isObject(error) &&\n hasProperty(error, 'code') &&\n typeof error.code === 'number' &&\n Number.isInteger(error.code)\n ) {\n return error.code;\n }\n\n return -32603;\n}\n\n/**\n * Get the error data from an unknown error type.\n *\n * @param error - The error to get the data from.\n * @returns The error data, or an empty object if the error does not have valid\n * data.\n * @internal\n */\nexport function getErrorData(error: unknown) {\n if (\n isObject(error) &&\n hasProperty(error, 'data') &&\n typeof error.data === 'object' &&\n error.data !== null &&\n isValidJson(error.data) &&\n !Array.isArray(error.data)\n ) {\n return error.data;\n }\n\n return {};\n}\n","import type { Infer } from 'superstruct';\nimport {\n Struct,\n define,\n literal as superstructLiteral,\n union as superstructUnion,\n} from 'superstruct';\nimport type { AnyStruct, InferStructTuple } from 'superstruct/dist/utils';\n\nimport type { EnumToUnion } from './helpers';\n\n/**\n * A wrapper of `superstruct`'s `literal` struct that also defines the name of\n * the struct as the literal value.\n *\n * This is useful for improving the error messages returned by `superstruct`.\n * For example, instead of returning an error like:\n *\n * ```\n * Expected the value to satisfy a union of `literal | literal`, but received: \\\"baz\\\"\n * ```\n *\n * This struct will return an error like:\n *\n * ```\n * Expected the value to satisfy a union of `\"foo\" | \"bar\"`, but received: \\\"baz\\\"\n * ```\n *\n * @param value - The literal value.\n * @returns The `superstruct` struct, which validates that the value is equal\n * to the literal value.\n */\nexport function literal(value: Type) {\n return define(\n JSON.stringify(value),\n superstructLiteral(value).validator,\n );\n}\n\n/**\n * A wrapper of `superstruct`'s `union` struct that also defines the schema as\n * the union of the schemas of the structs.\n *\n * This is useful for improving the error messages returned by `superstruct`.\n *\n * @param structs - The structs to union.\n * @param structs.\"0\" - The first struct.\n * @param structs.\"1\" - The remaining structs.\n * @returns The `superstruct` struct, which validates that the value satisfies\n * one of the structs.\n */\nexport function union([\n head,\n ...tail\n]: [head: Head, ...tail: Tail]): Struct<\n Infer | InferStructTuple[number],\n [head: Head, ...tail: Tail]\n> {\n const struct = superstructUnion([head, ...tail]);\n\n return new Struct({\n ...struct,\n schema: [head, ...tail],\n });\n}\n\n/**\n * Superstruct struct for validating an enum value. This allows using both the\n * enum string values and the enum itself as values.\n *\n * @param constant - The enum to validate against.\n * @returns The superstruct struct.\n */\nexport function enumValue(\n constant: Type,\n): Struct, null> {\n return literal(constant as EnumToUnion);\n}\n","import type { Infer, Struct } from 'superstruct';\nimport type {\n AnyStruct,\n EnumSchema,\n InferStructTuple,\n IsExactMatch,\n IsMatch,\n IsRecord,\n IsTuple,\n UnionToIntersection,\n} from 'superstruct/dist/utils';\n\nimport type { EmptyObject } from '../types';\nimport { union } from './structs';\n\n/**\n * Check if a type is a union. Infers `true` if it is a union, otherwise\n * `false`.\n */\ntype IsUnion = [Type] extends [UnionToIntersection] ? false : true;\n\n/**\n * Get a struct schema for a type.\n *\n * This is copied from `superstruct` but fixes some issues with the original\n * implementation.\n */\ntype StructSchema = IsUnion extends true\n ? null\n : [Type] extends [EmptyObject]\n ? EmptyObject\n : [Type] extends [string | undefined | null]\n ? [Type] extends [`0x${string}`]\n ? null\n : [Type] extends [IsMatch]\n ? null\n : [Type] extends [IsUnion]\n ? EnumSchema\n : Type\n : [Type] extends [number | undefined | null]\n ? [Type] extends [IsMatch]\n ? null\n : [Type] extends [IsUnion]\n ? EnumSchema\n : Type\n : [Type] extends [boolean]\n ? [Type] extends [IsExactMatch]\n ? null\n : Type\n : Type extends\n | bigint\n | symbol\n | undefined\n | null\n // eslint-disable-next-line @typescript-eslint/ban-types\n | Function\n | Date\n | Error\n | RegExp\n | Map\n | WeakMap\n | Set\n | WeakSet\n | Promise\n ? null\n : Type extends (infer E)[]\n ? Type extends IsTuple\n ? null\n : Struct\n : Type extends object\n ? Type extends IsRecord\n ? null\n : {\n [InnerKey in keyof Type]: Describe;\n }\n : null;\n\n/**\n * Describe a struct type.\n */\nexport type Describe = Struct>;\n\n/**\n * Create a union struct that uses `null` for the schema type, for better\n * compatibility with `Describe`.\n *\n * @param structs - The structs to union.\n * @returns The `superstruct` struct, which validates that the value satisfies\n * one of the structs.\n */\nexport function nullUnion(\n structs: [head: Head, ...tail: Tail],\n) {\n return union(structs) as unknown as Struct<\n Infer | InferStructTuple[number],\n null\n >;\n}\n","import { assert, hasProperty, isObject } from '@metamask/utils';\nimport { XMLParser } from 'fast-xml-parser';\n\n/**\n * Parse and validate a string as an SVG.\n *\n * @param svg - An SVG string.\n * @returns The SVG, its attributes and children in an object format.\n */\nexport function parseSvg(svg: string) {\n try {\n const trimmed = svg.trim();\n\n assert(trimmed.length > 0);\n\n const parser = new XMLParser({\n ignoreAttributes: false,\n parseAttributeValue: true,\n });\n const parsed = parser.parse(trimmed, true);\n\n assert(hasProperty(parsed, 'svg'));\n\n // Empty SVGs are not returned as objects\n if (!isObject(parsed.svg)) {\n return {};\n }\n\n return parsed.svg;\n } catch {\n throw new Error('Snap icon must be a valid SVG.');\n }\n}\n\n/**\n * Validate that a string is a valid SVG.\n *\n * @param svg - An SVG string.\n * @returns True if the SVG is valid otherwise false.\n */\nexport function isSvg(svg: string) {\n try {\n parseSvg(svg);\n return true;\n } catch {\n return false;\n }\n}\n","// Only internals that are used by other Snaps packages should be exported here.\nexport type { EnumToUnion } from './internals';\nexport {\n getErrorData,\n getErrorMessage,\n getErrorStack,\n SNAP_ERROR_CODE,\n SNAP_ERROR_MESSAGE,\n literal,\n union,\n enumValue,\n parseSvg,\n isSvg,\n} from './internals';\n\n// Re-exported from `@metamask/utils` for convenience.\nexport type {\n Json,\n JsonRpcError,\n JsonRpcRequest,\n JsonRpcParams,\n} from '@metamask/utils';\nexport { assert } from '@metamask/utils';\n\nexport * from './errors';\nexport * from './error-wrappers';\nexport * from './images';\nexport * from './types';\nexport * from './ui';\n","import { providerErrors, rpcErrors } from '@metamask/rpc-errors';\n\nimport { createSnapError } from './internals';\n\n/**\n * A JSON-RPC 2.0 Internal (-32603) error.\n *\n * This can be thrown by a Snap to indicate that an internal error occurred,\n * without crashing the Snap.\n *\n * @see https://www.jsonrpc.org/specification#error_object\n */\nexport const InternalError = createSnapError(rpcErrors.internal);\n\n/**\n * An Ethereum JSON-RPC Invalid Input (-32000) error.\n *\n * This can be thrown by a Snap to indicate that the input to a method is\n * invalid, without crashing the Snap.\n *\n * @see https://eips.ethereum.org/EIPS/eip-1474#error-codes\n */\nexport const InvalidInputError = createSnapError(rpcErrors.invalidInput);\n\n/**\n * A JSON-RPC 2.0 Invalid Params (-32602) error.\n *\n * This can be thrown by a Snap to indicate that the parameters to a method are\n * invalid, without crashing the Snap.\n *\n * @see https://www.jsonrpc.org/specification#error_object\n */\nexport const InvalidParamsError = createSnapError(rpcErrors.invalidParams);\n\n/**\n * A JSON-RPC 2.0 Invalid Request (-32600) error.\n *\n * This can be thrown by a Snap to indicate that the request is invalid, without\n * crashing the Snap.\n *\n * @see https://www.jsonrpc.org/specification#error_object\n */\nexport const InvalidRequestError = createSnapError(rpcErrors.invalidRequest);\n\n/**\n * An Ethereum JSON-RPC Limit Exceeded (-32005) error.\n *\n * This can be thrown by a Snap to indicate that a limit has been exceeded,\n * without crashing the Snap.\n *\n * @see https://eips.ethereum.org/EIPS/eip-1474#error-codes\n */\nexport const LimitExceededError = createSnapError(rpcErrors.limitExceeded);\n\n/**\n * An Ethereum JSON-RPC Method Not Found (-32601) error.\n *\n * This can be thrown by a Snap to indicate that a method does not exist,\n * without crashing the Snap.\n *\n * @see https://eips.ethereum.org/EIPS/eip-1474#error-codes\n */\nexport const MethodNotFoundError = createSnapError(rpcErrors.methodNotFound);\n\n/**\n * An Ethereum JSON-RPC Method Not Supported (-32004) error.\n *\n * This can be thrown by a Snap to indicate that a method is not supported,\n * without crashing the Snap.\n */\nexport const MethodNotSupportedError = createSnapError(\n rpcErrors.methodNotSupported,\n);\n\n/**\n * A JSON-RPC 2.0 Parse (-32700) error.\n *\n * This can be thrown by a Snap to indicate that a request is not valid JSON,\n * without crashing the Snap.\n *\n * @see https://www.jsonrpc.org/specification#error_object\n */\nexport const ParseError = createSnapError(rpcErrors.parse);\n\n/**\n * An Ethereum JSON-RPC Resource Not Found (-32001) error.\n *\n * This can be thrown by a Snap to indicate that a resource does not exist,\n * without crashing the Snap.\n *\n * @see https://eips.ethereum.org/EIPS/eip-1474#error-codes\n */\nexport const ResourceNotFoundError = createSnapError(\n rpcErrors.resourceNotFound,\n);\n\n/**\n * An Ethereum JSON-RPC Resource Unavailable (-32002) error.\n *\n * This can be thrown by a Snap to indicate that a resource is unavailable,\n * without crashing the Snap.\n *\n * @see https://eips.ethereum.org/EIPS/eip-1474#error-codes\n */\nexport const ResourceUnavailableError = createSnapError(\n rpcErrors.resourceUnavailable,\n);\n\n/**\n * An Ethereum JSON-RPC Transaction Rejected (-32003) error.\n *\n * This can be thrown by a Snap to indicate that a transaction was rejected,\n * without crashing the Snap.\n *\n * @see https://eips.ethereum.org/EIPS/eip-1474#error-codes\n */\nexport const TransactionRejected = createSnapError(\n rpcErrors.transactionRejected,\n);\n\n/**\n * An Ethereum Provider Chain Disconnected (4901) error.\n *\n * This can be thrown by a Snap to indicate that the provider is disconnected\n * from the requested chain, without crashing the Snap.\n *\n * @see https://eips.ethereum.org/EIPS/eip-1193#provider-errors\n */\nexport const ChainDisconnectedError = createSnapError(\n providerErrors.chainDisconnected,\n);\n\n/**\n * An Ethereum Provider Disconnected (4900) error.\n *\n * This can be thrown by a Snap to indicate that the provider is disconnected,\n * without crashing the Snap.\n *\n * @see https://eips.ethereum.org/EIPS/eip-1193#provider-errors\n */\nexport const DisconnectedError = createSnapError(providerErrors.disconnected);\n\n/**\n * An Ethereum Provider Unauthorized (4100) error.\n *\n * This can be thrown by a Snap to indicate that the requested method / account\n * is not authorized by the user, without crashing the Snap.\n */\nexport const UnauthorizedError = createSnapError(providerErrors.unauthorized);\n\n/**\n * An Ethereum Provider Unsupported Method (4200) error.\n *\n * This can be thrown by a Snap to indicate that the requested method is not\n * supported by the provider, without crashing the Snap.\n *\n * @see https://eips.ethereum.org/EIPS/eip-1193#provider-errors\n */\nexport const UnsupportedMethodError = createSnapError(\n providerErrors.unsupportedMethod,\n);\n\n/**\n * An Ethereum Provider User Rejected Request (4001) error.\n *\n * This can be thrown by a Snap to indicate that the user rejected the request,\n * without crashing the Snap.\n *\n * @see https://eips.ethereum.org/EIPS/eip-1193#provider-errors\n */\nexport const UserRejectedRequestError = createSnapError(\n providerErrors.userRejectedRequest,\n);\n","import { assert, bytesToBase64 } from '@metamask/utils';\n\nimport { image } from './ui';\n\n/**\n * Get raw image data from a URL.\n *\n * @param url - The URL to get the image data from.\n * @param options - The options to use when fetching the image data. This is\n * passed directly to `fetch`.\n * @returns A promise that resolves to the image data as a blob.\n */\nasync function getRawImageData(url: string, options?: RequestInit) {\n if (typeof fetch !== 'function') {\n throw new Error(\n `Failed to fetch image data from \"${url}\": Using this function requires the \"endowment:network-access\" permission.`,\n );\n }\n\n return fetch(url, options).then(async (response) => {\n if (!response.ok) {\n throw new Error(\n `Failed to fetch image data from \"${url}\": ${response.status} ${response.statusText}`,\n );\n }\n\n const blob = await response.blob();\n assert(\n blob.type === 'image/jpeg' || blob.type === 'image/png',\n 'Expected image data to be a JPEG or PNG image.',\n );\n\n return blob;\n });\n}\n\n/**\n * Get image data as data-string from a URL. This is useful for embedding images\n * inside of SVGs. Only JPEG and PNG images are supported.\n *\n * Note: This function uses `fetch` to get the image data. This means that using\n * it requires the `endowment:network-access` permission.\n *\n * @example\n * const imageData = await getImageData('https://cataas.com/cat');\n * const svg = `\n * \n * \n * \n * `;\n *\n * // Render the SVG in a Snap UI.\n * const ui = image(svg);\n * @param url - The URL to get the image data from.\n * @param options - The options to use when fetching the image data. This is\n * passed directly to `fetch`.\n * @returns A promise that resolves to the image data as a data-string.\n */\nexport async function getImageData(url: string, options?: RequestInit) {\n const blob = await getRawImageData(url, options);\n const bytes = new Uint8Array(await blob.arrayBuffer());\n\n return `data:${blob.type};base64,${bytesToBase64(bytes)}`;\n}\n\n/**\n * Options for getting an SVG image element from a URL.\n *\n * @property width - The width of the image.\n * @property height - The height of the image. If this is not provided, the\n * width will be used as the height.\n * @property request - The options to use when fetching the image data. This is\n * passed directly to `fetch`.\n */\nexport type ImageOptions = {\n width: number;\n height?: number;\n request?: RequestInit;\n};\n\n/**\n * Get an image component from a URL. This is useful for embedding images inside\n * Snap UIs. Only JPEG and PNG images are supported.\n *\n * Note: This function uses `fetch` to get the image data. This means that using\n * it requires the `endowment:network-access` permission.\n *\n * @example\n * const component = await getImage('https://cataas.com/cat');\n *\n * return await snap.request({\n * method: 'snap_dialog',\n * params: {\n * type: 'alert',\n * content: panel([\n * component,\n * ]),\n * },\n * });\n * @param url - The URL to get the image data from.\n * @param options - The options to use when fetching and rendering the image.\n * @param options.width - The width of the image.\n * @param options.height - The height of the image. If this is not provided, the\n * width will be used as the height.\n * @param options.request - The options to use when fetching the image data.\n * This is passed directly to `fetch`.\n * @returns A promise that resolves to the image data as an image component.\n */\nexport async function getImageComponent(\n url: string,\n { width, height = width, request }: ImageOptions,\n) {\n assert(\n typeof width === 'number' && width > 0,\n 'Expected width to be a number greater than 0.',\n );\n\n assert(\n typeof height === 'number' && height > 0,\n 'Expected height to be a number greater than 0.',\n );\n\n const imageData = await getImageData(url, request);\n const size = `width=\"${width}\" height=\"${height}\"`;\n\n return image(\n ``,\n );\n}\n","import { HexChecksumAddressStruct } from '@metamask/utils';\nimport type { Infer } from 'superstruct';\nimport { assign, literal, object } from 'superstruct';\n\nimport { createBuilder } from '../builder';\nimport { LiteralStruct, NodeType } from '../nodes';\n\nexport const AddressStruct = assign(\n LiteralStruct,\n object({\n type: literal(NodeType.Address),\n value: HexChecksumAddressStruct,\n }),\n);\n\n/**\n * A address node, that renders an EVM-like address and its icon.\n *\n * @property type - The type of the node. Must be the string `address`.\n * @property value - The address in hexadecimal, including 0x.\n */\nexport type Address = Infer;\n\n/**\n * Create an {@link Address} node.\n *\n * @param args - The node arguments. This can either be a string, or an object\n * with the `value` property.\n * @param args.value - The address to be rendered.\n * @returns The address node as an object.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * const node = address({ value: '0x4bbeeb066ed09b7aed07bf39eee0460dfa261520' });\n * const node = address('0x4bbeeb066ed09b7aed07bf39eee0460dfa261520');\n */\nexport const address = createBuilder(NodeType.Address, AddressStruct, [\n 'value',\n]);\n","import { assertStruct, isPlainObject } from '@metamask/utils';\nimport type { Struct } from 'superstruct';\n\nimport type { Component } from './components';\nimport type { NodeType } from './nodes';\n\n/**\n * A function that builds a {@link Component}. This infers the proper args type\n * from the given node.\n *\n * @internal\n */\ntype NodeBuilder = Omit<\n Node,\n 'type'\n> extends Record\n ? (...args: []) => Node\n : (...args: [Omit] | NodeArrayType) => Node;\n\n/**\n * Map from an array of node keys to the corresponding array type.\n *\n * @example\n * type Node = { type: 'node'; a: string; b: number; c: boolean };\n * type Keys = ['a', 'b', 'c'];\n *\n * type NodeArray = NodeArrayType; // [string, number, boolean]\n * @internal\n */\ntype NodeArrayType = {\n [Key in keyof Keys]: Node[Keys[Key]];\n};\n\n/**\n * A function that returns a function to \"build\" a {@link Component}. It infers\n * the type of the component from the given struct, and performs validation on\n * the created component.\n *\n * The returned function can handle the node arguments in two ways:\n * 1. As a single object, with the keys corresponding to the node's properties,\n * excluding the `type` property.\n * 2. As an array of arguments, with the order corresponding to the given keys.\n *\n * @param type - The type of the component to build.\n * @param struct - The struct to use to validate the component.\n * @param keys - The keys of the component to use as arguments to the builder.\n * The order of the keys determines the order of the arguments.\n * @returns A function that builds a component of the given type.\n * @internal\n */\nexport function createBuilder<\n Node extends Component,\n Keys extends (keyof Node)[] = [],\n>(\n type: NodeType,\n struct: Struct,\n keys: Keys = [] as unknown as Keys,\n): NodeBuilder {\n return (...args: [Omit] | NodeArrayType | []) => {\n // Node passed as a single object.\n if (args.length === 1 && isPlainObject(args[0])) {\n const node = { ...args[0], type };\n\n // The user could be passing invalid values to the builder, so we need to\n // validate them as per the component's struct.\n assertStruct(node, struct, `Invalid ${type} component`);\n return node;\n }\n\n // Node passed as an array of arguments.\n const node = keys.reduce>(\n (partialNode, key, index) => {\n if (args[index] !== undefined) {\n return {\n ...partialNode,\n [key]: args[index],\n };\n }\n\n return partialNode;\n },\n { type },\n );\n\n // The user could be passing invalid values to the builder, so we need to\n // validate them as per the component's struct.\n assertStruct(node, struct, `Invalid ${type} component`);\n return node;\n };\n}\n","import type { Infer } from 'superstruct';\nimport { assign, object, string, unknown } from 'superstruct';\n\n/**\n * The supported node types. This is based on SIP-7.\n *\n * @see https://metamask.github.io/SIPs/SIPS/sip-7\n */\nexport enum NodeType {\n Copyable = 'copyable',\n Divider = 'divider',\n Heading = 'heading',\n Panel = 'panel',\n Spinner = 'spinner',\n // eslint-disable-next-line @typescript-eslint/no-shadow\n Text = 'text',\n Image = 'image',\n Row = 'row',\n Address = 'address',\n Button = 'button',\n Input = 'input',\n Form = 'form',\n}\n\n/**\n * @internal\n */\nexport const NodeStruct = object({\n type: string(),\n});\n\n/**\n * The base node type. All nodes extend this type.\n *\n * @property type - The type of the node. See {@link NodeType} for the supported\n * node types.\n * @internal\n */\nexport type Node = Infer;\n\n/**\n * @internal\n */\nexport const LiteralStruct = assign(\n NodeStruct,\n object({\n value: unknown(),\n }),\n);\n\n/**\n * A node with a value. This is used for nodes that render a value, such as\n * {@link Text}.\n *\n * @property type - The type of the node.\n * @property value - The value of the node. The type of the value depends on the\n * node type.\n * @internal\n */\nexport type Literal = Infer;\n","import type { Infer } from 'superstruct';\nimport {\n assign,\n boolean,\n literal,\n object,\n optional,\n string,\n} from 'superstruct';\n\nimport { createBuilder } from '../builder';\nimport { LiteralStruct, NodeType } from '../nodes';\n\nexport const CopyableStruct = assign(\n LiteralStruct,\n object({\n type: literal(NodeType.Copyable),\n value: string(),\n sensitive: optional(boolean()),\n }),\n);\n\n/**\n * Text that can be copied to the clipboard. It can optionally be marked as\n * sensitive, in which case it will only be displayed to the user after clicking\n * on the component.\n *\n * @property type - The type of the node. Must be the string `copyable`.\n * @property value - The text to be copied.\n * @property sensitive - Whether the value is sensitive or not. Sensitive values\n * are only displayed to the user after clicking on the component. Defaults to\n * false.\n */\nexport type Copyable = Infer;\n\n/**\n * Create a {@link Copyable} component.\n *\n * @param args - The node arguments. This can either be a string, or an object\n * with the `text` property.\n * @param args.value - The text to be copied.\n * @param args.sensitive - Whether the value is sensitive or not. Sensitive\n * values are only displayed to the user after clicking on the component.\n * Defaults to false.\n * @returns A {@link Copyable} component.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * const node = copyable('Hello, world!');\n * const node = copyable({ value: 'Hello, world!' });\n */\nexport const copyable = createBuilder(NodeType.Copyable, CopyableStruct, [\n 'value',\n 'sensitive',\n]);\n","import type { Infer } from 'superstruct';\nimport { assign, literal, object } from 'superstruct';\n\nimport { createBuilder } from '../builder';\nimport { NodeStruct, NodeType } from '../nodes';\n\nexport const DividerStruct = assign(\n NodeStruct,\n object({\n type: literal(NodeType.Divider),\n }),\n);\n\n/**\n * A divider node, that renders a line between other nodes.\n */\nexport type Divider = Infer;\n\n/**\n * Create a {@link Divider} node.\n *\n * @returns The divider node as object.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * const node = divider();\n */\nexport const divider = createBuilder(NodeType.Divider, DividerStruct);\n","import type { Infer } from 'superstruct';\nimport { assign, literal, object, string } from 'superstruct';\n\nimport { createBuilder } from '../builder';\nimport { LiteralStruct, NodeType } from '../nodes';\n\nexport const HeadingStruct = assign(\n LiteralStruct,\n object({\n type: literal(NodeType.Heading),\n value: string(),\n }),\n);\n\n/**\n * A heading node, that renders the text as a heading. The level of the heading\n * is determined by the depth of the heading in the document.\n *\n * @property type - The type of the node, must be the string 'text'.\n * @property value - The text content of the node, either as plain text, or as a\n * markdown string.\n */\nexport type Heading = Infer;\n\n/**\n * Create a {@link Heading} node.\n *\n * @param args - The node arguments. This can either be a string, or an object\n * with the `value` property.\n * @param args.value - The heading text.\n * @returns The heading node as object.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * const node = heading({ value: 'Hello, world!' });\n * const node = heading('Hello, world!');\n */\nexport const heading = createBuilder(NodeType.Heading, HeadingStruct, [\n 'value',\n]);\n","import type { Infer } from 'superstruct';\nimport { assign, literal, object, refine, string } from 'superstruct';\n\nimport { isSvg } from '../../internals';\nimport { createBuilder } from '../builder';\nimport { NodeStruct, NodeType } from '../nodes';\n\n/**\n * Get a Struct that validates a string as a valid SVG.\n *\n * @returns A Struct that validates a string as a valid SVG.\n * @internal\n */\nexport function svg() {\n return refine(string(), 'SVG', (value) => {\n if (!isSvg(value)) {\n return 'Value is not a valid SVG.';\n }\n\n return true;\n });\n}\n\nexport const ImageStruct = assign(\n NodeStruct,\n object({\n type: literal(NodeType.Image),\n value: svg(),\n }),\n);\n\n/**\n * An image node, that renders an SVG image.\n *\n * @property type - The type of the node. Must be the string `image`.\n * @property value - The SVG image to be rendered.\n */\nexport type Image = Infer;\n\n/**\n * Create an {@link Image} node.\n *\n * @param args - The node arguments. This can either be a string, or an object\n * with the `value` property.\n * @param args.value - The SVG image to be rendered. Must be a valid SVG string.\n * @returns The image node as object. Other image formats are supported by\n * embedding them as data URLs in the SVG.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * const node = image({ value: '' });\n * const node = image('');\n */\nexport const image = createBuilder(NodeType.Image, ImageStruct, ['value']);\n","import type { Infer, Struct } from 'superstruct';\nimport { array, assign, lazy, literal, object, union } from 'superstruct';\n\nimport { createBuilder } from '../builder';\nimport { NodeStruct, NodeType } from '../nodes';\nimport { AddressStruct } from './address';\nimport { ButtonStruct } from './button';\nimport { CopyableStruct } from './copyable';\nimport { DividerStruct } from './divider';\nimport { FormStruct } from './form';\nimport { HeadingStruct } from './heading';\nimport { ImageStruct } from './image';\nimport { InputStruct } from './input';\nimport { RowStruct } from './row';\nimport { SpinnerStruct } from './spinner';\nimport { TextStruct } from './text';\n\n/**\n * @internal\n */\nexport const ParentStruct = assign(\n NodeStruct,\n object({\n // This node references itself indirectly, so we need to use `lazy()`.\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n children: array(lazy(() => ComponentStruct)),\n }),\n);\n\n/**\n * A node which supports child nodes. This is used for nodes that render their\n * children, such as {@link Panel}.\n *\n * @property type - The type of the node.\n * @property children - The children of the node\n * @internal\n */\nexport type Parent = Infer;\n\n/**\n * @internal\n */\nexport const PanelStruct: Struct = assign(\n ParentStruct,\n object({\n type: literal(NodeType.Panel),\n }),\n);\n\n/**\n * A panel node, which renders its children.\n *\n * @property type - The type of the node, must be the string 'text'.\n * @property value - The text content of the node, either as plain text, or as a\n * markdown string.\n */\n// This node references itself indirectly, so it cannot be inferred.\nexport type Panel = {\n type: NodeType.Panel;\n children: Component[];\n};\n\n/**\n * Create a {@link Panel} node.\n *\n * @param args - The node arguments. This can be either an array of children, or\n * an object with a `children` property.\n * @param args.children - The child nodes of the panel. This can be any valid\n * {@link Component}.\n * @returns The panel node as object.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * const node = panel({\n * children: [\n * heading({ text: 'Hello, world!' }),\n * text({ text: 'This is a panel.' }),\n * ],\n * });\n *\n * const node = panel([\n * heading('Hello, world!'),\n * text('This is a panel.'),\n * ]);\n */\nexport const panel = createBuilder(NodeType.Panel, PanelStruct, ['children']);\n\n// This is defined separately from `Component` to avoid circular dependencies.\nexport const ComponentStruct = union([\n CopyableStruct,\n DividerStruct,\n HeadingStruct,\n ImageStruct,\n PanelStruct,\n SpinnerStruct,\n TextStruct,\n RowStruct,\n AddressStruct,\n InputStruct,\n FormStruct,\n ButtonStruct,\n]);\n\n/**\n * All supported component types.\n */\nexport type Component = Infer;\n","import type { Infer } from 'superstruct';\nimport { assign, literal, object, optional, string, union } from 'superstruct';\n\nimport { enumValue } from '../../internals';\nimport { createBuilder } from '../builder';\nimport { LiteralStruct, NodeType } from '../nodes';\n\nexport enum ButtonVariant {\n Primary = 'primary',\n Secondary = 'secondary',\n}\n\nexport enum ButtonType {\n Button = 'button',\n Submit = 'submit',\n}\n\nexport const ButtonStruct = assign(\n LiteralStruct,\n object({\n type: literal(NodeType.Button),\n value: string(),\n variant: optional(\n union([\n enumValue(ButtonVariant.Primary),\n enumValue(ButtonVariant.Secondary),\n ]),\n ),\n buttonType: optional(\n union([enumValue(ButtonType.Button), enumValue(ButtonType.Submit)]),\n ),\n name: optional(string()),\n }),\n);\n\n/**\n * A button node, that renders either a primary or a secondary button.\n *\n * @property type - The type of the node, must be the string 'button'.\n * @property variant - The style variant of the node, must be either 'primary' or 'secondary'.\n * @property value - The text content of the node as plain text.\n * @property buttonType - The type of the button, must be either 'button' or 'submit'.\n * @property name - An optional name to identify the button.\n */\nexport type Button = Infer;\n\n/**\n * Create a {@link Button} node.\n *\n * @param args - The node arguments. This can be either a string, or an object\n * with a `value` property. A set of optional properties can be passed.\n * @param args.variant - The optional variant of the button.\n * @param args.value - The text content of the node.\n * @param args.name - The optional name of the button.\n * @returns The text node as object.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * ```typescript\n * const node = button({ variant: 'primary', text: 'Hello, world!', name: 'myButton' });\n * const node = button('Hello, world!', 'button', 'myButton', 'primary');\n * const node = button('Hello, world!');\n * ```\n */\nexport const button = createBuilder(NodeType.Button, ButtonStruct, [\n 'value',\n 'buttonType',\n 'name',\n 'variant',\n]);\n","import type { Infer } from 'superstruct';\nimport { array, assign, literal, object, string, union } from 'superstruct';\n\nimport { createBuilder } from '../builder';\nimport { NodeStruct, NodeType } from '../nodes';\nimport { ButtonStruct } from './button';\nimport { InputStruct } from './input';\n\nexport const FormComponentStruct = union([InputStruct, ButtonStruct]);\n\n/**\n * The subset of nodes allowed as children in the {@link Form} node.\n */\nexport type FormComponent = Infer;\n\nexport const FormStruct = assign(\n NodeStruct,\n object({\n type: literal(NodeType.Form),\n children: array(FormComponentStruct),\n name: string(),\n }),\n);\n\n/**\n * A form node that takes children {@link FormComponent} nodes and renders a form.\n *\n * @property type - The type of the node. Must be the string `form`.\n * @property children - The children of the node. Only {@link FormComponent} nodes are allowed.\n * @property name - The form name used to identify it.\n */\nexport type Form = Infer;\n\n/**\n * Create a {@link Form} node.\n *\n * @param args - The node arguments. This can be either an array of children and a string, or\n * an object with a `name` and `children` property.\n * @param args.name - The form name used to identify it.\n * @param args.children - The child nodes of the form. This can be any valid\n * {@link FormComponent}.\n * @returns The form node as object.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * const node = form({\n * name: 'myForm',\n * children: [\n * input({ name: 'myInput' }),\n * button({ value: 'Hello, world!' }),\n * ],\n * });\n *\n * const node = form('myForm', [input('myInput'), button('Hello, world!')]);\n */\nexport const form = createBuilder(NodeType.Form, FormStruct, [\n 'name',\n 'children',\n]);\n","import type { Infer } from 'superstruct';\nimport { assign, literal, object, optional, string, union } from 'superstruct';\n\nimport { enumValue } from '../../internals';\nimport { createBuilder } from '../builder';\nimport { LiteralStruct, NodeType } from '../nodes';\n\n/**\n * This replicates the available input types from the metamask extension.\n * https://github.com/MetaMask/metamask-extension/develop/ui/components/component-library/input/input.constants.js\n */\nexport enum InputType {\n /* eslint-disable @typescript-eslint/no-shadow */\n Text = 'text',\n Number = 'number',\n /* eslint-enable @typescript-eslint/no-shadow */\n Password = 'password',\n}\n\nexport const InputStruct = assign(\n LiteralStruct,\n object({\n type: literal(NodeType.Input),\n value: optional(string()),\n name: string(),\n inputType: optional(\n union([\n enumValue(InputType.Text),\n enumValue(InputType.Password),\n enumValue(InputType.Number),\n ]),\n ),\n placeholder: optional(string()),\n label: optional(string()),\n error: optional(string()),\n }),\n);\n\n/**\n * An input node, that renders an input.\n *\n * @property type - The type of the node, must be the string 'input'.\n * @property name - The name for the input.\n * @property value - The value of the input.\n * @property inputType - An optional type, either `text`, `password` or `number`.\n * @property placeholder - An optional input placeholder.\n * @property label - An optional input label.\n * @property error - An optional error text.\n */\nexport type Input = Infer;\n\n/**\n * Create a {@link Input} node.\n *\n * @param args - The node arguments. This can either be a name and an optional variant, value and placeholder or an object\n * with the properties: `inputType`, `value`, `variant`, `placeholder` and `name`.\n * @param args.name - The name for the input.\n * @param args.value - The value of the input.\n * @param args.inputType - An optional type, either `text`, `password` or `number`.\n * @param args.placeholder - An optional input placeholder.\n * @param args.label - An optional input label.\n * @param args.error - An optional error text.\n * @returns The input node as an object.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * const node = input('myInput');\n * const node = input('myInput', InputType.Text, 'my placeholder', 'myValue', 'myLabel');\n * const node = input({ name: 'myInput' });\n * const node = input({name: 'myInput', value: 'myValue', inputType: InputType.Password, placeholder: 'placeholder'})\n */\nexport const input = createBuilder(NodeType.Input, InputStruct, [\n 'name',\n 'inputType',\n 'placeholder',\n 'value',\n 'label',\n]);\n","import type { Infer } from 'superstruct';\nimport { assign, literal, object, string, optional, union } from 'superstruct';\n\nimport { enumValue } from '../../internals';\nimport { createBuilder } from '../builder';\nimport { LiteralStruct, NodeType } from '../nodes';\nimport { AddressStruct } from './address';\nimport { ImageStruct } from './image';\nimport { TextStruct } from './text';\n\nexport enum RowVariant {\n Default = 'default',\n Critical = 'critical',\n Warning = 'warning',\n}\n\n// A subset of components made available to the row\nconst RowComponentStruct = union([ImageStruct, TextStruct, AddressStruct]);\n\nexport const RowStruct = assign(\n LiteralStruct,\n object({\n type: literal(NodeType.Row),\n variant: optional(\n union([\n enumValue(RowVariant.Default),\n enumValue(RowVariant.Critical),\n enumValue(RowVariant.Warning),\n ]),\n ),\n label: string(),\n value: RowComponentStruct,\n }),\n);\n\n/**\n * A row node, that renders a row with a label and a value.\n *\n * @property type - The type of the node. Must be the string `row`.\n * @property label - The label for the row.\n * @property value - A sub component to be rendered\n * on one side of the row.\n * @property variant - Optional variant for styling.\n */\nexport type Row = Infer;\n\n/**\n * Create a {@link Row} node.\n *\n * @param args - The node arguments. This can either be a string, a component and an optional variant or an object\n * with the properties: `label`, `value` and `variant`.\n * @param args.label - The label for the row.\n * @param args.value - Another component, is currently limited to `image`, `text` and `address`.\n * @param args.variant - An optional variant, either `default`, `warning` or `critical`.\n * @returns The row node as an object.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * const node = row({ label: 'Address', value: address('0x4bbeeb066ed09b7aed07bf39eee0460dfa261520') });\n * const node = row({ label: 'Address', value: address('0x4bbeeb066ed09b7aed07bf39eee0460dfa261520'), variant: RowVariant.Warning });\n * const node = row('Address', address('0x4bbeeb066ed09b7aed07bf39eee0460dfa261520'));\n * const node = row('Address', address('0x4bbeeb066ed09b7aed07bf39eee0460dfa261520'), RowVariant.Warning);\n */\nexport const row = createBuilder(NodeType.Row, RowStruct, [\n 'label',\n 'value',\n 'variant',\n]);\n","import type { Infer } from 'superstruct';\nimport {\n assign,\n boolean,\n literal,\n object,\n optional,\n string,\n} from 'superstruct';\n\nimport { createBuilder } from '../builder';\nimport { LiteralStruct, NodeType } from '../nodes';\n\nexport const TextStruct = assign(\n LiteralStruct,\n object({\n type: literal(NodeType.Text),\n value: string(),\n markdown: optional(boolean()),\n }),\n);\n\n/**\n * A text node, that renders the text as one or more paragraphs.\n *\n * @property type - The type of the node, must be the string 'text'.\n * @property value - The text content of the node, either as plain text, or as a\n * markdown string.\n * @property markdown - A flag to enable/disable markdown, if nothing is specified\n * markdown will be enabled.\n */\nexport type Text = Infer;\n\n/**\n * Create a {@link Text} node.\n *\n * @param args - The node arguments. This can be either a string\n * and a boolean, or an object with a `value` property\n * and an optional `markdown` property.\n * @param args.value - The text content of the node.\n * @param args.markdown - An optional flag to enable or disable markdown. This\n * is enabled by default.\n * @returns The text node as object.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * const node = text({ value: 'Hello, world!' });\n * const node = text('Hello, world!');\n * const node = text({ value: 'Hello, world!', markdown: false });\n * const node = text('Hello, world!', false);\n */\nexport const text = createBuilder(NodeType.Text, TextStruct, [\n 'value',\n 'markdown',\n]);\n","import type { Infer } from 'superstruct';\nimport { assign, literal, object } from 'superstruct';\n\nimport { createBuilder } from '../builder';\nimport { NodeStruct, NodeType } from '../nodes';\n\nexport const SpinnerStruct = assign(\n NodeStruct,\n object({\n type: literal(NodeType.Spinner),\n }),\n);\n\n/**\n * A spinner node, that renders a spinner, either as a full-screen overlay, or\n * inline when nested inside a {@link Panel}.\n */\nexport type Spinner = Infer;\n\n/**\n * Create a {@link Spinner} node.\n *\n * @returns The spinner node as object.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * const node = spinner();\n */\nexport const spinner = createBuilder(NodeType.Spinner, SpinnerStruct);\n","import { assertStruct } from '@metamask/utils';\nimport { is } from 'superstruct';\n\nimport { ComponentStruct } from './components';\nimport type { Component } from './components';\n\n/**\n * Check if the given value is a {@link Component}. This performs recursive\n * validation of the component's children (if any).\n *\n * @param value - The value to check.\n * @returns `true` if the value is a {@link Component}, `false` otherwise.\n */\nexport function isComponent(value: unknown): value is Component {\n return is(value, ComponentStruct);\n}\n\n/**\n * Assert that the given value is a {@link Component}. This performs recursive\n * validation of the component's children (if any).\n *\n * @param value - The value to check.\n * @throws If the value is not a {@link Component}.\n */\nexport function assertIsComponent(value: unknown): asserts value is Component {\n assertStruct(value, ComponentStruct, 'Invalid component');\n}\n","import type { ComponentOrElement } from '..';\nimport type { EnumToUnion } from '../../internals';\nimport type { ChainId } from '../caip';\n\n/**\n * The severity level of content being returned from a transaction insight.\n * Currently only one level is supported:\n *\n * - `critical` - The transaction is critical and should not be submitted by the\n * user.\n */\nexport enum SeverityLevel {\n Critical = 'critical',\n}\n\n/**\n * An EIP-1559 (type 2) transaction object.\n *\n * @property from - The address the transaction is being sent from.\n * @property to - The address the transaction is being sent to.\n * @property nonce - The nonce of the transaction.\n * @property value - The value of the transaction.\n * @property data - The data of the transaction.\n * @property gas - The gas limit of the transaction.\n * @property maxFeePerGas - The maximum fee per gas of the transaction.\n * @property maxPriorityFeePerGas - The maximum priority fee per gas of the\n * transaction.\n * @property estimateSuggested - The suggested gas price for the transaction.\n * @property estimateUsed - The gas price used for the transaction.\n * @see https://eips.ethereum.org/EIPS/eip-1559\n */\nexport type EIP1559Transaction = {\n from: string;\n to: string;\n nonce: string;\n value: string;\n data: string;\n gas: string;\n maxFeePerGas: string;\n maxPriorityFeePerGas: string;\n estimateSuggested: string;\n estimateUsed: string;\n};\n\n/**\n * A legacy (type \"0\") transaction object.\n *\n * @property from - The address the transaction is being sent from.\n * @property to - The address the transaction is being sent to.\n * @property nonce - The nonce of the transaction.\n * @property value - The value of the transaction.\n * @property data - The data of the transaction.\n * @property gas - The gas limit of the transaction.\n * @property gasPrice - The gas price of the transaction.\n * @property estimateSuggested - The suggested gas price for the transaction.\n * @property estimateUsed - The gas price used for the transaction.\n */\nexport type LegacyTransaction = {\n from: string;\n to: string;\n nonce: string;\n value: string;\n data: string;\n gas: string;\n gasPrice: string;\n estimateSuggested: string;\n estimateUsed: string;\n};\n\n/**\n * A transaction object. This can be either an EIP-1559 transaction or a legacy\n * transaction.\n *\n * @see EIP1559Transaction\n * @see LegacyTransaction\n */\nexport type Transaction = EIP1559Transaction | LegacyTransaction;\n\n/**\n * The `onTransaction` handler. This is called whenever a transaction is\n * submitted to the snap. It can return insights about the transaction, which\n * will be displayed to the user.\n *\n * Note that using this handler requires the `endowment:transaction-insights`\n * permission.\n *\n * @param args - The request arguments.\n * @param args.transaction - The transaction object, containing the address,\n * value, data, and other properties of the transaction.\n * @param args.chainId - The CAIP-2 {@link ChainId} of the network the\n * transaction is being submitted to.\n * @param args.transactionOrigin - The origin of the transaction. This is the\n * URL of the website that submitted the transaction. This is only available if\n * the Snap has enabled the `allowTransactionOrigin` option in the\n * `endowment:transaction-insight` permission.\n * @returns An object containing insights about the transaction. See\n * {@link OnTransactionResponse}. Can also return `null` if no insights are\n * available.\n */\nexport type OnTransactionHandler = (args: {\n transaction: Transaction;\n chainId: ChainId;\n transactionOrigin?: string;\n}) => Promise;\n\n/**\n * The response from a Snap's `onTransaction` handler.\n *\n * @property component - A custom UI component, that will be shown in MetaMask.\n * @property id - A Snap interface ID.\n * @property severity - The severity level of the content. Currently only one\n * level is supported: `critical`.\n */\nexport type OnTransactionResponse =\n | {\n content: ComponentOrElement;\n severity?: EnumToUnion;\n }\n | {\n id: string;\n severity?: EnumToUnion;\n };\n","import type { Infer } from 'superstruct';\nimport {\n assign,\n literal,\n nullable,\n object,\n optional,\n record,\n string,\n union,\n} from 'superstruct';\n\nimport type { InterfaceContext } from '../interface';\n\n/**\n * The type of user input event fired.\n * Currently only three events are supported:\n *\n * - `ButtonClickEvent` - A button has been clicked in the UI.\n * - `FormSubmitEvent` - A Form has been submitted in the UI.\n * - `InputChangeEvent` - The value of an input field has changed in the UI.\n */\nexport enum UserInputEventType {\n ButtonClickEvent = 'ButtonClickEvent',\n FormSubmitEvent = 'FormSubmitEvent',\n InputChangeEvent = 'InputChangeEvent',\n}\n\nexport const GenericEventStruct = object({\n type: string(),\n name: optional(string()),\n});\n\nexport const ButtonClickEventStruct = assign(\n GenericEventStruct,\n object({\n type: literal(UserInputEventType.ButtonClickEvent),\n name: optional(string()),\n }),\n);\n\nexport const FormSubmitEventStruct = assign(\n GenericEventStruct,\n object({\n type: literal(UserInputEventType.FormSubmitEvent),\n value: record(string(), nullable(string())),\n name: string(),\n }),\n);\n\nexport const InputChangeEventStruct = assign(\n GenericEventStruct,\n object({\n type: literal(UserInputEventType.InputChangeEvent),\n name: string(),\n value: string(),\n }),\n);\n\nexport const UserInputEventStruct = union([\n ButtonClickEventStruct,\n FormSubmitEventStruct,\n InputChangeEventStruct,\n]);\n\n/**\n * A user input event fired in the UI. This is passed to the params of the `onUserInput` handler.\n *\n * @property type - The type of event fired. See {@link UserInputEventType} for the different types.\n * @property name - The component name that fired the event. It is optional for an {@link UserInputEventType.ButtonClickEvent}.\n * @property value - The value associated with the event. Only available when an {@link UserInputEventType.FormSubmitEvent} is fired.\n * It contains the form values submitted.\n */\nexport type UserInputEvent = Infer;\n\n/**\n * The `onUserInput` handler. This is called when an user input event is fired in the UI.\n *\n * @param args - The user input event.\n * @param args.id - The user interface id.\n * @param args.event - The {@link UserInputEvent} object, containing the data about the fired event.\n */\nexport type OnUserInputHandler = (args: {\n id: string;\n event: UserInputEvent;\n context: InterfaceContext | null;\n}) => Promise;\n","import type { ComponentOrElement } from '..';\nimport type { EnumToUnion } from '../../internals';\n\n/**\n * The type of dialog to display.\n *\n * - `alert` - A dialog with a single button.\n * - `confirmation` - A dialog with two buttons, one to confirm and one to\n * cancel.\n * - `prompt` - A dialog with two buttons and a text input.\n */\nexport enum DialogType {\n Alert = 'alert',\n Confirmation = 'confirmation',\n Prompt = 'prompt',\n}\n\n/**\n * An alert dialog.\n *\n * @property type - The type of dialog. Must be `alert`.\n * @property content - The content to display in the dialog.\n * @property id - The Snap interface ID.\n */\nexport type AlertDialog =\n | {\n type: EnumToUnion;\n content: ComponentOrElement;\n }\n | {\n type: EnumToUnion;\n id: string;\n };\n\n/**\n * A confirmation dialog.\n *\n * @property type - The type of dialog. Must be `confirmation`.\n * @property content - The content to display in the dialog.\n * @property id - The Snap interface ID.\n */\nexport type ConfirmationDialog =\n | {\n type: EnumToUnion;\n content: ComponentOrElement;\n }\n | {\n type: EnumToUnion;\n id: string;\n };\n\n/**\n * A prompt dialog.\n *\n * @property type - The type of dialog. Must be `prompt`.\n * @property content - The content to display in the dialog.\n * @property id - The Snap interface ID.\n * @property placeholder - An optional placeholder text to display in the text\n * input.\n */\nexport type PromptDialog =\n | {\n type: EnumToUnion;\n content: ComponentOrElement;\n placeholder?: string;\n }\n | {\n type: EnumToUnion;\n id: string;\n placeholder?: string;\n };\n\n/**\n * The request parameters for the `snap_dialog` method.\n *\n * @property type - The type of dialog to display.\n * @property content - The content to display in the dialog.\n * @property id - The Snap interface ID.\n * @property placeholder - The placeholder text to display in the dialog. Only\n * applicable for the `prompt` dialog.\n */\nexport type DialogParams = AlertDialog | ConfirmationDialog | PromptDialog;\n\n/**\n * The result returned by the `snap_dialog` method.\n *\n * - If the dialog is an `alert`, the result is `null`.\n * - If the dialog is a `confirmation`, the result is a boolean indicating\n * whether the user confirmed the dialog.\n * - If the dialog is a `prompt`, the result is the value entered by\n * the user.\n */\nexport type DialogResult = null | boolean | string;\n","import type { EnumToUnion } from '../../internals';\n\n/**\n * The encoding to use when retrieving the file. Defaults to `Base64`.\n */\nexport enum AuxiliaryFileEncoding {\n Base64 = 'base64',\n Hex = 'hex',\n Utf8 = 'utf8',\n}\n\n/**\n * The request parameters for the `snap_getFile` method.\n *\n * @property path - The path to the file to retrieve.\n * @property encoding - The encoding to use when retrieving the file.\n */\nexport type GetFileParams = {\n path: string;\n encoding?: EnumToUnion;\n};\n\n/**\n * The result returned by the `snap_getFile` method.\n */\nexport type GetFileResult = string;\n","import type { Json } from '@metamask/utils';\n\nimport type { EnumToUnion } from '../../internals';\n\n/**\n * The operations that can be performed on the state.\n */\nexport enum ManageStateOperation {\n ClearState = 'clear',\n GetState = 'get',\n UpdateState = 'update',\n}\n\n/**\n * The clear state operation, which clears the state.\n *\n * @property operation - The operation to perform on the state. Must be `clear`.\n * @property encrypted - Whether to use the separate encrypted state, or the\n * unencrypted state. Defaults to the encrypted state. Encrypted state can only\n * be used if the extension is unlocked, while unencrypted state can be used\n * whether the extension is locked or unlocked.\n */\nexport type ClearStateOperation = {\n operation: EnumToUnion;\n encrypted?: boolean;\n};\n\n/**\n * The get state operation, which retrieves the state.\n *\n * @property operation - The operation to perform on the state. Must be `get`.\n * @property encrypted - Whether to use the separate encrypted state, or the\n * unencrypted state. Defaults to the encrypted state. Encrypted state can only\n * be used if the extension is unlocked, while unencrypted state can be used\n * whether the extension is locked or unlocked.\n */\nexport type GetStateOperation = {\n operation: EnumToUnion;\n encrypted?: boolean;\n};\n\n/**\n * The update state operation, which updates the state.\n *\n * @property operation - The operation to perform on the state. Must be\n * `update`.\n * @property encrypted - Whether to use the separate encrypted state, or the\n * unencrypted state. Defaults to the encrypted state. Encrypted state can only\n * be used if the extension is unlocked, while unencrypted state can be used\n * whether the extension is locked or unlocked.\n * @property newState - The new state to set.\n */\nexport type UpdateStateOperation = {\n operation: EnumToUnion;\n encrypted?: boolean;\n newState: Record;\n};\n\n/**\n * The request parameters for the `snap_manageState` method.\n *\n * @property operation - The operation to perform on the state.\n * @property encrypted - Whether to use the separate encrypted state, or the\n * unencrypted state. Defaults to the encrypted state.\n * @property newState - The new state to set. Only applicable for the `set`\n * operation.\n */\nexport type ManageStateParams =\n | ClearStateOperation\n | GetStateOperation\n | UpdateStateOperation;\n\n/**\n * The result returned by the `snap_manageState` method.\n *\n * If the operation is `get`, the result is the state. Otherwise, the result is\n * `null`.\n */\nexport type ManageStateResult = Record | null;\n","import type { EnumToUnion } from '../../internals';\n\n/**\n * The types of notifications that can be displayed.\n *\n * - `InApp` - A notification that is displayed in by the MetaMask extension.\n * - `Native` - A notification that is displayed by the operating system.\n */\nexport enum NotificationType {\n InApp = 'inApp',\n Native = 'native',\n}\n\n/**\n * The request parameters for the `snap_notify` method.\n *\n * @property type - The type of notification to display.\n * @property message - The message to display in the notification.\n */\nexport type NotifyParams = {\n type: EnumToUnion;\n message: string;\n};\n\n/**\n * The result returned by the `snap_notify` method.\n *\n * This method does not return anything.\n */\nexport type NotifyResult = null;\n","import { JsonStruct } from '@metamask/utils';\nimport type { Infer } from 'superstruct';\nimport { nullable, record, string, union } from 'superstruct';\n\nimport type { JSXElement } from '../jsx';\nimport { RootJSXElementStruct } from '../jsx';\nimport type { Component } from '../ui';\nimport { ComponentStruct } from '../ui';\n\n/**\n * To avoid typing problems with the interface state when manipulating it we have to differentiate the state of\n * a form (that will be contained inside the root state) and the root state since a key in the root stat can contain\n * either the value of an input or a sub-state of a form.\n */\n\nexport const FormStateStruct = record(string(), nullable(string()));\n\nexport const InterfaceStateStruct = record(\n string(),\n union([FormStateStruct, nullable(string())]),\n);\n\nexport type FormState = Infer;\nexport type InterfaceState = Infer;\n\nexport type ComponentOrElement = Component | JSXElement;\nexport const ComponentOrElementStruct = union([\n ComponentStruct,\n RootJSXElementStruct,\n]);\n\nexport const InterfaceContextStruct = record(string(), JsonStruct);\nexport type InterfaceContext = Infer;\n","import {\n hasProperty,\n HexChecksumAddressStruct,\n isPlainObject,\n JsonStruct,\n} from '@metamask/utils';\nimport type { Struct } from 'superstruct';\nimport {\n is,\n boolean,\n optional,\n array,\n lazy,\n nullable,\n number,\n object,\n record,\n string,\n tuple,\n} from 'superstruct';\nimport type { ObjectSchema } from 'superstruct/dist/utils';\n\nimport type { Describe } from '../internals';\nimport { literal, nullUnion } from '../internals';\nimport type { EmptyObject } from '../types';\nimport type {\n GenericSnapElement,\n JsonObject,\n Key,\n MaybeArray,\n SnapElement,\n StringElement,\n} from './component';\nimport type {\n AddressElement,\n BoldElement,\n BoxElement,\n ButtonElement,\n CopyableElement,\n DividerElement,\n DropdownElement,\n OptionElement,\n FieldElement,\n FormElement,\n HeadingElement,\n ImageElement,\n InputElement,\n ItalicElement,\n JSXElement,\n LinkElement,\n RowElement,\n SpinnerElement,\n StandardFormattingElement,\n TextElement,\n ValueElement,\n} from './components';\n\n/**\n * A struct for the {@link Key} type.\n */\nexport const KeyStruct: Describe = nullUnion([string(), number()]);\n\n/**\n * A struct for the {@link StringElement} type.\n */\nexport const StringElementStruct: Describe = maybeArray(\n string(),\n);\n\n/**\n * A struct for the {@link GenericSnapElement} type.\n */\nexport const ElementStruct: Describe = object({\n type: string(),\n props: record(string(), JsonStruct),\n key: nullable(KeyStruct),\n});\n\n/**\n * A helper function for creating a struct for a {@link MaybeArray} type.\n *\n * @param struct - The struct for the maybe array type.\n * @returns The struct for the maybe array type.\n */\nfunction maybeArray(\n struct: Struct,\n): Struct, any> {\n return nullUnion([struct, array(struct)]);\n}\n\n/**\n * A helper function for creating a struct for a JSX element.\n *\n * @param name - The name of the element.\n * @param props - The props of the element.\n * @returns The struct for the element.\n */\nfunction element(\n name: Name,\n props: Props = {} as Props,\n) {\n return object({\n type: literal(name) as unknown as Struct,\n props: object(props),\n key: nullable(KeyStruct),\n });\n}\n\n/**\n * A struct for the {@link ButtonElement} type.\n */\nexport const ButtonStruct: Describe = element('Button', {\n children: StringElementStruct,\n name: optional(string()),\n type: optional(nullUnion([literal('button'), literal('submit')])),\n variant: optional(nullUnion([literal('primary'), literal('destructive')])),\n disabled: optional(boolean()),\n});\n\n/**\n * A struct for the {@link InputElement} type.\n */\nexport const InputStruct: Describe = element('Input', {\n name: string(),\n type: optional(\n nullUnion([literal('text'), literal('password'), literal('number')]),\n ),\n value: optional(string()),\n placeholder: optional(string()),\n});\n\n/**\n * A struct for the {@link OptionElement} type.\n */\nexport const OptionStruct: Describe = element('Option', {\n value: string(),\n children: string(),\n});\n\n/**\n * A struct for the {@link DropdownElement} type.\n */\nexport const DropdownStruct: Describe = element('Dropdown', {\n name: string(),\n value: optional(string()),\n children: maybeArray(OptionStruct),\n});\n\n/**\n * A struct for the {@link FieldElement} type.\n */\nexport const FieldStruct: Describe = element('Field', {\n label: optional(string()),\n error: optional(string()),\n children: nullUnion([\n tuple([InputStruct, ButtonStruct]),\n InputStruct,\n DropdownStruct,\n ]),\n});\n\n/**\n * A struct for the {@link FormElement} type.\n */\nexport const FormStruct: Describe = element('Form', {\n children: maybeArray(nullUnion([FieldStruct, ButtonStruct])),\n name: string(),\n});\n\n/**\n * A struct for the {@link BoldElement} type.\n */\nexport const BoldStruct: Describe = element('Bold', {\n children: maybeArray(\n nullable(\n nullUnion([\n string(),\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n lazy(() => ItalicStruct) as unknown as Struct<\n SnapElement\n >,\n ]),\n ),\n ),\n});\n\n/**\n * A struct for the {@link ItalicElement} type.\n */\nexport const ItalicStruct: Describe = element('Italic', {\n children: maybeArray(\n nullable(\n nullUnion([\n string(),\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n lazy(() => BoldStruct) as unknown as Struct<\n SnapElement\n >,\n ]),\n ),\n ),\n});\n\nexport const FormattingStruct: Describe = nullUnion([\n BoldStruct,\n ItalicStruct,\n]);\n\n/**\n * A struct for the {@link AddressElement} type.\n */\nexport const AddressStruct: Describe = element('Address', {\n address: HexChecksumAddressStruct,\n});\n\n/**\n * A struct for the {@link BoxElement} type.\n */\nexport const BoxStruct: Describe = element('Box', {\n children: maybeArray(\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n nullable(lazy(() => BoxChildStruct)),\n ) as unknown as Struct, null>,\n direction: optional(nullUnion([literal('horizontal'), literal('vertical')])),\n alignment: optional(\n nullUnion([\n literal('start'),\n literal('center'),\n literal('end'),\n literal('space-between'),\n literal('space-around'),\n ]),\n ),\n});\n\n/**\n * A struct for the {@link CopyableElement} type.\n */\nexport const CopyableStruct: Describe = element('Copyable', {\n value: string(),\n sensitive: optional(boolean()),\n});\n\n/**\n * A struct for the {@link DividerElement} type.\n */\nexport const DividerStruct: Describe = element('Divider');\n\n/**\n * A struct for the {@link ValueElement} type.\n */\nexport const ValueStruct: Describe = element('Value', {\n value: string(),\n extra: string(),\n});\n\n/**\n * A struct for the {@link HeadingElement} type.\n */\nexport const HeadingStruct: Describe = element('Heading', {\n children: StringElementStruct,\n});\n\n/**\n * A struct for the {@link ImageElement} type.\n */\nexport const ImageStruct: Describe = element('Image', {\n src: string(),\n alt: optional(string()),\n});\n\n/**\n * A struct for the {@link LinkElement} type.\n */\nexport const LinkStruct: Describe = element('Link', {\n href: string(),\n children: maybeArray(nullable(nullUnion([FormattingStruct, string()]))),\n});\n\n/**\n * A struct for the {@link TextElement} type.\n */\nexport const TextStruct: Describe = element('Text', {\n children: maybeArray(\n nullable(nullUnion([string(), BoldStruct, ItalicStruct, LinkStruct])),\n ),\n});\n\n/**\n * A struct for the {@link RowElement} type.\n */\nexport const RowStruct: Describe = element('Row', {\n label: string(),\n children: nullUnion([AddressStruct, ImageStruct, TextStruct, ValueStruct]),\n variant: optional(\n nullUnion([literal('default'), literal('warning'), literal('error')]),\n ),\n});\n\n/**\n * A struct for the {@link SpinnerElement} type.\n */\nexport const SpinnerStruct: Describe = element('Spinner');\n\n/**\n * A subset of JSX elements that are allowed as children of the Box component.\n * This set should include all components, except components that need to be nested\n * in another component (e.g. Field must be contained in a Form).\n */\nexport const BoxChildStruct = nullUnion([\n ButtonStruct,\n InputStruct,\n FormStruct,\n BoldStruct,\n ItalicStruct,\n AddressStruct,\n BoxStruct,\n CopyableStruct,\n DividerStruct,\n HeadingStruct,\n ImageStruct,\n LinkStruct,\n RowStruct,\n SpinnerStruct,\n TextStruct,\n DropdownStruct,\n]);\n\n/**\n * For now, the allowed JSX elements at the root are the same as the allowed\n * children of the Box component.\n */\nexport const RootJSXElementStruct = BoxChildStruct;\n\n/**\n * A struct for the {@link JSXElement} type.\n */\nexport const JSXElementStruct: Describe = nullUnion([\n ButtonStruct,\n InputStruct,\n FieldStruct,\n FormStruct,\n BoldStruct,\n ItalicStruct,\n AddressStruct,\n BoxStruct,\n CopyableStruct,\n DividerStruct,\n HeadingStruct,\n ImageStruct,\n LinkStruct,\n RowStruct,\n SpinnerStruct,\n TextStruct,\n DropdownStruct,\n OptionStruct,\n ValueStruct,\n]);\n\n/**\n * Check if a value is a JSX element.\n *\n * @param value - The value to check.\n * @returns True if the value is a JSX element, false otherwise.\n */\nexport function isJSXElement(value: unknown): value is JSXElement {\n return is(value, JSXElementStruct);\n}\n\n/**\n * Check if a value is a JSX element, without validating all of its contents.\n * This is useful when you want to validate the structure of a value, but not\n * all the children.\n *\n * This should only be used when you are sure that the value is safe to use,\n * i.e., after using {@link isJSXElement}.\n *\n * @param value - The value to check.\n * @returns True if the value is a JSX element, false otherwise.\n */\nexport function isJSXElementUnsafe(value: unknown): value is JSXElement {\n return (\n isPlainObject(value) &&\n hasProperty(value, 'type') &&\n hasProperty(value, 'props') &&\n hasProperty(value, 'key')\n );\n}\n\n/**\n * Assert that a value is a JSX element.\n *\n * @param value - The value to check.\n * @throws If the value is not a JSX element.\n */\nexport function assertJSXElement(value: unknown): asserts value is JSXElement {\n // TODO: We should use the error parsing utils from `snaps-utils` to improve\n // the error messages. It currently includes colours and potentially other\n // formatting that we might not want to include in the SDK.\n if (!isJSXElement(value)) {\n throw new Error(\n `Expected a JSX element, but received ${JSON.stringify(\n value,\n )}. Please refer to the documentation for the supported JSX elements and their props.`,\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAcO,IAAM,YAAN,cAAwB,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAqBnC,YACE,OACA,OAA6B,CAAC,GAC9B;AACA,UAAM,UAAU,gBAAgB,KAAK;AACrC,UAAM,OAAO;AAzBf,uBAAS,OAAT;AAEA,uBAAS,UAAT;AAEA,uBAAS,OAAT;AAEA,uBAAS,QAAT;AAqBE,uBAAK,UAAW;AAChB,uBAAK,OAAQ,aAAa,KAAK;AAE/B,UAAM,aAAa,EAAE,GAAG,aAAa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,CAAC,CAAC;AAAA,EACtE;AACF,CAAC;AAKM,IAAMa,iBAA0C,QAAQ,SAAS;AAOjE,IAAM,iBAAiB,UAAU;AAAA,EACtCd;AAAA,EACAG;AAAA,EACAC;AAAA,EACA;AAAA,EACA;AAAA,EACAE;AAAA,EACA;AAAA,EACAE;AAAA,EACAC;AAAA,EACAC;AAAA,EACAC;AAAA,EACA;AAAA,EACAE;AAAA,EACAC;AAAA,EACAF;AAAA,EACA;AACF,CAAC;AAMM,IAAM,uBAAuB;AAK7B,IAAM,mBAAyC,UAAU;AAAA,EAC9DZ;AAAA,EACAG;AAAA,EACA;AAAA,EACAC;AAAA,EACA;AAAA,EACA;AAAA,EACAE;AAAA,EACA;AAAA,EACAE;AAAA,EACAC;AAAA,EACAC;AAAA,EACAC;AAAA,EACA;AAAA,EACAE;AAAA,EACAC;AAAA,EACAF;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;;;ADtVM,IAAM,kBAAkBG,QAAOC,SAAO,GAAGC,UAASD,SAAO,CAAC,CAAC;AAE3D,IAAM,uBAAuBD;AAAA,EAClCC,SAAO;AAAA,EACPE,OAAM,CAAC,iBAAiBD,UAASD,SAAO,CAAC,CAAC,CAAC;AAC7C;AAMO,IAAM,2BAA2BE,OAAM;AAAA,EAC5C;AAAA,EACA;AACF,CAAC;AAEM,IAAM,yBAAyBH,QAAOC,SAAO,GAAGG,WAAU;","names":["error","hasProperty","isObject","svg","assert","assert","assign","literal","object","node","NodeType","assign","object","literal","assign","literal","object","string","assign","object","literal","string","assign","literal","object","assign","object","literal","assign","literal","object","string","assign","object","literal","string","assign","literal","object","string","string","assign","object","literal","array","assign","literal","object","union","assign","literal","object","optional","string","union","ButtonVariant","ButtonType","assign","object","literal","string","optional","union","assign","literal","object","string","union","assign","literal","object","optional","string","union","InputType","assign","object","literal","optional","string","union","union","assign","object","literal","string","assign","literal","object","string","optional","union","assign","boolean","literal","object","optional","string","assign","object","literal","string","optional","boolean","RowVariant","union","assign","object","literal","optional","string","assign","literal","object","assign","object","literal","assign","object","array","literal","union","assertStruct","assertStruct","assert","SeverityLevel","assign","literal","object","optional","string","union","UserInputEventType","DialogType","AuxiliaryFileEncoding","ManageStateOperation","NotificationType","JsonStruct","nullable","record","string","union","hasProperty","HexChecksumAddressStruct","isPlainObject","is","boolean","optional","array","lazy","nullable","object","record","string","string","object","record","nullable","array","ButtonStruct","optional","boolean","InputStruct","FormStruct","lazy","AddressStruct","HexChecksumAddressStruct","CopyableStruct","DividerStruct","HeadingStruct","ImageStruct","TextStruct","RowStruct","SpinnerStruct","record","string","nullable","union","JsonStruct"]} +\ No newline at end of file ++{"version":3,"sources":["../src/errors.ts","../src/internals/error-wrappers.ts","../src/internals/errors.ts","../src/internals/structs.ts","../src/internals/jsx.ts","../src/internals/svg.ts","../src/index.ts","../src/error-wrappers.ts","../src/images.ts","../src/ui/components/address.ts","../src/ui/builder.ts","../src/ui/nodes.ts","../src/ui/components/copyable.ts","../src/ui/components/divider.ts","../src/ui/components/heading.ts","../src/ui/components/image.ts","../src/ui/components/panel.ts","../src/ui/components/button.ts","../src/ui/components/form.ts","../src/ui/components/input.ts","../src/ui/components/row.ts","../src/ui/components/text.ts","../src/ui/components/spinner.ts","../src/ui/component.ts","../src/types/handlers/transaction.ts","../src/types/handlers/user-input.ts","../src/types/methods/dialog.ts","../src/types/methods/get-file.ts","../src/types/methods/manage-state.ts","../src/types/methods/notify.ts","../src/types/interface.ts","../src/jsx/validation.ts"],"sourcesContent":["import type { Json, JsonRpcError } from '@metamask/utils';\n\nimport {\n getErrorCode,\n getErrorData,\n getErrorMessage,\n SNAP_ERROR_CODE,\n SNAP_ERROR_MESSAGE,\n} from './internals';\n\n/**\n * A generic error which can be thrown by a Snap, without it causing the Snap to\n * crash.\n */\nexport class SnapError extends Error {\n readonly #code: number;\n\n readonly #message: string;\n\n readonly #data?: Record;\n\n readonly #stack?: string;\n\n /**\n * Create a new `SnapError`.\n *\n * @param error - The error to create the `SnapError` from. If this is a\n * `string`, it will be used as the error message. If this is an `Error`, its\n * `message` property will be used as the error message. If this is a\n * `JsonRpcError`, its `message` property will be used as the error message\n * and its `code` property will be used as the error code. Otherwise, the\n * error will be converted to a string and used as the error message.\n * @param data - Additional data to include in the error. This will be merged\n * with the error data, if any.\n */\n constructor(\n error: string | Error | JsonRpcError,\n data: Record = {},\n ) {\n const message = getErrorMessage(error);\n super(message);\n\n this.#message = message;\n this.#code = getErrorCode(error);\n\n const mergedData = { ...getErrorData(error), ...data };\n if (Object.keys(mergedData).length > 0) {\n this.#data = mergedData;\n }\n\n this.#stack = super.stack;\n }\n\n /**\n * The error name.\n *\n * @returns The error name.\n */\n get name() {\n return 'SnapError';\n }\n\n /**\n * The error code.\n *\n * @returns The error code.\n */\n get code() {\n return this.#code;\n }\n\n /**\n * The error message.\n *\n * @returns The error message.\n */\n // This line is covered, but Jest doesn't pick it up for some reason.\n /* istanbul ignore next */\n get message() {\n return this.#message;\n }\n\n /**\n * Additional data for the error.\n *\n * @returns Additional data for the error.\n */\n get data() {\n return this.#data;\n }\n\n /**\n * The error stack.\n *\n * @returns The error stack.\n */\n // This line is covered, but Jest doesn't pick it up for some reason.\n /* istanbul ignore next */\n get stack() {\n return this.#stack;\n }\n\n /**\n * Convert the error to a JSON object.\n *\n * @returns The JSON object.\n */\n toJSON(): SerializedSnapError {\n return {\n code: SNAP_ERROR_CODE,\n message: SNAP_ERROR_MESSAGE,\n data: {\n cause: {\n code: this.code,\n message: this.message,\n stack: this.stack,\n ...(this.data ? { data: this.data } : {}),\n },\n },\n };\n }\n\n /**\n * Serialize the error to a JSON object. This is called by\n * `@metamask/rpc-errors` when serializing the error.\n *\n * @returns The JSON object.\n */\n serialize() {\n return this.toJSON();\n }\n}\n\n/**\n * A serialized {@link SnapError}. It's JSON-serializable, so it can be sent\n * over the RPC. The original error is wrapped in the `cause` property.\n *\n * @property code - The error code. This is always `-31002`.\n * @property message - The error message. This is always `'Snap Error'`.\n * @property data - The error data.\n * @property data.cause - The cause of the error.\n * @property data.cause.code - The error code.\n * @property data.cause.message - The error message.\n * @property data.cause.stack - The error stack.\n * @property data.cause.data - Additional data for the error.\n * @see SnapError\n */\nexport type SerializedSnapError = {\n code: typeof SNAP_ERROR_CODE;\n message: typeof SNAP_ERROR_MESSAGE;\n data: {\n cause: JsonRpcError;\n };\n};\n","import type { rpcErrors } from '@metamask/rpc-errors';\nimport type { Json } from '@metamask/utils';\n\nimport { SnapError } from '../errors';\n\nexport type JsonRpcErrorFunction = typeof rpcErrors.parse;\n\n/**\n * Create a `SnapError` class from an error function from\n * `@metamask/rpc-errors`. This is useful for creating custom error classes\n * which can be thrown by a Snap.\n *\n * The created class will inherit the message, code, and data properties from\n * the error function.\n *\n * @param fn - The error function to create the class from.\n * @returns The created `SnapError` class.\n */\nexport function createSnapError(fn: JsonRpcErrorFunction) {\n return class SnapJsonRpcError extends SnapError {\n /**\n * Create a new `SnapJsonRpcError` from a message.\n *\n * @param message - The message to create the error from.\n */\n constructor(message?: string);\n\n /**\n * Create a new `SnapJsonRpcError` from data.\n *\n * @param data - The data to create the error from.\n */\n constructor(data?: Record);\n\n /**\n * Create a new `SnapJsonRpcError` from a message and data.\n *\n * @param message - The message to create the error from.\n * @param data - The data to create the error from.\n */\n constructor(\n message?: string | Record,\n data?: Record,\n );\n\n /**\n * Create a new `SnapJsonRpcError` from a message and data.\n *\n * @param message - The message to create the error from.\n * @param data - The data to create the error from.\n */\n constructor(\n message?: string | Record,\n data?: Record,\n ) {\n if (typeof message === 'object') {\n const error = fn();\n super({\n code: error.code,\n message: error.message,\n data: message,\n });\n\n return;\n }\n\n const error = fn(message);\n super({\n code: error.code,\n message: error.message,\n data,\n });\n }\n };\n}\n","import { hasProperty, isObject, isValidJson } from '@metamask/utils';\n\nexport const SNAP_ERROR_CODE = -31002;\nexport const SNAP_ERROR_MESSAGE = 'Snap Error';\n\n/**\n * Get the error message from an unknown error type.\n *\n * - If the error is an object with a `message` property, return the message.\n * - Otherwise, return the error converted to a string.\n *\n * @param error - The error to get the message from.\n * @returns The error message.\n * @internal\n */\nexport function getErrorMessage(error: unknown) {\n if (\n isObject(error) &&\n hasProperty(error, 'message') &&\n typeof error.message === 'string'\n ) {\n return error.message;\n }\n\n return String(error);\n}\n\n/**\n * Get the error stack from an unknown error type.\n *\n * @param error - The error to get the stack from.\n * @returns The error stack, or undefined if the error does not have a valid\n * stack.\n * @internal\n */\nexport function getErrorStack(error: unknown) {\n if (\n isObject(error) &&\n hasProperty(error, 'stack') &&\n typeof error.stack === 'string'\n ) {\n return error.stack;\n }\n\n return undefined;\n}\n\n/**\n * Get the error code from an unknown error type.\n *\n * @param error - The error to get the code from.\n * @returns The error code, or `-32603` if the error does not have a valid code.\n * @internal\n */\nexport function getErrorCode(error: unknown) {\n if (\n isObject(error) &&\n hasProperty(error, 'code') &&\n typeof error.code === 'number' &&\n Number.isInteger(error.code)\n ) {\n return error.code;\n }\n\n return -32603;\n}\n\n/**\n * Get the error data from an unknown error type.\n *\n * @param error - The error to get the data from.\n * @returns The error data, or an empty object if the error does not have valid\n * data.\n * @internal\n */\nexport function getErrorData(error: unknown) {\n if (\n isObject(error) &&\n hasProperty(error, 'data') &&\n typeof error.data === 'object' &&\n error.data !== null &&\n isValidJson(error.data) &&\n !Array.isArray(error.data)\n ) {\n return error.data;\n }\n\n return {};\n}\n","import type { Infer } from 'superstruct';\nimport {\n Struct,\n define,\n literal as superstructLiteral,\n union as superstructUnion,\n} from 'superstruct';\nimport type { AnyStruct, InferStructTuple } from 'superstruct';\n\nimport type { EnumToUnion } from './helpers';\n\n/**\n * A wrapper of `superstruct`'s `literal` struct that also defines the name of\n * the struct as the literal value.\n *\n * This is useful for improving the error messages returned by `superstruct`.\n * For example, instead of returning an error like:\n *\n * ```\n * Expected the value to satisfy a union of `literal | literal`, but received: \\\"baz\\\"\n * ```\n *\n * This struct will return an error like:\n *\n * ```\n * Expected the value to satisfy a union of `\"foo\" | \"bar\"`, but received: \\\"baz\\\"\n * ```\n *\n * @param value - The literal value.\n * @returns The `superstruct` struct, which validates that the value is equal\n * to the literal value.\n */\nexport function literal(value: Type) {\n return define(\n JSON.stringify(value),\n superstructLiteral(value).validator,\n );\n}\n\n/**\n * A wrapper of `superstruct`'s `union` struct that also defines the schema as\n * the union of the schemas of the structs.\n *\n * This is useful for improving the error messages returned by `superstruct`.\n *\n * @param structs - The structs to union.\n * @param structs.\"0\" - The first struct.\n * @param structs.\"1\" - The remaining structs.\n * @returns The `superstruct` struct, which validates that the value satisfies\n * one of the structs.\n */\nexport function union([\n head,\n ...tail\n]: [head: Head, ...tail: Tail]): Struct<\n Infer | InferStructTuple[number],\n [head: Head, ...tail: Tail]\n> {\n const struct = superstructUnion([head, ...tail]);\n\n return new Struct({\n ...struct,\n schema: [head, ...tail],\n });\n}\n\n/**\n * Superstruct struct for validating an enum value. This allows using both the\n * enum string values and the enum itself as values.\n *\n * @param constant - The enum to validate against.\n * @returns The superstruct struct.\n */\nexport function enumValue(\n constant: Type,\n): Struct, null> {\n return literal(constant as EnumToUnion);\n}\n","import type { Infer, Struct } from 'superstruct';\nimport type {\n AnyStruct,\n EnumSchema,\n InferStructTuple,\n IsExactMatch,\n IsMatch,\n IsRecord,\n IsTuple,\n UnionToIntersection,\n} from 'superstruct';\n\nimport type { EmptyObject } from '../types';\nimport { union } from './structs';\n\n/**\n * Check if a type is a union. Infers `true` if it is a union, otherwise\n * `false`.\n */\ntype IsUnion = [Type] extends [UnionToIntersection] ? false : true;\n\n/**\n * Get a struct schema for a type.\n *\n * This is copied from `superstruct` but fixes some issues with the original\n * implementation.\n */\ntype StructSchema = IsUnion extends true\n ? null\n : [Type] extends [EmptyObject]\n ? EmptyObject\n : [Type] extends [string | undefined | null]\n ? [Type] extends [`0x${string}`]\n ? null\n : [Type] extends [IsMatch]\n ? null\n : [Type] extends [IsUnion]\n ? EnumSchema\n : Type\n : [Type] extends [number | undefined | null]\n ? [Type] extends [IsMatch]\n ? null\n : [Type] extends [IsUnion]\n ? EnumSchema\n : Type\n : [Type] extends [boolean]\n ? [Type] extends [IsExactMatch]\n ? null\n : Type\n : Type extends\n | bigint\n | symbol\n | undefined\n | null\n // eslint-disable-next-line @typescript-eslint/ban-types\n | Function\n | Date\n | Error\n | RegExp\n | Map\n | WeakMap\n | Set\n | WeakSet\n | Promise\n ? null\n : Type extends (infer E)[]\n ? Type extends IsTuple\n ? null\n : Struct\n : Type extends object\n ? Type extends IsRecord\n ? null\n : {\n [InnerKey in keyof Type]: Describe;\n }\n : null;\n\n/**\n * Describe a struct type.\n */\nexport type Describe = Struct>;\n\n/**\n * Create a union struct that uses `null` for the schema type, for better\n * compatibility with `Describe`.\n *\n * @param structs - The structs to union.\n * @returns The `superstruct` struct, which validates that the value satisfies\n * one of the structs.\n */\nexport function nullUnion(\n structs: [head: Head, ...tail: Tail],\n) {\n return union(structs) as unknown as Struct<\n Infer | InferStructTuple[number],\n null\n >;\n}\n","import { assert, hasProperty, isObject } from '@metamask/utils';\nimport { XMLParser } from 'fast-xml-parser';\n\n/**\n * Parse and validate a string as an SVG.\n *\n * @param svg - An SVG string.\n * @returns The SVG, its attributes and children in an object format.\n */\nexport function parseSvg(svg: string) {\n try {\n const trimmed = svg.trim();\n\n assert(trimmed.length > 0);\n\n const parser = new XMLParser({\n ignoreAttributes: false,\n parseAttributeValue: true,\n });\n const parsed = parser.parse(trimmed, true);\n\n assert(hasProperty(parsed, 'svg'));\n\n // Empty SVGs are not returned as objects\n if (!isObject(parsed.svg)) {\n return {};\n }\n\n return parsed.svg;\n } catch {\n throw new Error('Snap icon must be a valid SVG.');\n }\n}\n\n/**\n * Validate that a string is a valid SVG.\n *\n * @param svg - An SVG string.\n * @returns True if the SVG is valid otherwise false.\n */\nexport function isSvg(svg: string) {\n try {\n parseSvg(svg);\n return true;\n } catch {\n return false;\n }\n}\n","// Only internals that are used by other Snaps packages should be exported here.\nexport type { EnumToUnion } from './internals';\nexport {\n getErrorData,\n getErrorMessage,\n getErrorStack,\n SNAP_ERROR_CODE,\n SNAP_ERROR_MESSAGE,\n literal,\n union,\n enumValue,\n parseSvg,\n isSvg,\n} from './internals';\n\n// Re-exported from `@metamask/utils` for convenience.\nexport type {\n Json,\n JsonRpcError,\n JsonRpcRequest,\n JsonRpcParams,\n} from '@metamask/utils';\nexport { assert } from '@metamask/utils';\n\nexport * from './errors';\nexport * from './error-wrappers';\nexport * from './images';\nexport * from './types';\nexport * from './ui';\n","import { providerErrors, rpcErrors } from '@metamask/rpc-errors';\n\nimport { createSnapError } from './internals';\n\n/**\n * A JSON-RPC 2.0 Internal (-32603) error.\n *\n * This can be thrown by a Snap to indicate that an internal error occurred,\n * without crashing the Snap.\n *\n * @see https://www.jsonrpc.org/specification#error_object\n */\nexport const InternalError = createSnapError(rpcErrors.internal);\n\n/**\n * An Ethereum JSON-RPC Invalid Input (-32000) error.\n *\n * This can be thrown by a Snap to indicate that the input to a method is\n * invalid, without crashing the Snap.\n *\n * @see https://eips.ethereum.org/EIPS/eip-1474#error-codes\n */\nexport const InvalidInputError = createSnapError(rpcErrors.invalidInput);\n\n/**\n * A JSON-RPC 2.0 Invalid Params (-32602) error.\n *\n * This can be thrown by a Snap to indicate that the parameters to a method are\n * invalid, without crashing the Snap.\n *\n * @see https://www.jsonrpc.org/specification#error_object\n */\nexport const InvalidParamsError = createSnapError(rpcErrors.invalidParams);\n\n/**\n * A JSON-RPC 2.0 Invalid Request (-32600) error.\n *\n * This can be thrown by a Snap to indicate that the request is invalid, without\n * crashing the Snap.\n *\n * @see https://www.jsonrpc.org/specification#error_object\n */\nexport const InvalidRequestError = createSnapError(rpcErrors.invalidRequest);\n\n/**\n * An Ethereum JSON-RPC Limit Exceeded (-32005) error.\n *\n * This can be thrown by a Snap to indicate that a limit has been exceeded,\n * without crashing the Snap.\n *\n * @see https://eips.ethereum.org/EIPS/eip-1474#error-codes\n */\nexport const LimitExceededError = createSnapError(rpcErrors.limitExceeded);\n\n/**\n * An Ethereum JSON-RPC Method Not Found (-32601) error.\n *\n * This can be thrown by a Snap to indicate that a method does not exist,\n * without crashing the Snap.\n *\n * @see https://eips.ethereum.org/EIPS/eip-1474#error-codes\n */\nexport const MethodNotFoundError = createSnapError(rpcErrors.methodNotFound);\n\n/**\n * An Ethereum JSON-RPC Method Not Supported (-32004) error.\n *\n * This can be thrown by a Snap to indicate that a method is not supported,\n * without crashing the Snap.\n */\nexport const MethodNotSupportedError = createSnapError(\n rpcErrors.methodNotSupported,\n);\n\n/**\n * A JSON-RPC 2.0 Parse (-32700) error.\n *\n * This can be thrown by a Snap to indicate that a request is not valid JSON,\n * without crashing the Snap.\n *\n * @see https://www.jsonrpc.org/specification#error_object\n */\nexport const ParseError = createSnapError(rpcErrors.parse);\n\n/**\n * An Ethereum JSON-RPC Resource Not Found (-32001) error.\n *\n * This can be thrown by a Snap to indicate that a resource does not exist,\n * without crashing the Snap.\n *\n * @see https://eips.ethereum.org/EIPS/eip-1474#error-codes\n */\nexport const ResourceNotFoundError = createSnapError(\n rpcErrors.resourceNotFound,\n);\n\n/**\n * An Ethereum JSON-RPC Resource Unavailable (-32002) error.\n *\n * This can be thrown by a Snap to indicate that a resource is unavailable,\n * without crashing the Snap.\n *\n * @see https://eips.ethereum.org/EIPS/eip-1474#error-codes\n */\nexport const ResourceUnavailableError = createSnapError(\n rpcErrors.resourceUnavailable,\n);\n\n/**\n * An Ethereum JSON-RPC Transaction Rejected (-32003) error.\n *\n * This can be thrown by a Snap to indicate that a transaction was rejected,\n * without crashing the Snap.\n *\n * @see https://eips.ethereum.org/EIPS/eip-1474#error-codes\n */\nexport const TransactionRejected = createSnapError(\n rpcErrors.transactionRejected,\n);\n\n/**\n * An Ethereum Provider Chain Disconnected (4901) error.\n *\n * This can be thrown by a Snap to indicate that the provider is disconnected\n * from the requested chain, without crashing the Snap.\n *\n * @see https://eips.ethereum.org/EIPS/eip-1193#provider-errors\n */\nexport const ChainDisconnectedError = createSnapError(\n providerErrors.chainDisconnected,\n);\n\n/**\n * An Ethereum Provider Disconnected (4900) error.\n *\n * This can be thrown by a Snap to indicate that the provider is disconnected,\n * without crashing the Snap.\n *\n * @see https://eips.ethereum.org/EIPS/eip-1193#provider-errors\n */\nexport const DisconnectedError = createSnapError(providerErrors.disconnected);\n\n/**\n * An Ethereum Provider Unauthorized (4100) error.\n *\n * This can be thrown by a Snap to indicate that the requested method / account\n * is not authorized by the user, without crashing the Snap.\n */\nexport const UnauthorizedError = createSnapError(providerErrors.unauthorized);\n\n/**\n * An Ethereum Provider Unsupported Method (4200) error.\n *\n * This can be thrown by a Snap to indicate that the requested method is not\n * supported by the provider, without crashing the Snap.\n *\n * @see https://eips.ethereum.org/EIPS/eip-1193#provider-errors\n */\nexport const UnsupportedMethodError = createSnapError(\n providerErrors.unsupportedMethod,\n);\n\n/**\n * An Ethereum Provider User Rejected Request (4001) error.\n *\n * This can be thrown by a Snap to indicate that the user rejected the request,\n * without crashing the Snap.\n *\n * @see https://eips.ethereum.org/EIPS/eip-1193#provider-errors\n */\nexport const UserRejectedRequestError = createSnapError(\n providerErrors.userRejectedRequest,\n);\n","import { assert, bytesToBase64 } from '@metamask/utils';\n\nimport { image } from './ui';\n\n/**\n * Get raw image data from a URL.\n *\n * @param url - The URL to get the image data from.\n * @param options - The options to use when fetching the image data. This is\n * passed directly to `fetch`.\n * @returns A promise that resolves to the image data as a blob.\n */\nasync function getRawImageData(url: string, options?: RequestInit) {\n if (typeof fetch !== 'function') {\n throw new Error(\n `Failed to fetch image data from \"${url}\": Using this function requires the \"endowment:network-access\" permission.`,\n );\n }\n\n return fetch(url, options).then(async (response) => {\n if (!response.ok) {\n throw new Error(\n `Failed to fetch image data from \"${url}\": ${response.status} ${response.statusText}`,\n );\n }\n\n const blob = await response.blob();\n assert(\n blob.type === 'image/jpeg' || blob.type === 'image/png',\n 'Expected image data to be a JPEG or PNG image.',\n );\n\n return blob;\n });\n}\n\n/**\n * Get image data as data-string from a URL. This is useful for embedding images\n * inside of SVGs. Only JPEG and PNG images are supported.\n *\n * Note: This function uses `fetch` to get the image data. This means that using\n * it requires the `endowment:network-access` permission.\n *\n * @example\n * const imageData = await getImageData('https://cataas.com/cat');\n * const svg = `\n * \n * \n * \n * `;\n *\n * // Render the SVG in a Snap UI.\n * const ui = image(svg);\n * @param url - The URL to get the image data from.\n * @param options - The options to use when fetching the image data. This is\n * passed directly to `fetch`.\n * @returns A promise that resolves to the image data as a data-string.\n */\nexport async function getImageData(url: string, options?: RequestInit) {\n const blob = await getRawImageData(url, options);\n const bytes = new Uint8Array(await blob.arrayBuffer());\n\n return `data:${blob.type};base64,${bytesToBase64(bytes)}`;\n}\n\n/**\n * Options for getting an SVG image element from a URL.\n *\n * @property width - The width of the image.\n * @property height - The height of the image. If this is not provided, the\n * width will be used as the height.\n * @property request - The options to use when fetching the image data. This is\n * passed directly to `fetch`.\n */\nexport type ImageOptions = {\n width: number;\n height?: number;\n request?: RequestInit;\n};\n\n/**\n * Get an image component from a URL. This is useful for embedding images inside\n * Snap UIs. Only JPEG and PNG images are supported.\n *\n * Note: This function uses `fetch` to get the image data. This means that using\n * it requires the `endowment:network-access` permission.\n *\n * @example\n * const component = await getImage('https://cataas.com/cat');\n *\n * return await snap.request({\n * method: 'snap_dialog',\n * params: {\n * type: 'alert',\n * content: panel([\n * component,\n * ]),\n * },\n * });\n * @param url - The URL to get the image data from.\n * @param options - The options to use when fetching and rendering the image.\n * @param options.width - The width of the image.\n * @param options.height - The height of the image. If this is not provided, the\n * width will be used as the height.\n * @param options.request - The options to use when fetching the image data.\n * This is passed directly to `fetch`.\n * @returns A promise that resolves to the image data as an image component.\n */\nexport async function getImageComponent(\n url: string,\n { width, height = width, request }: ImageOptions,\n) {\n assert(\n typeof width === 'number' && width > 0,\n 'Expected width to be a number greater than 0.',\n );\n\n assert(\n typeof height === 'number' && height > 0,\n 'Expected height to be a number greater than 0.',\n );\n\n const imageData = await getImageData(url, request);\n const size = `width=\"${width}\" height=\"${height}\"`;\n\n return image(\n ``,\n );\n}\n","import { HexChecksumAddressStruct } from '@metamask/utils';\nimport type { Infer } from 'superstruct';\nimport { assign, literal, object } from 'superstruct';\n\nimport { createBuilder } from '../builder';\nimport { LiteralStruct, NodeType } from '../nodes';\n\nexport const AddressStruct = assign(\n LiteralStruct,\n object({\n type: literal(NodeType.Address),\n value: HexChecksumAddressStruct,\n }),\n);\n\n/**\n * A address node, that renders an EVM-like address and its icon.\n *\n * @property type - The type of the node. Must be the string `address`.\n * @property value - The address in hexadecimal, including 0x.\n */\nexport type Address = Infer;\n\n/**\n * Create an {@link Address} node.\n *\n * @param args - The node arguments. This can either be a string, or an object\n * with the `value` property.\n * @param args.value - The address to be rendered.\n * @returns The address node as an object.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * const node = address({ value: '0x4bbeeb066ed09b7aed07bf39eee0460dfa261520' });\n * const node = address('0x4bbeeb066ed09b7aed07bf39eee0460dfa261520');\n */\nexport const address = createBuilder(NodeType.Address, AddressStruct, [\n 'value',\n]);\n","import { assertStruct, isPlainObject } from '@metamask/utils';\nimport type { Struct } from 'superstruct';\n\nimport type { Component } from './components';\nimport type { NodeType } from './nodes';\n\n/**\n * A function that builds a {@link Component}. This infers the proper args type\n * from the given node.\n *\n * @internal\n */\ntype NodeBuilder = Omit<\n Node,\n 'type'\n> extends Record\n ? (...args: []) => Node\n : (...args: [Omit] | NodeArrayType) => Node;\n\n/**\n * Map from an array of node keys to the corresponding array type.\n *\n * @example\n * type Node = { type: 'node'; a: string; b: number; c: boolean };\n * type Keys = ['a', 'b', 'c'];\n *\n * type NodeArray = NodeArrayType; // [string, number, boolean]\n * @internal\n */\ntype NodeArrayType = {\n [Key in keyof Keys]: Node[Keys[Key]];\n};\n\n/**\n * A function that returns a function to \"build\" a {@link Component}. It infers\n * the type of the component from the given struct, and performs validation on\n * the created component.\n *\n * The returned function can handle the node arguments in two ways:\n * 1. As a single object, with the keys corresponding to the node's properties,\n * excluding the `type` property.\n * 2. As an array of arguments, with the order corresponding to the given keys.\n *\n * @param type - The type of the component to build.\n * @param struct - The struct to use to validate the component.\n * @param keys - The keys of the component to use as arguments to the builder.\n * The order of the keys determines the order of the arguments.\n * @returns A function that builds a component of the given type.\n * @internal\n */\nexport function createBuilder<\n Node extends Component,\n Keys extends (keyof Node)[] = [],\n>(\n type: NodeType,\n struct: Struct,\n keys: Keys = [] as unknown as Keys,\n): NodeBuilder {\n return (...args: [Omit] | NodeArrayType | []) => {\n // Node passed as a single object.\n if (args.length === 1 && isPlainObject(args[0])) {\n const node = { ...args[0], type };\n\n // The user could be passing invalid values to the builder, so we need to\n // validate them as per the component's struct.\n assertStruct(node, struct, `Invalid ${type} component`);\n return node;\n }\n\n // Node passed as an array of arguments.\n const node = keys.reduce>(\n (partialNode, key, index) => {\n if (args[index] !== undefined) {\n return {\n ...partialNode,\n [key]: args[index],\n };\n }\n\n return partialNode;\n },\n { type },\n );\n\n // The user could be passing invalid values to the builder, so we need to\n // validate them as per the component's struct.\n assertStruct(node, struct, `Invalid ${type} component`);\n return node;\n };\n}\n","import type { Infer } from 'superstruct';\nimport { assign, object, string, unknown } from 'superstruct';\n\n/**\n * The supported node types. This is based on SIP-7.\n *\n * @see https://metamask.github.io/SIPs/SIPS/sip-7\n */\nexport enum NodeType {\n Copyable = 'copyable',\n Divider = 'divider',\n Heading = 'heading',\n Panel = 'panel',\n Spinner = 'spinner',\n // eslint-disable-next-line @typescript-eslint/no-shadow\n Text = 'text',\n Image = 'image',\n Row = 'row',\n Address = 'address',\n Button = 'button',\n Input = 'input',\n Form = 'form',\n}\n\n/**\n * @internal\n */\nexport const NodeStruct = object({\n type: string(),\n});\n\n/**\n * The base node type. All nodes extend this type.\n *\n * @property type - The type of the node. See {@link NodeType} for the supported\n * node types.\n * @internal\n */\nexport type Node = Infer;\n\n/**\n * @internal\n */\nexport const LiteralStruct = assign(\n NodeStruct,\n object({\n value: unknown(),\n }),\n);\n\n/**\n * A node with a value. This is used for nodes that render a value, such as\n * {@link Text}.\n *\n * @property type - The type of the node.\n * @property value - The value of the node. The type of the value depends on the\n * node type.\n * @internal\n */\nexport type Literal = Infer;\n","import type { Infer } from 'superstruct';\nimport {\n assign,\n boolean,\n literal,\n object,\n optional,\n string,\n} from 'superstruct';\n\nimport { createBuilder } from '../builder';\nimport { LiteralStruct, NodeType } from '../nodes';\n\nexport const CopyableStruct = assign(\n LiteralStruct,\n object({\n type: literal(NodeType.Copyable),\n value: string(),\n sensitive: optional(boolean()),\n }),\n);\n\n/**\n * Text that can be copied to the clipboard. It can optionally be marked as\n * sensitive, in which case it will only be displayed to the user after clicking\n * on the component.\n *\n * @property type - The type of the node. Must be the string `copyable`.\n * @property value - The text to be copied.\n * @property sensitive - Whether the value is sensitive or not. Sensitive values\n * are only displayed to the user after clicking on the component. Defaults to\n * false.\n */\nexport type Copyable = Infer;\n\n/**\n * Create a {@link Copyable} component.\n *\n * @param args - The node arguments. This can either be a string, or an object\n * with the `text` property.\n * @param args.value - The text to be copied.\n * @param args.sensitive - Whether the value is sensitive or not. Sensitive\n * values are only displayed to the user after clicking on the component.\n * Defaults to false.\n * @returns A {@link Copyable} component.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * const node = copyable('Hello, world!');\n * const node = copyable({ value: 'Hello, world!' });\n */\nexport const copyable = createBuilder(NodeType.Copyable, CopyableStruct, [\n 'value',\n 'sensitive',\n]);\n","import type { Infer } from 'superstruct';\nimport { assign, literal, object } from 'superstruct';\n\nimport { createBuilder } from '../builder';\nimport { NodeStruct, NodeType } from '../nodes';\n\nexport const DividerStruct = assign(\n NodeStruct,\n object({\n type: literal(NodeType.Divider),\n }),\n);\n\n/**\n * A divider node, that renders a line between other nodes.\n */\nexport type Divider = Infer;\n\n/**\n * Create a {@link Divider} node.\n *\n * @returns The divider node as object.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * const node = divider();\n */\nexport const divider = createBuilder(NodeType.Divider, DividerStruct);\n","import type { Infer } from 'superstruct';\nimport { assign, literal, object, string } from 'superstruct';\n\nimport { createBuilder } from '../builder';\nimport { LiteralStruct, NodeType } from '../nodes';\n\nexport const HeadingStruct = assign(\n LiteralStruct,\n object({\n type: literal(NodeType.Heading),\n value: string(),\n }),\n);\n\n/**\n * A heading node, that renders the text as a heading. The level of the heading\n * is determined by the depth of the heading in the document.\n *\n * @property type - The type of the node, must be the string 'text'.\n * @property value - The text content of the node, either as plain text, or as a\n * markdown string.\n */\nexport type Heading = Infer;\n\n/**\n * Create a {@link Heading} node.\n *\n * @param args - The node arguments. This can either be a string, or an object\n * with the `value` property.\n * @param args.value - The heading text.\n * @returns The heading node as object.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * const node = heading({ value: 'Hello, world!' });\n * const node = heading('Hello, world!');\n */\nexport const heading = createBuilder(NodeType.Heading, HeadingStruct, [\n 'value',\n]);\n","import type { Infer } from 'superstruct';\nimport { assign, literal, object, refine, string } from 'superstruct';\n\nimport { isSvg } from '../../internals';\nimport { createBuilder } from '../builder';\nimport { NodeStruct, NodeType } from '../nodes';\n\n/**\n * Get a Struct that validates a string as a valid SVG.\n *\n * @returns A Struct that validates a string as a valid SVG.\n * @internal\n */\nexport function svg() {\n return refine(string(), 'SVG', (value) => {\n if (!isSvg(value)) {\n return 'Value is not a valid SVG.';\n }\n\n return true;\n });\n}\n\nexport const ImageStruct = assign(\n NodeStruct,\n object({\n type: literal(NodeType.Image),\n value: svg(),\n }),\n);\n\n/**\n * An image node, that renders an SVG image.\n *\n * @property type - The type of the node. Must be the string `image`.\n * @property value - The SVG image to be rendered.\n */\nexport type Image = Infer;\n\n/**\n * Create an {@link Image} node.\n *\n * @param args - The node arguments. This can either be a string, or an object\n * with the `value` property.\n * @param args.value - The SVG image to be rendered. Must be a valid SVG string.\n * @returns The image node as object. Other image formats are supported by\n * embedding them as data URLs in the SVG.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * const node = image({ value: '' });\n * const node = image('');\n */\nexport const image = createBuilder(NodeType.Image, ImageStruct, ['value']);\n","import type { Infer, Struct } from 'superstruct';\nimport { array, assign, lazy, literal, object, union } from 'superstruct';\n\nimport { createBuilder } from '../builder';\nimport { NodeStruct, NodeType } from '../nodes';\nimport { AddressStruct } from './address';\nimport { ButtonStruct } from './button';\nimport { CopyableStruct } from './copyable';\nimport { DividerStruct } from './divider';\nimport { FormStruct } from './form';\nimport { HeadingStruct } from './heading';\nimport { ImageStruct } from './image';\nimport { InputStruct } from './input';\nimport { RowStruct } from './row';\nimport { SpinnerStruct } from './spinner';\nimport { TextStruct } from './text';\n\n/**\n * @internal\n */\nexport const ParentStruct = assign(\n NodeStruct,\n object({\n // This node references itself indirectly, so we need to use `lazy()`.\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n children: array(lazy(() => ComponentStruct)),\n }),\n);\n\n/**\n * A node which supports child nodes. This is used for nodes that render their\n * children, such as {@link Panel}.\n *\n * @property type - The type of the node.\n * @property children - The children of the node\n * @internal\n */\nexport type Parent = Infer;\n\n/**\n * @internal\n */\nexport const PanelStruct: Struct = assign(\n ParentStruct,\n object({\n type: literal(NodeType.Panel),\n }),\n);\n\n/**\n * A panel node, which renders its children.\n *\n * @property type - The type of the node, must be the string 'text'.\n * @property value - The text content of the node, either as plain text, or as a\n * markdown string.\n */\n// This node references itself indirectly, so it cannot be inferred.\nexport type Panel = {\n type: NodeType.Panel;\n children: Component[];\n};\n\n/**\n * Create a {@link Panel} node.\n *\n * @param args - The node arguments. This can be either an array of children, or\n * an object with a `children` property.\n * @param args.children - The child nodes of the panel. This can be any valid\n * {@link Component}.\n * @returns The panel node as object.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * const node = panel({\n * children: [\n * heading({ text: 'Hello, world!' }),\n * text({ text: 'This is a panel.' }),\n * ],\n * });\n *\n * const node = panel([\n * heading('Hello, world!'),\n * text('This is a panel.'),\n * ]);\n */\nexport const panel = createBuilder(NodeType.Panel, PanelStruct, ['children']);\n\n// This is defined separately from `Component` to avoid circular dependencies.\nexport const ComponentStruct = union([\n CopyableStruct,\n DividerStruct,\n HeadingStruct,\n ImageStruct,\n PanelStruct,\n SpinnerStruct,\n TextStruct,\n RowStruct,\n AddressStruct,\n InputStruct,\n FormStruct,\n ButtonStruct,\n]);\n\n/**\n * All supported component types.\n */\nexport type Component = Infer;\n","import type { Infer } from 'superstruct';\nimport { assign, literal, object, optional, string, union } from 'superstruct';\n\nimport { enumValue } from '../../internals';\nimport { createBuilder } from '../builder';\nimport { LiteralStruct, NodeType } from '../nodes';\n\nexport enum ButtonVariant {\n Primary = 'primary',\n Secondary = 'secondary',\n}\n\nexport enum ButtonType {\n Button = 'button',\n Submit = 'submit',\n}\n\nexport const ButtonStruct = assign(\n LiteralStruct,\n object({\n type: literal(NodeType.Button),\n value: string(),\n variant: optional(\n union([\n enumValue(ButtonVariant.Primary),\n enumValue(ButtonVariant.Secondary),\n ]),\n ),\n buttonType: optional(\n union([enumValue(ButtonType.Button), enumValue(ButtonType.Submit)]),\n ),\n name: optional(string()),\n }),\n);\n\n/**\n * A button node, that renders either a primary or a secondary button.\n *\n * @property type - The type of the node, must be the string 'button'.\n * @property variant - The style variant of the node, must be either 'primary' or 'secondary'.\n * @property value - The text content of the node as plain text.\n * @property buttonType - The type of the button, must be either 'button' or 'submit'.\n * @property name - An optional name to identify the button.\n */\nexport type Button = Infer;\n\n/**\n * Create a {@link Button} node.\n *\n * @param args - The node arguments. This can be either a string, or an object\n * with a `value` property. A set of optional properties can be passed.\n * @param args.variant - The optional variant of the button.\n * @param args.value - The text content of the node.\n * @param args.name - The optional name of the button.\n * @returns The text node as object.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * ```typescript\n * const node = button({ variant: 'primary', text: 'Hello, world!', name: 'myButton' });\n * const node = button('Hello, world!', 'button', 'myButton', 'primary');\n * const node = button('Hello, world!');\n * ```\n */\nexport const button = createBuilder(NodeType.Button, ButtonStruct, [\n 'value',\n 'buttonType',\n 'name',\n 'variant',\n]);\n","import type { Infer } from 'superstruct';\nimport { array, assign, literal, object, string, union } from 'superstruct';\n\nimport { createBuilder } from '../builder';\nimport { NodeStruct, NodeType } from '../nodes';\nimport { ButtonStruct } from './button';\nimport { InputStruct } from './input';\n\nexport const FormComponentStruct = union([InputStruct, ButtonStruct]);\n\n/**\n * The subset of nodes allowed as children in the {@link Form} node.\n */\nexport type FormComponent = Infer;\n\nexport const FormStruct = assign(\n NodeStruct,\n object({\n type: literal(NodeType.Form),\n children: array(FormComponentStruct),\n name: string(),\n }),\n);\n\n/**\n * A form node that takes children {@link FormComponent} nodes and renders a form.\n *\n * @property type - The type of the node. Must be the string `form`.\n * @property children - The children of the node. Only {@link FormComponent} nodes are allowed.\n * @property name - The form name used to identify it.\n */\nexport type Form = Infer;\n\n/**\n * Create a {@link Form} node.\n *\n * @param args - The node arguments. This can be either an array of children and a string, or\n * an object with a `name` and `children` property.\n * @param args.name - The form name used to identify it.\n * @param args.children - The child nodes of the form. This can be any valid\n * {@link FormComponent}.\n * @returns The form node as object.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * const node = form({\n * name: 'myForm',\n * children: [\n * input({ name: 'myInput' }),\n * button({ value: 'Hello, world!' }),\n * ],\n * });\n *\n * const node = form('myForm', [input('myInput'), button('Hello, world!')]);\n */\nexport const form = createBuilder(NodeType.Form, FormStruct, [\n 'name',\n 'children',\n]);\n","import type { Infer } from 'superstruct';\nimport { assign, literal, object, optional, string, union } from 'superstruct';\n\nimport { enumValue } from '../../internals';\nimport { createBuilder } from '../builder';\nimport { LiteralStruct, NodeType } from '../nodes';\n\n/**\n * This replicates the available input types from the metamask extension.\n * https://github.com/MetaMask/metamask-extension/develop/ui/components/component-library/input/input.constants.js\n */\nexport enum InputType {\n /* eslint-disable @typescript-eslint/no-shadow */\n Text = 'text',\n Number = 'number',\n /* eslint-enable @typescript-eslint/no-shadow */\n Password = 'password',\n}\n\nexport const InputStruct = assign(\n LiteralStruct,\n object({\n type: literal(NodeType.Input),\n value: optional(string()),\n name: string(),\n inputType: optional(\n union([\n enumValue(InputType.Text),\n enumValue(InputType.Password),\n enumValue(InputType.Number),\n ]),\n ),\n placeholder: optional(string()),\n label: optional(string()),\n error: optional(string()),\n }),\n);\n\n/**\n * An input node, that renders an input.\n *\n * @property type - The type of the node, must be the string 'input'.\n * @property name - The name for the input.\n * @property value - The value of the input.\n * @property inputType - An optional type, either `text`, `password` or `number`.\n * @property placeholder - An optional input placeholder.\n * @property label - An optional input label.\n * @property error - An optional error text.\n */\nexport type Input = Infer;\n\n/**\n * Create a {@link Input} node.\n *\n * @param args - The node arguments. This can either be a name and an optional variant, value and placeholder or an object\n * with the properties: `inputType`, `value`, `variant`, `placeholder` and `name`.\n * @param args.name - The name for the input.\n * @param args.value - The value of the input.\n * @param args.inputType - An optional type, either `text`, `password` or `number`.\n * @param args.placeholder - An optional input placeholder.\n * @param args.label - An optional input label.\n * @param args.error - An optional error text.\n * @returns The input node as an object.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * const node = input('myInput');\n * const node = input('myInput', InputType.Text, 'my placeholder', 'myValue', 'myLabel');\n * const node = input({ name: 'myInput' });\n * const node = input({name: 'myInput', value: 'myValue', inputType: InputType.Password, placeholder: 'placeholder'})\n */\nexport const input = createBuilder(NodeType.Input, InputStruct, [\n 'name',\n 'inputType',\n 'placeholder',\n 'value',\n 'label',\n]);\n","import type { Infer } from 'superstruct';\nimport { assign, literal, object, string, optional, union } from 'superstruct';\n\nimport { enumValue } from '../../internals';\nimport { createBuilder } from '../builder';\nimport { LiteralStruct, NodeType } from '../nodes';\nimport { AddressStruct } from './address';\nimport { ImageStruct } from './image';\nimport { TextStruct } from './text';\n\nexport enum RowVariant {\n Default = 'default',\n Critical = 'critical',\n Warning = 'warning',\n}\n\n// A subset of components made available to the row\nconst RowComponentStruct = union([ImageStruct, TextStruct, AddressStruct]);\n\nexport const RowStruct = assign(\n LiteralStruct,\n object({\n type: literal(NodeType.Row),\n variant: optional(\n union([\n enumValue(RowVariant.Default),\n enumValue(RowVariant.Critical),\n enumValue(RowVariant.Warning),\n ]),\n ),\n label: string(),\n value: RowComponentStruct,\n }),\n);\n\n/**\n * A row node, that renders a row with a label and a value.\n *\n * @property type - The type of the node. Must be the string `row`.\n * @property label - The label for the row.\n * @property value - A sub component to be rendered\n * on one side of the row.\n * @property variant - Optional variant for styling.\n */\nexport type Row = Infer;\n\n/**\n * Create a {@link Row} node.\n *\n * @param args - The node arguments. This can either be a string, a component and an optional variant or an object\n * with the properties: `label`, `value` and `variant`.\n * @param args.label - The label for the row.\n * @param args.value - Another component, is currently limited to `image`, `text` and `address`.\n * @param args.variant - An optional variant, either `default`, `warning` or `critical`.\n * @returns The row node as an object.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * const node = row({ label: 'Address', value: address('0x4bbeeb066ed09b7aed07bf39eee0460dfa261520') });\n * const node = row({ label: 'Address', value: address('0x4bbeeb066ed09b7aed07bf39eee0460dfa261520'), variant: RowVariant.Warning });\n * const node = row('Address', address('0x4bbeeb066ed09b7aed07bf39eee0460dfa261520'));\n * const node = row('Address', address('0x4bbeeb066ed09b7aed07bf39eee0460dfa261520'), RowVariant.Warning);\n */\nexport const row = createBuilder(NodeType.Row, RowStruct, [\n 'label',\n 'value',\n 'variant',\n]);\n","import type { Infer } from 'superstruct';\nimport {\n assign,\n boolean,\n literal,\n object,\n optional,\n string,\n} from 'superstruct';\n\nimport { createBuilder } from '../builder';\nimport { LiteralStruct, NodeType } from '../nodes';\n\nexport const TextStruct = assign(\n LiteralStruct,\n object({\n type: literal(NodeType.Text),\n value: string(),\n markdown: optional(boolean()),\n }),\n);\n\n/**\n * A text node, that renders the text as one or more paragraphs.\n *\n * @property type - The type of the node, must be the string 'text'.\n * @property value - The text content of the node, either as plain text, or as a\n * markdown string.\n * @property markdown - A flag to enable/disable markdown, if nothing is specified\n * markdown will be enabled.\n */\nexport type Text = Infer;\n\n/**\n * Create a {@link Text} node.\n *\n * @param args - The node arguments. This can be either a string\n * and a boolean, or an object with a `value` property\n * and an optional `markdown` property.\n * @param args.value - The text content of the node.\n * @param args.markdown - An optional flag to enable or disable markdown. This\n * is enabled by default.\n * @returns The text node as object.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * const node = text({ value: 'Hello, world!' });\n * const node = text('Hello, world!');\n * const node = text({ value: 'Hello, world!', markdown: false });\n * const node = text('Hello, world!', false);\n */\nexport const text = createBuilder(NodeType.Text, TextStruct, [\n 'value',\n 'markdown',\n]);\n","import type { Infer } from 'superstruct';\nimport { assign, literal, object } from 'superstruct';\n\nimport { createBuilder } from '../builder';\nimport { NodeStruct, NodeType } from '../nodes';\n\nexport const SpinnerStruct = assign(\n NodeStruct,\n object({\n type: literal(NodeType.Spinner),\n }),\n);\n\n/**\n * A spinner node, that renders a spinner, either as a full-screen overlay, or\n * inline when nested inside a {@link Panel}.\n */\nexport type Spinner = Infer;\n\n/**\n * Create a {@link Spinner} node.\n *\n * @returns The spinner node as object.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * const node = spinner();\n */\nexport const spinner = createBuilder(NodeType.Spinner, SpinnerStruct);\n","import { assertStruct } from '@metamask/utils';\nimport { is } from 'superstruct';\n\nimport { ComponentStruct } from './components';\nimport type { Component } from './components';\n\n/**\n * Check if the given value is a {@link Component}. This performs recursive\n * validation of the component's children (if any).\n *\n * @param value - The value to check.\n * @returns `true` if the value is a {@link Component}, `false` otherwise.\n */\nexport function isComponent(value: unknown): value is Component {\n return is(value, ComponentStruct);\n}\n\n/**\n * Assert that the given value is a {@link Component}. This performs recursive\n * validation of the component's children (if any).\n *\n * @param value - The value to check.\n * @throws If the value is not a {@link Component}.\n */\nexport function assertIsComponent(value: unknown): asserts value is Component {\n assertStruct(value, ComponentStruct, 'Invalid component');\n}\n","import type { ComponentOrElement } from '..';\nimport type { EnumToUnion } from '../../internals';\nimport type { ChainId } from '../caip';\n\n/**\n * The severity level of content being returned from a transaction insight.\n * Currently only one level is supported:\n *\n * - `critical` - The transaction is critical and should not be submitted by the\n * user.\n */\nexport enum SeverityLevel {\n Critical = 'critical',\n}\n\n/**\n * An EIP-1559 (type 2) transaction object.\n *\n * @property from - The address the transaction is being sent from.\n * @property to - The address the transaction is being sent to.\n * @property nonce - The nonce of the transaction.\n * @property value - The value of the transaction.\n * @property data - The data of the transaction.\n * @property gas - The gas limit of the transaction.\n * @property maxFeePerGas - The maximum fee per gas of the transaction.\n * @property maxPriorityFeePerGas - The maximum priority fee per gas of the\n * transaction.\n * @property estimateSuggested - The suggested gas price for the transaction.\n * @property estimateUsed - The gas price used for the transaction.\n * @see https://eips.ethereum.org/EIPS/eip-1559\n */\nexport type EIP1559Transaction = {\n from: string;\n to: string;\n nonce: string;\n value: string;\n data: string;\n gas: string;\n maxFeePerGas: string;\n maxPriorityFeePerGas: string;\n estimateSuggested: string;\n estimateUsed: string;\n};\n\n/**\n * A legacy (type \"0\") transaction object.\n *\n * @property from - The address the transaction is being sent from.\n * @property to - The address the transaction is being sent to.\n * @property nonce - The nonce of the transaction.\n * @property value - The value of the transaction.\n * @property data - The data of the transaction.\n * @property gas - The gas limit of the transaction.\n * @property gasPrice - The gas price of the transaction.\n * @property estimateSuggested - The suggested gas price for the transaction.\n * @property estimateUsed - The gas price used for the transaction.\n */\nexport type LegacyTransaction = {\n from: string;\n to: string;\n nonce: string;\n value: string;\n data: string;\n gas: string;\n gasPrice: string;\n estimateSuggested: string;\n estimateUsed: string;\n};\n\n/**\n * A transaction object. This can be either an EIP-1559 transaction or a legacy\n * transaction.\n *\n * @see EIP1559Transaction\n * @see LegacyTransaction\n */\nexport type Transaction = EIP1559Transaction | LegacyTransaction;\n\n/**\n * The `onTransaction` handler. This is called whenever a transaction is\n * submitted to the snap. It can return insights about the transaction, which\n * will be displayed to the user.\n *\n * Note that using this handler requires the `endowment:transaction-insights`\n * permission.\n *\n * @param args - The request arguments.\n * @param args.transaction - The transaction object, containing the address,\n * value, data, and other properties of the transaction.\n * @param args.chainId - The CAIP-2 {@link ChainId} of the network the\n * transaction is being submitted to.\n * @param args.transactionOrigin - The origin of the transaction. This is the\n * URL of the website that submitted the transaction. This is only available if\n * the Snap has enabled the `allowTransactionOrigin` option in the\n * `endowment:transaction-insight` permission.\n * @returns An object containing insights about the transaction. See\n * {@link OnTransactionResponse}. Can also return `null` if no insights are\n * available.\n */\nexport type OnTransactionHandler = (args: {\n transaction: Transaction;\n chainId: ChainId;\n transactionOrigin?: string;\n}) => Promise;\n\n/**\n * The response from a Snap's `onTransaction` handler.\n *\n * @property component - A custom UI component, that will be shown in MetaMask.\n * @property id - A Snap interface ID.\n * @property severity - The severity level of the content. Currently only one\n * level is supported: `critical`.\n */\nexport type OnTransactionResponse =\n | {\n content: ComponentOrElement;\n severity?: EnumToUnion;\n }\n | {\n id: string;\n severity?: EnumToUnion;\n };\n","import type { Infer } from 'superstruct';\nimport {\n assign,\n literal,\n nullable,\n object,\n optional,\n record,\n string,\n union,\n} from 'superstruct';\n\nimport type { InterfaceContext } from '../interface';\n\n/**\n * The type of user input event fired.\n * Currently only three events are supported:\n *\n * - `ButtonClickEvent` - A button has been clicked in the UI.\n * - `FormSubmitEvent` - A Form has been submitted in the UI.\n * - `InputChangeEvent` - The value of an input field has changed in the UI.\n */\nexport enum UserInputEventType {\n ButtonClickEvent = 'ButtonClickEvent',\n FormSubmitEvent = 'FormSubmitEvent',\n InputChangeEvent = 'InputChangeEvent',\n}\n\nexport const GenericEventStruct = object({\n type: string(),\n name: optional(string()),\n});\n\nexport const ButtonClickEventStruct = assign(\n GenericEventStruct,\n object({\n type: literal(UserInputEventType.ButtonClickEvent),\n name: optional(string()),\n }),\n);\n\nexport const FormSubmitEventStruct = assign(\n GenericEventStruct,\n object({\n type: literal(UserInputEventType.FormSubmitEvent),\n value: record(string(), nullable(string())),\n name: string(),\n }),\n);\n\nexport const InputChangeEventStruct = assign(\n GenericEventStruct,\n object({\n type: literal(UserInputEventType.InputChangeEvent),\n name: string(),\n value: string(),\n }),\n);\n\nexport const UserInputEventStruct = union([\n ButtonClickEventStruct,\n FormSubmitEventStruct,\n InputChangeEventStruct,\n]);\n\n/**\n * A user input event fired in the UI. This is passed to the params of the `onUserInput` handler.\n *\n * @property type - The type of event fired. See {@link UserInputEventType} for the different types.\n * @property name - The component name that fired the event. It is optional for an {@link UserInputEventType.ButtonClickEvent}.\n * @property value - The value associated with the event. Only available when an {@link UserInputEventType.FormSubmitEvent} is fired.\n * It contains the form values submitted.\n */\nexport type UserInputEvent = Infer;\n\n/**\n * The `onUserInput` handler. This is called when an user input event is fired in the UI.\n *\n * @param args - The user input event.\n * @param args.id - The user interface id.\n * @param args.event - The {@link UserInputEvent} object, containing the data about the fired event.\n */\nexport type OnUserInputHandler = (args: {\n id: string;\n event: UserInputEvent;\n context: InterfaceContext | null;\n}) => Promise;\n","import type { ComponentOrElement } from '..';\nimport type { EnumToUnion } from '../../internals';\n\n/**\n * The type of dialog to display.\n *\n * - `alert` - A dialog with a single button.\n * - `confirmation` - A dialog with two buttons, one to confirm and one to\n * cancel.\n * - `prompt` - A dialog with two buttons and a text input.\n */\nexport enum DialogType {\n Alert = 'alert',\n Confirmation = 'confirmation',\n Prompt = 'prompt',\n}\n\n/**\n * An alert dialog.\n *\n * @property type - The type of dialog. Must be `alert`.\n * @property content - The content to display in the dialog.\n * @property id - The Snap interface ID.\n */\nexport type AlertDialog =\n | {\n type: EnumToUnion;\n content: ComponentOrElement;\n }\n | {\n type: EnumToUnion;\n id: string;\n };\n\n/**\n * A confirmation dialog.\n *\n * @property type - The type of dialog. Must be `confirmation`.\n * @property content - The content to display in the dialog.\n * @property id - The Snap interface ID.\n */\nexport type ConfirmationDialog =\n | {\n type: EnumToUnion;\n content: ComponentOrElement;\n }\n | {\n type: EnumToUnion;\n id: string;\n };\n\n/**\n * A prompt dialog.\n *\n * @property type - The type of dialog. Must be `prompt`.\n * @property content - The content to display in the dialog.\n * @property id - The Snap interface ID.\n * @property placeholder - An optional placeholder text to display in the text\n * input.\n */\nexport type PromptDialog =\n | {\n type: EnumToUnion;\n content: ComponentOrElement;\n placeholder?: string;\n }\n | {\n type: EnumToUnion;\n id: string;\n placeholder?: string;\n };\n\n/**\n * The request parameters for the `snap_dialog` method.\n *\n * @property type - The type of dialog to display.\n * @property content - The content to display in the dialog.\n * @property id - The Snap interface ID.\n * @property placeholder - The placeholder text to display in the dialog. Only\n * applicable for the `prompt` dialog.\n */\nexport type DialogParams = AlertDialog | ConfirmationDialog | PromptDialog;\n\n/**\n * The result returned by the `snap_dialog` method.\n *\n * - If the dialog is an `alert`, the result is `null`.\n * - If the dialog is a `confirmation`, the result is a boolean indicating\n * whether the user confirmed the dialog.\n * - If the dialog is a `prompt`, the result is the value entered by\n * the user.\n */\nexport type DialogResult = null | boolean | string;\n","import type { EnumToUnion } from '../../internals';\n\n/**\n * The encoding to use when retrieving the file. Defaults to `Base64`.\n */\nexport enum AuxiliaryFileEncoding {\n Base64 = 'base64',\n Hex = 'hex',\n Utf8 = 'utf8',\n}\n\n/**\n * The request parameters for the `snap_getFile` method.\n *\n * @property path - The path to the file to retrieve.\n * @property encoding - The encoding to use when retrieving the file.\n */\nexport type GetFileParams = {\n path: string;\n encoding?: EnumToUnion;\n};\n\n/**\n * The result returned by the `snap_getFile` method.\n */\nexport type GetFileResult = string;\n","import type { Json } from '@metamask/utils';\n\nimport type { EnumToUnion } from '../../internals';\n\n/**\n * The operations that can be performed on the state.\n */\nexport enum ManageStateOperation {\n ClearState = 'clear',\n GetState = 'get',\n UpdateState = 'update',\n}\n\n/**\n * The clear state operation, which clears the state.\n *\n * @property operation - The operation to perform on the state. Must be `clear`.\n * @property encrypted - Whether to use the separate encrypted state, or the\n * unencrypted state. Defaults to the encrypted state. Encrypted state can only\n * be used if the extension is unlocked, while unencrypted state can be used\n * whether the extension is locked or unlocked.\n */\nexport type ClearStateOperation = {\n operation: EnumToUnion;\n encrypted?: boolean;\n};\n\n/**\n * The get state operation, which retrieves the state.\n *\n * @property operation - The operation to perform on the state. Must be `get`.\n * @property encrypted - Whether to use the separate encrypted state, or the\n * unencrypted state. Defaults to the encrypted state. Encrypted state can only\n * be used if the extension is unlocked, while unencrypted state can be used\n * whether the extension is locked or unlocked.\n */\nexport type GetStateOperation = {\n operation: EnumToUnion;\n encrypted?: boolean;\n};\n\n/**\n * The update state operation, which updates the state.\n *\n * @property operation - The operation to perform on the state. Must be\n * `update`.\n * @property encrypted - Whether to use the separate encrypted state, or the\n * unencrypted state. Defaults to the encrypted state. Encrypted state can only\n * be used if the extension is unlocked, while unencrypted state can be used\n * whether the extension is locked or unlocked.\n * @property newState - The new state to set.\n */\nexport type UpdateStateOperation = {\n operation: EnumToUnion;\n encrypted?: boolean;\n newState: Record;\n};\n\n/**\n * The request parameters for the `snap_manageState` method.\n *\n * @property operation - The operation to perform on the state.\n * @property encrypted - Whether to use the separate encrypted state, or the\n * unencrypted state. Defaults to the encrypted state.\n * @property newState - The new state to set. Only applicable for the `set`\n * operation.\n */\nexport type ManageStateParams =\n | ClearStateOperation\n | GetStateOperation\n | UpdateStateOperation;\n\n/**\n * The result returned by the `snap_manageState` method.\n *\n * If the operation is `get`, the result is the state. Otherwise, the result is\n * `null`.\n */\nexport type ManageStateResult = Record | null;\n","import type { EnumToUnion } from '../../internals';\n\n/**\n * The types of notifications that can be displayed.\n *\n * - `InApp` - A notification that is displayed in by the MetaMask extension.\n * - `Native` - A notification that is displayed by the operating system.\n */\nexport enum NotificationType {\n InApp = 'inApp',\n Native = 'native',\n}\n\n/**\n * The request parameters for the `snap_notify` method.\n *\n * @property type - The type of notification to display.\n * @property message - The message to display in the notification.\n */\nexport type NotifyParams = {\n type: EnumToUnion;\n message: string;\n};\n\n/**\n * The result returned by the `snap_notify` method.\n *\n * This method does not return anything.\n */\nexport type NotifyResult = null;\n","import { JsonStruct } from '@metamask/utils';\nimport type { Infer } from 'superstruct';\nimport { nullable, record, string, union } from 'superstruct';\n\nimport type { JSXElement } from '../jsx';\nimport { RootJSXElementStruct } from '../jsx';\nimport type { Component } from '../ui';\nimport { ComponentStruct } from '../ui';\n\n/**\n * To avoid typing problems with the interface state when manipulating it we have to differentiate the state of\n * a form (that will be contained inside the root state) and the root state since a key in the root stat can contain\n * either the value of an input or a sub-state of a form.\n */\n\nexport const FormStateStruct = record(string(), nullable(string()));\n\nexport const InterfaceStateStruct = record(\n string(),\n union([FormStateStruct, nullable(string())]),\n);\n\nexport type FormState = Infer;\nexport type InterfaceState = Infer;\n\nexport type ComponentOrElement = Component | JSXElement;\nexport const ComponentOrElementStruct = union([\n ComponentStruct,\n RootJSXElementStruct,\n]);\n\nexport const InterfaceContextStruct = record(string(), JsonStruct);\nexport type InterfaceContext = Infer;\n","import {\n hasProperty,\n HexChecksumAddressStruct,\n isPlainObject,\n JsonStruct,\n} from '@metamask/utils';\nimport type { Struct } from 'superstruct';\nimport {\n is,\n boolean,\n optional,\n array,\n lazy,\n nullable,\n number,\n object,\n record,\n string,\n tuple,\n} from 'superstruct';\nimport type { ObjectSchema } from 'superstruct';\n\nimport type { Describe } from '../internals';\nimport { literal, nullUnion } from '../internals';\nimport type { EmptyObject } from '../types';\nimport type {\n GenericSnapElement,\n JsonObject,\n Key,\n MaybeArray,\n SnapElement,\n StringElement,\n} from './component';\nimport type {\n AddressElement,\n BoldElement,\n BoxElement,\n ButtonElement,\n CopyableElement,\n DividerElement,\n DropdownElement,\n OptionElement,\n FieldElement,\n FormElement,\n HeadingElement,\n ImageElement,\n InputElement,\n ItalicElement,\n JSXElement,\n LinkElement,\n RowElement,\n SpinnerElement,\n StandardFormattingElement,\n TextElement,\n ValueElement,\n} from './components';\n\n/**\n * A struct for the {@link Key} type.\n */\nexport const KeyStruct: Describe = nullUnion([string(), number()]);\n\n/**\n * A struct for the {@link StringElement} type.\n */\nexport const StringElementStruct: Describe = maybeArray(\n string(),\n);\n\n/**\n * A struct for the {@link GenericSnapElement} type.\n */\nexport const ElementStruct: Describe = object({\n type: string(),\n props: record(string(), JsonStruct),\n key: nullable(KeyStruct),\n});\n\n/**\n * A helper function for creating a struct for a {@link MaybeArray} type.\n *\n * @param struct - The struct for the maybe array type.\n * @returns The struct for the maybe array type.\n */\nfunction maybeArray(\n struct: Struct,\n): Struct, any> {\n return nullUnion([struct, array(struct)]);\n}\n\n/**\n * A helper function for creating a struct for a JSX element.\n *\n * @param name - The name of the element.\n * @param props - The props of the element.\n * @returns The struct for the element.\n */\nfunction element(\n name: Name,\n props: Props = {} as Props,\n) {\n return object({\n type: literal(name) as unknown as Struct,\n props: object(props),\n key: nullable(KeyStruct),\n });\n}\n\n/**\n * A struct for the {@link ButtonElement} type.\n */\nexport const ButtonStruct: Describe = element('Button', {\n children: StringElementStruct,\n name: optional(string()),\n type: optional(nullUnion([literal('button'), literal('submit')])),\n variant: optional(nullUnion([literal('primary'), literal('destructive')])),\n disabled: optional(boolean()),\n});\n\n/**\n * A struct for the {@link InputElement} type.\n */\nexport const InputStruct: Describe = element('Input', {\n name: string(),\n type: optional(\n nullUnion([literal('text'), literal('password'), literal('number')]),\n ),\n value: optional(string()),\n placeholder: optional(string()),\n});\n\n/**\n * A struct for the {@link OptionElement} type.\n */\nexport const OptionStruct: Describe = element('Option', {\n value: string(),\n children: string(),\n});\n\n/**\n * A struct for the {@link DropdownElement} type.\n */\nexport const DropdownStruct: Describe = element('Dropdown', {\n name: string(),\n value: optional(string()),\n children: maybeArray(OptionStruct),\n});\n\n/**\n * A struct for the {@link FieldElement} type.\n */\nexport const FieldStruct: Describe = element('Field', {\n label: optional(string()),\n error: optional(string()),\n children: nullUnion([\n tuple([InputStruct, ButtonStruct]),\n InputStruct,\n DropdownStruct,\n ]),\n});\n\n/**\n * A struct for the {@link FormElement} type.\n */\nexport const FormStruct: Describe = element('Form', {\n children: maybeArray(nullUnion([FieldStruct, ButtonStruct])),\n name: string(),\n});\n\n/**\n * A struct for the {@link BoldElement} type.\n */\nexport const BoldStruct: Describe = element('Bold', {\n children: maybeArray(\n nullable(\n nullUnion([\n string(),\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n lazy(() => ItalicStruct) as unknown as Struct<\n SnapElement\n >,\n ]),\n ),\n ),\n});\n\n/**\n * A struct for the {@link ItalicElement} type.\n */\nexport const ItalicStruct: Describe = element('Italic', {\n children: maybeArray(\n nullable(\n nullUnion([\n string(),\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n lazy(() => BoldStruct) as unknown as Struct<\n SnapElement\n >,\n ]),\n ),\n ),\n});\n\nexport const FormattingStruct: Describe = nullUnion([\n BoldStruct,\n ItalicStruct,\n]);\n\n/**\n * A struct for the {@link AddressElement} type.\n */\nexport const AddressStruct: Describe = element('Address', {\n address: HexChecksumAddressStruct,\n});\n\n/**\n * A struct for the {@link BoxElement} type.\n */\nexport const BoxStruct: Describe = element('Box', {\n children: maybeArray(\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n nullable(lazy(() => BoxChildStruct)),\n ) as unknown as Struct, null>,\n direction: optional(nullUnion([literal('horizontal'), literal('vertical')])),\n alignment: optional(\n nullUnion([\n literal('start'),\n literal('center'),\n literal('end'),\n literal('space-between'),\n literal('space-around'),\n ]),\n ),\n});\n\n/**\n * A struct for the {@link CopyableElement} type.\n */\nexport const CopyableStruct: Describe = element('Copyable', {\n value: string(),\n sensitive: optional(boolean()),\n});\n\n/**\n * A struct for the {@link DividerElement} type.\n */\nexport const DividerStruct: Describe = element('Divider');\n\n/**\n * A struct for the {@link ValueElement} type.\n */\nexport const ValueStruct: Describe = element('Value', {\n value: string(),\n extra: string(),\n});\n\n/**\n * A struct for the {@link HeadingElement} type.\n */\nexport const HeadingStruct: Describe = element('Heading', {\n children: StringElementStruct,\n});\n\n/**\n * A struct for the {@link ImageElement} type.\n */\nexport const ImageStruct: Describe = element('Image', {\n src: string(),\n alt: optional(string()),\n});\n\n/**\n * A struct for the {@link LinkElement} type.\n */\nexport const LinkStruct: Describe = element('Link', {\n href: string(),\n children: maybeArray(nullable(nullUnion([FormattingStruct, string()]))),\n});\n\n/**\n * A struct for the {@link TextElement} type.\n */\nexport const TextStruct: Describe = element('Text', {\n children: maybeArray(\n nullable(nullUnion([string(), BoldStruct, ItalicStruct, LinkStruct])),\n ),\n});\n\n/**\n * A struct for the {@link RowElement} type.\n */\nexport const RowStruct: Describe = element('Row', {\n label: string(),\n children: nullUnion([AddressStruct, ImageStruct, TextStruct, ValueStruct]),\n variant: optional(\n nullUnion([literal('default'), literal('warning'), literal('error')]),\n ),\n});\n\n/**\n * A struct for the {@link SpinnerElement} type.\n */\nexport const SpinnerStruct: Describe = element('Spinner');\n\n/**\n * A subset of JSX elements that are allowed as children of the Box component.\n * This set should include all components, except components that need to be nested\n * in another component (e.g. Field must be contained in a Form).\n */\nexport const BoxChildStruct = nullUnion([\n ButtonStruct,\n InputStruct,\n FormStruct,\n BoldStruct,\n ItalicStruct,\n AddressStruct,\n BoxStruct,\n CopyableStruct,\n DividerStruct,\n HeadingStruct,\n ImageStruct,\n LinkStruct,\n RowStruct,\n SpinnerStruct,\n TextStruct,\n DropdownStruct,\n]);\n\n/**\n * For now, the allowed JSX elements at the root are the same as the allowed\n * children of the Box component.\n */\nexport const RootJSXElementStruct = BoxChildStruct;\n\n/**\n * A struct for the {@link JSXElement} type.\n */\nexport const JSXElementStruct: Describe = nullUnion([\n ButtonStruct,\n InputStruct,\n FieldStruct,\n FormStruct,\n BoldStruct,\n ItalicStruct,\n AddressStruct,\n BoxStruct,\n CopyableStruct,\n DividerStruct,\n HeadingStruct,\n ImageStruct,\n LinkStruct,\n RowStruct,\n SpinnerStruct,\n TextStruct,\n DropdownStruct,\n OptionStruct,\n ValueStruct,\n]);\n\n/**\n * Check if a value is a JSX element.\n *\n * @param value - The value to check.\n * @returns True if the value is a JSX element, false otherwise.\n */\nexport function isJSXElement(value: unknown): value is JSXElement {\n return is(value, JSXElementStruct);\n}\n\n/**\n * Check if a value is a JSX element, without validating all of its contents.\n * This is useful when you want to validate the structure of a value, but not\n * all the children.\n *\n * This should only be used when you are sure that the value is safe to use,\n * i.e., after using {@link isJSXElement}.\n *\n * @param value - The value to check.\n * @returns True if the value is a JSX element, false otherwise.\n */\nexport function isJSXElementUnsafe(value: unknown): value is JSXElement {\n return (\n isPlainObject(value) &&\n hasProperty(value, 'type') &&\n hasProperty(value, 'props') &&\n hasProperty(value, 'key')\n );\n}\n\n/**\n * Assert that a value is a JSX element.\n *\n * @param value - The value to check.\n * @throws If the value is not a JSX element.\n */\nexport function assertJSXElement(value: unknown): asserts value is JSXElement {\n // TODO: We should use the error parsing utils from `snaps-utils` to improve\n // the error messages. It currently includes colours and potentially other\n // formatting that we might not want to include in the SDK.\n if (!isJSXElement(value)) {\n throw new Error(\n `Expected a JSX element, but received ${JSON.stringify(\n value,\n )}. Please refer to the documentation for the supported JSX elements and their props.`,\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAcO,IAAM,YAAN,cAAwB,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAqBnC,YACE,OACA,OAA6B,CAAC,GAC9B;AACA,UAAM,UAAU,gBAAgB,KAAK;AACrC,UAAM,OAAO;AAzBf,uBAAS,OAAT;AAEA,uBAAS,UAAT;AAEA,uBAAS,OAAT;AAEA,uBAAS,QAAT;AAqBE,uBAAK,UAAW;AAChB,uBAAK,OAAQ,aAAa,KAAK;AAE/B,UAAM,aAAa,EAAE,GAAG,aAAa,KAAK,GAAG,GAAG,KAAK;AACrD,QAAI,OAAO,KAAK,UAAU,EAAE,SAAS,GAAG;AACtC,yBAAK,OAAQ;AAAA,IACf;AAEA,uBAAK,QAAS,MAAM;AAAA,EACtB;AA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A;AAAA,EACA;AAAA,EACAE;AAAA,EACA;AAAA,EACAE;AAAA,EACAC;AAAA,EACAC;AAAA,EACAC;AAAA,EACA;AAAA,EACAE;AAAA,EACAC;AAAA,EACAF;AAAA,EACA;AACF,CAAC;AAMM,IAAM,uBAAuB;AAK7B,IAAM,mBAAyC,UAAU;AAAA,EAC9DZ;AAAA,EACAG;AAAA,EACA;AAAA,EACAC;AAAA,EACA;AAAA,EACA;AAAA,EACAE;AAAA,EACA;AAAA,EACAE;AAAA,EACAC;AAAA,EACAC;AAAA,EACAC;AAAA,EACA;AAAA,EACAE;AAAA,EACAC;AAAA,EACAF;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;;;ADtVM,IAAM,kBAAkBG,QAAOC,SAAO,GAAGC,UAASD,SAAO,CAAC,CAAC;AAE3D,IAAM,uBAAuBD;AAAA,EAClCC,SAAO;AAAA,EACPE,OAAM,CAAC,iBAAiBD,UAASD,SAAO,CAAC,CAAC,CAAC;AAC7C;AAMO,IAAM,2BAA2BE,OAAM;AAAA,EAC5C;AAAA,EACA;AACF,CAAC;AAEM,IAAM,yBAAyBH,QAAOC,SAAO,GAAGG,WAAU;","names":["error","hasProperty","isObject","svg","assert","assert","assign","literal","object","node","NodeType","assign","object","literal","assign","literal","object","string","assign","object","literal","string","assign","literal","object","assign","object","literal","assign","literal","object","string","assign","object","literal","string","assign","literal","object","string","string","assign","object","literal","array","assign","literal","object","union","assign","literal","object","optional","string","union","ButtonVariant","ButtonType","assign","object","literal","string","optional","union","assign","literal","object","string","union","assign","literal","object","optional","string","union","InputType","assign","object","literal","optional","string","union","union","assign","object","literal","string","assign","literal","object","string","optional","union","assign","boolean","literal","object","optional","string","assign","object","literal","string","optional","boolean","RowVariant","union","assign","object","literal","optional","string","assign","literal","object","assign","object","literal","assign","object","array","literal","union","assertStruct","assertStruct","assert","SeverityLevel","assign","literal","object","optional","string","union","UserInputEventType","DialogType","AuxiliaryFileEncoding","ManageStateOperation","NotificationType","JsonStruct","nullable","record","string","union","hasProperty","HexChecksumAddressStruct","isPlainObject","is","boolean","optional","array","lazy","nullable","object","record","string","string","object","record","nullable","array","ButtonStruct","optional","boolean","InputStruct","FormStruct","lazy","AddressStruct","HexChecksumAddressStruct","CopyableStruct","DividerStruct","HeadingStruct","ImageStruct","TextStruct","RowStruct","SpinnerStruct","record","string","nullable","union","JsonStruct"]} +\ No newline at end of file +diff --git a/dist/jsx/index.js.map b/dist/jsx/index.js.map +index 4cda1449ef3341a5cdc62075e62c1d2850fc8be2..92f7a08191f98c0aae8f43bb15606a5d7aba0c7c 100644 +--- a/dist/jsx/index.js.map ++++ b/dist/jsx/index.js.map +@@ -1 +1 @@ +-{"version":3,"sources":["../../src/jsx/index.ts","../../src/jsx/component.ts","../../src/jsx/components/form/Button.ts","../../src/jsx/components/form/Dropdown.ts","../../src/jsx/components/form/Option.ts","../../src/jsx/components/form/Field.ts","../../src/jsx/components/form/Form.ts","../../src/jsx/components/form/Input.ts","../../src/jsx/components/formatting/Bold.ts","../../src/jsx/components/formatting/Italic.ts","../../src/jsx/components/Address.ts","../../src/jsx/components/Box.ts","../../src/jsx/components/Copyable.ts","../../src/jsx/components/Divider.ts","../../src/jsx/components/Value.ts","../../src/jsx/components/Heading.ts","../../src/jsx/components/Image.ts","../../src/jsx/components/Link.ts","../../src/jsx/components/Row.ts","../../src/jsx/components/Spinner.ts","../../src/jsx/components/Text.ts","../../src/jsx/jsx-runtime.ts","../../src/jsx/validation.ts","../../src/internals/structs.ts","../../src/internals/jsx.ts","../../src/jsx/jsx-dev-runtime.ts"],"sourcesContent":["export * from './component';\nexport * from './components';\nexport * from './jsx-runtime';\nexport * from './jsx-dev-runtime';\nexport {\n JSXElementStruct,\n RootJSXElementStruct,\n isJSXElement,\n isJSXElementUnsafe,\n assertJSXElement,\n} from './validation';\n","import type { Json } from '@metamask/utils';\n\n/**\n * A key, which can be a string or a number.\n */\nexport type Key = string | number;\n\n/**\n * A JSON object.\n */\nexport type JsonObject = Record;\n\n/**\n * A generic JSX element.\n *\n * @property type - The type of the element.\n * @property props - The props of the element.\n * @property key - The key of the element.\n */\nexport type GenericSnapElement = {\n type: string;\n props: JsonObject;\n key: Key | null;\n};\n\n/**\n * A JSX element.\n *\n * @property type - The type of the element.\n * @property props - The props of the element.\n * @property key - The key of the element.\n */\nexport type SnapElement<\n Props extends JsonObject = Record,\n Type extends string = string,\n> = {\n type: Type;\n props: Props;\n key: Key | null;\n};\n\n/**\n * A type that can be a single value or an array of values.\n *\n * @template Type - The type that can be an array.\n * @example\n * type MaybeArrayString = MaybeArray;\n * const maybeArrayString: MaybeArrayString = 'hello';\n * const maybeArrayStringArray: MaybeArrayString = ['hello', 'world'];\n */\nexport type MaybeArray = Type | Type[];\n\n/**\n * A JSX node, which can be an element, a string, null, or an array of nodes.\n */\nexport type SnapNode = MaybeArray;\n\n/**\n * A JSX string element, which can be a string or an array of strings.\n */\nexport type StringElement = MaybeArray;\n\n/**\n * A JSX component.\n */\nexport type SnapComponent<\n Props extends JsonObject = Record,\n Type extends string = string,\n> = (props: Props & { key?: Key | null }) => SnapElement;\n\n/**\n * Remove undefined props from an object.\n *\n * @param props - The object to remove undefined props from.\n * @returns The object without undefined props.\n */\nfunction removeUndefinedProps(props: Props): Props {\n return Object.fromEntries(\n Object.entries(props).filter(([, value]) => value !== undefined),\n ) as Props;\n}\n\n/**\n * Create a Snap component from a type. This is a helper function that creates a\n * Snap component function.\n *\n * @param type - The type of the component.\n * @returns A function that creates a Snap element.\n * @see SnapComponent\n */\nexport function createSnapComponent<\n Props extends JsonObject = Record,\n Type extends string = string,\n>(type: Type): SnapComponent {\n return (props: Props & { key?: Key | null }) => {\n const { key = null, ...rest } = props;\n return {\n type,\n props: removeUndefinedProps(rest as Props),\n key,\n };\n };\n}\n","import type { StringElement } from '../../component';\nimport { createSnapComponent } from '../../component';\n\n// TODO: Add the `onClick` prop to the `ButtonProps` type.\n\n/**\n * The props of the {@link Button} component.\n *\n * @property children - The text to display on the button.\n * @property name - The name of the button. This is used to identify the button\n * in the event handler.\n * @property type - The type of the button, i.e., `'button'` or `'submit'`.\n * Defaults to `'button'`.\n * @property variant - The variant of the button, i.e., `'primary'` or\n * `'destructive'`. Defaults to `'primary'`.\n * @property disabled - Whether the button is disabled. Defaults to `false`.\n */\nexport type ButtonProps = {\n children: StringElement;\n name?: string | undefined;\n type?: 'button' | 'submit' | undefined;\n variant?: 'primary' | 'destructive' | undefined;\n disabled?: boolean | undefined;\n};\n\nconst TYPE = 'Button';\n\n/**\n * A button component, which is used to create a clickable button.\n *\n * @param props - The props of the component.\n * @param props.children - The text to display on the button. This should be a\n * string or an array of strings.\n * @returns A button element.\n * @example\n * \n */\nexport const Button = createSnapComponent(TYPE);\n\n/**\n * A button element.\n *\n * @see Button\n */\nexport type ButtonElement = ReturnType;\n","import type { MaybeArray } from '../../component';\nimport { createSnapComponent } from '../../component';\nimport type { OptionElement } from './Option';\n\n/**\n * The props of the {@link Dropdown} component.\n *\n * @property name - The name of the dropdown. This is used to identify the\n * state in the form data.\n * @property value - The selected value of the dropdown.\n * @property children - The children of the dropdown.\n */\ntype DropdownProps = {\n name: string;\n value?: string;\n children: MaybeArray;\n};\n\nconst TYPE = 'Dropdown';\n\n/**\n * A dropdown component, which is used to create a dropdown. This component\n * can only be used as a child of the {@link Field} component.\n *\n * @param props - The props of the component.\n * @param props.name - The name of the dropdown field. This is used to identify the\n * state in the form data.\n * @param props.value - The selected value of the dropdown.\n * @param props.children - The children of the dropdown.\n * @returns A dropdown element.\n * @example\n * \n * \n * \n * \n * \n */\nexport const Dropdown = createSnapComponent(TYPE);\n\n/**\n * A dropdown element.\n *\n * @see Dropdown\n */\nexport type DropdownElement = ReturnType;\n","import { createSnapComponent } from '../../component';\n\n/**\n * The props of the {@link Option} component.\n *\n * @property value - The value of the dropdown option. This is used to populate the\n * state in the form data.\n * @property children - The text to display.\n */\ntype OptionProps = {\n value: string;\n children: string;\n};\n\nconst TYPE = 'Option';\n\n/**\n * A dropdown option component, which is used to create a dropdown option. This component\n * can only be used as a child of the {@link Dropdown} component.\n *\n * @param props - The props of the component.\n * @param props.value - The value of the dropdown option. This is used to populate the\n * state in the form data.\n * @param props.children - The text to display.\n * @returns A dropdown option element.\n * @example\n * \n * \n * \n * \n * \n */\nexport const Option = createSnapComponent(TYPE);\n\n/**\n * A dropdown option element.\n *\n * @see Option\n */\nexport type OptionElement = ReturnType;\n","import { createSnapComponent } from '../../component';\nimport type { ButtonElement } from './Button';\nimport type { DropdownElement } from './Dropdown';\nimport type { InputElement } from './Input';\n\n/**\n * The props of the {@link Field} component.\n *\n * @property label - The label of the field.\n * @property error - The error message of the field.\n * @property children - The input field and the submit button.\n */\nexport type FieldProps = {\n label?: string | undefined;\n error?: string | undefined;\n children: [InputElement, ButtonElement] | InputElement | DropdownElement;\n};\n\nconst TYPE = 'Field';\n\n/**\n * A field component, which is used to create a form field. This component can\n * only be used as a child of the {@link Form} component.\n *\n * @param props - The props of the component.\n * @param props.label - The label of the field.\n * @param props.error - The error message of the field.\n * @param props.children - The input field and the submit button.\n * @returns A field element.\n * @example\n * \n * \n * \n * \n */\nexport const Field = createSnapComponent(TYPE);\n\n/**\n * A field element.\n *\n * @see Field\n */\nexport type FieldElement = ReturnType;\n","import type { MaybeArray } from '../../component';\nimport { createSnapComponent } from '../../component';\nimport type { ButtonElement } from './Button';\nimport type { FieldElement } from './Field';\n\n// TODO: Add `onSubmit` prop to the `FormProps` type.\n\n/**\n * The props of the {@link Form} component.\n *\n * @property children - The form fields. See {@link Field}.\n * @property name - The name of the form. This is used to identify the form in\n * the event handler.\n */\ntype FormProps = {\n children: MaybeArray;\n name: string;\n};\n\nconst TYPE = 'Form';\n\n/**\n * A form component, which is used to create a form.\n *\n * @param props - The props of the component.\n * @param props.children - The form fields. This should be a single field or an\n * array of fields.\n * @param props.name - The name of the form. This is used to identify the form\n * in the event handler.\n * @returns A form element.\n * @example\n *
\n * \n * \n * \n * \n *
\n */\nexport const Form = createSnapComponent(TYPE);\n\n/**\n * A form element.\n *\n * @see Form\n */\nexport type FormElement = ReturnType;\n","import { createSnapComponent } from '../../component';\n\n// TODO: Add the `onChange` prop to the `InputProps` type.\n\n/**\n * The props of the {@link Input} component.\n *\n * @property name - The name of the input field. This is used to identify the\n * input field in the form data.\n * @property type - The type of the input field. Defaults to `text`.\n * @property value - The value of the input field.\n * @property placeholder - The placeholder text of the input field.\n */\ntype InputProps = {\n name: string;\n type?: 'text' | 'password' | 'number' | undefined;\n value?: string | undefined;\n placeholder?: string | undefined;\n};\n\nconst TYPE = 'Input';\n\n/**\n * An input component, which is used to create an input field. This component\n * can only be used as a child of the {@link Field} component.\n *\n * @param props - The props of the component.\n * @param props.name - The name of the input field. This is used to identify the\n * input field in the form data.\n * @param props.type - The type of the input field.\n * @param props.value - The value of the input field.\n * @param props.placeholder - The placeholder text of the input field.\n * @returns An input element.\n * @example\n * \n */\nexport const Input = createSnapComponent(TYPE);\n\n/**\n * An input element.\n *\n * @see Input\n */\nexport type InputElement = ReturnType;\n","import type { JsonObject, MaybeArray, SnapElement } from '../../component';\nimport { createSnapComponent } from '../../component';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { Text } from '../Text';\n\n/**\n * The children of the {@link Bold} component.\n */\nexport type BoldChildren = MaybeArray<\n | string\n // We have to specify the type here to avoid a circular reference.\n | SnapElement\n | null\n>;\n\n/**\n * The props of the {@link Bold} component.\n *\n * @property children - The text to display in bold.\n */\nexport type BoldProps = {\n children: BoldChildren;\n};\n\nconst TYPE = 'Bold';\n\n/**\n * A bold component, which is used to display text in bold. This component can\n * only be used as a child of the {@link Text} component.\n *\n * @param props - The props of the component.\n * @param props.children - The text to display in bold.\n * @returns A bold element.\n * @example\n * \n * Hello world!\n * \n */\nexport const Bold = createSnapComponent(TYPE);\n\n/**\n * A bold element.\n *\n * @see Bold\n */\nexport type BoldElement = ReturnType;\n","import type { JsonObject, MaybeArray, SnapElement } from '../../component';\nimport { createSnapComponent } from '../../component';\n\n/**\n * The children of the {@link Italic} component.\n */\nexport type ItalicChildren = MaybeArray<\n | string\n // We have to specify the type here to avoid a circular reference.\n | SnapElement\n | null\n>;\n\n/**\n * The props of the {@link Italic} component.\n *\n * @property children - The text to display in italic. This should be a string\n * or an array of strings.\n */\nexport type ItalicProps = {\n children: ItalicChildren;\n};\n\nconst TYPE = 'Italic';\n\n/**\n * An italic component, which is used to display text in italic. This componen\n * can only be used as a child of the {@link Text} component.\n *\n * @param props - The props of the component.\n * @param props.children - The text to display in italic. This should be a\n * string or an array of strings.\n * @returns An italic element.\n * @example\n * \n * Hello world!\n * \n */\nexport const Italic = createSnapComponent(TYPE);\n\n/**\n * An italic element.\n *\n * @see Italic\n */\nexport type ItalicElement = ReturnType;\n","import { createSnapComponent } from '../component';\n\n/**\n * The props of the {@link Address} component.\n *\n * @property address - The (Ethereum) address to display. This should be a\n * valid Ethereum address, starting with `0x`.\n */\nexport type AddressProps = {\n address: `0x${string}`;\n};\n\nconst TYPE = 'Address';\n\n/**\n * An address component, which is used to display an Ethereum address.\n *\n * This component does not accept any children.\n *\n * @param props - The props of the component.\n * @param props.address - The (Ethereum) address to display. This should be a\n * valid Ethereum address, starting with `0x`.\n * @returns An address element.\n * @example\n *
\n */\nexport const Address = createSnapComponent(TYPE);\n\n/**\n * An address element.\n *\n * @see Address\n */\nexport type AddressElement = ReturnType;\n","import type { GenericSnapElement, MaybeArray } from '../component';\nimport { createSnapComponent } from '../component';\n\n/**\n * The props of the {@link Box} component.\n *\n * @property children - The children of the box.\n * @property direction - The direction to stack the components within the box. Defaults to `vertical`.\n * @property alignment - The alignment mode to use within the box. Defaults to `start`.\n */\nexport type BoxProps = {\n // We can't use `JSXElement` because it causes a circular reference.\n children: MaybeArray;\n direction?: 'vertical' | 'horizontal';\n alignment?: 'start' | 'center' | 'end' | 'space-between' | 'space-around';\n};\n\nconst TYPE = 'Box';\n\n/**\n * A box component, which is used to group multiple components together.\n *\n * @param props - The props of the component.\n * @param props.children - The children of the box.\n * @returns A box element.\n * @example\n * \n * Hello world!\n * \n */\nexport const Box = createSnapComponent(TYPE);\n\n/**\n * A box element.\n *\n * @see Box\n */\nexport type BoxElement = ReturnType;\n","import { createSnapComponent } from '../component';\n\n/**\n * The props of the {@link Copyable} component.\n *\n * @property value - The value to copy when the user clicks on the copyable\n * element.\n * @property sensitive - Whether the value is sensitive. If `true`, the value\n * will be hidden when the user is not interacting with the copyable element.\n */\nexport type CopyableProps = {\n value: string;\n sensitive?: boolean | undefined;\n};\n\nconst TYPE = 'Copyable';\n\n/**\n * A copyable component, which is used to display text that can be copied by the\n * user.\n *\n * @param props - The props of the component.\n * @param props.value - The value to copy when the user clicks on the copyable\n * element.\n * @param props.sensitive - Whether the value is sensitive. If `true`, the value\n * will be hidden when the user is not interacting with the copyable element.\n * @example\n * \n * \n */\nexport const Copyable = createSnapComponent(TYPE);\n\n/**\n * A copyable element.\n *\n * @see Copyable\n */\nexport type CopyableElement = ReturnType;\n","import { createSnapComponent } from '../component';\n\nconst TYPE = 'Divider';\n\n/**\n * A divider component, which is used to create a horizontal line between\n * elements.\n *\n * This component does not have any props.\n *\n * @returns A divider element.\n * @example\n * \n */\nexport const Divider = createSnapComponent(TYPE);\n\n/**\n * A divider element.\n *\n * @see Divider\n */\nexport type DividerElement = ReturnType;\n","import { createSnapComponent } from '../component';\n\n/**\n * The props of the {@link Value} component.\n *\n * @property value - The value shown on the right side.\n * @property extra - The extra text shown on the left side.\n */\nexport type ValueProps = {\n value: string;\n extra: string;\n};\n\nconst TYPE = 'Value';\n\n/**\n * A value component, which can be used to display two different text values side by side.\n *\n * This component can only be used as a child of the {@link Row} component.\n *\n * This component does not accept any children.\n *\n * @param props - The props of the component.\n * @param props.value - The value shown on the right side.\n * @param props.extra - The extra text shown on the left side.\n * @returns A value element.\n * @example\n * \n */\nexport const Value = createSnapComponent(TYPE);\n\n/**\n * A value element.\n *\n * @see Value\n */\nexport type ValueElement = ReturnType;\n","import type { StringElement } from '../component';\nimport { createSnapComponent } from '../component';\n\n/**\n * The props of the {@link Heading} component.\n *\n * @property children - The text to display in the heading.\n */\ntype HeadingProps = {\n children: StringElement;\n};\n\nconst TYPE = 'Heading';\n\n/**\n * A heading component, which is used to display heading text.\n *\n * @param props - The props of the component.\n * @param props.children - The text to display in the heading.\n * @returns A heading element.\n * @example\n * Hello world!\n */\nexport const Heading = createSnapComponent(TYPE);\n\n/**\n * A heading element.\n *\n * @see Heading\n */\nexport type HeadingElement = ReturnType;\n","import { createSnapComponent } from '../component';\n\n/**\n * The props of the {@link Image} component.\n *\n * @property src - The SVG image to display. This should be an SVG string, and\n * other formats such as PNG and JPEG are not supported directly. You can use\n * the `data:` URL scheme to embed images inside the SVG.\n * @property alt - The alternative text of the image, which describes the image\n * for users who cannot see it.\n */\ntype ImageProps = {\n src: string;\n alt?: string | undefined;\n};\n\nconst TYPE = 'Image';\n\n/**\n * An image component, which is used to display an image.\n *\n * This component does not accept any children.\n *\n * @param props - The props of the component.\n * @param props.src - The URL of the image to display. This should be an SVG\n * string, and other formats such as PNG and JPEG are not supported directly.\n * You can use the `data:` URL scheme to embed images inside the SVG.\n * @param props.alt - The alternative text of the image, which describes the\n * image for users who cannot see it.\n * @returns An image element.\n * @example\n * ...\" alt=\"An example image\" />\n */\nexport const Image = createSnapComponent(TYPE);\n\n/**\n * An image element.\n *\n * @see Image\n */\nexport type ImageElement = ReturnType;\n","import type { MaybeArray } from '../component';\nimport { createSnapComponent } from '../component';\nimport type { StandardFormattingElement } from './formatting';\n\n/**\n * The children of the {@link Link} component.\n */\nexport type LinkChildren = MaybeArray<\n string | StandardFormattingElement | null\n>;\n\n/**\n * The props of the {@link Link} component.\n *\n * @property children - The text to display in the link.\n * @property href - The URL to link to. This must be an `https` or `mailto` URL.\n * `http` is not allowed.\n */\nexport type LinkProps = {\n children: LinkChildren;\n href: string;\n};\n\nconst TYPE = 'Link';\n\n/**\n * A link component, which is used to display a hyperlink.\n *\n * @param props - The props of the component.\n * @param props.children - The text to display in the link.\n * @param props.href - The URL to link to. This must be an `https` or `mailto`\n * URL. `http` is not allowed.\n * @returns A link element.\n * @example\n * Click here\n */\nexport const Link = createSnapComponent(TYPE);\n\n/**\n * A link element.\n *\n * @see Link\n */\nexport type LinkElement = ReturnType;\n","import { createSnapComponent } from '../component';\nimport type { AddressElement } from './Address';\nimport type { ImageElement } from './Image';\nimport type { TextElement } from './Text';\nimport type { ValueElement } from './Value';\n\n/**\n * The children of a {@link Row} component.\n */\nexport type RowChildren =\n | AddressElement\n | ImageElement\n | TextElement\n | ValueElement;\n\n/**\n * The props of the {@link Row} component.\n *\n * @property label - The label of the row.\n * @property children - The content of the row. This can be an address, an\n * image, or text.\n * @property variant - The variant of the row.\n */\nexport type RowProps = {\n label: string;\n children: RowChildren;\n variant?: 'default' | 'warning' | 'error';\n};\n\nconst TYPE = 'Row';\n\n/**\n * A row component, which is used to display a row of information.\n *\n * @param props - The props of the component.\n * @param props.label - The label of the row.\n * @param props.children - The content of the row. This can be an address, an\n * image, or text.\n * @param props.variant - The variant of the row.\n * @returns A row element.\n * @example\n * \n *
\n * \n */\nexport const Row = createSnapComponent(TYPE);\n\n/**\n * A row element.\n *\n * @see Row\n */\nexport type RowElement = ReturnType;\n","import { createSnapComponent } from '../component';\n\nconst TYPE = 'Spinner';\n\n/**\n * A spinner component, which is used to display a spinner, indicating that some\n * operation is in progress.\n *\n * This component does not accept any props.\n *\n * @returns A spinner element.\n * @example\n * \n */\nexport const Spinner = createSnapComponent(TYPE);\n\n/**\n * A spinner element.\n *\n * @see Spinner\n */\nexport type SpinnerElement = ReturnType;\n","import type { MaybeArray } from '../component';\nimport { createSnapComponent } from '../component';\nimport type { StandardFormattingElement } from './formatting';\nimport type { LinkElement } from './Link';\n\n/**\n * The children of the {@link Text} component.\n */\nexport type TextChildren = MaybeArray<\n string | StandardFormattingElement | LinkElement | null\n>;\n\n/**\n * The props of the {@link Text} component.\n *\n * @property children - The text to display.\n */\nexport type TextProps = {\n children: TextChildren;\n};\n\nconst TYPE = 'Text';\n\n/**\n * A text component, which is used to display text.\n *\n * @param props - The props of the component.\n * @param props.children - The text to display.\n * @returns A text element.\n * @example\n * \n * Hello world!\n * \n */\nexport const Text = createSnapComponent(TYPE);\n\n/**\n * A text element.\n *\n * @see Text\n */\nexport type TextElement = ReturnType;\n","import type { JsonObject, Key, SnapComponent } from './component';\n\n/**\n * The JSX runtime for Snaps SDK components. This function is used to render\n * Snap components into a format that can be used by the Snaps.\n *\n * This is the \"production\" version of the runtime, which does not include\n * additional validation, as it is handled by MetaMask. To use this runtime,\n * specify `@metamask/snaps-sdk` as import source for JSX, and use `react-jsx`\n * as the pragma.\n *\n * @param component - The component to render.\n * @param props - The props to pass to the component.\n * @param key - The key of the component.\n * @returns The rendered component.\n * @see https://www.typescriptlang.org/tsconfig/#jsx\n */\nexport function jsx(\n component: SnapComponent,\n props: Props,\n key: Key | null,\n): unknown | null {\n if (typeof component === 'string') {\n // If component is a string, it is a built-in HTML element. This is not\n // supported in Snaps, so we throw an error.\n throw new Error(\n `An HTML element (\"${String(\n component,\n )}\") was used in a Snap component, which is not supported by Snaps UI. Please use one of the supported Snap components.`,\n );\n }\n\n if (!component) {\n // If component is undefined, a JSX fragment `<>...` was used, which is\n // not supported in Snaps.\n throw new Error(\n 'A JSX fragment was used in a Snap component, which is not supported by Snaps UI. Please use one of the supported Snap components.',\n );\n }\n\n return component({ ...props, key });\n}\n\n/**\n * The JSX runtime for Snaps SDK components. This function is used to render\n * Snap components into a format that can be used by the Snaps.\n *\n * The `jsxs` function is used for rendering nested components.\n *\n * This is the \"production\" version of the runtime, which does not include\n * additional validation, as it is handled by MetaMask. To use this runtime,\n * specify `@metamask/snaps-sdk` as import source for JSX, and use `react-jsx`\n * as the pragma.\n *\n * @param component - The component to render.\n * @param props - The props to pass to the component.\n * @param key - The key of the component.\n * @returns The rendered component.\n * @see https://www.typescriptlang.org/tsconfig/#jsx\n */\nexport function jsxs(\n component: SnapComponent,\n props: Props,\n key: Key | null,\n): unknown | null {\n return jsx(component, props, key);\n}\n","import {\n hasProperty,\n HexChecksumAddressStruct,\n isPlainObject,\n JsonStruct,\n} from '@metamask/utils';\nimport type { Struct } from 'superstruct';\nimport {\n is,\n boolean,\n optional,\n array,\n lazy,\n nullable,\n number,\n object,\n record,\n string,\n tuple,\n} from 'superstruct';\nimport type { ObjectSchema } from 'superstruct/dist/utils';\n\nimport type { Describe } from '../internals';\nimport { literal, nullUnion } from '../internals';\nimport type { EmptyObject } from '../types';\nimport type {\n GenericSnapElement,\n JsonObject,\n Key,\n MaybeArray,\n SnapElement,\n StringElement,\n} from './component';\nimport type {\n AddressElement,\n BoldElement,\n BoxElement,\n ButtonElement,\n CopyableElement,\n DividerElement,\n DropdownElement,\n OptionElement,\n FieldElement,\n FormElement,\n HeadingElement,\n ImageElement,\n InputElement,\n ItalicElement,\n JSXElement,\n LinkElement,\n RowElement,\n SpinnerElement,\n StandardFormattingElement,\n TextElement,\n ValueElement,\n} from './components';\n\n/**\n * A struct for the {@link Key} type.\n */\nexport const KeyStruct: Describe = nullUnion([string(), number()]);\n\n/**\n * A struct for the {@link StringElement} type.\n */\nexport const StringElementStruct: Describe = maybeArray(\n string(),\n);\n\n/**\n * A struct for the {@link GenericSnapElement} type.\n */\nexport const ElementStruct: Describe = object({\n type: string(),\n props: record(string(), JsonStruct),\n key: nullable(KeyStruct),\n});\n\n/**\n * A helper function for creating a struct for a {@link MaybeArray} type.\n *\n * @param struct - The struct for the maybe array type.\n * @returns The struct for the maybe array type.\n */\nfunction maybeArray(\n struct: Struct,\n): Struct, any> {\n return nullUnion([struct, array(struct)]);\n}\n\n/**\n * A helper function for creating a struct for a JSX element.\n *\n * @param name - The name of the element.\n * @param props - The props of the element.\n * @returns The struct for the element.\n */\nfunction element(\n name: Name,\n props: Props = {} as Props,\n) {\n return object({\n type: literal(name) as unknown as Struct,\n props: object(props),\n key: nullable(KeyStruct),\n });\n}\n\n/**\n * A struct for the {@link ButtonElement} type.\n */\nexport const ButtonStruct: Describe = element('Button', {\n children: StringElementStruct,\n name: optional(string()),\n type: optional(nullUnion([literal('button'), literal('submit')])),\n variant: optional(nullUnion([literal('primary'), literal('destructive')])),\n disabled: optional(boolean()),\n});\n\n/**\n * A struct for the {@link InputElement} type.\n */\nexport const InputStruct: Describe = element('Input', {\n name: string(),\n type: optional(\n nullUnion([literal('text'), literal('password'), literal('number')]),\n ),\n value: optional(string()),\n placeholder: optional(string()),\n});\n\n/**\n * A struct for the {@link OptionElement} type.\n */\nexport const OptionStruct: Describe = element('Option', {\n value: string(),\n children: string(),\n});\n\n/**\n * A struct for the {@link DropdownElement} type.\n */\nexport const DropdownStruct: Describe = element('Dropdown', {\n name: string(),\n value: optional(string()),\n children: maybeArray(OptionStruct),\n});\n\n/**\n * A struct for the {@link FieldElement} type.\n */\nexport const FieldStruct: Describe = element('Field', {\n label: optional(string()),\n error: optional(string()),\n children: nullUnion([\n tuple([InputStruct, ButtonStruct]),\n InputStruct,\n DropdownStruct,\n ]),\n});\n\n/**\n * A struct for the {@link FormElement} type.\n */\nexport const FormStruct: Describe = element('Form', {\n children: maybeArray(nullUnion([FieldStruct, ButtonStruct])),\n name: string(),\n});\n\n/**\n * A struct for the {@link BoldElement} type.\n */\nexport const BoldStruct: Describe = element('Bold', {\n children: maybeArray(\n nullable(\n nullUnion([\n string(),\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n lazy(() => ItalicStruct) as unknown as Struct<\n SnapElement\n >,\n ]),\n ),\n ),\n});\n\n/**\n * A struct for the {@link ItalicElement} type.\n */\nexport const ItalicStruct: Describe = element('Italic', {\n children: maybeArray(\n nullable(\n nullUnion([\n string(),\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n lazy(() => BoldStruct) as unknown as Struct<\n SnapElement\n >,\n ]),\n ),\n ),\n});\n\nexport const FormattingStruct: Describe = nullUnion([\n BoldStruct,\n ItalicStruct,\n]);\n\n/**\n * A struct for the {@link AddressElement} type.\n */\nexport const AddressStruct: Describe = element('Address', {\n address: HexChecksumAddressStruct,\n});\n\n/**\n * A struct for the {@link BoxElement} type.\n */\nexport const BoxStruct: Describe = element('Box', {\n children: maybeArray(\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n nullable(lazy(() => BoxChildStruct)),\n ) as unknown as Struct, null>,\n direction: optional(nullUnion([literal('horizontal'), literal('vertical')])),\n alignment: optional(\n nullUnion([\n literal('start'),\n literal('center'),\n literal('end'),\n literal('space-between'),\n literal('space-around'),\n ]),\n ),\n});\n\n/**\n * A struct for the {@link CopyableElement} type.\n */\nexport const CopyableStruct: Describe = element('Copyable', {\n value: string(),\n sensitive: optional(boolean()),\n});\n\n/**\n * A struct for the {@link DividerElement} type.\n */\nexport const DividerStruct: Describe = element('Divider');\n\n/**\n * A struct for the {@link ValueElement} type.\n */\nexport const ValueStruct: Describe = element('Value', {\n value: string(),\n extra: string(),\n});\n\n/**\n * A struct for the {@link HeadingElement} type.\n */\nexport const HeadingStruct: Describe = element('Heading', {\n children: StringElementStruct,\n});\n\n/**\n * A struct for the {@link ImageElement} type.\n */\nexport const ImageStruct: Describe = element('Image', {\n src: string(),\n alt: optional(string()),\n});\n\n/**\n * A struct for the {@link LinkElement} type.\n */\nexport const LinkStruct: Describe = element('Link', {\n href: string(),\n children: maybeArray(nullable(nullUnion([FormattingStruct, string()]))),\n});\n\n/**\n * A struct for the {@link TextElement} type.\n */\nexport const TextStruct: Describe = element('Text', {\n children: maybeArray(\n nullable(nullUnion([string(), BoldStruct, ItalicStruct, LinkStruct])),\n ),\n});\n\n/**\n * A struct for the {@link RowElement} type.\n */\nexport const RowStruct: Describe = element('Row', {\n label: string(),\n children: nullUnion([AddressStruct, ImageStruct, TextStruct, ValueStruct]),\n variant: optional(\n nullUnion([literal('default'), literal('warning'), literal('error')]),\n ),\n});\n\n/**\n * A struct for the {@link SpinnerElement} type.\n */\nexport const SpinnerStruct: Describe = element('Spinner');\n\n/**\n * A subset of JSX elements that are allowed as children of the Box component.\n * This set should include all components, except components that need to be nested\n * in another component (e.g. Field must be contained in a Form).\n */\nexport const BoxChildStruct = nullUnion([\n ButtonStruct,\n InputStruct,\n FormStruct,\n BoldStruct,\n ItalicStruct,\n AddressStruct,\n BoxStruct,\n CopyableStruct,\n DividerStruct,\n HeadingStruct,\n ImageStruct,\n LinkStruct,\n RowStruct,\n SpinnerStruct,\n TextStruct,\n DropdownStruct,\n]);\n\n/**\n * For now, the allowed JSX elements at the root are the same as the allowed\n * children of the Box component.\n */\nexport const RootJSXElementStruct = BoxChildStruct;\n\n/**\n * A struct for the {@link JSXElement} type.\n */\nexport const JSXElementStruct: Describe = nullUnion([\n ButtonStruct,\n InputStruct,\n FieldStruct,\n FormStruct,\n BoldStruct,\n ItalicStruct,\n AddressStruct,\n BoxStruct,\n CopyableStruct,\n DividerStruct,\n HeadingStruct,\n ImageStruct,\n LinkStruct,\n RowStruct,\n SpinnerStruct,\n TextStruct,\n DropdownStruct,\n OptionStruct,\n ValueStruct,\n]);\n\n/**\n * Check if a value is a JSX element.\n *\n * @param value - The value to check.\n * @returns True if the value is a JSX element, false otherwise.\n */\nexport function isJSXElement(value: unknown): value is JSXElement {\n return is(value, JSXElementStruct);\n}\n\n/**\n * Check if a value is a JSX element, without validating all of its contents.\n * This is useful when you want to validate the structure of a value, but not\n * all the children.\n *\n * This should only be used when you are sure that the value is safe to use,\n * i.e., after using {@link isJSXElement}.\n *\n * @param value - The value to check.\n * @returns True if the value is a JSX element, false otherwise.\n */\nexport function isJSXElementUnsafe(value: unknown): value is JSXElement {\n return (\n isPlainObject(value) &&\n hasProperty(value, 'type') &&\n hasProperty(value, 'props') &&\n hasProperty(value, 'key')\n );\n}\n\n/**\n * Assert that a value is a JSX element.\n *\n * @param value - The value to check.\n * @throws If the value is not a JSX element.\n */\nexport function assertJSXElement(value: unknown): asserts value is JSXElement {\n // TODO: We should use the error parsing utils from `snaps-utils` to improve\n // the error messages. It currently includes colours and potentially other\n // formatting that we might not want to include in the SDK.\n if (!isJSXElement(value)) {\n throw new Error(\n `Expected a JSX element, but received ${JSON.stringify(\n value,\n )}. Please refer to the documentation for the supported JSX elements and their props.`,\n );\n }\n}\n","import type { Infer } from 'superstruct';\nimport {\n Struct,\n define,\n literal as superstructLiteral,\n union as superstructUnion,\n} from 'superstruct';\nimport type { AnyStruct, InferStructTuple } from 'superstruct/dist/utils';\n\nimport type { EnumToUnion } from './helpers';\n\n/**\n * A wrapper of `superstruct`'s `literal` struct that also defines the name of\n * the struct as the literal value.\n *\n * This is useful for improving the error messages returned by `superstruct`.\n * For example, instead of returning an error like:\n *\n * ```\n * Expected the value to satisfy a union of `literal | literal`, but received: \\\"baz\\\"\n * ```\n *\n * This struct will return an error like:\n *\n * ```\n * Expected the value to satisfy a union of `\"foo\" | \"bar\"`, but received: \\\"baz\\\"\n * ```\n *\n * @param value - The literal value.\n * @returns The `superstruct` struct, which validates that the value is equal\n * to the literal value.\n */\nexport function literal(value: Type) {\n return define(\n JSON.stringify(value),\n superstructLiteral(value).validator,\n );\n}\n\n/**\n * A wrapper of `superstruct`'s `union` struct that also defines the schema as\n * the union of the schemas of the structs.\n *\n * This is useful for improving the error messages returned by `superstruct`.\n *\n * @param structs - The structs to union.\n * @param structs.\"0\" - The first struct.\n * @param structs.\"1\" - The remaining structs.\n * @returns The `superstruct` struct, which validates that the value satisfies\n * one of the structs.\n */\nexport function union([\n head,\n ...tail\n]: [head: Head, ...tail: Tail]): Struct<\n Infer | InferStructTuple[number],\n [head: Head, ...tail: Tail]\n> {\n const struct = superstructUnion([head, ...tail]);\n\n return new Struct({\n ...struct,\n schema: [head, ...tail],\n });\n}\n\n/**\n * Superstruct struct for validating an enum value. This allows using both the\n * enum string values and the enum itself as values.\n *\n * @param constant - The enum to validate against.\n * @returns The superstruct struct.\n */\nexport function enumValue(\n constant: Type,\n): Struct, null> {\n return literal(constant as EnumToUnion);\n}\n","import type { Infer, Struct } from 'superstruct';\nimport type {\n AnyStruct,\n EnumSchema,\n InferStructTuple,\n IsExactMatch,\n IsMatch,\n IsRecord,\n IsTuple,\n UnionToIntersection,\n} from 'superstruct/dist/utils';\n\nimport type { EmptyObject } from '../types';\nimport { union } from './structs';\n\n/**\n * Check if a type is a union. Infers `true` if it is a union, otherwise\n * `false`.\n */\ntype IsUnion = [Type] extends [UnionToIntersection] ? false : true;\n\n/**\n * Get a struct schema for a type.\n *\n * This is copied from `superstruct` but fixes some issues with the original\n * implementation.\n */\ntype StructSchema = IsUnion extends true\n ? null\n : [Type] extends [EmptyObject]\n ? EmptyObject\n : [Type] extends [string | undefined | null]\n ? [Type] extends [`0x${string}`]\n ? null\n : [Type] extends [IsMatch]\n ? null\n : [Type] extends [IsUnion]\n ? EnumSchema\n : Type\n : [Type] extends [number | undefined | null]\n ? [Type] extends [IsMatch]\n ? null\n : [Type] extends [IsUnion]\n ? EnumSchema\n : Type\n : [Type] extends [boolean]\n ? [Type] extends [IsExactMatch]\n ? null\n : Type\n : Type extends\n | bigint\n | symbol\n | undefined\n | null\n // eslint-disable-next-line @typescript-eslint/ban-types\n | Function\n | Date\n | Error\n | RegExp\n | Map\n | WeakMap\n | Set\n | WeakSet\n | Promise\n ? null\n : Type extends (infer E)[]\n ? Type extends IsTuple\n ? null\n : Struct\n : Type extends object\n ? Type extends IsRecord\n ? null\n : {\n [InnerKey in keyof Type]: Describe;\n }\n : null;\n\n/**\n * Describe a struct type.\n */\nexport type Describe = Struct>;\n\n/**\n * Create a union struct that uses `null` for the schema type, for better\n * compatibility with `Describe`.\n *\n * @param structs - The structs to union.\n * @returns The `superstruct` struct, which validates that the value satisfies\n * one of the structs.\n */\nexport function nullUnion(\n structs: [head: Head, ...tail: Tail],\n) {\n return union(structs) as unknown as Struct<\n Infer | InferStructTuple[number],\n null\n >;\n}\n","import type { JsonObject, Key, SnapComponent } from './component';\nimport { jsx } from './jsx-runtime';\nimport { assertJSXElement } from './validation';\n\n/**\n * The JSX runtime for Snaps SDK components. This function is used to render\n * Snap components into a format that can be used by the Snaps.\n *\n * This is the \"development\" version of the runtime, which includes additional\n * validation, which is otherwise handled by MetaMask. To use this runtime,\n * specify `@metamask/snaps-sdk` as import source for JSX, and use\n * `react-jsxdev` as the pragma.\n *\n * @param component - The component to render.\n * @param props - The props to pass to the component.\n * @param key - The key of the component.\n * @returns The rendered component.\n * @see https://www.typescriptlang.org/tsconfig/#jsx\n */\nexport function jsxDEV(\n component: SnapComponent,\n props: Props,\n key: Key | null,\n): unknown | null {\n const element = jsx(component, props, key);\n assertJSXElement(element);\n\n return element;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;AC4EA,SAAS,qBAA+C,OAAqB;AAC3E,SAAO,OAAO;AAAA,IACZ,OAAO,QAAQ,KAAK,EAAE,OAAO,CAAC,CAAC,EAAE,KAAK,MAAM,UAAU,MAAS;AAAA,EACjE;AACF;AAUO,SAAS,oBAGd,MAAwC;AACxC,SAAO,CAAC,UAAwC;AAC9C,UAAM,EAAE,MAAM,MAAM,GAAG,KAAK,IAAI;AAChC,WAAO;AAAA,MACL;AAAA,MACA,OAAO,qBAAqB,IAAa;AAAA,MACzC;AAAA,IACF;AAAA,EACF;AACF;;;AC7EA,IAAM,OAAO;AAYN,IAAM,SAAS,oBAA8C,IAAI;;;ACnBxE,IAAMA,QAAO;AAmBN,IAAM,WAAW,oBAAgDA,KAAI;;;ACvB5E,IAAMC,QAAO;AAkBN,IAAM,SAAS,oBAA8CA,KAAI;;;ACdxE,IAAMC,QAAO;AAiBN,IAAM,QAAQ,oBAA6CA,KAAI;;;AChBtE,IAAMC,QAAO;AAmBN,IAAM,OAAO,oBAA4CA,KAAI;;;AClBpE,IAAMC,QAAO;AAgBN,IAAM,QAAQ,oBAA6CA,KAAI;;;ACZtE,IAAMC,Q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TYPE","TYPE","TYPE","TYPE","TYPE","TYPE","TYPE","TYPE","TYPE","import_superstruct","superstructLiteral","superstructUnion","element"]} +\ No newline at end of file ++{"version":3,"sources":["../../src/jsx/index.ts","../../src/jsx/component.ts","../../src/jsx/components/form/Button.ts","../../src/jsx/components/form/Dropdown.ts","../../src/jsx/components/form/Option.ts","../../src/jsx/components/form/Field.ts","../../src/jsx/components/form/Form.ts","../../src/jsx/components/form/Input.ts","../../src/jsx/components/formatting/Bold.ts","../../src/jsx/components/formatting/Italic.ts","../../src/jsx/components/Address.ts","../../src/jsx/components/Box.ts","../../src/jsx/components/Copyable.ts","../../src/jsx/components/Divider.ts","../../src/jsx/components/Value.ts","../../src/jsx/components/Heading.ts","../../src/jsx/components/Image.ts","../../src/jsx/components/Link.ts","../../src/jsx/components/Row.ts","../../src/jsx/components/Spinner.ts","../../src/jsx/components/Text.ts","../../src/jsx/jsx-runtime.ts","../../src/jsx/validation.ts","../../src/internals/structs.ts","../../src/internals/jsx.ts","../../src/jsx/jsx-dev-runtime.ts"],"sourcesContent":["export * from './component';\nexport * from './components';\nexport * from './jsx-runtime';\nexport * from './jsx-dev-runtime';\nexport {\n JSXElementStruct,\n RootJSXElementStruct,\n isJSXElement,\n isJSXElementUnsafe,\n assertJSXElement,\n} from './validation';\n","import type { Json } from '@metamask/utils';\n\n/**\n * A key, which can be a string or a number.\n */\nexport type Key = string | number;\n\n/**\n * A JSON object.\n */\nexport type JsonObject = Record;\n\n/**\n * A generic JSX element.\n *\n * @property type - The type of the element.\n * @property props - The props of the element.\n * @property key - The key of the element.\n */\nexport type GenericSnapElement = {\n type: string;\n props: JsonObject;\n key: Key | null;\n};\n\n/**\n * A JSX element.\n *\n * @property type - The type of the element.\n * @property props - The props of the element.\n * @property key - The key of the element.\n */\nexport type SnapElement<\n Props extends JsonObject = Record,\n Type extends string = string,\n> = {\n type: Type;\n props: Props;\n key: Key | null;\n};\n\n/**\n * A type that can be a single value or an array of values.\n *\n * @template Type - The type that can be an array.\n * @example\n * type MaybeArrayString = MaybeArray;\n * const maybeArrayString: MaybeArrayString = 'hello';\n * const maybeArrayStringArray: MaybeArrayString = ['hello', 'world'];\n */\nexport type MaybeArray = Type | Type[];\n\n/**\n * A JSX node, which can be an element, a string, null, or an array of nodes.\n */\nexport type SnapNode = MaybeArray;\n\n/**\n * A JSX string element, which can be a string or an array of strings.\n */\nexport type StringElement = MaybeArray;\n\n/**\n * A JSX component.\n */\nexport type SnapComponent<\n Props extends JsonObject = Record,\n Type extends string = string,\n> = (props: Props & { key?: Key | null }) => SnapElement;\n\n/**\n * Remove undefined props from an object.\n *\n * @param props - The object to remove undefined props from.\n * @returns The object without undefined props.\n */\nfunction removeUndefinedProps(props: Props): Props {\n return Object.fromEntries(\n Object.entries(props).filter(([, value]) => value !== undefined),\n ) as Props;\n}\n\n/**\n * Create a Snap component from a type. This is a helper function that creates a\n * Snap component function.\n *\n * @param type - The type of the component.\n * @returns A function that creates a Snap element.\n * @see SnapComponent\n */\nexport function createSnapComponent<\n Props extends JsonObject = Record,\n Type extends string = string,\n>(type: Type): SnapComponent {\n return (props: Props & { key?: Key | null }) => {\n const { key = null, ...rest } = props;\n return {\n type,\n props: removeUndefinedProps(rest as Props),\n key,\n };\n };\n}\n","import type { StringElement } from '../../component';\nimport { createSnapComponent } from '../../component';\n\n// TODO: Add the `onClick` prop to the `ButtonProps` type.\n\n/**\n * The props of the {@link Button} component.\n *\n * @property children - The text to display on the button.\n * @property name - The name of the button. This is used to identify the button\n * in the event handler.\n * @property type - The type of the button, i.e., `'button'` or `'submit'`.\n * Defaults to `'button'`.\n * @property variant - The variant of the button, i.e., `'primary'` or\n * `'destructive'`. Defaults to `'primary'`.\n * @property disabled - Whether the button is disabled. Defaults to `false`.\n */\nexport type ButtonProps = {\n children: StringElement;\n name?: string | undefined;\n type?: 'button' | 'submit' | undefined;\n variant?: 'primary' | 'destructive' | undefined;\n disabled?: boolean | undefined;\n};\n\nconst TYPE = 'Button';\n\n/**\n * A button component, which is used to create a clickable button.\n *\n * @param props - The props of the component.\n * @param props.children - The text to display on the button. This should be a\n * string or an array of strings.\n * @returns A button element.\n * @example\n * \n */\nexport const Button = createSnapComponent(TYPE);\n\n/**\n * A button element.\n *\n * @see Button\n */\nexport type ButtonElement = ReturnType;\n","import type { MaybeArray } from '../../component';\nimport { createSnapComponent } from '../../component';\nimport type { OptionElement } from './Option';\n\n/**\n * The props of the {@link Dropdown} component.\n *\n * @property name - The name of the dropdown. This is used to identify the\n * state in the form data.\n * @property value - The selected value of the dropdown.\n * @property children - The children of the dropdown.\n */\ntype DropdownProps = {\n name: string;\n value?: string;\n children: MaybeArray;\n};\n\nconst TYPE = 'Dropdown';\n\n/**\n * A dropdown component, which is used to create a dropdown. This component\n * can only be used as a child of the {@link Field} component.\n *\n * @param props - The props of the component.\n * @param props.name - The name of the dropdown field. This is used to identify the\n * state in the form data.\n * @param props.value - The selected value of the dropdown.\n * @param props.children - The children of the dropdown.\n * @returns A dropdown element.\n * @example\n * \n * \n * \n * \n * \n */\nexport const Dropdown = createSnapComponent(TYPE);\n\n/**\n * A dropdown element.\n *\n * @see Dropdown\n */\nexport type DropdownElement = ReturnType;\n","import { createSnapComponent } from '../../component';\n\n/**\n * The props of the {@link Option} component.\n *\n * @property value - The value of the dropdown option. This is used to populate the\n * state in the form data.\n * @property children - The text to display.\n */\ntype OptionProps = {\n value: string;\n children: string;\n};\n\nconst TYPE = 'Option';\n\n/**\n * A dropdown option component, which is used to create a dropdown option. This component\n * can only be used as a child of the {@link Dropdown} component.\n *\n * @param props - The props of the component.\n * @param props.value - The value of the dropdown option. This is used to populate the\n * state in the form data.\n * @param props.children - The text to display.\n * @returns A dropdown option element.\n * @example\n * \n * \n * \n * \n * \n */\nexport const Option = createSnapComponent(TYPE);\n\n/**\n * A dropdown option element.\n *\n * @see Option\n */\nexport type OptionElement = ReturnType;\n","import { createSnapComponent } from '../../component';\nimport type { ButtonElement } from './Button';\nimport type { DropdownElement } from './Dropdown';\nimport type { InputElement } from './Input';\n\n/**\n * The props of the {@link Field} component.\n *\n * @property label - The label of the field.\n * @property error - The error message of the field.\n * @property children - The input field and the submit button.\n */\nexport type FieldProps = {\n label?: string | undefined;\n error?: string | undefined;\n children: [InputElement, ButtonElement] | InputElement | DropdownElement;\n};\n\nconst TYPE = 'Field';\n\n/**\n * A field component, which is used to create a form field. This component can\n * only be used as a child of the {@link Form} component.\n *\n * @param props - The props of the component.\n * @param props.label - The label of the field.\n * @param props.error - The error message of the field.\n * @param props.children - The input field and the submit button.\n * @returns A field element.\n * @example\n * \n * \n * \n * \n */\nexport const Field = createSnapComponent(TYPE);\n\n/**\n * A field element.\n *\n * @see Field\n */\nexport type FieldElement = ReturnType;\n","import type { MaybeArray } from '../../component';\nimport { createSnapComponent } from '../../component';\nimport type { ButtonElement } from './Button';\nimport type { FieldElement } from './Field';\n\n// TODO: Add `onSubmit` prop to the `FormProps` type.\n\n/**\n * The props of the {@link Form} component.\n *\n * @property children - The form fields. See {@link Field}.\n * @property name - The name of the form. This is used to identify the form in\n * the event handler.\n */\ntype FormProps = {\n children: MaybeArray;\n name: string;\n};\n\nconst TYPE = 'Form';\n\n/**\n * A form component, which is used to create a form.\n *\n * @param props - The props of the component.\n * @param props.children - The form fields. This should be a single field or an\n * array of fields.\n * @param props.name - The name of the form. This is used to identify the form\n * in the event handler.\n * @returns A form element.\n * @example\n *
\n * \n * \n * \n * \n *
\n */\nexport const Form = createSnapComponent(TYPE);\n\n/**\n * A form element.\n *\n * @see Form\n */\nexport type FormElement = ReturnType;\n","import { createSnapComponent } from '../../component';\n\n// TODO: Add the `onChange` prop to the `InputProps` type.\n\n/**\n * The props of the {@link Input} component.\n *\n * @property name - The name of the input field. This is used to identify the\n * input field in the form data.\n * @property type - The type of the input field. Defaults to `text`.\n * @property value - The value of the input field.\n * @property placeholder - The placeholder text of the input field.\n */\ntype InputProps = {\n name: string;\n type?: 'text' | 'password' | 'number' | undefined;\n value?: string | undefined;\n placeholder?: string | undefined;\n};\n\nconst TYPE = 'Input';\n\n/**\n * An input component, which is used to create an input field. This component\n * can only be used as a child of the {@link Field} component.\n *\n * @param props - The props of the component.\n * @param props.name - The name of the input field. This is used to identify the\n * input field in the form data.\n * @param props.type - The type of the input field.\n * @param props.value - The value of the input field.\n * @param props.placeholder - The placeholder text of the input field.\n * @returns An input element.\n * @example\n * \n */\nexport const Input = createSnapComponent(TYPE);\n\n/**\n * An input element.\n *\n * @see Input\n */\nexport type InputElement = ReturnType;\n","import type { JsonObject, MaybeArray, SnapElement } from '../../component';\nimport { createSnapComponent } from '../../component';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { Text } from '../Text';\n\n/**\n * The children of the {@link Bold} component.\n */\nexport type BoldChildren = MaybeArray<\n | string\n // We have to specify the type here to avoid a circular reference.\n | SnapElement\n | null\n>;\n\n/**\n * The props of the {@link Bold} component.\n *\n * @property children - The text to display in bold.\n */\nexport type BoldProps = {\n children: BoldChildren;\n};\n\nconst TYPE = 'Bold';\n\n/**\n * A bold component, which is used to display text in bold. This component can\n * only be used as a child of the {@link Text} component.\n *\n * @param props - The props of the component.\n * @param props.children - The text to display in bold.\n * @returns A bold element.\n * @example\n * \n * Hello world!\n * \n */\nexport const Bold = createSnapComponent(TYPE);\n\n/**\n * A bold element.\n *\n * @see Bold\n */\nexport type BoldElement = ReturnType;\n","import type { JsonObject, MaybeArray, SnapElement } from '../../component';\nimport { createSnapComponent } from '../../component';\n\n/**\n * The children of the {@link Italic} component.\n */\nexport type ItalicChildren = MaybeArray<\n | string\n // We have to specify the type here to avoid a circular reference.\n | SnapElement\n | null\n>;\n\n/**\n * The props of the {@link Italic} component.\n *\n * @property children - The text to display in italic. This should be a string\n * or an array of strings.\n */\nexport type ItalicProps = {\n children: ItalicChildren;\n};\n\nconst TYPE = 'Italic';\n\n/**\n * An italic component, which is used to display text in italic. This componen\n * can only be used as a child of the {@link Text} component.\n *\n * @param props - The props of the component.\n * @param props.children - The text to display in italic. This should be a\n * string or an array of strings.\n * @returns An italic element.\n * @example\n * \n * Hello world!\n * \n */\nexport const Italic = createSnapComponent(TYPE);\n\n/**\n * An italic element.\n *\n * @see Italic\n */\nexport type ItalicElement = ReturnType;\n","import { createSnapComponent } from '../component';\n\n/**\n * The props of the {@link Address} component.\n *\n * @property address - The (Ethereum) address to display. This should be a\n * valid Ethereum address, starting with `0x`.\n */\nexport type AddressProps = {\n address: `0x${string}`;\n};\n\nconst TYPE = 'Address';\n\n/**\n * An address component, which is used to display an Ethereum address.\n *\n * This component does not accept any children.\n *\n * @param props - The props of the component.\n * @param props.address - The (Ethereum) address to display. This should be a\n * valid Ethereum address, starting with `0x`.\n * @returns An address element.\n * @example\n *
\n */\nexport const Address = createSnapComponent(TYPE);\n\n/**\n * An address element.\n *\n * @see Address\n */\nexport type AddressElement = ReturnType;\n","import type { GenericSnapElement, MaybeArray } from '../component';\nimport { createSnapComponent } from '../component';\n\n/**\n * The props of the {@link Box} component.\n *\n * @property children - The children of the box.\n * @property direction - The direction to stack the components within the box. Defaults to `vertical`.\n * @property alignment - The alignment mode to use within the box. Defaults to `start`.\n */\nexport type BoxProps = {\n // We can't use `JSXElement` because it causes a circular reference.\n children: MaybeArray;\n direction?: 'vertical' | 'horizontal';\n alignment?: 'start' | 'center' | 'end' | 'space-between' | 'space-around';\n};\n\nconst TYPE = 'Box';\n\n/**\n * A box component, which is used to group multiple components together.\n *\n * @param props - The props of the component.\n * @param props.children - The children of the box.\n * @returns A box element.\n * @example\n * \n * Hello world!\n * \n */\nexport const Box = createSnapComponent(TYPE);\n\n/**\n * A box element.\n *\n * @see Box\n */\nexport type BoxElement = ReturnType;\n","import { createSnapComponent } from '../component';\n\n/**\n * The props of the {@link Copyable} component.\n *\n * @property value - The value to copy when the user clicks on the copyable\n * element.\n * @property sensitive - Whether the value is sensitive. If `true`, the value\n * will be hidden when the user is not interacting with the copyable element.\n */\nexport type CopyableProps = {\n value: string;\n sensitive?: boolean | undefined;\n};\n\nconst TYPE = 'Copyable';\n\n/**\n * A copyable component, which is used to display text that can be copied by the\n * user.\n *\n * @param props - The props of the component.\n * @param props.value - The value to copy when the user clicks on the copyable\n * element.\n * @param props.sensitive - Whether the value is sensitive. If `true`, the value\n * will be hidden when the user is not interacting with the copyable element.\n * @example\n * \n * \n */\nexport const Copyable = createSnapComponent(TYPE);\n\n/**\n * A copyable element.\n *\n * @see Copyable\n */\nexport type CopyableElement = ReturnType;\n","import { createSnapComponent } from '../component';\n\nconst TYPE = 'Divider';\n\n/**\n * A divider component, which is used to create a horizontal line between\n * elements.\n *\n * This component does not have any props.\n *\n * @returns A divider element.\n * @example\n * \n */\nexport const Divider = createSnapComponent(TYPE);\n\n/**\n * A divider element.\n *\n * @see Divider\n */\nexport type DividerElement = ReturnType;\n","import { createSnapComponent } from '../component';\n\n/**\n * The props of the {@link Value} component.\n *\n * @property value - The value shown on the right side.\n * @property extra - The extra text shown on the left side.\n */\nexport type ValueProps = {\n value: string;\n extra: string;\n};\n\nconst TYPE = 'Value';\n\n/**\n * A value component, which can be used to display two different text values side by side.\n *\n * This component can only be used as a child of the {@link Row} component.\n *\n * This component does not accept any children.\n *\n * @param props - The props of the component.\n * @param props.value - The value shown on the right side.\n * @param props.extra - The extra text shown on the left side.\n * @returns A value element.\n * @example\n * \n */\nexport const Value = createSnapComponent(TYPE);\n\n/**\n * A value element.\n *\n * @see Value\n */\nexport type ValueElement = ReturnType;\n","import type { StringElement } from '../component';\nimport { createSnapComponent } from '../component';\n\n/**\n * The props of the {@link Heading} component.\n *\n * @property children - The text to display in the heading.\n */\ntype HeadingProps = {\n children: StringElement;\n};\n\nconst TYPE = 'Heading';\n\n/**\n * A heading component, which is used to display heading text.\n *\n * @param props - The props of the component.\n * @param props.children - The text to display in the heading.\n * @returns A heading element.\n * @example\n * Hello world!\n */\nexport const Heading = createSnapComponent(TYPE);\n\n/**\n * A heading element.\n *\n * @see Heading\n */\nexport type HeadingElement = ReturnType;\n","import { createSnapComponent } from '../component';\n\n/**\n * The props of the {@link Image} component.\n *\n * @property src - The SVG image to display. This should be an SVG string, and\n * other formats such as PNG and JPEG are not supported directly. You can use\n * the `data:` URL scheme to embed images inside the SVG.\n * @property alt - The alternative text of the image, which describes the image\n * for users who cannot see it.\n */\ntype ImageProps = {\n src: string;\n alt?: string | undefined;\n};\n\nconst TYPE = 'Image';\n\n/**\n * An image component, which is used to display an image.\n *\n * This component does not accept any children.\n *\n * @param props - The props of the component.\n * @param props.src - The URL of the image to display. This should be an SVG\n * string, and other formats such as PNG and JPEG are not supported directly.\n * You can use the `data:` URL scheme to embed images inside the SVG.\n * @param props.alt - The alternative text of the image, which describes the\n * image for users who cannot see it.\n * @returns An image element.\n * @example\n * ...\" alt=\"An example image\" />\n */\nexport const Image = createSnapComponent(TYPE);\n\n/**\n * An image element.\n *\n * @see Image\n */\nexport type ImageElement = ReturnType;\n","import type { MaybeArray } from '../component';\nimport { createSnapComponent } from '../component';\nimport type { StandardFormattingElement } from './formatting';\n\n/**\n * The children of the {@link Link} component.\n */\nexport type LinkChildren = MaybeArray<\n string | StandardFormattingElement | null\n>;\n\n/**\n * The props of the {@link Link} component.\n *\n * @property children - The text to display in the link.\n * @property href - The URL to link to. This must be an `https` or `mailto` URL.\n * `http` is not allowed.\n */\nexport type LinkProps = {\n children: LinkChildren;\n href: string;\n};\n\nconst TYPE = 'Link';\n\n/**\n * A link component, which is used to display a hyperlink.\n *\n * @param props - The props of the component.\n * @param props.children - The text to display in the link.\n * @param props.href - The URL to link to. This must be an `https` or `mailto`\n * URL. `http` is not allowed.\n * @returns A link element.\n * @example\n * Click here\n */\nexport const Link = createSnapComponent(TYPE);\n\n/**\n * A link element.\n *\n * @see Link\n */\nexport type LinkElement = ReturnType;\n","import { createSnapComponent } from '../component';\nimport type { AddressElement } from './Address';\nimport type { ImageElement } from './Image';\nimport type { TextElement } from './Text';\nimport type { ValueElement } from './Value';\n\n/**\n * The children of a {@link Row} component.\n */\nexport type RowChildren =\n | AddressElement\n | ImageElement\n | TextElement\n | ValueElement;\n\n/**\n * The props of the {@link Row} component.\n *\n * @property label - The label of the row.\n * @property children - The content of the row. This can be an address, an\n * image, or text.\n * @property variant - The variant of the row.\n */\nexport type RowProps = {\n label: string;\n children: RowChildren;\n variant?: 'default' | 'warning' | 'error';\n};\n\nconst TYPE = 'Row';\n\n/**\n * A row component, which is used to display a row of information.\n *\n * @param props - The props of the component.\n * @param props.label - The label of the row.\n * @param props.children - The content of the row. This can be an address, an\n * image, or text.\n * @param props.variant - The variant of the row.\n * @returns A row element.\n * @example\n * \n *
\n * \n */\nexport const Row = createSnapComponent(TYPE);\n\n/**\n * A row element.\n *\n * @see Row\n */\nexport type RowElement = ReturnType;\n","import { createSnapComponent } from '../component';\n\nconst TYPE = 'Spinner';\n\n/**\n * A spinner component, which is used to display a spinner, indicating that some\n * operation is in progress.\n *\n * This component does not accept any props.\n *\n * @returns A spinner element.\n * @example\n * \n */\nexport const Spinner = createSnapComponent(TYPE);\n\n/**\n * A spinner element.\n *\n * @see Spinner\n */\nexport type SpinnerElement = ReturnType;\n","import type { MaybeArray } from '../component';\nimport { createSnapComponent } from '../component';\nimport type { StandardFormattingElement } from './formatting';\nimport type { LinkElement } from './Link';\n\n/**\n * The children of the {@link Text} component.\n */\nexport type TextChildren = MaybeArray<\n string | StandardFormattingElement | LinkElement | null\n>;\n\n/**\n * The props of the {@link Text} component.\n *\n * @property children - The text to display.\n */\nexport type TextProps = {\n children: TextChildren;\n};\n\nconst TYPE = 'Text';\n\n/**\n * A text component, which is used to display text.\n *\n * @param props - The props of the component.\n * @param props.children - The text to display.\n * @returns A text element.\n * @example\n * \n * Hello world!\n * \n */\nexport const Text = createSnapComponent(TYPE);\n\n/**\n * A text element.\n *\n * @see Text\n */\nexport type TextElement = ReturnType;\n","import type { JsonObject, Key, SnapComponent } from './component';\n\n/**\n * The JSX runtime for Snaps SDK components. This function is used to render\n * Snap components into a format that can be used by the Snaps.\n *\n * This is the \"production\" version of the runtime, which does not include\n * additional validation, as it is handled by MetaMask. To use this runtime,\n * specify `@metamask/snaps-sdk` as import source for JSX, and use `react-jsx`\n * as the pragma.\n *\n * @param component - The component to render.\n * @param props - The props to pass to the component.\n * @param key - The key of the component.\n * @returns The rendered component.\n * @see https://www.typescriptlang.org/tsconfig/#jsx\n */\nexport function jsx(\n component: SnapComponent,\n props: Props,\n key: Key | null,\n): unknown | null {\n if (typeof component === 'string') {\n // If component is a string, it is a built-in HTML element. This is not\n // supported in Snaps, so we throw an error.\n throw new Error(\n `An HTML element (\"${String(\n component,\n )}\") was used in a Snap component, which is not supported by Snaps UI. Please use one of the supported Snap components.`,\n );\n }\n\n if (!component) {\n // If component is undefined, a JSX fragment `<>...` was used, which is\n // not supported in Snaps.\n throw new Error(\n 'A JSX fragment was used in a Snap component, which is not supported by Snaps UI. Please use one of the supported Snap components.',\n );\n }\n\n return component({ ...props, key });\n}\n\n/**\n * The JSX runtime for Snaps SDK components. This function is used to render\n * Snap components into a format that can be used by the Snaps.\n *\n * The `jsxs` function is used for rendering nested components.\n *\n * This is the \"production\" version of the runtime, which does not include\n * additional validation, as it is handled by MetaMask. To use this runtime,\n * specify `@metamask/snaps-sdk` as import source for JSX, and use `react-jsx`\n * as the pragma.\n *\n * @param component - The component to render.\n * @param props - The props to pass to the component.\n * @param key - The key of the component.\n * @returns The rendered component.\n * @see https://www.typescriptlang.org/tsconfig/#jsx\n */\nexport function jsxs(\n component: SnapComponent,\n props: Props,\n key: Key | null,\n): unknown | null {\n return jsx(component, props, key);\n}\n","import {\n hasProperty,\n HexChecksumAddressStruct,\n isPlainObject,\n JsonStruct,\n} from '@metamask/utils';\nimport type { Struct } from 'superstruct';\nimport {\n is,\n boolean,\n optional,\n array,\n lazy,\n nullable,\n number,\n object,\n record,\n string,\n tuple,\n} from 'superstruct';\nimport type { ObjectSchema } from 'superstruct';\n\nimport type { Describe } from '../internals';\nimport { literal, nullUnion } from '../internals';\nimport type { EmptyObject } from '../types';\nimport type {\n GenericSnapElement,\n JsonObject,\n Key,\n MaybeArray,\n SnapElement,\n StringElement,\n} from './component';\nimport type {\n AddressElement,\n BoldElement,\n BoxElement,\n ButtonElement,\n CopyableElement,\n DividerElement,\n DropdownElement,\n OptionElement,\n FieldElement,\n FormElement,\n HeadingElement,\n ImageElement,\n InputElement,\n ItalicElement,\n JSXElement,\n LinkElement,\n RowElement,\n SpinnerElement,\n StandardFormattingElement,\n TextElement,\n ValueElement,\n} from './components';\n\n/**\n * A struct for the {@link Key} type.\n */\nexport const KeyStruct: Describe = nullUnion([string(), number()]);\n\n/**\n * A struct for the {@link StringElement} type.\n */\nexport const StringElementStruct: Describe = maybeArray(\n string(),\n);\n\n/**\n * A struct for the {@link GenericSnapElement} type.\n */\nexport const ElementStruct: Describe = object({\n type: string(),\n props: record(string(), JsonStruct),\n key: nullable(KeyStruct),\n});\n\n/**\n * A helper function for creating a struct for a {@link MaybeArray} type.\n *\n * @param struct - The struct for the maybe array type.\n * @returns The struct for the maybe array type.\n */\nfunction maybeArray(\n struct: Struct,\n): Struct, any> {\n return nullUnion([struct, array(struct)]);\n}\n\n/**\n * A helper function for creating a struct for a JSX element.\n *\n * @param name - The name of the element.\n * @param props - The props of the element.\n * @returns The struct for the element.\n */\nfunction element(\n name: Name,\n props: Props = {} as Props,\n) {\n return object({\n type: literal(name) as unknown as Struct,\n props: object(props),\n key: nullable(KeyStruct),\n });\n}\n\n/**\n * A struct for the {@link ButtonElement} type.\n */\nexport const ButtonStruct: Describe = element('Button', {\n children: StringElementStruct,\n name: optional(string()),\n type: optional(nullUnion([literal('button'), literal('submit')])),\n variant: optional(nullUnion([literal('primary'), literal('destructive')])),\n disabled: optional(boolean()),\n});\n\n/**\n * A struct for the {@link InputElement} type.\n */\nexport const InputStruct: Describe = element('Input', {\n name: string(),\n type: optional(\n nullUnion([literal('text'), literal('password'), literal('number')]),\n ),\n value: optional(string()),\n placeholder: optional(string()),\n});\n\n/**\n * A struct for the {@link OptionElement} type.\n */\nexport const OptionStruct: Describe = element('Option', {\n value: string(),\n children: string(),\n});\n\n/**\n * A struct for the {@link DropdownElement} type.\n */\nexport const DropdownStruct: Describe = element('Dropdown', {\n name: string(),\n value: optional(string()),\n children: maybeArray(OptionStruct),\n});\n\n/**\n * A struct for the {@link FieldElement} type.\n */\nexport const FieldStruct: Describe = element('Field', {\n label: optional(string()),\n error: optional(string()),\n children: nullUnion([\n tuple([InputStruct, ButtonStruct]),\n InputStruct,\n DropdownStruct,\n ]),\n});\n\n/**\n * A struct for the {@link FormElement} type.\n */\nexport const FormStruct: Describe = element('Form', {\n children: maybeArray(nullUnion([FieldStruct, ButtonStruct])),\n name: string(),\n});\n\n/**\n * A struct for the {@link BoldElement} type.\n */\nexport const BoldStruct: Describe = element('Bold', {\n children: maybeArray(\n nullable(\n nullUnion([\n string(),\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n lazy(() => ItalicStruct) as unknown as Struct<\n SnapElement\n >,\n ]),\n ),\n ),\n});\n\n/**\n * A struct for the {@link ItalicElement} type.\n */\nexport const ItalicStruct: Describe = element('Italic', {\n children: maybeArray(\n nullable(\n nullUnion([\n string(),\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n lazy(() => BoldStruct) as unknown as Struct<\n SnapElement\n >,\n ]),\n ),\n ),\n});\n\nexport const FormattingStruct: Describe = nullUnion([\n BoldStruct,\n ItalicStruct,\n]);\n\n/**\n * A struct for the {@link AddressElement} type.\n */\nexport const AddressStruct: Describe = element('Address', {\n address: HexChecksumAddressStruct,\n});\n\n/**\n * A struct for the {@link BoxElement} type.\n */\nexport const BoxStruct: Describe = element('Box', {\n children: maybeArray(\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n nullable(lazy(() => BoxChildStruct)),\n ) as unknown as Struct, null>,\n direction: optional(nullUnion([literal('horizontal'), literal('vertical')])),\n alignment: optional(\n nullUnion([\n literal('start'),\n literal('center'),\n literal('end'),\n literal('space-between'),\n literal('space-around'),\n ]),\n ),\n});\n\n/**\n * A struct for the {@link CopyableElement} type.\n */\nexport const CopyableStruct: Describe = element('Copyable', {\n value: string(),\n sensitive: optional(boolean()),\n});\n\n/**\n * A struct for the {@link DividerElement} type.\n */\nexport const DividerStruct: Describe = element('Divider');\n\n/**\n * A struct for the {@link ValueElement} type.\n */\nexport const ValueStruct: Describe = element('Value', {\n value: string(),\n extra: string(),\n});\n\n/**\n * A struct for the {@link HeadingElement} type.\n */\nexport const HeadingStruct: Describe = element('Heading', {\n children: StringElementStruct,\n});\n\n/**\n * A struct for the {@link ImageElement} type.\n */\nexport const ImageStruct: Describe = element('Image', {\n src: string(),\n alt: optional(string()),\n});\n\n/**\n * A struct for the {@link LinkElement} type.\n */\nexport const LinkStruct: Describe = element('Link', {\n href: string(),\n children: maybeArray(nullable(nullUnion([FormattingStruct, string()]))),\n});\n\n/**\n * A struct for the {@link TextElement} type.\n */\nexport const TextStruct: Describe = element('Text', {\n children: maybeArray(\n nullable(nullUnion([string(), BoldStruct, ItalicStruct, LinkStruct])),\n ),\n});\n\n/**\n * A struct for the {@link RowElement} type.\n */\nexport const RowStruct: Describe = element('Row', {\n label: string(),\n children: nullUnion([AddressStruct, ImageStruct, TextStruct, ValueStruct]),\n variant: optional(\n nullUnion([literal('default'), literal('warning'), literal('error')]),\n ),\n});\n\n/**\n * A struct for the {@link SpinnerElement} type.\n */\nexport const SpinnerStruct: Describe = element('Spinner');\n\n/**\n * A subset of JSX elements that are allowed as children of the Box component.\n * This set should include all components, except components that need to be nested\n * in another component (e.g. Field must be contained in a Form).\n */\nexport const BoxChildStruct = nullUnion([\n ButtonStruct,\n InputStruct,\n FormStruct,\n BoldStruct,\n ItalicStruct,\n AddressStruct,\n BoxStruct,\n CopyableStruct,\n DividerStruct,\n HeadingStruct,\n ImageStruct,\n LinkStruct,\n RowStruct,\n SpinnerStruct,\n TextStruct,\n DropdownStruct,\n]);\n\n/**\n * For now, the allowed JSX elements at the root are the same as the allowed\n * children of the Box component.\n */\nexport const RootJSXElementStruct = BoxChildStruct;\n\n/**\n * A struct for the {@link JSXElement} type.\n */\nexport const JSXElementStruct: Describe = nullUnion([\n ButtonStruct,\n InputStruct,\n FieldStruct,\n FormStruct,\n BoldStruct,\n ItalicStruct,\n AddressStruct,\n BoxStruct,\n CopyableStruct,\n DividerStruct,\n HeadingStruct,\n ImageStruct,\n LinkStruct,\n RowStruct,\n SpinnerStruct,\n TextStruct,\n DropdownStruct,\n OptionStruct,\n ValueStruct,\n]);\n\n/**\n * Check if a value is a JSX element.\n *\n * @param value - The value to check.\n * @returns True if the value is a JSX element, false otherwise.\n */\nexport function isJSXElement(value: unknown): value is JSXElement {\n return is(value, JSXElementStruct);\n}\n\n/**\n * Check if a value is a JSX element, without validating all of its contents.\n * This is useful when you want to validate the structure of a value, but not\n * all the children.\n *\n * This should only be used when you are sure that the value is safe to use,\n * i.e., after using {@link isJSXElement}.\n *\n * @param value - The value to check.\n * @returns True if the value is a JSX element, false otherwise.\n */\nexport function isJSXElementUnsafe(value: unknown): value is JSXElement {\n return (\n isPlainObject(value) &&\n hasProperty(value, 'type') &&\n hasProperty(value, 'props') &&\n hasProperty(value, 'key')\n );\n}\n\n/**\n * Assert that a value is a JSX element.\n *\n * @param value - The value to check.\n * @throws If the value is not a JSX element.\n */\nexport function assertJSXElement(value: unknown): asserts value is JSXElement {\n // TODO: We should use the error parsing utils from `snaps-utils` to improve\n // the error messages. It currently includes colours and potentially other\n // formatting that we might not want to include in the SDK.\n if (!isJSXElement(value)) {\n throw new Error(\n `Expected a JSX element, but received ${JSON.stringify(\n value,\n )}. Please refer to the documentation for the supported JSX elements and their props.`,\n );\n }\n}\n","import type { Infer } from 'superstruct';\nimport {\n Struct,\n define,\n literal as superstructLiteral,\n union as superstructUnion,\n} from 'superstruct';\nimport type { AnyStruct, InferStructTuple } from 'superstruct';\n\nimport type { EnumToUnion } from './helpers';\n\n/**\n * A wrapper of `superstruct`'s `literal` struct that also defines the name of\n * the struct as the literal value.\n *\n * This is useful for improving the error messages returned by `superstruct`.\n * For example, instead of returning an error like:\n *\n * ```\n * Expected the value to satisfy a union of `literal | literal`, but received: \\\"baz\\\"\n * ```\n *\n * This struct will return an error like:\n *\n * ```\n * Expected the value to satisfy a union of `\"foo\" | \"bar\"`, but received: \\\"baz\\\"\n * ```\n *\n * @param value - The literal value.\n * @returns The `superstruct` struct, which validates that the value is equal\n * to the literal value.\n */\nexport function literal(value: Type) {\n return define(\n JSON.stringify(value),\n superstructLiteral(value).validator,\n );\n}\n\n/**\n * A wrapper of `superstruct`'s `union` struct that also defines the schema as\n * the union of the schemas of the structs.\n *\n * This is useful for improving the error messages returned by `superstruct`.\n *\n * @param structs - The structs to union.\n * @param structs.\"0\" - The first struct.\n * @param structs.\"1\" - The remaining structs.\n * @returns The `superstruct` struct, which validates that the value satisfies\n * one of the structs.\n */\nexport function union([\n head,\n ...tail\n]: [head: Head, ...tail: Tail]): Struct<\n Infer | InferStructTuple[number],\n [head: Head, ...tail: Tail]\n> {\n const struct = superstructUnion([head, ...tail]);\n\n return new Struct({\n ...struct,\n schema: [head, ...tail],\n });\n}\n\n/**\n * Superstruct struct for validating an enum value. This allows using both the\n * enum string values and the enum itself as values.\n *\n * @param constant - The enum to validate against.\n * @returns The superstruct struct.\n */\nexport function enumValue(\n constant: Type,\n): Struct, null> {\n return literal(constant as EnumToUnion);\n}\n","import type { Infer, Struct } from 'superstruct';\nimport type {\n AnyStruct,\n EnumSchema,\n InferStructTuple,\n IsExactMatch,\n IsMatch,\n IsRecord,\n IsTuple,\n UnionToIntersection,\n} from 'superstruct';\n\nimport type { EmptyObject } from '../types';\nimport { union } from './structs';\n\n/**\n * Check if a type is a union. Infers `true` if it is a union, otherwise\n * `false`.\n */\ntype IsUnion = [Type] extends [UnionToIntersection] ? false : true;\n\n/**\n * Get a struct schema for a type.\n *\n * This is copied from `superstruct` but fixes some issues with the original\n * implementation.\n */\ntype StructSchema = IsUnion extends true\n ? null\n : [Type] extends [EmptyObject]\n ? EmptyObject\n : [Type] extends [string | undefined | null]\n ? [Type] extends [`0x${string}`]\n ? null\n : [Type] extends [IsMatch]\n ? null\n : [Type] extends [IsUnion]\n ? EnumSchema\n : Type\n : [Type] extends [number | undefined | null]\n ? [Type] extends [IsMatch]\n ? null\n : [Type] extends [IsUnion]\n ? EnumSchema\n : Type\n : [Type] extends [boolean]\n ? [Type] extends [IsExactMatch]\n ? null\n : Type\n : Type extends\n | bigint\n | symbol\n | undefined\n | null\n // eslint-disable-next-line @typescript-eslint/ban-types\n | Function\n | Date\n | Error\n | RegExp\n | Map\n | WeakMap\n | Set\n | WeakSet\n | Promise\n ? null\n : Type extends (infer E)[]\n ? Type extends IsTuple\n ? null\n : Struct\n : Type extends object\n ? Type extends IsRecord\n ? null\n : {\n [InnerKey in keyof Type]: Describe;\n }\n : null;\n\n/**\n * Describe a struct type.\n */\nexport type Describe = Struct>;\n\n/**\n * Create a union struct that uses `null` for the schema type, for better\n * compatibility with `Describe`.\n *\n * @param structs - The structs to union.\n * @returns The `superstruct` struct, which validates that the value satisfies\n * one of the structs.\n */\nexport function nullUnion(\n structs: [head: Head, ...tail: Tail],\n) {\n return union(structs) as unknown as Struct<\n Infer | InferStructTuple[number],\n null\n >;\n}\n","import type { JsonObject, Key, SnapComponent } from './component';\nimport { jsx } from './jsx-runtime';\nimport { assertJSXElement } from './validation';\n\n/**\n * The JSX runtime for Snaps SDK components. This function is used to render\n * Snap components into a format that can be used by the Snaps.\n *\n * This is the \"development\" version of the runtime, which includes additional\n * validation, which is otherwise handled by MetaMask. To use this runtime,\n * specify `@metamask/snaps-sdk` as import source for JSX, and use\n * `react-jsxdev` as the pragma.\n *\n * @param component - The component to render.\n * @param props - The props to pass to the component.\n * @param key - The key of the component.\n * @returns The rendered component.\n * @see https://www.typescriptlang.org/tsconfig/#jsx\n */\nexport function jsxDEV(\n component: SnapComponent,\n props: Props,\n key: Key | null,\n): unknown | null {\n const element = jsx(component, props, key);\n assertJSXElement(element);\n\n return element;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA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,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAMM,IAAM,uBAAuB;AAK7B,IAAM,mBAAyC,UAAU;AAAA,EAC9D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAQM,SAAS,aAAa,OAAqC;AAChE,aAAO,wBAAG,OAAO,gBAAgB;AACnC;AAaO,SAAS,mBAAmB,OAAqC;AACtE,aACE,4BAAc,KAAK,SACnB,0BAAY,OAAO,MAAM,SACzB,0BAAY,OAAO,OAAO,SAC1B,0BAAY,OAAO,KAAK;AAE5B;AAQO,SAAS,iBAAiB,OAA6C;AAI5E,MAAI,CAAC,aAAa,KAAK,GAAG;AACxB,UAAM,IAAI;AAAA,MACR,wCAAwC,KAAK;AAAA,QAC3C;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AACF;;;AGnYO,SAAS,OACd,WACA,OACA,KACgB;AAChB,QAAMC,WAAU,IAAI,WAAW,OAAO,GAAG;AACzC,mBAAiBA,QAAO;AAExB,SAAOA;AACT;","names":["TYPE","TYPE","TYPE","TYPE","TYPE","TYPE","TYPE","TYPE","TYPE","TYPE","TYPE","TYPE","TYPE","TYPE","TYPE","TYPE","TYPE","TYPE","import_superstruct","superstructLiteral","superstructUnion","element"]} +\ No newline at end of file +diff --git a/dist/jsx/index.mjs.map b/dist/jsx/index.mjs.map +index 37d1e93ebb4c7b96ee2c97403070041d5294643b..7698f9a5a6cb65f1b620f9ddc713b8d1c9eacffe 100644 +--- a/dist/jsx/index.mjs.map ++++ b/dist/jsx/index.mjs.map +@@ -1 +1 @@ +-{"version":3,"sources":["../../src/jsx/component.ts","../../src/jsx/components/form/Button.ts","../../src/jsx/components/form/Dropdown.ts","../../src/jsx/components/form/Option.ts","../../src/jsx/components/form/Field.ts","../../src/jsx/components/form/Form.ts","../../src/jsx/components/form/Input.ts","../../src/jsx/components/formatting/Bold.ts","../../src/jsx/components/formatting/Italic.ts","../../src/jsx/components/Address.ts","../../src/jsx/components/Box.ts","../../src/jsx/components/Copyable.ts","../../src/jsx/components/Divider.ts","../../src/jsx/components/Value.ts","../../src/jsx/components/Heading.ts","../../src/jsx/components/Image.ts","../../src/jsx/components/Link.ts","../../src/jsx/components/Row.ts","../../src/jsx/components/Spinner.ts","../../src/jsx/components/Text.ts","../../src/jsx/jsx-runtime.ts","../../src/jsx/validation.ts","../../src/internals/structs.ts","../../src/internals/jsx.ts","../../src/jsx/jsx-dev-runtime.ts"],"sourcesContent":["import type { Json } from '@metamask/utils';\n\n/**\n * A key, which can be a string or a number.\n */\nexport type Key = string | number;\n\n/**\n * A JSON object.\n */\nexport type JsonObject = Record;\n\n/**\n * A generic JSX element.\n *\n * @property type - The type of the element.\n * @property props - The props of the element.\n * @property key - The key of the element.\n */\nexport type GenericSnapElement = {\n type: string;\n props: JsonObject;\n key: Key | null;\n};\n\n/**\n * A JSX element.\n *\n * @property type - The type of the element.\n * @property props - The props of the element.\n * @property key - The key of the element.\n */\nexport type SnapElement<\n Props extends JsonObject = Record,\n Type extends string = string,\n> = {\n type: Type;\n props: Props;\n key: Key | null;\n};\n\n/**\n * A type that can be a single value or an array of values.\n *\n * @template Type - The type that can be an array.\n * @example\n * type MaybeArrayString = MaybeArray;\n * const maybeArrayString: MaybeArrayString = 'hello';\n * const maybeArrayStringArray: MaybeArrayString = ['hello', 'world'];\n */\nexport type MaybeArray = Type | Type[];\n\n/**\n * A JSX node, which can be an element, a string, null, or an array of nodes.\n */\nexport type SnapNode = MaybeArray;\n\n/**\n * A JSX string element, which can be a string or an array of strings.\n */\nexport type StringElement = MaybeArray;\n\n/**\n * A JSX component.\n */\nexport type SnapComponent<\n Props extends JsonObject = Record,\n Type extends string = string,\n> = (props: Props & { key?: Key | null }) => SnapElement;\n\n/**\n * Remove undefined props from an object.\n *\n * @param props - The object to remove undefined props from.\n * @returns The object without undefined props.\n */\nfunction removeUndefinedProps(props: Props): Props {\n return Object.fromEntries(\n Object.entries(props).filter(([, value]) => value !== undefined),\n ) as Props;\n}\n\n/**\n * Create a Snap component from a type. This is a helper function that creates a\n * Snap component function.\n *\n * @param type - The type of the component.\n * @returns A function that creates a Snap element.\n * @see SnapComponent\n */\nexport function createSnapComponent<\n Props extends JsonObject = Record,\n Type extends string = string,\n>(type: Type): SnapComponent {\n return (props: Props & { key?: Key | null }) => {\n const { key = null, ...rest } = props;\n return {\n type,\n props: removeUndefinedProps(rest as Props),\n key,\n };\n };\n}\n","import type { StringElement } from '../../component';\nimport { createSnapComponent } from '../../component';\n\n// TODO: Add the `onClick` prop to the `ButtonProps` type.\n\n/**\n * The props of the {@link Button} component.\n *\n * @property children - The text to display on the button.\n * @property name - The name of the button. This is used to identify the button\n * in the event handler.\n * @property type - The type of the button, i.e., `'button'` or `'submit'`.\n * Defaults to `'button'`.\n * @property variant - The variant of the button, i.e., `'primary'` or\n * `'destructive'`. Defaults to `'primary'`.\n * @property disabled - Whether the button is disabled. Defaults to `false`.\n */\nexport type ButtonProps = {\n children: StringElement;\n name?: string | undefined;\n type?: 'button' | 'submit' | undefined;\n variant?: 'primary' | 'destructive' | undefined;\n disabled?: boolean | undefined;\n};\n\nconst TYPE = 'Button';\n\n/**\n * A button component, which is used to create a clickable button.\n *\n * @param props - The props of the component.\n * @param props.children - The text to display on the button. This should be a\n * string or an array of strings.\n * @returns A button element.\n * @example\n * \n */\nexport const Button = createSnapComponent(TYPE);\n\n/**\n * A button element.\n *\n * @see Button\n */\nexport type ButtonElement = ReturnType;\n","import type { MaybeArray } from '../../component';\nimport { createSnapComponent } from '../../component';\nimport type { OptionElement } from './Option';\n\n/**\n * The props of the {@link Dropdown} component.\n *\n * @property name - The name of the dropdown. This is used to identify the\n * state in the form data.\n * @property value - The selected value of the dropdown.\n * @property children - The children of the dropdown.\n */\ntype DropdownProps = {\n name: string;\n value?: string;\n children: MaybeArray;\n};\n\nconst TYPE = 'Dropdown';\n\n/**\n * A dropdown component, which is used to create a dropdown. This component\n * can only be used as a child of the {@link Field} component.\n *\n * @param props - The props of the component.\n * @param props.name - The name of the dropdown field. This is used to identify the\n * state in the form data.\n * @param props.value - The selected value of the dropdown.\n * @param props.children - The children of the dropdown.\n * @returns A dropdown element.\n * @example\n * \n * \n * \n * \n * \n */\nexport const Dropdown = createSnapComponent(TYPE);\n\n/**\n * A dropdown element.\n *\n * @see Dropdown\n */\nexport type DropdownElement = ReturnType;\n","import { createSnapComponent } from '../../component';\n\n/**\n * The props of the {@link Option} component.\n *\n * @property value - The value of the dropdown option. This is used to populate the\n * state in the form data.\n * @property children - The text to display.\n */\ntype OptionProps = {\n value: string;\n children: string;\n};\n\nconst TYPE = 'Option';\n\n/**\n * A dropdown option component, which is used to create a dropdown option. This component\n * can only be used as a child of the {@link Dropdown} component.\n *\n * @param props - The props of the component.\n * @param props.value - The value of the dropdown option. This is used to populate the\n * state in the form data.\n * @param props.children - The text to display.\n * @returns A dropdown option element.\n * @example\n * \n * \n * \n * \n * \n */\nexport const Option = createSnapComponent(TYPE);\n\n/**\n * A dropdown option element.\n *\n * @see Option\n */\nexport type OptionElement = ReturnType;\n","import { createSnapComponent } from '../../component';\nimport type { ButtonElement } from './Button';\nimport type { DropdownElement } from './Dropdown';\nimport type { InputElement } from './Input';\n\n/**\n * The props of the {@link Field} component.\n *\n * @property label - The label of the field.\n * @property error - The error message of the field.\n * @property children - The input field and the submit button.\n */\nexport type FieldProps = {\n label?: string | undefined;\n error?: string | undefined;\n children: [InputElement, ButtonElement] | InputElement | DropdownElement;\n};\n\nconst TYPE = 'Field';\n\n/**\n * A field component, which is used to create a form field. This component can\n * only be used as a child of the {@link Form} component.\n *\n * @param props - The props of the component.\n * @param props.label - The label of the field.\n * @param props.error - The error message of the field.\n * @param props.children - The input field and the submit button.\n * @returns A field element.\n * @example\n * \n * \n * \n * \n */\nexport const Field = createSnapComponent(TYPE);\n\n/**\n * A field element.\n *\n * @see Field\n */\nexport type FieldElement = ReturnType;\n","import type { MaybeArray } from '../../component';\nimport { createSnapComponent } from '../../component';\nimport type { ButtonElement } from './Button';\nimport type { FieldElement } from './Field';\n\n// TODO: Add `onSubmit` prop to the `FormProps` type.\n\n/**\n * The props of the {@link Form} component.\n *\n * @property children - The form fields. See {@link Field}.\n * @property name - The name of the form. This is used to identify the form in\n * the event handler.\n */\ntype FormProps = {\n children: MaybeArray;\n name: string;\n};\n\nconst TYPE = 'Form';\n\n/**\n * A form component, which is used to create a form.\n *\n * @param props - The props of the component.\n * @param props.children - The form fields. This should be a single field or an\n * array of fields.\n * @param props.name - The name of the form. This is used to identify the form\n * in the event handler.\n * @returns A form element.\n * @example\n *
\n * \n * \n * \n * \n *
\n */\nexport const Form = createSnapComponent(TYPE);\n\n/**\n * A form element.\n *\n * @see Form\n */\nexport type FormElement = ReturnType;\n","import { createSnapComponent } from '../../component';\n\n// TODO: Add the `onChange` prop to the `InputProps` type.\n\n/**\n * The props of the {@link Input} component.\n *\n * @property name - The name of the input field. This is used to identify the\n * input field in the form data.\n * @property type - The type of the input field. Defaults to `text`.\n * @property value - The value of the input field.\n * @property placeholder - The placeholder text of the input field.\n */\ntype InputProps = {\n name: string;\n type?: 'text' | 'password' | 'number' | undefined;\n value?: string | undefined;\n placeholder?: string | undefined;\n};\n\nconst TYPE = 'Input';\n\n/**\n * An input component, which is used to create an input field. This component\n * can only be used as a child of the {@link Field} component.\n *\n * @param props - The props of the component.\n * @param props.name - The name of the input field. This is used to identify the\n * input field in the form data.\n * @param props.type - The type of the input field.\n * @param props.value - The value of the input field.\n * @param props.placeholder - The placeholder text of the input field.\n * @returns An input element.\n * @example\n * \n */\nexport const Input = createSnapComponent(TYPE);\n\n/**\n * An input element.\n *\n * @see Input\n */\nexport type InputElement = ReturnType;\n","import type { JsonObject, MaybeArray, SnapElement } from '../../component';\nimport { createSnapComponent } from '../../component';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { Text } from '../Text';\n\n/**\n * The children of the {@link Bold} component.\n */\nexport type BoldChildren = MaybeArray<\n | string\n // We have to specify the type here to avoid a circular reference.\n | SnapElement\n | null\n>;\n\n/**\n * The props of the {@link Bold} component.\n *\n * @property children - The text to display in bold.\n */\nexport type BoldProps = {\n children: BoldChildren;\n};\n\nconst TYPE = 'Bold';\n\n/**\n * A bold component, which is used to display text in bold. This component can\n * only be used as a child of the {@link Text} component.\n *\n * @param props - The props of the component.\n * @param props.children - The text to display in bold.\n * @returns A bold element.\n * @example\n * \n * Hello world!\n * \n */\nexport const Bold = createSnapComponent(TYPE);\n\n/**\n * A bold element.\n *\n * @see Bold\n */\nexport type BoldElement = ReturnType;\n","import type { JsonObject, MaybeArray, SnapElement } from '../../component';\nimport { createSnapComponent } from '../../component';\n\n/**\n * The children of the {@link Italic} component.\n */\nexport type ItalicChildren = MaybeArray<\n | string\n // We have to specify the type here to avoid a circular reference.\n | SnapElement\n | null\n>;\n\n/**\n * The props of the {@link Italic} component.\n *\n * @property children - The text to display in italic. This should be a string\n * or an array of strings.\n */\nexport type ItalicProps = {\n children: ItalicChildren;\n};\n\nconst TYPE = 'Italic';\n\n/**\n * An italic component, which is used to display text in italic. This componen\n * can only be used as a child of the {@link Text} component.\n *\n * @param props - The props of the component.\n * @param props.children - The text to display in italic. This should be a\n * string or an array of strings.\n * @returns An italic element.\n * @example\n * \n * Hello world!\n * \n */\nexport const Italic = createSnapComponent(TYPE);\n\n/**\n * An italic element.\n *\n * @see Italic\n */\nexport type ItalicElement = ReturnType;\n","import { createSnapComponent } from '../component';\n\n/**\n * The props of the {@link Address} component.\n *\n * @property address - The (Ethereum) address to display. This should be a\n * valid Ethereum address, starting with `0x`.\n */\nexport type AddressProps = {\n address: `0x${string}`;\n};\n\nconst TYPE = 'Address';\n\n/**\n * An address component, which is used to display an Ethereum address.\n *\n * This component does not accept any children.\n *\n * @param props - The props of the component.\n * @param props.address - The (Ethereum) address to display. This should be a\n * valid Ethereum address, starting with `0x`.\n * @returns An address element.\n * @example\n *
\n */\nexport const Address = createSnapComponent(TYPE);\n\n/**\n * An address element.\n *\n * @see Address\n */\nexport type AddressElement = ReturnType;\n","import type { GenericSnapElement, MaybeArray } from '../component';\nimport { createSnapComponent } from '../component';\n\n/**\n * The props of the {@link Box} component.\n *\n * @property children - The children of the box.\n * @property direction - The direction to stack the components within the box. Defaults to `vertical`.\n * @property alignment - The alignment mode to use within the box. Defaults to `start`.\n */\nexport type BoxProps = {\n // We can't use `JSXElement` because it causes a circular reference.\n children: MaybeArray;\n direction?: 'vertical' | 'horizontal';\n alignment?: 'start' | 'center' | 'end' | 'space-between' | 'space-around';\n};\n\nconst TYPE = 'Box';\n\n/**\n * A box component, which is used to group multiple components together.\n *\n * @param props - The props of the component.\n * @param props.children - The children of the box.\n * @returns A box element.\n * @example\n * \n * Hello world!\n * \n */\nexport const Box = createSnapComponent(TYPE);\n\n/**\n * A box element.\n *\n * @see Box\n */\nexport type BoxElement = ReturnType;\n","import { createSnapComponent } from '../component';\n\n/**\n * The props of the {@link Copyable} component.\n *\n * @property value - The value to copy when the user clicks on the copyable\n * element.\n * @property sensitive - Whether the value is sensitive. If `true`, the value\n * will be hidden when the user is not interacting with the copyable element.\n */\nexport type CopyableProps = {\n value: string;\n sensitive?: boolean | undefined;\n};\n\nconst TYPE = 'Copyable';\n\n/**\n * A copyable component, which is used to display text that can be copied by the\n * user.\n *\n * @param props - The props of the component.\n * @param props.value - The value to copy when the user clicks on the copyable\n * element.\n * @param props.sensitive - Whether the value is sensitive. If `true`, the value\n * will be hidden when the user is not interacting with the copyable element.\n * @example\n * \n * \n */\nexport const Copyable = createSnapComponent(TYPE);\n\n/**\n * A copyable element.\n *\n * @see Copyable\n */\nexport type CopyableElement = ReturnType;\n","import { createSnapComponent } from '../component';\n\nconst TYPE = 'Divider';\n\n/**\n * A divider component, which is used to create a horizontal line between\n * elements.\n *\n * This component does not have any props.\n *\n * @returns A divider element.\n * @example\n * \n */\nexport const Divider = createSnapComponent(TYPE);\n\n/**\n * A divider element.\n *\n * @see Divider\n */\nexport type DividerElement = ReturnType;\n","import { createSnapComponent } from '../component';\n\n/**\n * The props of the {@link Value} component.\n *\n * @property value - The value shown on the right side.\n * @property extra - The extra text shown on the left side.\n */\nexport type ValueProps = {\n value: string;\n extra: string;\n};\n\nconst TYPE = 'Value';\n\n/**\n * A value component, which can be used to display two different text values side by side.\n *\n * This component can only be used as a child of the {@link Row} component.\n *\n * This component does not accept any children.\n *\n * @param props - The props of the component.\n * @param props.value - The value shown on the right side.\n * @param props.extra - The extra text shown on the left side.\n * @returns A value element.\n * @example\n * \n */\nexport const Value = createSnapComponent(TYPE);\n\n/**\n * A value element.\n *\n * @see Value\n */\nexport type ValueElement = ReturnType;\n","import type { StringElement } from '../component';\nimport { createSnapComponent } from '../component';\n\n/**\n * The props of the {@link Heading} component.\n *\n * @property children - The text to display in the heading.\n */\ntype HeadingProps = {\n children: StringElement;\n};\n\nconst TYPE = 'Heading';\n\n/**\n * A heading component, which is used to display heading text.\n *\n * @param props - The props of the component.\n * @param props.children - The text to display in the heading.\n * @returns A heading element.\n * @example\n * Hello world!\n */\nexport const Heading = createSnapComponent(TYPE);\n\n/**\n * A heading element.\n *\n * @see Heading\n */\nexport type HeadingElement = ReturnType;\n","import { createSnapComponent } from '../component';\n\n/**\n * The props of the {@link Image} component.\n *\n * @property src - The SVG image to display. This should be an SVG string, and\n * other formats such as PNG and JPEG are not supported directly. You can use\n * the `data:` URL scheme to embed images inside the SVG.\n * @property alt - The alternative text of the image, which describes the image\n * for users who cannot see it.\n */\ntype ImageProps = {\n src: string;\n alt?: string | undefined;\n};\n\nconst TYPE = 'Image';\n\n/**\n * An image component, which is used to display an image.\n *\n * This component does not accept any children.\n *\n * @param props - The props of the component.\n * @param props.src - The URL of the image to display. This should be an SVG\n * string, and other formats such as PNG and JPEG are not supported directly.\n * You can use the `data:` URL scheme to embed images inside the SVG.\n * @param props.alt - The alternative text of the image, which describes the\n * image for users who cannot see it.\n * @returns An image element.\n * @example\n * ...\" alt=\"An example image\" />\n */\nexport const Image = createSnapComponent(TYPE);\n\n/**\n * An image element.\n *\n * @see Image\n */\nexport type ImageElement = ReturnType;\n","import type { MaybeArray } from '../component';\nimport { createSnapComponent } from '../component';\nimport type { StandardFormattingElement } from './formatting';\n\n/**\n * The children of the {@link Link} component.\n */\nexport type LinkChildren = MaybeArray<\n string | StandardFormattingElement | null\n>;\n\n/**\n * The props of the {@link Link} component.\n *\n * @property children - The text to display in the link.\n * @property href - The URL to link to. This must be an `https` or `mailto` URL.\n * `http` is not allowed.\n */\nexport type LinkProps = {\n children: LinkChildren;\n href: string;\n};\n\nconst TYPE = 'Link';\n\n/**\n * A link component, which is used to display a hyperlink.\n *\n * @param props - The props of the component.\n * @param props.children - The text to display in the link.\n * @param props.href - The URL to link to. This must be an `https` or `mailto`\n * URL. `http` is not allowed.\n * @returns A link element.\n * @example\n * Click here\n */\nexport const Link = createSnapComponent(TYPE);\n\n/**\n * A link element.\n *\n * @see Link\n */\nexport type LinkElement = ReturnType;\n","import { createSnapComponent } from '../component';\nimport type { AddressElement } from './Address';\nimport type { ImageElement } from './Image';\nimport type { TextElement } from './Text';\nimport type { ValueElement } from './Value';\n\n/**\n * The children of a {@link Row} component.\n */\nexport type RowChildren =\n | AddressElement\n | ImageElement\n | TextElement\n | ValueElement;\n\n/**\n * The props of the {@link Row} component.\n *\n * @property label - The label of the row.\n * @property children - The content of the row. This can be an address, an\n * image, or text.\n * @property variant - The variant of the row.\n */\nexport type RowProps = {\n label: string;\n children: RowChildren;\n variant?: 'default' | 'warning' | 'error';\n};\n\nconst TYPE = 'Row';\n\n/**\n * A row component, which is used to display a row of information.\n *\n * @param props - The props of the component.\n * @param props.label - The label of the row.\n * @param props.children - The content of the row. This can be an address, an\n * image, or text.\n * @param props.variant - The variant of the row.\n * @returns A row element.\n * @example\n * \n *
\n * \n */\nexport const Row = createSnapComponent(TYPE);\n\n/**\n * A row element.\n *\n * @see Row\n */\nexport type RowElement = ReturnType;\n","import { createSnapComponent } from '../component';\n\nconst TYPE = 'Spinner';\n\n/**\n * A spinner component, which is used to display a spinner, indicating that some\n * operation is in progress.\n *\n * This component does not accept any props.\n *\n * @returns A spinner element.\n * @example\n * \n */\nexport const Spinner = createSnapComponent(TYPE);\n\n/**\n * A spinner element.\n *\n * @see Spinner\n */\nexport type SpinnerElement = ReturnType;\n","import type { MaybeArray } from '../component';\nimport { createSnapComponent } from '../component';\nimport type { StandardFormattingElement } from './formatting';\nimport type { LinkElement } from './Link';\n\n/**\n * The children of the {@link Text} component.\n */\nexport type TextChildren = MaybeArray<\n string | StandardFormattingElement | LinkElement | null\n>;\n\n/**\n * The props of the {@link Text} component.\n *\n * @property children - The text to display.\n */\nexport type TextProps = {\n children: TextChildren;\n};\n\nconst TYPE = 'Text';\n\n/**\n * A text component, which is used to display text.\n *\n * @param props - The props of the component.\n * @param props.children - The text to display.\n * @returns A text element.\n * @example\n * \n * Hello world!\n * \n */\nexport const Text = createSnapComponent(TYPE);\n\n/**\n * A text element.\n *\n * @see Text\n */\nexport type TextElement = ReturnType;\n","import type { JsonObject, Key, SnapComponent } from './component';\n\n/**\n * The JSX runtime for Snaps SDK components. This function is used to render\n * Snap components into a format that can be used by the Snaps.\n *\n * This is the \"production\" version of the runtime, which does not include\n * additional validation, as it is handled by MetaMask. To use this runtime,\n * specify `@metamask/snaps-sdk` as import source for JSX, and use `react-jsx`\n * as the pragma.\n *\n * @param component - The component to render.\n * @param props - The props to pass to the component.\n * @param key - The key of the component.\n * @returns The rendered component.\n * @see https://www.typescriptlang.org/tsconfig/#jsx\n */\nexport function jsx(\n component: SnapComponent,\n props: Props,\n key: Key | null,\n): unknown | null {\n if (typeof component === 'string') {\n // If component is a string, it is a built-in HTML element. This is not\n // supported in Snaps, so we throw an error.\n throw new Error(\n `An HTML element (\"${String(\n component,\n )}\") was used in a Snap component, which is not supported by Snaps UI. Please use one of the supported Snap components.`,\n );\n }\n\n if (!component) {\n // If component is undefined, a JSX fragment `<>...` was used, which is\n // not supported in Snaps.\n throw new Error(\n 'A JSX fragment was used in a Snap component, which is not supported by Snaps UI. Please use one of the supported Snap components.',\n );\n }\n\n return component({ ...props, key });\n}\n\n/**\n * The JSX runtime for Snaps SDK components. This function is used to render\n * Snap components into a format that can be used by the Snaps.\n *\n * The `jsxs` function is used for rendering nested components.\n *\n * This is the \"production\" version of the runtime, which does not include\n * additional validation, as it is handled by MetaMask. To use this runtime,\n * specify `@metamask/snaps-sdk` as import source for JSX, and use `react-jsx`\n * as the pragma.\n *\n * @param component - The component to render.\n * @param props - The props to pass to the component.\n * @param key - The key of the component.\n * @returns The rendered component.\n * @see https://www.typescriptlang.org/tsconfig/#jsx\n */\nexport function jsxs(\n component: SnapComponent,\n props: Props,\n key: Key | null,\n): unknown | null {\n return jsx(component, props, key);\n}\n","import {\n hasProperty,\n HexChecksumAddressStruct,\n isPlainObject,\n JsonStruct,\n} from '@metamask/utils';\nimport type { Struct } from 'superstruct';\nimport {\n is,\n boolean,\n optional,\n array,\n lazy,\n nullable,\n number,\n object,\n record,\n string,\n tuple,\n} from 'superstruct';\nimport type { ObjectSchema } from 'superstruct/dist/utils';\n\nimport type { Describe } from '../internals';\nimport { literal, nullUnion } from '../internals';\nimport type { EmptyObject } from '../types';\nimport type {\n GenericSnapElement,\n JsonObject,\n Key,\n MaybeArray,\n SnapElement,\n StringElement,\n} from './component';\nimport type {\n AddressElement,\n BoldElement,\n BoxElement,\n ButtonElement,\n CopyableElement,\n DividerElement,\n DropdownElement,\n OptionElement,\n FieldElement,\n FormElement,\n HeadingElement,\n ImageElement,\n InputElement,\n ItalicElement,\n JSXElement,\n LinkElement,\n RowElement,\n SpinnerElement,\n StandardFormattingElement,\n TextElement,\n ValueElement,\n} from './components';\n\n/**\n * A struct for the {@link Key} type.\n */\nexport const KeyStruct: Describe = nullUnion([string(), number()]);\n\n/**\n * A struct for the {@link StringElement} type.\n */\nexport const StringElementStruct: Describe = maybeArray(\n string(),\n);\n\n/**\n * A struct for the {@link GenericSnapElement} type.\n */\nexport const ElementStruct: Describe = object({\n type: string(),\n props: record(string(), JsonStruct),\n key: nullable(KeyStruct),\n});\n\n/**\n * A helper function for creating a struct for a {@link MaybeArray} type.\n *\n * @param struct - The struct for the maybe array type.\n * @returns The struct for the maybe array type.\n */\nfunction maybeArray(\n struct: Struct,\n): Struct, any> {\n return nullUnion([struct, array(struct)]);\n}\n\n/**\n * A helper function for creating a struct for a JSX element.\n *\n * @param name - The name of the element.\n * @param props - The props of the element.\n * @returns The struct for the element.\n */\nfunction element(\n name: Name,\n props: Props = {} as Props,\n) {\n return object({\n type: literal(name) as unknown as Struct,\n props: object(props),\n key: nullable(KeyStruct),\n });\n}\n\n/**\n * A struct for the {@link ButtonElement} type.\n */\nexport const ButtonStruct: Describe = element('Button', {\n children: StringElementStruct,\n name: optional(string()),\n type: optional(nullUnion([literal('button'), literal('submit')])),\n variant: optional(nullUnion([literal('primary'), literal('destructive')])),\n disabled: optional(boolean()),\n});\n\n/**\n * A struct for the {@link InputElement} type.\n */\nexport const InputStruct: Describe = element('Input', {\n name: string(),\n type: optional(\n nullUnion([literal('text'), literal('password'), literal('number')]),\n ),\n value: optional(string()),\n placeholder: optional(string()),\n});\n\n/**\n * A struct for the {@link OptionElement} type.\n */\nexport const OptionStruct: Describe = element('Option', {\n value: string(),\n children: string(),\n});\n\n/**\n * A struct for the {@link DropdownElement} type.\n */\nexport const DropdownStruct: Describe = element('Dropdown', {\n name: string(),\n value: optional(string()),\n children: maybeArray(OptionStruct),\n});\n\n/**\n * A struct for the {@link FieldElement} type.\n */\nexport const FieldStruct: Describe = element('Field', {\n label: optional(string()),\n error: optional(string()),\n children: nullUnion([\n tuple([InputStruct, ButtonStruct]),\n InputStruct,\n DropdownStruct,\n ]),\n});\n\n/**\n * A struct for the {@link FormElement} type.\n */\nexport const FormStruct: Describe = element('Form', {\n children: maybeArray(nullUnion([FieldStruct, ButtonStruct])),\n name: string(),\n});\n\n/**\n * A struct for the {@link BoldElement} type.\n */\nexport const BoldStruct: Describe = element('Bold', {\n children: maybeArray(\n nullable(\n nullUnion([\n string(),\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n lazy(() => ItalicStruct) as unknown as Struct<\n SnapElement\n >,\n ]),\n ),\n ),\n});\n\n/**\n * A struct for the {@link ItalicElement} type.\n */\nexport const ItalicStruct: Describe = element('Italic', {\n children: maybeArray(\n nullable(\n nullUnion([\n string(),\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n lazy(() => BoldStruct) as unknown as Struct<\n SnapElement\n >,\n ]),\n ),\n ),\n});\n\nexport const FormattingStruct: Describe = nullUnion([\n BoldStruct,\n ItalicStruct,\n]);\n\n/**\n * A struct for the {@link AddressElement} type.\n */\nexport const AddressStruct: Describe = element('Address', {\n address: HexChecksumAddressStruct,\n});\n\n/**\n * A struct for the {@link BoxElement} type.\n */\nexport const BoxStruct: Describe = element('Box', {\n children: maybeArray(\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n nullable(lazy(() => BoxChildStruct)),\n ) as unknown as Struct, null>,\n direction: optional(nullUnion([literal('horizontal'), literal('vertical')])),\n alignment: optional(\n nullUnion([\n literal('start'),\n literal('center'),\n literal('end'),\n literal('space-between'),\n literal('space-around'),\n ]),\n ),\n});\n\n/**\n * A struct for the {@link CopyableElement} type.\n */\nexport const CopyableStruct: Describe = element('Copyable', {\n value: string(),\n sensitive: optional(boolean()),\n});\n\n/**\n * A struct for the {@link DividerElement} type.\n */\nexport const DividerStruct: Describe = element('Divider');\n\n/**\n * A struct for the {@link ValueElement} type.\n */\nexport const ValueStruct: Describe = element('Value', {\n value: string(),\n extra: string(),\n});\n\n/**\n * A struct for the {@link HeadingElement} type.\n */\nexport const HeadingStruct: Describe = element('Heading', {\n children: StringElementStruct,\n});\n\n/**\n * A struct for the {@link ImageElement} type.\n */\nexport const ImageStruct: Describe = element('Image', {\n src: string(),\n alt: optional(string()),\n});\n\n/**\n * A struct for the {@link LinkElement} type.\n */\nexport const LinkStruct: Describe = element('Link', {\n href: string(),\n children: maybeArray(nullable(nullUnion([FormattingStruct, string()]))),\n});\n\n/**\n * A struct for the {@link TextElement} type.\n */\nexport const TextStruct: Describe = element('Text', {\n children: maybeArray(\n nullable(nullUnion([string(), BoldStruct, ItalicStruct, LinkStruct])),\n ),\n});\n\n/**\n * A struct for the {@link RowElement} type.\n */\nexport const RowStruct: Describe = element('Row', {\n label: string(),\n children: nullUnion([AddressStruct, ImageStruct, TextStruct, ValueStruct]),\n variant: optional(\n nullUnion([literal('default'), literal('warning'), literal('error')]),\n ),\n});\n\n/**\n * A struct for the {@link SpinnerElement} type.\n */\nexport const SpinnerStruct: Describe = element('Spinner');\n\n/**\n * A subset of JSX elements that are allowed as children of the Box component.\n * This set should include all components, except components that need to be nested\n * in another component (e.g. Field must be contained in a Form).\n */\nexport const BoxChildStruct = nullUnion([\n ButtonStruct,\n InputStruct,\n FormStruct,\n BoldStruct,\n ItalicStruct,\n AddressStruct,\n BoxStruct,\n CopyableStruct,\n DividerStruct,\n HeadingStruct,\n ImageStruct,\n LinkStruct,\n RowStruct,\n SpinnerStruct,\n TextStruct,\n DropdownStruct,\n]);\n\n/**\n * For now, the allowed JSX elements at the root are the same as the allowed\n * children of the Box component.\n */\nexport const RootJSXElementStruct = BoxChildStruct;\n\n/**\n * A struct for the {@link JSXElement} type.\n */\nexport const JSXElementStruct: Describe = nullUnion([\n ButtonStruct,\n InputStruct,\n FieldStruct,\n FormStruct,\n BoldStruct,\n ItalicStruct,\n AddressStruct,\n BoxStruct,\n CopyableStruct,\n DividerStruct,\n HeadingStruct,\n ImageStruct,\n LinkStruct,\n RowStruct,\n SpinnerStruct,\n TextStruct,\n DropdownStruct,\n OptionStruct,\n ValueStruct,\n]);\n\n/**\n * Check if a value is a JSX element.\n *\n * @param value - The value to check.\n * @returns True if the value is a JSX element, false otherwise.\n */\nexport function isJSXElement(value: unknown): value is JSXElement {\n return is(value, JSXElementStruct);\n}\n\n/**\n * Check if a value is a JSX element, without validating all of its contents.\n * This is useful when you want to validate the structure of a value, but not\n * all the children.\n *\n * This should only be used when you are sure that the value is safe to use,\n * i.e., after using {@link isJSXElement}.\n *\n * @param value - The value to check.\n * @returns True if the value is a JSX element, false otherwise.\n */\nexport function isJSXElementUnsafe(value: unknown): value is JSXElement {\n return (\n isPlainObject(value) &&\n hasProperty(value, 'type') &&\n hasProperty(value, 'props') &&\n hasProperty(value, 'key')\n );\n}\n\n/**\n * Assert that a value is a JSX element.\n *\n * @param value - The value to check.\n * @throws If the value is not a JSX element.\n */\nexport function assertJSXElement(value: unknown): asserts value is JSXElement {\n // TODO: We should use the error parsing utils from `snaps-utils` to improve\n // the error messages. It currently includes colours and potentially other\n // formatting that we might not want to include in the SDK.\n if (!isJSXElement(value)) {\n throw new Error(\n `Expected a JSX element, but received ${JSON.stringify(\n value,\n )}. Please refer to the documentation for the supported JSX elements and their props.`,\n );\n }\n}\n","import type { Infer } from 'superstruct';\nimport {\n Struct,\n define,\n literal as superstructLiteral,\n union as superstructUnion,\n} from 'superstruct';\nimport type { AnyStruct, InferStructTuple } from 'superstruct/dist/utils';\n\nimport type { EnumToUnion } from './helpers';\n\n/**\n * A wrapper of `superstruct`'s `literal` struct that also defines the name of\n * the struct as the literal value.\n *\n * This is useful for improving the error messages returned by `superstruct`.\n * For example, instead of returning an error like:\n *\n * ```\n * Expected the value to satisfy a union of `literal | literal`, but received: \\\"baz\\\"\n * ```\n *\n * This struct will return an error like:\n *\n * ```\n * Expected the value to satisfy a union of `\"foo\" | \"bar\"`, but received: \\\"baz\\\"\n * ```\n *\n * @param value - The literal value.\n * @returns The `superstruct` struct, which validates that the value is equal\n * to the literal value.\n */\nexport function literal(value: Type) {\n return define(\n JSON.stringify(value),\n superstructLiteral(value).validator,\n );\n}\n\n/**\n * A wrapper of `superstruct`'s `union` struct that also defines the schema as\n * the union of the schemas of the structs.\n *\n * This is useful for improving the error messages returned by `superstruct`.\n *\n * @param structs - The structs to union.\n * @param structs.\"0\" - The first struct.\n * @param structs.\"1\" - The remaining structs.\n * @returns The `superstruct` struct, which validates that the value satisfies\n * one of the structs.\n */\nexport function union([\n head,\n ...tail\n]: [head: Head, ...tail: Tail]): Struct<\n Infer | InferStructTuple[number],\n [head: Head, ...tail: Tail]\n> {\n const struct = superstructUnion([head, ...tail]);\n\n return new Struct({\n ...struct,\n schema: [head, ...tail],\n });\n}\n\n/**\n * Superstruct struct for validating an enum value. This allows using both the\n * enum string values and the enum itself as values.\n *\n * @param constant - The enum to validate against.\n * @returns The superstruct struct.\n */\nexport function enumValue(\n constant: Type,\n): Struct, null> {\n return literal(constant as EnumToUnion);\n}\n","import type { Infer, Struct } from 'superstruct';\nimport type {\n AnyStruct,\n EnumSchema,\n InferStructTuple,\n IsExactMatch,\n IsMatch,\n IsRecord,\n IsTuple,\n UnionToIntersection,\n} from 'superstruct/dist/utils';\n\nimport type { EmptyObject } from '../types';\nimport { union } from './structs';\n\n/**\n * Check if a type is a union. Infers `true` if it is a union, otherwise\n * `false`.\n */\ntype IsUnion = [Type] extends [UnionToIntersection] ? false : true;\n\n/**\n * Get a struct schema for a type.\n *\n * This is copied from `superstruct` but fixes some issues with the original\n * implementation.\n */\ntype StructSchema = IsUnion extends true\n ? null\n : [Type] extends [EmptyObject]\n ? EmptyObject\n : [Type] extends [string | undefined | null]\n ? [Type] extends [`0x${string}`]\n ? null\n : [Type] extends [IsMatch]\n ? null\n : [Type] extends [IsUnion]\n ? EnumSchema\n : Type\n : [Type] extends [number | undefined | null]\n ? [Type] extends [IsMatch]\n ? null\n : [Type] extends [IsUnion]\n ? EnumSchema\n : Type\n : [Type] extends [boolean]\n ? [Type] extends [IsExactMatch]\n ? null\n : Type\n : Type extends\n | bigint\n | symbol\n | undefined\n | null\n // eslint-disable-next-line @typescript-eslint/ban-types\n | Function\n | Date\n | Error\n | RegExp\n | Map\n | WeakMap\n | Set\n | WeakSet\n | Promise\n ? null\n : Type extends (infer E)[]\n ? Type extends IsTuple\n ? null\n : Struct\n : Type extends object\n ? Type extends IsRecord\n ? null\n : {\n [InnerKey in keyof Type]: Describe;\n }\n : null;\n\n/**\n * Describe a struct type.\n */\nexport type Describe = Struct>;\n\n/**\n * Create a union struct that uses `null` for the schema type, for better\n * compatibility with `Describe`.\n *\n * @param structs - The structs to union.\n * @returns The `superstruct` struct, which validates that the value satisfies\n * one of the structs.\n */\nexport function nullUnion(\n structs: [head: Head, ...tail: Tail],\n) {\n return union(structs) as unknown as Struct<\n Infer | InferStructTuple[number],\n null\n >;\n}\n","import type { JsonObject, Key, SnapComponent } from './component';\nimport { jsx } from './jsx-runtime';\nimport { assertJSXElement } from './validation';\n\n/**\n * The JSX runtime for Snaps SDK components. This function is used to render\n * Snap components into a format that can be used by the Snaps.\n *\n * This is the \"development\" version of the runtime, which includes additional\n * validation, which is otherwise handled by MetaMask. To use this runtime,\n * specify `@metamask/snaps-sdk` as import source for JSX, and use\n * `react-jsxdev` as the pragma.\n *\n * @param component - The component to render.\n * @param props - The props to pass to the component.\n * @param key - The key of the component.\n * @returns The rendered component.\n * @see https://www.typescriptlang.org/tsconfig/#jsx\n */\nexport function jsxDEV(\n component: SnapComponent,\n props: Props,\n key: Key | null,\n): unknown | null {\n const element = jsx(component, props, key);\n assertJSXElement(element);\n\n return element;\n}\n"],"mappings":";AA4EA,SAAS,qBAA+C,OAAqB;AAC3E,SAAO,OAAO;AAAA,IACZ,OAAO,QAAQ,KAAK,EAAE,OAAO,CAAC,CAAC,EAAE,KAAK,MAAM,UAAU,MAAS;AAAA,EACjE;AACF;AAUO,SAAS,oBAGd,MAAwC;AACxC,SAAO,CAAC,UAAwC;AAC9C,UAAM,EAAE,MAAM,MAAM,GAAG,KAAK,IAAI;AAChC,WAAO;AAAA,MACL;AAAA,MACA,OAAO,qBAAqB,IAAa;AAAA,MACzC;AAAA,IACF;AAAA,EACF;AACF;;;AC7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AO,gBAAgB;AACnC;AAaO,SAAS,mBAAmB,OAAqC;AACtE,SACE,cAAc,KAAK,KACnB,YAAY,OAAO,MAAM,KACzB,YAAY,OAAO,OAAO,KAC1B,YAAY,OAAO,KAAK;AAE5B;AAQO,SAAS,iBAAiB,OAA6C;AAI5E,MAAI,CAAC,aAAa,KAAK,GAAG;AACxB,UAAM,IAAI;AAAA,MACR,wCAAwC,KAAK;AAAA,QAC3C;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AACF;;;AGnYO,SAAS,OACd,WACA,OACA,KACgB;AAChB,QAAMC,WAAU,IAAI,WAAW,OAAO,GAAG;AACzC,mBAAiBA,QAAO;AAExB,SAAOA;AACT;","names":["TYPE","TYPE","TYPE","TYPE","TYPE","TYPE","TYPE","TYPE","TYPE","TYPE","TYPE","TYPE","TYPE","TYPE","TYPE","TYPE","TYPE","TYPE","element"]} +\ No newline at end of file ++{"version":3,"sources":["../../src/jsx/component.ts","../../src/jsx/components/form/Button.ts","../../src/jsx/components/form/Dropdown.ts","../../src/jsx/components/form/Option.ts","../../src/jsx/components/form/Field.ts","../../src/jsx/components/form/Form.ts","../../src/jsx/components/form/Input.ts","../../src/jsx/components/formatting/Bold.ts","../../src/jsx/components/formatting/Italic.ts","../../src/jsx/components/Address.ts","../../src/jsx/components/Box.ts","../../src/jsx/components/Copyable.ts","../../src/jsx/components/Divider.ts","../../src/jsx/components/Value.ts","../../src/jsx/components/Heading.ts","../../src/jsx/components/Image.ts","../../src/jsx/components/Link.ts","../../src/jsx/components/Row.ts","../../src/jsx/components/Spinner.ts","../../src/jsx/components/Text.ts","../../src/jsx/jsx-runtime.ts","../../src/jsx/validation.ts","../../src/internals/structs.ts","../../src/internals/jsx.ts","../../src/jsx/jsx-dev-runtime.ts"],"sourcesContent":["import type { Json } from '@metamask/utils';\n\n/**\n * A key, which can be a string or a number.\n */\nexport type Key = string | number;\n\n/**\n * A JSON object.\n */\nexport type JsonObject = Record;\n\n/**\n * A generic JSX element.\n *\n * @property type - The type of the element.\n * @property props - The props of the element.\n * @property key - The key of the element.\n */\nexport type GenericSnapElement = {\n type: string;\n props: JsonObject;\n key: Key | null;\n};\n\n/**\n * A JSX element.\n *\n * @property type - The type of the element.\n * @property props - The props of the element.\n * @property key - The key of the element.\n */\nexport type SnapElement<\n Props extends JsonObject = Record,\n Type extends string = string,\n> = {\n type: Type;\n props: Props;\n key: Key | null;\n};\n\n/**\n * A type that can be a single value or an array of values.\n *\n * @template Type - The type that can be an array.\n * @example\n * type MaybeArrayString = MaybeArray;\n * const maybeArrayString: MaybeArrayString = 'hello';\n * const maybeArrayStringArray: MaybeArrayString = ['hello', 'world'];\n */\nexport type MaybeArray = Type | Type[];\n\n/**\n * A JSX node, which can be an element, a string, null, or an array of nodes.\n */\nexport type SnapNode = MaybeArray;\n\n/**\n * A JSX string element, which can be a string or an array of strings.\n */\nexport type StringElement = MaybeArray;\n\n/**\n * A JSX component.\n */\nexport type SnapComponent<\n Props extends JsonObject = Record,\n Type extends string = string,\n> = (props: Props & { key?: Key | null }) => SnapElement;\n\n/**\n * Remove undefined props from an object.\n *\n * @param props - The object to remove undefined props from.\n * @returns The object without undefined props.\n */\nfunction removeUndefinedProps(props: Props): Props {\n return Object.fromEntries(\n Object.entries(props).filter(([, value]) => value !== undefined),\n ) as Props;\n}\n\n/**\n * Create a Snap component from a type. This is a helper function that creates a\n * Snap component function.\n *\n * @param type - The type of the component.\n * @returns A function that creates a Snap element.\n * @see SnapComponent\n */\nexport function createSnapComponent<\n Props extends JsonObject = Record,\n Type extends string = string,\n>(type: Type): SnapComponent {\n return (props: Props & { key?: Key | null }) => {\n const { key = null, ...rest } = props;\n return {\n type,\n props: removeUndefinedProps(rest as Props),\n key,\n };\n };\n}\n","import type { StringElement } from '../../component';\nimport { createSnapComponent } from '../../component';\n\n// TODO: Add the `onClick` prop to the `ButtonProps` type.\n\n/**\n * The props of the {@link Button} component.\n *\n * @property children - The text to display on the button.\n * @property name - The name of the button. This is used to identify the button\n * in the event handler.\n * @property type - The type of the button, i.e., `'button'` or `'submit'`.\n * Defaults to `'button'`.\n * @property variant - The variant of the button, i.e., `'primary'` or\n * `'destructive'`. Defaults to `'primary'`.\n * @property disabled - Whether the button is disabled. Defaults to `false`.\n */\nexport type ButtonProps = {\n children: StringElement;\n name?: string | undefined;\n type?: 'button' | 'submit' | undefined;\n variant?: 'primary' | 'destructive' | undefined;\n disabled?: boolean | undefined;\n};\n\nconst TYPE = 'Button';\n\n/**\n * A button component, which is used to create a clickable button.\n *\n * @param props - The props of the component.\n * @param props.children - The text to display on the button. This should be a\n * string or an array of strings.\n * @returns A button element.\n * @example\n * \n */\nexport const Button = createSnapComponent(TYPE);\n\n/**\n * A button element.\n *\n * @see Button\n */\nexport type ButtonElement = ReturnType;\n","import type { MaybeArray } from '../../component';\nimport { createSnapComponent } from '../../component';\nimport type { OptionElement } from './Option';\n\n/**\n * The props of the {@link Dropdown} component.\n *\n * @property name - The name of the dropdown. This is used to identify the\n * state in the form data.\n * @property value - The selected value of the dropdown.\n * @property children - The children of the dropdown.\n */\ntype DropdownProps = {\n name: string;\n value?: string;\n children: MaybeArray;\n};\n\nconst TYPE = 'Dropdown';\n\n/**\n * A dropdown component, which is used to create a dropdown. This component\n * can only be used as a child of the {@link Field} component.\n *\n * @param props - The props of the component.\n * @param props.name - The name of the dropdown field. This is used to identify the\n * state in the form data.\n * @param props.value - The selected value of the dropdown.\n * @param props.children - The children of the dropdown.\n * @returns A dropdown element.\n * @example\n * \n * \n * \n * \n * \n */\nexport const Dropdown = createSnapComponent(TYPE);\n\n/**\n * A dropdown element.\n *\n * @see Dropdown\n */\nexport type DropdownElement = ReturnType;\n","import { createSnapComponent } from '../../component';\n\n/**\n * The props of the {@link Option} component.\n *\n * @property value - The value of the dropdown option. This is used to populate the\n * state in the form data.\n * @property children - The text to display.\n */\ntype OptionProps = {\n value: string;\n children: string;\n};\n\nconst TYPE = 'Option';\n\n/**\n * A dropdown option component, which is used to create a dropdown option. This component\n * can only be used as a child of the {@link Dropdown} component.\n *\n * @param props - The props of the component.\n * @param props.value - The value of the dropdown option. This is used to populate the\n * state in the form data.\n * @param props.children - The text to display.\n * @returns A dropdown option element.\n * @example\n * \n * \n * \n * \n * \n */\nexport const Option = createSnapComponent(TYPE);\n\n/**\n * A dropdown option element.\n *\n * @see Option\n */\nexport type OptionElement = ReturnType;\n","import { createSnapComponent } from '../../component';\nimport type { ButtonElement } from './Button';\nimport type { DropdownElement } from './Dropdown';\nimport type { InputElement } from './Input';\n\n/**\n * The props of the {@link Field} component.\n *\n * @property label - The label of the field.\n * @property error - The error message of the field.\n * @property children - The input field and the submit button.\n */\nexport type FieldProps = {\n label?: string | undefined;\n error?: string | undefined;\n children: [InputElement, ButtonElement] | InputElement | DropdownElement;\n};\n\nconst TYPE = 'Field';\n\n/**\n * A field component, which is used to create a form field. This component can\n * only be used as a child of the {@link Form} component.\n *\n * @param props - The props of the component.\n * @param props.label - The label of the field.\n * @param props.error - The error message of the field.\n * @param props.children - The input field and the submit button.\n * @returns A field element.\n * @example\n * \n * \n * \n * \n */\nexport const Field = createSnapComponent(TYPE);\n\n/**\n * A field element.\n *\n * @see Field\n */\nexport type FieldElement = ReturnType;\n","import type { MaybeArray } from '../../component';\nimport { createSnapComponent } from '../../component';\nimport type { ButtonElement } from './Button';\nimport type { FieldElement } from './Field';\n\n// TODO: Add `onSubmit` prop to the `FormProps` type.\n\n/**\n * The props of the {@link Form} component.\n *\n * @property children - The form fields. See {@link Field}.\n * @property name - The name of the form. This is used to identify the form in\n * the event handler.\n */\ntype FormProps = {\n children: MaybeArray;\n name: string;\n};\n\nconst TYPE = 'Form';\n\n/**\n * A form component, which is used to create a form.\n *\n * @param props - The props of the component.\n * @param props.children - The form fields. This should be a single field or an\n * array of fields.\n * @param props.name - The name of the form. This is used to identify the form\n * in the event handler.\n * @returns A form element.\n * @example\n *
\n * \n * \n * \n * \n *
\n */\nexport const Form = createSnapComponent(TYPE);\n\n/**\n * A form element.\n *\n * @see Form\n */\nexport type FormElement = ReturnType;\n","import { createSnapComponent } from '../../component';\n\n// TODO: Add the `onChange` prop to the `InputProps` type.\n\n/**\n * The props of the {@link Input} component.\n *\n * @property name - The name of the input field. This is used to identify the\n * input field in the form data.\n * @property type - The type of the input field. Defaults to `text`.\n * @property value - The value of the input field.\n * @property placeholder - The placeholder text of the input field.\n */\ntype InputProps = {\n name: string;\n type?: 'text' | 'password' | 'number' | undefined;\n value?: string | undefined;\n placeholder?: string | undefined;\n};\n\nconst TYPE = 'Input';\n\n/**\n * An input component, which is used to create an input field. This component\n * can only be used as a child of the {@link Field} component.\n *\n * @param props - The props of the component.\n * @param props.name - The name of the input field. This is used to identify the\n * input field in the form data.\n * @param props.type - The type of the input field.\n * @param props.value - The value of the input field.\n * @param props.placeholder - The placeholder text of the input field.\n * @returns An input element.\n * @example\n * \n */\nexport const Input = createSnapComponent(TYPE);\n\n/**\n * An input element.\n *\n * @see Input\n */\nexport type InputElement = ReturnType;\n","import type { JsonObject, MaybeArray, SnapElement } from '../../component';\nimport { createSnapComponent } from '../../component';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { Text } from '../Text';\n\n/**\n * The children of the {@link Bold} component.\n */\nexport type BoldChildren = MaybeArray<\n | string\n // We have to specify the type here to avoid a circular reference.\n | SnapElement\n | null\n>;\n\n/**\n * The props of the {@link Bold} component.\n *\n * @property children - The text to display in bold.\n */\nexport type BoldProps = {\n children: BoldChildren;\n};\n\nconst TYPE = 'Bold';\n\n/**\n * A bold component, which is used to display text in bold. This component can\n * only be used as a child of the {@link Text} component.\n *\n * @param props - The props of the component.\n * @param props.children - The text to display in bold.\n * @returns A bold element.\n * @example\n * \n * Hello world!\n * \n */\nexport const Bold = createSnapComponent(TYPE);\n\n/**\n * A bold element.\n *\n * @see Bold\n */\nexport type BoldElement = ReturnType;\n","import type { JsonObject, MaybeArray, SnapElement } from '../../component';\nimport { createSnapComponent } from '../../component';\n\n/**\n * The children of the {@link Italic} component.\n */\nexport type ItalicChildren = MaybeArray<\n | string\n // We have to specify the type here to avoid a circular reference.\n | SnapElement\n | null\n>;\n\n/**\n * The props of the {@link Italic} component.\n *\n * @property children - The text to display in italic. This should be a string\n * or an array of strings.\n */\nexport type ItalicProps = {\n children: ItalicChildren;\n};\n\nconst TYPE = 'Italic';\n\n/**\n * An italic component, which is used to display text in italic. This componen\n * can only be used as a child of the {@link Text} component.\n *\n * @param props - The props of the component.\n * @param props.children - The text to display in italic. This should be a\n * string or an array of strings.\n * @returns An italic element.\n * @example\n * \n * Hello world!\n * \n */\nexport const Italic = createSnapComponent(TYPE);\n\n/**\n * An italic element.\n *\n * @see Italic\n */\nexport type ItalicElement = ReturnType;\n","import { createSnapComponent } from '../component';\n\n/**\n * The props of the {@link Address} component.\n *\n * @property address - The (Ethereum) address to display. This should be a\n * valid Ethereum address, starting with `0x`.\n */\nexport type AddressProps = {\n address: `0x${string}`;\n};\n\nconst TYPE = 'Address';\n\n/**\n * An address component, which is used to display an Ethereum address.\n *\n * This component does not accept any children.\n *\n * @param props - The props of the component.\n * @param props.address - The (Ethereum) address to display. This should be a\n * valid Ethereum address, starting with `0x`.\n * @returns An address element.\n * @example\n *
\n */\nexport const Address = createSnapComponent(TYPE);\n\n/**\n * An address element.\n *\n * @see Address\n */\nexport type AddressElement = ReturnType;\n","import type { GenericSnapElement, MaybeArray } from '../component';\nimport { createSnapComponent } from '../component';\n\n/**\n * The props of the {@link Box} component.\n *\n * @property children - The children of the box.\n * @property direction - The direction to stack the components within the box. Defaults to `vertical`.\n * @property alignment - The alignment mode to use within the box. Defaults to `start`.\n */\nexport type BoxProps = {\n // We can't use `JSXElement` because it causes a circular reference.\n children: MaybeArray;\n direction?: 'vertical' | 'horizontal';\n alignment?: 'start' | 'center' | 'end' | 'space-between' | 'space-around';\n};\n\nconst TYPE = 'Box';\n\n/**\n * A box component, which is used to group multiple components together.\n *\n * @param props - The props of the component.\n * @param props.children - The children of the box.\n * @returns A box element.\n * @example\n * \n * Hello world!\n * \n */\nexport const Box = createSnapComponent(TYPE);\n\n/**\n * A box element.\n *\n * @see Box\n */\nexport type BoxElement = ReturnType;\n","import { createSnapComponent } from '../component';\n\n/**\n * The props of the {@link Copyable} component.\n *\n * @property value - The value to copy when the user clicks on the copyable\n * element.\n * @property sensitive - Whether the value is sensitive. If `true`, the value\n * will be hidden when the user is not interacting with the copyable element.\n */\nexport type CopyableProps = {\n value: string;\n sensitive?: boolean | undefined;\n};\n\nconst TYPE = 'Copyable';\n\n/**\n * A copyable component, which is used to display text that can be copied by the\n * user.\n *\n * @param props - The props of the component.\n * @param props.value - The value to copy when the user clicks on the copyable\n * element.\n * @param props.sensitive - Whether the value is sensitive. If `true`, the value\n * will be hidden when the user is not interacting with the copyable element.\n * @example\n * \n * \n */\nexport const Copyable = createSnapComponent(TYPE);\n\n/**\n * A copyable element.\n *\n * @see Copyable\n */\nexport type CopyableElement = ReturnType;\n","import { createSnapComponent } from '../component';\n\nconst TYPE = 'Divider';\n\n/**\n * A divider component, which is used to create a horizontal line between\n * elements.\n *\n * This component does not have any props.\n *\n * @returns A divider element.\n * @example\n * \n */\nexport const Divider = createSnapComponent(TYPE);\n\n/**\n * A divider element.\n *\n * @see Divider\n */\nexport type DividerElement = ReturnType;\n","import { createSnapComponent } from '../component';\n\n/**\n * The props of the {@link Value} component.\n *\n * @property value - The value shown on the right side.\n * @property extra - The extra text shown on the left side.\n */\nexport type ValueProps = {\n value: string;\n extra: string;\n};\n\nconst TYPE = 'Value';\n\n/**\n * A value component, which can be used to display two different text values side by side.\n *\n * This component can only be used as a child of the {@link Row} component.\n *\n * This component does not accept any children.\n *\n * @param props - The props of the component.\n * @param props.value - The value shown on the right side.\n * @param props.extra - The extra text shown on the left side.\n * @returns A value element.\n * @example\n * \n */\nexport const Value = createSnapComponent(TYPE);\n\n/**\n * A value element.\n *\n * @see Value\n */\nexport type ValueElement = ReturnType;\n","import type { StringElement } from '../component';\nimport { createSnapComponent } from '../component';\n\n/**\n * The props of the {@link Heading} component.\n *\n * @property children - The text to display in the heading.\n */\ntype HeadingProps = {\n children: StringElement;\n};\n\nconst TYPE = 'Heading';\n\n/**\n * A heading component, which is used to display heading text.\n *\n * @param props - The props of the component.\n * @param props.children - The text to display in the heading.\n * @returns A heading element.\n * @example\n * Hello world!\n */\nexport const Heading = createSnapComponent(TYPE);\n\n/**\n * A heading element.\n *\n * @see Heading\n */\nexport type HeadingElement = ReturnType;\n","import { createSnapComponent } from '../component';\n\n/**\n * The props of the {@link Image} component.\n *\n * @property src - The SVG image to display. This should be an SVG string, and\n * other formats such as PNG and JPEG are not supported directly. You can use\n * the `data:` URL scheme to embed images inside the SVG.\n * @property alt - The alternative text of the image, which describes the image\n * for users who cannot see it.\n */\ntype ImageProps = {\n src: string;\n alt?: string | undefined;\n};\n\nconst TYPE = 'Image';\n\n/**\n * An image component, which is used to display an image.\n *\n * This component does not accept any children.\n *\n * @param props - The props of the component.\n * @param props.src - The URL of the image to display. This should be an SVG\n * string, and other formats such as PNG and JPEG are not supported directly.\n * You can use the `data:` URL scheme to embed images inside the SVG.\n * @param props.alt - The alternative text of the image, which describes the\n * image for users who cannot see it.\n * @returns An image element.\n * @example\n * ...\" alt=\"An example image\" />\n */\nexport const Image = createSnapComponent(TYPE);\n\n/**\n * An image element.\n *\n * @see Image\n */\nexport type ImageElement = ReturnType;\n","import type { MaybeArray } from '../component';\nimport { createSnapComponent } from '../component';\nimport type { StandardFormattingElement } from './formatting';\n\n/**\n * The children of the {@link Link} component.\n */\nexport type LinkChildren = MaybeArray<\n string | StandardFormattingElement | null\n>;\n\n/**\n * The props of the {@link Link} component.\n *\n * @property children - The text to display in the link.\n * @property href - The URL to link to. This must be an `https` or `mailto` URL.\n * `http` is not allowed.\n */\nexport type LinkProps = {\n children: LinkChildren;\n href: string;\n};\n\nconst TYPE = 'Link';\n\n/**\n * A link component, which is used to display a hyperlink.\n *\n * @param props - The props of the component.\n * @param props.children - The text to display in the link.\n * @param props.href - The URL to link to. This must be an `https` or `mailto`\n * URL. `http` is not allowed.\n * @returns A link element.\n * @example\n * Click here\n */\nexport const Link = createSnapComponent(TYPE);\n\n/**\n * A link element.\n *\n * @see Link\n */\nexport type LinkElement = ReturnType;\n","import { createSnapComponent } from '../component';\nimport type { AddressElement } from './Address';\nimport type { ImageElement } from './Image';\nimport type { TextElement } from './Text';\nimport type { ValueElement } from './Value';\n\n/**\n * The children of a {@link Row} component.\n */\nexport type RowChildren =\n | AddressElement\n | ImageElement\n | TextElement\n | ValueElement;\n\n/**\n * The props of the {@link Row} component.\n *\n * @property label - The label of the row.\n * @property children - The content of the row. This can be an address, an\n * image, or text.\n * @property variant - The variant of the row.\n */\nexport type RowProps = {\n label: string;\n children: RowChildren;\n variant?: 'default' | 'warning' | 'error';\n};\n\nconst TYPE = 'Row';\n\n/**\n * A row component, which is used to display a row of information.\n *\n * @param props - The props of the component.\n * @param props.label - The label of the row.\n * @param props.children - The content of the row. This can be an address, an\n * image, or text.\n * @param props.variant - The variant of the row.\n * @returns A row element.\n * @example\n * \n *
\n * \n */\nexport const Row = createSnapComponent(TYPE);\n\n/**\n * A row element.\n *\n * @see Row\n */\nexport type RowElement = ReturnType;\n","import { createSnapComponent } from '../component';\n\nconst TYPE = 'Spinner';\n\n/**\n * A spinner component, which is used to display a spinner, indicating that some\n * operation is in progress.\n *\n * This component does not accept any props.\n *\n * @returns A spinner element.\n * @example\n * \n */\nexport const Spinner = createSnapComponent(TYPE);\n\n/**\n * A spinner element.\n *\n * @see Spinner\n */\nexport type SpinnerElement = ReturnType;\n","import type { MaybeArray } from '../component';\nimport { createSnapComponent } from '../component';\nimport type { StandardFormattingElement } from './formatting';\nimport type { LinkElement } from './Link';\n\n/**\n * The children of the {@link Text} component.\n */\nexport type TextChildren = MaybeArray<\n string | StandardFormattingElement | LinkElement | null\n>;\n\n/**\n * The props of the {@link Text} component.\n *\n * @property children - The text to display.\n */\nexport type TextProps = {\n children: TextChildren;\n};\n\nconst TYPE = 'Text';\n\n/**\n * A text component, which is used to display text.\n *\n * @param props - The props of the component.\n * @param props.children - The text to display.\n * @returns A text element.\n * @example\n * \n * Hello world!\n * \n */\nexport const Text = createSnapComponent(TYPE);\n\n/**\n * A text element.\n *\n * @see Text\n */\nexport type TextElement = ReturnType;\n","import type { JsonObject, Key, SnapComponent } from './component';\n\n/**\n * The JSX runtime for Snaps SDK components. This function is used to render\n * Snap components into a format that can be used by the Snaps.\n *\n * This is the \"production\" version of the runtime, which does not include\n * additional validation, as it is handled by MetaMask. To use this runtime,\n * specify `@metamask/snaps-sdk` as import source for JSX, and use `react-jsx`\n * as the pragma.\n *\n * @param component - The component to render.\n * @param props - The props to pass to the component.\n * @param key - The key of the component.\n * @returns The rendered component.\n * @see https://www.typescriptlang.org/tsconfig/#jsx\n */\nexport function jsx(\n component: SnapComponent,\n props: Props,\n key: Key | null,\n): unknown | null {\n if (typeof component === 'string') {\n // If component is a string, it is a built-in HTML element. This is not\n // supported in Snaps, so we throw an error.\n throw new Error(\n `An HTML element (\"${String(\n component,\n )}\") was used in a Snap component, which is not supported by Snaps UI. Please use one of the supported Snap components.`,\n );\n }\n\n if (!component) {\n // If component is undefined, a JSX fragment `<>...` was used, which is\n // not supported in Snaps.\n throw new Error(\n 'A JSX fragment was used in a Snap component, which is not supported by Snaps UI. Please use one of the supported Snap components.',\n );\n }\n\n return component({ ...props, key });\n}\n\n/**\n * The JSX runtime for Snaps SDK components. This function is used to render\n * Snap components into a format that can be used by the Snaps.\n *\n * The `jsxs` function is used for rendering nested components.\n *\n * This is the \"production\" version of the runtime, which does not include\n * additional validation, as it is handled by MetaMask. To use this runtime,\n * specify `@metamask/snaps-sdk` as import source for JSX, and use `react-jsx`\n * as the pragma.\n *\n * @param component - The component to render.\n * @param props - The props to pass to the component.\n * @param key - The key of the component.\n * @returns The rendered component.\n * @see https://www.typescriptlang.org/tsconfig/#jsx\n */\nexport function jsxs(\n component: SnapComponent,\n props: Props,\n key: Key | null,\n): unknown | null {\n return jsx(component, props, key);\n}\n","import {\n hasProperty,\n HexChecksumAddressStruct,\n isPlainObject,\n JsonStruct,\n} from '@metamask/utils';\nimport type { Struct } from 'superstruct';\nimport {\n is,\n boolean,\n optional,\n array,\n lazy,\n nullable,\n number,\n object,\n record,\n string,\n tuple,\n} from 'superstruct';\nimport type { ObjectSchema } from 'superstruct';\n\nimport type { Describe } from '../internals';\nimport { literal, nullUnion } from '../internals';\nimport type { EmptyObject } from '../types';\nimport type {\n GenericSnapElement,\n JsonObject,\n Key,\n MaybeArray,\n SnapElement,\n StringElement,\n} from './component';\nimport type {\n AddressElement,\n BoldElement,\n BoxElement,\n ButtonElement,\n CopyableElement,\n DividerElement,\n DropdownElement,\n OptionElement,\n FieldElement,\n FormElement,\n HeadingElement,\n ImageElement,\n InputElement,\n ItalicElement,\n JSXElement,\n LinkElement,\n RowElement,\n SpinnerElement,\n StandardFormattingElement,\n TextElement,\n ValueElement,\n} from './components';\n\n/**\n * A struct for the {@link Key} type.\n */\nexport const KeyStruct: Describe = nullUnion([string(), number()]);\n\n/**\n * A struct for the {@link StringElement} type.\n */\nexport const StringElementStruct: Describe = maybeArray(\n string(),\n);\n\n/**\n * A struct for the {@link GenericSnapElement} type.\n */\nexport const ElementStruct: Describe = object({\n type: string(),\n props: record(string(), JsonStruct),\n key: nullable(KeyStruct),\n});\n\n/**\n * A helper function for creating a struct for a {@link MaybeArray} type.\n *\n * @param struct - The struct for the maybe array type.\n * @returns The struct for the maybe array type.\n */\nfunction maybeArray(\n struct: Struct,\n): Struct, any> {\n return nullUnion([struct, array(struct)]);\n}\n\n/**\n * A helper function for creating a struct for a JSX element.\n *\n * @param name - The name of the element.\n * @param props - The props of the element.\n * @returns The struct for the element.\n */\nfunction element(\n name: Name,\n props: Props = {} as Props,\n) {\n return object({\n type: literal(name) as unknown as Struct,\n props: object(props),\n key: nullable(KeyStruct),\n });\n}\n\n/**\n * A struct for the {@link ButtonElement} type.\n */\nexport const ButtonStruct: Describe = element('Button', {\n children: StringElementStruct,\n name: optional(string()),\n type: optional(nullUnion([literal('button'), literal('submit')])),\n variant: optional(nullUnion([literal('primary'), literal('destructive')])),\n disabled: optional(boolean()),\n});\n\n/**\n * A struct for the {@link InputElement} type.\n */\nexport const InputStruct: Describe = element('Input', {\n name: string(),\n type: optional(\n nullUnion([literal('text'), literal('password'), literal('number')]),\n ),\n value: optional(string()),\n placeholder: optional(string()),\n});\n\n/**\n * A struct for the {@link OptionElement} type.\n */\nexport const OptionStruct: Describe = element('Option', {\n value: string(),\n children: string(),\n});\n\n/**\n * A struct for the {@link DropdownElement} type.\n */\nexport const DropdownStruct: Describe = element('Dropdown', {\n name: string(),\n value: optional(string()),\n children: maybeArray(OptionStruct),\n});\n\n/**\n * A struct for the {@link FieldElement} type.\n */\nexport const FieldStruct: Describe = element('Field', {\n label: optional(string()),\n error: optional(string()),\n children: nullUnion([\n tuple([InputStruct, ButtonStruct]),\n InputStruct,\n DropdownStruct,\n ]),\n});\n\n/**\n * A struct for the {@link FormElement} type.\n */\nexport const FormStruct: Describe = element('Form', {\n children: maybeArray(nullUnion([FieldStruct, ButtonStruct])),\n name: string(),\n});\n\n/**\n * A struct for the {@link BoldElement} type.\n */\nexport const BoldStruct: Describe = element('Bold', {\n children: maybeArray(\n nullable(\n nullUnion([\n string(),\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n lazy(() => ItalicStruct) as unknown as Struct<\n SnapElement\n >,\n ]),\n ),\n ),\n});\n\n/**\n * A struct for the {@link ItalicElement} type.\n */\nexport const ItalicStruct: Describe = element('Italic', {\n children: maybeArray(\n nullable(\n nullUnion([\n string(),\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n lazy(() => BoldStruct) as unknown as Struct<\n SnapElement\n >,\n ]),\n ),\n ),\n});\n\nexport const FormattingStruct: Describe = nullUnion([\n BoldStruct,\n ItalicStruct,\n]);\n\n/**\n * A struct for the {@link AddressElement} type.\n */\nexport const AddressStruct: Describe = element('Address', {\n address: HexChecksumAddressStruct,\n});\n\n/**\n * A struct for the {@link BoxElement} type.\n */\nexport const BoxStruct: Describe = element('Box', {\n children: maybeArray(\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n nullable(lazy(() => BoxChildStruct)),\n ) as unknown as Struct, null>,\n direction: optional(nullUnion([literal('horizontal'), literal('vertical')])),\n alignment: optional(\n nullUnion([\n literal('start'),\n literal('center'),\n literal('end'),\n literal('space-between'),\n literal('space-around'),\n ]),\n ),\n});\n\n/**\n * A struct for the {@link CopyableElement} type.\n */\nexport const CopyableStruct: Describe = element('Copyable', {\n value: string(),\n sensitive: optional(boolean()),\n});\n\n/**\n * A struct for the {@link DividerElement} type.\n */\nexport const DividerStruct: Describe = element('Divider');\n\n/**\n * A struct for the {@link ValueElement} type.\n */\nexport const ValueStruct: Describe = element('Value', {\n value: string(),\n extra: string(),\n});\n\n/**\n * A struct for the {@link HeadingElement} type.\n */\nexport const HeadingStruct: Describe = element('Heading', {\n children: StringElementStruct,\n});\n\n/**\n * A struct for the {@link ImageElement} type.\n */\nexport const ImageStruct: Describe = element('Image', {\n src: string(),\n alt: optional(string()),\n});\n\n/**\n * A struct for the {@link LinkElement} type.\n */\nexport const LinkStruct: Describe = element('Link', {\n href: string(),\n children: maybeArray(nullable(nullUnion([FormattingStruct, string()]))),\n});\n\n/**\n * A struct for the {@link TextElement} type.\n */\nexport const TextStruct: Describe = element('Text', {\n children: maybeArray(\n nullable(nullUnion([string(), BoldStruct, ItalicStruct, LinkStruct])),\n ),\n});\n\n/**\n * A struct for the {@link RowElement} type.\n */\nexport const RowStruct: Describe = element('Row', {\n label: string(),\n children: nullUnion([AddressStruct, ImageStruct, TextStruct, ValueStruct]),\n variant: optional(\n nullUnion([literal('default'), literal('warning'), literal('error')]),\n ),\n});\n\n/**\n * A struct for the {@link SpinnerElement} type.\n */\nexport const SpinnerStruct: Describe = element('Spinner');\n\n/**\n * A subset of JSX elements that are allowed as children of the Box component.\n * This set should include all components, except components that need to be nested\n * in another component (e.g. Field must be contained in a Form).\n */\nexport const BoxChildStruct = nullUnion([\n ButtonStruct,\n InputStruct,\n FormStruct,\n BoldStruct,\n ItalicStruct,\n AddressStruct,\n BoxStruct,\n CopyableStruct,\n DividerStruct,\n HeadingStruct,\n ImageStruct,\n LinkStruct,\n RowStruct,\n SpinnerStruct,\n TextStruct,\n DropdownStruct,\n]);\n\n/**\n * For now, the allowed JSX elements at the root are the same as the allowed\n * children of the Box component.\n */\nexport const RootJSXElementStruct = BoxChildStruct;\n\n/**\n * A struct for the {@link JSXElement} type.\n */\nexport const JSXElementStruct: Describe = nullUnion([\n ButtonStruct,\n InputStruct,\n FieldStruct,\n FormStruct,\n BoldStruct,\n ItalicStruct,\n AddressStruct,\n BoxStruct,\n CopyableStruct,\n DividerStruct,\n HeadingStruct,\n ImageStruct,\n LinkStruct,\n RowStruct,\n SpinnerStruct,\n TextStruct,\n DropdownStruct,\n OptionStruct,\n ValueStruct,\n]);\n\n/**\n * Check if a value is a JSX element.\n *\n * @param value - The value to check.\n * @returns True if the value is a JSX element, false otherwise.\n */\nexport function isJSXElement(value: unknown): value is JSXElement {\n return is(value, JSXElementStruct);\n}\n\n/**\n * Check if a value is a JSX element, without validating all of its contents.\n * This is useful when you want to validate the structure of a value, but not\n * all the children.\n *\n * This should only be used when you are sure that the value is safe to use,\n * i.e., after using {@link isJSXElement}.\n *\n * @param value - The value to check.\n * @returns True if the value is a JSX element, false otherwise.\n */\nexport function isJSXElementUnsafe(value: unknown): value is JSXElement {\n return (\n isPlainObject(value) &&\n hasProperty(value, 'type') &&\n hasProperty(value, 'props') &&\n hasProperty(value, 'key')\n );\n}\n\n/**\n * Assert that a value is a JSX element.\n *\n * @param value - The value to check.\n * @throws If the value is not a JSX element.\n */\nexport function assertJSXElement(value: unknown): asserts value is JSXElement {\n // TODO: We should use the error parsing utils from `snaps-utils` to improve\n // the error messages. It currently includes colours and potentially other\n // formatting that we might not want to include in the SDK.\n if (!isJSXElement(value)) {\n throw new Error(\n `Expected a JSX element, but received ${JSON.stringify(\n value,\n )}. Please refer to the documentation for the supported JSX elements and their props.`,\n );\n }\n}\n","import type { Infer } from 'superstruct';\nimport {\n Struct,\n define,\n literal as superstructLiteral,\n union as superstructUnion,\n} from 'superstruct';\nimport type { AnyStruct, InferStructTuple } from 'superstruct';\n\nimport type { EnumToUnion } from './helpers';\n\n/**\n * A wrapper of `superstruct`'s `literal` struct that also defines the name of\n * the struct as the literal value.\n *\n * This is useful for improving the error messages returned by `superstruct`.\n * For example, instead of returning an error like:\n *\n * ```\n * Expected the value to satisfy a union of `literal | literal`, but received: \\\"baz\\\"\n * ```\n *\n * This struct will return an error like:\n *\n * ```\n * Expected the value to satisfy a union of `\"foo\" | \"bar\"`, but received: \\\"baz\\\"\n * ```\n *\n * @param value - The literal value.\n * @returns The `superstruct` struct, which validates that the value is equal\n * to the literal value.\n */\nexport function literal(value: Type) {\n return define(\n JSON.stringify(value),\n superstructLiteral(value).validator,\n );\n}\n\n/**\n * A wrapper of `superstruct`'s `union` struct that also defines the schema as\n * the union of the schemas of the structs.\n *\n * This is useful for improving the error messages returned by `superstruct`.\n *\n * @param structs - The structs to union.\n * @param structs.\"0\" - The first struct.\n * @param structs.\"1\" - The remaining structs.\n * @returns The `superstruct` struct, which validates that the value satisfies\n * one of the structs.\n */\nexport function union([\n head,\n ...tail\n]: [head: Head, ...tail: Tail]): Struct<\n Infer | InferStructTuple[number],\n [head: Head, ...tail: Tail]\n> {\n const struct = superstructUnion([head, ...tail]);\n\n return new Struct({\n ...struct,\n schema: [head, ...tail],\n });\n}\n\n/**\n * Superstruct struct for validating an enum value. This allows using both the\n * enum string values and the enum itself as values.\n *\n * @param constant - The enum to validate against.\n * @returns The superstruct struct.\n */\nexport function enumValue(\n constant: Type,\n): Struct, null> {\n return literal(constant as EnumToUnion);\n}\n","import type { Infer, Struct } from 'superstruct';\nimport type {\n AnyStruct,\n EnumSchema,\n InferStructTuple,\n IsExactMatch,\n IsMatch,\n IsRecord,\n IsTuple,\n UnionToIntersection,\n} from 'superstruct';\n\nimport type { EmptyObject } from '../types';\nimport { union } from './structs';\n\n/**\n * Check if a type is a union. Infers `true` if it is a union, otherwise\n * `false`.\n */\ntype IsUnion = [Type] extends [UnionToIntersection] ? false : true;\n\n/**\n * Get a struct schema for a type.\n *\n * This is copied from `superstruct` but fixes some issues with the original\n * implementation.\n */\ntype StructSchema = IsUnion extends true\n ? null\n : [Type] extends [EmptyObject]\n ? EmptyObject\n : [Type] extends [string | undefined | null]\n ? [Type] extends [`0x${string}`]\n ? null\n : [Type] extends [IsMatch]\n ? null\n : [Type] extends [IsUnion]\n ? EnumSchema\n : Type\n : [Type] extends [number | undefined | null]\n ? [Type] extends [IsMatch]\n ? null\n : [Type] extends [IsUnion]\n ? EnumSchema\n : Type\n : [Type] extends [boolean]\n ? [Type] extends [IsExactMatch]\n ? null\n : Type\n : Type extends\n | bigint\n | symbol\n | undefined\n | null\n // eslint-disable-next-line @typescript-eslint/ban-types\n | Function\n | Date\n | Error\n | RegExp\n | Map\n | WeakMap\n | Set\n | WeakSet\n | Promise\n ? null\n : Type extends (infer E)[]\n ? Type extends IsTuple\n ? null\n : Struct\n : Type extends object\n ? Type extends IsRecord\n ? null\n : {\n [InnerKey in keyof Type]: Describe;\n }\n : null;\n\n/**\n * Describe a struct type.\n */\nexport type Describe = Struct>;\n\n/**\n * Create a union struct that uses `null` for the schema type, for better\n * compatibility with `Describe`.\n *\n * @param structs - The structs to union.\n * @returns The `superstruct` struct, which validates that the value satisfies\n * one of the structs.\n */\nexport function nullUnion(\n structs: [head: Head, ...tail: Tail],\n) {\n return union(structs) as unknown as Struct<\n Infer | InferStructTuple[number],\n null\n >;\n}\n","import type { JsonObject, Key, SnapComponent } from './component';\nimport { jsx } from './jsx-runtime';\nimport { assertJSXElement } from './validation';\n\n/**\n * The JSX runtime for Snaps SDK components. This function is used to render\n * Snap components into a format that can be used by the Snaps.\n *\n * This is the \"development\" version of the runtime, which includes additional\n * validation, which is otherwise handled by MetaMask. To use this runtime,\n * specify `@metamask/snaps-sdk` as import source for JSX, and use\n * `react-jsxdev` as the pragma.\n *\n * @param component - The component to render.\n * @param props - The props to pass to the component.\n * @param key - The key of the component.\n * @returns The rendered component.\n * @see https://www.typescriptlang.org/tsconfig/#jsx\n */\nexport function jsxDEV(\n component: SnapComponent,\n props: Props,\n key: Key | null,\n): unknown | null {\n const element = jsx(component, props, key);\n assertJSXElement(element);\n\n return element;\n}\n"],"mappings":";AA4EA,SAAS,qBAA+C,OAAqB;AAC3E,SAAO,OAAO;AAAA,IACZ,OAAO,QAAQ,KAAK,EAAE,OAAO,CAAC,CAAC,EAAE,KAAK,MAAM,UAAU,MAAS;AAAA,EACjE;AACF;AAUO,SAAS,oBAGd,MAAwC;AACxC,SAAO,CAAC,UAAwC;AAC9C,UAAM,EAAE,MAAM,MAAM,GAAG,KAAK,IAAI;AAChC,WAAO;AAAA,MACL;AAAA,MACA,OAAO,qBAAqB,IAAa;AAAA,MACzC;AAAA,IACF;AAAA,EACF;AACF;;;AC7EA,IAAM,OAAO;AAYN,IAAM,SAAS,oBAA8C,IAAI;;;ACnBxE,IAAMA,QAAO;AAmBN,IAAM,WAAW,oBAAgDA,KAAI;;;ACvB5E,IAAMC,QAAO;AAkBN,IAAM,SAAS,oBAA8CA,KAAI;;;ACdxE,IAAMC,QAAO;AAiBN,IAAM,QAAQ,oBAA6CA,KAAI;;;AChBtE,IAAMC,QAAO;AAmBN,IAAM,OAAO,oBAA4CA,KAAI;;;AClBpE,IAAMC,QAAO;AAgBN,IAAM,QAAQ,oBAA6CA,KAAI;;;ACZtE,IAAMC,QAAO;AAcN,IAAM,OAAO,oBAA4CA,KAAI;;;ACfpE,IAAMC,QAAO;AAeN,IAAM,SAAS,oBAA8CA,KAAI;;;AC1BxE,IAAMC,QAAO;AAcN,IAAM,UAAU,oBAA+CA,KAAI;;;ACT1E,IAAMC,SAAO;AAaN,IAAM,MAAM,oBAA2CA,MAAI;;;ACflE,IAAMC,SAAO;AAeN,IAAM,WAAW,oBAAgDA,MAAI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,QAAQ,OAAO,CAAC,CAAC;AAAA,EACtE;AACF,CAAC;AAKM,IAAM,gBAA0C,QAAQ,SAAS;AAOjE,IAAM,iBAAiB,UAAU;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAMM,IAAM,uBAAuB;AAK7B,IAAM,mBAAyC,UAAU;AAAA,EAC9D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAQM,SAAS,aAAa,OAAqC;AAChE,SAAO,GAAG,OAAO,gBAAgB;AACnC;AAaO,SAAS,mBAAmB,OAAqC;AACtE,SACE,cAAc,KAAK,KACnB,YAAY,OAAO,MAAM,KACzB,YAAY,OAAO,OAAO,KAC1B,YAAY,OAAO,KAAK;AAE5B;AAQO,SAAS,iBAAiB,OAA6C;AAI5E,MAAI,CAAC,aAAa,KAAK,GAAG;AACxB,UAAM,IAAI;AAAA,MACR,wCAAwC,KAAK;AAAA,QAC3C;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AACF;;;AGnYO,SAAS,OACd,WACA,OACA,KACgB;AAChB,QAAMC,WAAU,IAAI,WAAW,OAAO,GAAG;AACzC,mBAAiBA,QAAO;AAExB,SAAOA;AACT;","names":["TYPE","TYPE","TYPE","TYPE","TYPE","TYPE","TYPE","TYPE","TYPE","TYPE","TYPE","TYPE","TYPE","TYPE","TYPE","TYPE","TYPE","TYPE","element"]} +\ No newline at end of file +diff --git a/dist/jsx/jsx-dev-runtime.js.map b/dist/jsx/jsx-dev-runtime.js.map +index 48aa98ff1c8e93e24d2d7aab993b5086c0e26e73..5eeb9d4013a09181b0259eabf0810ecfb1957230 100644 +--- a/dist/jsx/jsx-dev-runtime.js.map ++++ b/dist/jsx/jsx-dev-runtime.js.map +@@ -1 +1 @@ +-{"version":3,"sources":["../../src/jsx/jsx-dev-runtime.ts","../../src/jsx/jsx-runtime.ts","../../src/jsx/validation.ts","../../src/internals/structs.ts","../../src/internals/jsx.ts"],"sourcesContent":["import type { JsonObject, Key, SnapComponent } from './component';\nimport { jsx } from './jsx-runtime';\nimport { assertJSXElement } from './validation';\n\n/**\n * The JSX runtime for Snaps SDK components. This function is used to render\n * Snap components into a format that can be used by the Snaps.\n *\n * This is the \"development\" version of the runtime, which includes additional\n * validation, which is otherwise handled by MetaMask. To use this runtime,\n * specify `@metamask/snaps-sdk` as import source for JSX, and use\n * `react-jsxdev` as the pragma.\n *\n * @param component - The component to render.\n * @param props - The props to pass to the component.\n * @param key - The key of the component.\n * @returns The rendered component.\n * @see https://www.typescriptlang.org/tsconfig/#jsx\n */\nexport function jsxDEV(\n component: SnapComponent,\n props: Props,\n key: Key | null,\n): unknown | null {\n const element = jsx(component, props, key);\n assertJSXElement(element);\n\n return element;\n}\n","import type { JsonObject, Key, SnapComponent } from './component';\n\n/**\n * The JSX runtime for Snaps SDK components. This function is used to render\n * Snap components into a format that can be used by the Snaps.\n *\n * This is the \"production\" version of the runtime, which does not include\n * additional validation, as it is handled by MetaMask. To use this runtime,\n * specify `@metamask/snaps-sdk` as import source for JSX, and use `react-jsx`\n * as the pragma.\n *\n * @param component - The component to render.\n * @param props - The props to pass to the component.\n * @param key - The key of the component.\n * @returns The rendered component.\n * @see https://www.typescriptlang.org/tsconfig/#jsx\n */\nexport function jsx(\n component: SnapComponent,\n props: Props,\n key: Key | null,\n): unknown | null {\n if (typeof component === 'string') {\n // If component is a string, it is a built-in HTML element. This is not\n // supported in Snaps, so we throw an error.\n throw new Error(\n `An HTML element (\"${String(\n component,\n )}\") was used in a Snap component, which is not supported by Snaps UI. Please use one of the supported Snap components.`,\n );\n }\n\n if (!component) {\n // If component is undefined, a JSX fragment `<>...` was used, which is\n // not supported in Snaps.\n throw new Error(\n 'A JSX fragment was used in a Snap component, which is not supported by Snaps UI. Please use one of the supported Snap components.',\n );\n }\n\n return component({ ...props, key });\n}\n\n/**\n * The JSX runtime for Snaps SDK components. This function is used to render\n * Snap components into a format that can be used by the Snaps.\n *\n * The `jsxs` function is used for rendering nested components.\n *\n * This is the \"production\" version of the runtime, which does not include\n * additional validation, as it is handled by MetaMask. To use this runtime,\n * specify `@metamask/snaps-sdk` as import source for JSX, and use `react-jsx`\n * as the pragma.\n *\n * @param component - The component to render.\n * @param props - The props to pass to the component.\n * @param key - The key of the component.\n * @returns The rendered component.\n * @see https://www.typescriptlang.org/tsconfig/#jsx\n */\nexport function jsxs(\n component: SnapComponent,\n props: Props,\n key: Key | null,\n): unknown | null {\n return jsx(component, props, key);\n}\n","import {\n hasProperty,\n HexChecksumAddressStruct,\n isPlainObject,\n JsonStruct,\n} from '@metamask/utils';\nimport type { Struct } from 'superstruct';\nimport {\n is,\n boolean,\n optional,\n array,\n lazy,\n nullable,\n number,\n object,\n record,\n string,\n tuple,\n} from 'superstruct';\nimport type { ObjectSchema } from 'superstruct/dist/utils';\n\nimport type { Describe } from '../internals';\nimport { literal, nullUnion } from '../internals';\nimport type { EmptyObject } from '../types';\nimport type {\n GenericSnapElement,\n JsonObject,\n Key,\n MaybeArray,\n SnapElement,\n StringElement,\n} from './component';\nimport type {\n AddressElement,\n BoldElement,\n BoxElement,\n ButtonElement,\n CopyableElement,\n DividerElement,\n DropdownElement,\n OptionElement,\n FieldElement,\n FormElement,\n HeadingElement,\n ImageElement,\n InputElement,\n ItalicElement,\n JSXElement,\n LinkElement,\n RowElement,\n SpinnerElement,\n StandardFormattingElement,\n TextElement,\n ValueElement,\n} from './components';\n\n/**\n * A struct for the {@link Key} type.\n */\nexport const KeyStruct: Describe = nullUnion([string(), number()]);\n\n/**\n * A struct for the {@link StringElement} type.\n */\nexport const StringElementStruct: Describe = maybeArray(\n string(),\n);\n\n/**\n * A struct for the {@link GenericSnapElement} type.\n */\nexport const ElementStruct: Describe = object({\n type: string(),\n props: record(string(), JsonStruct),\n key: nullable(KeyStruct),\n});\n\n/**\n * A helper function for creating a struct for a {@link MaybeArray} type.\n *\n * @param struct - The struct for the maybe array type.\n * @returns The struct for the maybe array type.\n */\nfunction maybeArray(\n struct: Struct,\n): Struct, any> {\n return nullUnion([struct, array(struct)]);\n}\n\n/**\n * A helper function for creating a struct for a JSX element.\n *\n * @param name - The name of the element.\n * @param props - The props of the element.\n * @returns The struct for the element.\n */\nfunction element(\n name: Name,\n props: Props = {} as Props,\n) {\n return object({\n type: literal(name) as unknown as Struct,\n props: object(props),\n key: nullable(KeyStruct),\n });\n}\n\n/**\n * A struct for the {@link ButtonElement} type.\n */\nexport const ButtonStruct: Describe = element('Button', {\n children: StringElementStruct,\n name: optional(string()),\n type: optional(nullUnion([literal('button'), literal('submit')])),\n variant: optional(nullUnion([literal('primary'), literal('destructive')])),\n disabled: optional(boolean()),\n});\n\n/**\n * A struct for the {@link InputElement} type.\n */\nexport const InputStruct: Describe = element('Input', {\n name: string(),\n type: optional(\n nullUnion([literal('text'), literal('password'), literal('number')]),\n ),\n value: optional(string()),\n placeholder: optional(string()),\n});\n\n/**\n * A struct for the {@link OptionElement} type.\n */\nexport const OptionStruct: Describe = element('Option', {\n value: string(),\n children: string(),\n});\n\n/**\n * A struct for the {@link DropdownElement} type.\n */\nexport const DropdownStruct: Describe = element('Dropdown', {\n name: string(),\n value: optional(string()),\n children: maybeArray(OptionStruct),\n});\n\n/**\n * A struct for the {@link FieldElement} type.\n */\nexport const FieldStruct: Describe = element('Field', {\n label: optional(string()),\n error: optional(string()),\n children: nullUnion([\n tuple([InputStruct, ButtonStruct]),\n InputStruct,\n DropdownStruct,\n ]),\n});\n\n/**\n * A struct for the {@link FormElement} type.\n */\nexport const FormStruct: Describe = element('Form', {\n children: maybeArray(nullUnion([FieldStruct, ButtonStruct])),\n name: string(),\n});\n\n/**\n * A struct for the {@link BoldElement} type.\n */\nexport const BoldStruct: Describe = element('Bold', {\n children: maybeArray(\n nullable(\n nullUnion([\n string(),\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n lazy(() => ItalicStruct) as unknown as Struct<\n SnapElement\n >,\n ]),\n ),\n ),\n});\n\n/**\n * A struct for the {@link ItalicElement} type.\n */\nexport const ItalicStruct: Describe = element('Italic', {\n children: maybeArray(\n nullable(\n nullUnion([\n string(),\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n lazy(() => BoldStruct) as unknown as Struct<\n SnapElement\n >,\n ]),\n ),\n ),\n});\n\nexport const FormattingStruct: Describe = nullUnion([\n BoldStruct,\n ItalicStruct,\n]);\n\n/**\n * A struct for the {@link AddressElement} type.\n */\nexport const AddressStruct: Describe = element('Address', {\n address: HexChecksumAddressStruct,\n});\n\n/**\n * A struct for the {@link BoxElement} type.\n */\nexport const BoxStruct: Describe = element('Box', {\n children: maybeArray(\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n nullable(lazy(() => BoxChildStruct)),\n ) as unknown as Struct, null>,\n direction: optional(nullUnion([literal('horizontal'), literal('vertical')])),\n alignment: optional(\n nullUnion([\n literal('start'),\n literal('center'),\n literal('end'),\n literal('space-between'),\n literal('space-around'),\n ]),\n ),\n});\n\n/**\n * A struct for the {@link CopyableElement} type.\n */\nexport const CopyableStruct: Describe = element('Copyable', {\n value: string(),\n sensitive: optional(boolean()),\n});\n\n/**\n * A struct for the {@link DividerElement} type.\n */\nexport const DividerStruct: Describe = element('Divider');\n\n/**\n * A struct for the {@link ValueElement} type.\n */\nexport const ValueStruct: Describe = element('Value', {\n value: string(),\n extra: string(),\n});\n\n/**\n * A struct for the {@link HeadingElement} type.\n */\nexport const HeadingStruct: Describe = element('Heading', {\n children: StringElementStruct,\n});\n\n/**\n * A struct for the {@link ImageElement} type.\n */\nexport const ImageStruct: Describe = element('Image', {\n src: string(),\n alt: optional(string()),\n});\n\n/**\n * A struct for the {@link LinkElement} type.\n */\nexport const LinkStruct: Describe = element('Link', {\n href: string(),\n children: maybeArray(nullable(nullUnion([FormattingStruct, string()]))),\n});\n\n/**\n * A struct for the {@link TextElement} type.\n */\nexport const TextStruct: Describe = element('Text', {\n children: maybeArray(\n nullable(nullUnion([string(), BoldStruct, ItalicStruct, LinkStruct])),\n ),\n});\n\n/**\n * A struct for the {@link RowElement} type.\n */\nexport const RowStruct: Describe = element('Row', {\n label: string(),\n children: nullUnion([AddressStruct, ImageStruct, TextStruct, ValueStruct]),\n variant: optional(\n nullUnion([literal('default'), literal('warning'), literal('error')]),\n ),\n});\n\n/**\n * A struct for the {@link SpinnerElement} type.\n */\nexport const SpinnerStruct: Describe = element('Spinner');\n\n/**\n * A subset of JSX elements that are allowed as children of the Box component.\n * This set should include all components, except components that need to be nested\n * in another component (e.g. Field must be contained in a Form).\n */\nexport const BoxChildStruct = nullUnion([\n ButtonStruct,\n InputStruct,\n FormStruct,\n BoldStruct,\n ItalicStruct,\n AddressStruct,\n BoxStruct,\n CopyableStruct,\n DividerStruct,\n HeadingStruct,\n ImageStruct,\n LinkStruct,\n RowStruct,\n SpinnerStruct,\n TextStruct,\n DropdownStruct,\n]);\n\n/**\n * For now, the allowed JSX elements at the root are the same as the allowed\n * children of the Box component.\n */\nexport const RootJSXElementStruct = BoxChildStruct;\n\n/**\n * A struct for the {@link JSXElement} type.\n */\nexport const JSXElementStruct: Describe = nullUnion([\n ButtonStruct,\n InputStruct,\n FieldStruct,\n FormStruct,\n BoldStruct,\n ItalicStruct,\n AddressStruct,\n BoxStruct,\n CopyableStruct,\n DividerStruct,\n HeadingStruct,\n ImageStruct,\n LinkStruct,\n RowStruct,\n SpinnerStruct,\n TextStruct,\n DropdownStruct,\n OptionStruct,\n ValueStruct,\n]);\n\n/**\n * Check if a value is a JSX element.\n *\n * @param value - The value to check.\n * @returns True if the value is a JSX element, false otherwise.\n */\nexport function isJSXElement(value: unknown): value is JSXElement {\n return is(value, JSXElementStruct);\n}\n\n/**\n * Check if a value is a JSX element, without validating all of its contents.\n * This is useful when you want to validate the structure of a value, but not\n * all the children.\n *\n * This should only be used when you are sure that the value is safe to use,\n * i.e., after using {@link isJSXElement}.\n *\n * @param value - The value to check.\n * @returns True if the value is a JSX element, false otherwise.\n */\nexport function isJSXElementUnsafe(value: unknown): value is JSXElement {\n return (\n isPlainObject(value) &&\n hasProperty(value, 'type') &&\n hasProperty(value, 'props') &&\n hasProperty(value, 'key')\n );\n}\n\n/**\n * Assert that a value is a JSX element.\n *\n * @param value - The value to check.\n * @throws If the value is not a JSX element.\n */\nexport function assertJSXElement(value: unknown): asserts value is JSXElement {\n // TODO: We should use the error parsing utils from `snaps-utils` to improve\n // the error messages. It currently includes colours and potentially other\n // formatting that we might not want to include in the SDK.\n if (!isJSXElement(value)) {\n throw new Error(\n `Expected a JSX element, but received ${JSON.stringify(\n value,\n )}. Please refer to the documentation for the supported JSX elements and their props.`,\n );\n }\n}\n","import type { Infer } from 'superstruct';\nimport {\n Struct,\n define,\n literal as superstructLiteral,\n union as superstructUnion,\n} from 'superstruct';\nimport type { AnyStruct, InferStructTuple } from 'superstruct/dist/utils';\n\nimport type { EnumToUnion } from './helpers';\n\n/**\n * A wrapper of `superstruct`'s `literal` struct that also defines the name of\n * the struct as the literal value.\n *\n * This is useful for improving the error messages returned by `superstruct`.\n * For example, instead of returning an error like:\n *\n * ```\n * Expected the value to satisfy a union of `literal | literal`, but received: \\\"baz\\\"\n * ```\n *\n * This struct will return an error like:\n *\n * ```\n * Expected the value to satisfy a union of `\"foo\" | \"bar\"`, but received: \\\"baz\\\"\n * ```\n *\n * @param value - The literal value.\n * @returns The `superstruct` struct, which validates that the value is equal\n * to the literal value.\n */\nexport function literal(value: Type) {\n return define(\n JSON.stringify(value),\n superstructLiteral(value).validator,\n );\n}\n\n/**\n * A wrapper of `superstruct`'s `union` struct that also defines the schema as\n * the union of the schemas of the structs.\n *\n * This is useful for improving the error messages returned by `superstruct`.\n *\n * @param structs - The structs to union.\n * @param structs.\"0\" - The first struct.\n * @param structs.\"1\" - The remaining structs.\n * @returns The `superstruct` struct, which validates that the value satisfies\n * one of the structs.\n */\nexport function union([\n head,\n ...tail\n]: [head: Head, ...tail: Tail]): Struct<\n Infer | InferStructTuple[number],\n [head: Head, ...tail: Tail]\n> {\n const struct = superstructUnion([head, ...tail]);\n\n return new Struct({\n ...struct,\n schema: [head, ...tail],\n });\n}\n\n/**\n * Superstruct struct for validating an enum value. This allows using both the\n * enum string values and the enum itself as values.\n *\n * @param constant - The enum to validate against.\n * @returns The superstruct struct.\n */\nexport function enumValue(\n constant: Type,\n): Struct, null> {\n return literal(constant as EnumToUnion);\n}\n","import type { Infer, Struct } from 'superstruct';\nimport type {\n AnyStruct,\n EnumSchema,\n InferStructTuple,\n IsExactMatch,\n IsMatch,\n IsRecord,\n IsTuple,\n UnionToIntersection,\n} from 'superstruct/dist/utils';\n\nimport type { EmptyObject } from '../types';\nimport { union } from './structs';\n\n/**\n * Check if a type is a union. Infers `true` if it is a union, otherwise\n * `false`.\n */\ntype IsUnion = [Type] extends [UnionToIntersection] ? false : true;\n\n/**\n * Get a struct schema for a type.\n *\n * This is copied from `superstruct` but fixes some issues with the original\n * implementation.\n */\ntype StructSchema = IsUnion extends true\n ? null\n : [Type] extends [EmptyObject]\n ? EmptyObject\n : [Type] extends [string | undefined | null]\n ? [Type] extends [`0x${string}`]\n ? null\n : [Type] extends [IsMatch]\n ? null\n : [Type] extends [IsUnion]\n ? EnumSchema\n : Type\n : [Type] extends [number | undefined | null]\n ? [Type] extends [IsMatch]\n ? null\n : [Type] extends [IsUnion]\n ? EnumSchema\n : Type\n : [Type] extends [boolean]\n ? [Type] extends [IsExactMatch]\n ? null\n : Type\n : Type extends\n | bigint\n | symbol\n | undefined\n | null\n // eslint-disable-next-line @typescript-eslint/ban-types\n | Function\n | Date\n | Error\n | RegExp\n | Map\n | WeakMap\n | Set\n | WeakSet\n | Promise\n ? null\n : Type extends (infer E)[]\n ? Type extends IsTuple\n ? null\n : Struct\n : Type extends object\n ? Type extends IsRecord\n ? null\n : {\n [InnerKey in keyof Type]: Describe;\n }\n : null;\n\n/**\n * Describe a struct type.\n */\nexport type Describe = Struct>;\n\n/**\n * Create a union struct that uses `null` for the schema type, for better\n * compatibility with `Describe`.\n *\n * @param structs - The structs to union.\n * @returns The `superstruct` struct, which validates that the value satisfies\n * one of the structs.\n */\nexport function nullUnion(\n structs: [head: Head, ...tail: Tail],\n) {\n return union(structs) as unknown as Struct<\n Infer | InferStructTuple[number],\n null\n >;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACiBO,SAAS,IACd,WACA,OACA,KACgB;AAChB,MAAI,OAAO,cAAc,UAAU;AAGjC,UAAM,IAAI;AAAA,MACR,qBAAqB;AAAA,QACnB;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AAEA,MAAI,CAAC,WAAW;AAGd,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEA,SAAO,UAAU,EAAE,GAAG,OAAO,IAAI,CAAC;AACpC;;;ACzCA,mBAKO;AAEP,IAAAA,sBAYO;;;AClBP,yBAKO;AA0BA,SAAS,QAAgD,OAAa;AAC3E,aAAO;AAAA,IACL,KAAK,UAAU,KAAK;AAAA,QACpB,mBAAAC,SAAmB,KAAK,EAAE;AAAA,EAC5B;AACF;AAcO,SAAS,MAAwD;AAAA,EACtE;AAAA,EACA,GAAG;AACL,GAGE;AACA,QAAM,aAAS,mBAAAC,OAAiB,CAAC,MAAM,GAAG,IAAI,CAAC;AAE/C,SAAO,IAAI,0BAAO;AAAA,IAChB,GAAG;AAAA,IACH,QAAQ,CAAC,MAAM,GAAG,IAAI;AAAA,EACxB,CAAC;AACH;;;AC0BO,SAAS,UACd,SACA;AACA,SAAO,MAAM,OAAO;AAItB;;;AFrCO,IAAM,YAA2B,UAAU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AAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAWM,IAAM,mBAAyC,UAAU;AAAA,EAC9D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAQM,SAAS,aAAa,OAAqC;AAChE,aAAO,wBAAG,OAAO,gBAAgB;AACnC;AA4BO,SAAS,iBAAiB,OAA6C;AAI5E,MAAI,CAAC,aAAa,KAAK,GAAG;AACxB,UAAM,IAAI;AAAA,MACR,wCAAwC,KAAK;AAAA,QAC3C;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AACF;;;AFnYO,SAAS,OACd,WACA,OACA,KACgB;AAChB,QAAMC,WAAU,IAAI,WAAW,OAAO,GAAG;AACzC,mBAAiBA,QAAO;AAExB,SAAOA;AACT;","names":["import_superstruct","superstructLiteral","superstructUnion","element"]} +\ No newline at end of file ++{"version":3,"sources":["../../src/jsx/jsx-dev-runtime.ts","../../src/jsx/jsx-runtime.ts","../../src/jsx/validation.ts","../../src/internals/structs.ts","../../src/internals/jsx.ts"],"sourcesContent":["import type { JsonObject, Key, SnapComponent } from './component';\nimport { jsx } from './jsx-runtime';\nimport { assertJSXElement } from './validation';\n\n/**\n * The JSX runtime for Snaps SDK components. This function is used to render\n * Snap components into a format that can be used by the Snaps.\n *\n * This is the \"development\" version of the runtime, which includes additional\n * validation, which is otherwise handled by MetaMask. To use this runtime,\n * specify `@metamask/snaps-sdk` as import source for JSX, and use\n * `react-jsxdev` as the pragma.\n *\n * @param component - The component to render.\n * @param props - The props to pass to the component.\n * @param key - The key of the component.\n * @returns The rendered component.\n * @see https://www.typescriptlang.org/tsconfig/#jsx\n */\nexport function jsxDEV(\n component: SnapComponent,\n props: Props,\n key: Key | null,\n): unknown | null {\n const element = jsx(component, props, key);\n assertJSXElement(element);\n\n return element;\n}\n","import type { JsonObject, Key, SnapComponent } from './component';\n\n/**\n * The JSX runtime for Snaps SDK components. This function is used to render\n * Snap components into a format that can be used by the Snaps.\n *\n * This is the \"production\" version of the runtime, which does not include\n * additional validation, as it is handled by MetaMask. To use this runtime,\n * specify `@metamask/snaps-sdk` as import source for JSX, and use `react-jsx`\n * as the pragma.\n *\n * @param component - The component to render.\n * @param props - The props to pass to the component.\n * @param key - The key of the component.\n * @returns The rendered component.\n * @see https://www.typescriptlang.org/tsconfig/#jsx\n */\nexport function jsx(\n component: SnapComponent,\n props: Props,\n key: Key | null,\n): unknown | null {\n if (typeof component === 'string') {\n // If component is a string, it is a built-in HTML element. This is not\n // supported in Snaps, so we throw an error.\n throw new Error(\n `An HTML element (\"${String(\n component,\n )}\") was used in a Snap component, which is not supported by Snaps UI. Please use one of the supported Snap components.`,\n );\n }\n\n if (!component) {\n // If component is undefined, a JSX fragment `<>...` was used, which is\n // not supported in Snaps.\n throw new Error(\n 'A JSX fragment was used in a Snap component, which is not supported by Snaps UI. Please use one of the supported Snap components.',\n );\n }\n\n return component({ ...props, key });\n}\n\n/**\n * The JSX runtime for Snaps SDK components. This function is used to render\n * Snap components into a format that can be used by the Snaps.\n *\n * The `jsxs` function is used for rendering nested components.\n *\n * This is the \"production\" version of the runtime, which does not include\n * additional validation, as it is handled by MetaMask. To use this runtime,\n * specify `@metamask/snaps-sdk` as import source for JSX, and use `react-jsx`\n * as the pragma.\n *\n * @param component - The component to render.\n * @param props - The props to pass to the component.\n * @param key - The key of the component.\n * @returns The rendered component.\n * @see https://www.typescriptlang.org/tsconfig/#jsx\n */\nexport function jsxs(\n component: SnapComponent,\n props: Props,\n key: Key | null,\n): unknown | null {\n return jsx(component, props, key);\n}\n","import {\n hasProperty,\n HexChecksumAddressStruct,\n isPlainObject,\n JsonStruct,\n} from '@metamask/utils';\nimport type { Struct } from 'superstruct';\nimport {\n is,\n boolean,\n optional,\n array,\n lazy,\n nullable,\n number,\n object,\n record,\n string,\n tuple,\n} from 'superstruct';\nimport type { ObjectSchema } from 'superstruct';\n\nimport type { Describe } from '../internals';\nimport { literal, nullUnion } from '../internals';\nimport type { EmptyObject } from '../types';\nimport type {\n GenericSnapElement,\n JsonObject,\n Key,\n MaybeArray,\n SnapElement,\n StringElement,\n} from './component';\nimport type {\n AddressElement,\n BoldElement,\n BoxElement,\n ButtonElement,\n CopyableElement,\n DividerElement,\n DropdownElement,\n OptionElement,\n FieldElement,\n FormElement,\n HeadingElement,\n ImageElement,\n InputElement,\n ItalicElement,\n JSXElement,\n LinkElement,\n RowElement,\n SpinnerElement,\n StandardFormattingElement,\n TextElement,\n ValueElement,\n} from './components';\n\n/**\n * A struct for the {@link Key} type.\n */\nexport const KeyStruct: Describe = nullUnion([string(), number()]);\n\n/**\n * A struct for the {@link StringElement} type.\n */\nexport const StringElementStruct: Describe = maybeArray(\n string(),\n);\n\n/**\n * A struct for the {@link GenericSnapElement} type.\n */\nexport const ElementStruct: Describe = object({\n type: string(),\n props: record(string(), JsonStruct),\n key: nullable(KeyStruct),\n});\n\n/**\n * A helper function for creating a struct for a {@link MaybeArray} type.\n *\n * @param struct - The struct for the maybe array type.\n * @returns The struct for the maybe array type.\n */\nfunction maybeArray(\n struct: Struct,\n): Struct, any> {\n return nullUnion([struct, array(struct)]);\n}\n\n/**\n * A helper function for creating a struct for a JSX element.\n *\n * @param name - The name of the element.\n * @param props - The props of the element.\n * @returns The struct for the element.\n */\nfunction element(\n name: Name,\n props: Props = {} as Props,\n) {\n return object({\n type: literal(name) as unknown as Struct,\n props: object(props),\n key: nullable(KeyStruct),\n });\n}\n\n/**\n * A struct for the {@link ButtonElement} type.\n */\nexport const ButtonStruct: Describe = element('Button', {\n children: StringElementStruct,\n name: optional(string()),\n type: optional(nullUnion([literal('button'), literal('submit')])),\n variant: optional(nullUnion([literal('primary'), literal('destructive')])),\n disabled: optional(boolean()),\n});\n\n/**\n * A struct for the {@link InputElement} type.\n */\nexport const InputStruct: Describe = element('Input', {\n name: string(),\n type: optional(\n nullUnion([literal('text'), literal('password'), literal('number')]),\n ),\n value: optional(string()),\n placeholder: optional(string()),\n});\n\n/**\n * A struct for the {@link OptionElement} type.\n */\nexport const OptionStruct: Describe = element('Option', {\n value: string(),\n children: string(),\n});\n\n/**\n * A struct for the {@link DropdownElement} type.\n */\nexport const DropdownStruct: Describe = element('Dropdown', {\n name: string(),\n value: optional(string()),\n children: maybeArray(OptionStruct),\n});\n\n/**\n * A struct for the {@link FieldElement} type.\n */\nexport const FieldStruct: Describe = element('Field', {\n label: optional(string()),\n error: optional(string()),\n children: nullUnion([\n tuple([InputStruct, ButtonStruct]),\n InputStruct,\n DropdownStruct,\n ]),\n});\n\n/**\n * A struct for the {@link FormElement} type.\n */\nexport const FormStruct: Describe = element('Form', {\n children: maybeArray(nullUnion([FieldStruct, ButtonStruct])),\n name: string(),\n});\n\n/**\n * A struct for the {@link BoldElement} type.\n */\nexport const BoldStruct: Describe = element('Bold', {\n children: maybeArray(\n nullable(\n nullUnion([\n string(),\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n lazy(() => ItalicStruct) as unknown as Struct<\n SnapElement\n >,\n ]),\n ),\n ),\n});\n\n/**\n * A struct for the {@link ItalicElement} type.\n */\nexport const ItalicStruct: Describe = element('Italic', {\n children: maybeArray(\n nullable(\n nullUnion([\n string(),\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n lazy(() => BoldStruct) as unknown as Struct<\n SnapElement\n >,\n ]),\n ),\n ),\n});\n\nexport const FormattingStruct: Describe = nullUnion([\n BoldStruct,\n ItalicStruct,\n]);\n\n/**\n * A struct for the {@link AddressElement} type.\n */\nexport const AddressStruct: Describe = element('Address', {\n address: HexChecksumAddressStruct,\n});\n\n/**\n * A struct for the {@link BoxElement} type.\n */\nexport const BoxStruct: Describe = element('Box', {\n children: maybeArray(\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n nullable(lazy(() => BoxChildStruct)),\n ) as unknown as Struct, null>,\n direction: optional(nullUnion([literal('horizontal'), literal('vertical')])),\n alignment: optional(\n nullUnion([\n literal('start'),\n literal('center'),\n literal('end'),\n literal('space-between'),\n literal('space-around'),\n ]),\n ),\n});\n\n/**\n * A struct for the {@link CopyableElement} type.\n */\nexport const CopyableStruct: Describe = element('Copyable', {\n value: string(),\n sensitive: optional(boolean()),\n});\n\n/**\n * A struct for the {@link DividerElement} type.\n */\nexport const DividerStruct: Describe = element('Divider');\n\n/**\n * A struct for the {@link ValueElement} type.\n */\nexport const ValueStruct: Describe = element('Value', {\n value: string(),\n extra: string(),\n});\n\n/**\n * A struct for the {@link HeadingElement} type.\n */\nexport const HeadingStruct: Describe = element('Heading', {\n children: StringElementStruct,\n});\n\n/**\n * A struct for the {@link ImageElement} type.\n */\nexport const ImageStruct: Describe = element('Image', {\n src: string(),\n alt: optional(string()),\n});\n\n/**\n * A struct for the {@link LinkElement} type.\n */\nexport const LinkStruct: Describe = element('Link', {\n href: string(),\n children: maybeArray(nullable(nullUnion([FormattingStruct, string()]))),\n});\n\n/**\n * A struct for the {@link TextElement} type.\n */\nexport const TextStruct: Describe = element('Text', {\n children: maybeArray(\n nullable(nullUnion([string(), BoldStruct, ItalicStruct, LinkStruct])),\n ),\n});\n\n/**\n * A struct for the {@link RowElement} type.\n */\nexport const RowStruct: Describe = element('Row', {\n label: string(),\n children: nullUnion([AddressStruct, ImageStruct, TextStruct, ValueStruct]),\n variant: optional(\n nullUnion([literal('default'), literal('warning'), literal('error')]),\n ),\n});\n\n/**\n * A struct for the {@link SpinnerElement} type.\n */\nexport const SpinnerStruct: Describe = element('Spinner');\n\n/**\n * A subset of JSX elements that are allowed as children of the Box component.\n * This set should include all components, except components that need to be nested\n * in another component (e.g. Field must be contained in a Form).\n */\nexport const BoxChildStruct = nullUnion([\n ButtonStruct,\n InputStruct,\n FormStruct,\n BoldStruct,\n ItalicStruct,\n AddressStruct,\n BoxStruct,\n CopyableStruct,\n DividerStruct,\n HeadingStruct,\n ImageStruct,\n LinkStruct,\n RowStruct,\n SpinnerStruct,\n TextStruct,\n DropdownStruct,\n]);\n\n/**\n * For now, the allowed JSX elements at the root are the same as the allowed\n * children of the Box component.\n */\nexport const RootJSXElementStruct = BoxChildStruct;\n\n/**\n * A struct for the {@link JSXElement} type.\n */\nexport const JSXElementStruct: Describe = nullUnion([\n ButtonStruct,\n InputStruct,\n FieldStruct,\n FormStruct,\n BoldStruct,\n ItalicStruct,\n AddressStruct,\n BoxStruct,\n CopyableStruct,\n DividerStruct,\n HeadingStruct,\n ImageStruct,\n LinkStruct,\n RowStruct,\n SpinnerStruct,\n TextStruct,\n DropdownStruct,\n OptionStruct,\n ValueStruct,\n]);\n\n/**\n * Check if a value is a JSX element.\n *\n * @param value - The value to check.\n * @returns True if the value is a JSX element, false otherwise.\n */\nexport function isJSXElement(value: unknown): value is JSXElement {\n return is(value, JSXElementStruct);\n}\n\n/**\n * Check if a value is a JSX element, without validating all of its contents.\n * This is useful when you want to validate the structure of a value, but not\n * all the children.\n *\n * This should only be used when you are sure that the value is safe to use,\n * i.e., after using {@link isJSXElement}.\n *\n * @param value - The value to check.\n * @returns True if the value is a JSX element, false otherwise.\n */\nexport function isJSXElementUnsafe(value: unknown): value is JSXElement {\n return (\n isPlainObject(value) &&\n hasProperty(value, 'type') &&\n hasProperty(value, 'props') &&\n hasProperty(value, 'key')\n );\n}\n\n/**\n * Assert that a value is a JSX element.\n *\n * @param value - The value to check.\n * @throws If the value is not a JSX element.\n */\nexport function assertJSXElement(value: unknown): asserts value is JSXElement {\n // TODO: We should use the error parsing utils from `snaps-utils` to improve\n // the error messages. It currently includes colours and potentially other\n // formatting that we might not want to include in the SDK.\n if (!isJSXElement(value)) {\n throw new Error(\n `Expected a JSX element, but received ${JSON.stringify(\n value,\n )}. Please refer to the documentation for the supported JSX elements and their props.`,\n );\n }\n}\n","import type { Infer } from 'superstruct';\nimport {\n Struct,\n define,\n literal as superstructLiteral,\n union as superstructUnion,\n} from 'superstruct';\nimport type { AnyStruct, InferStructTuple } from 'superstruct';\n\nimport type { EnumToUnion } from './helpers';\n\n/**\n * A wrapper of `superstruct`'s `literal` struct that also defines the name of\n * the struct as the literal value.\n *\n * This is useful for improving the error messages returned by `superstruct`.\n * For example, instead of returning an error like:\n *\n * ```\n * Expected the value to satisfy a union of `literal | literal`, but received: \\\"baz\\\"\n * ```\n *\n * This struct will return an error like:\n *\n * ```\n * Expected the value to satisfy a union of `\"foo\" | \"bar\"`, but received: \\\"baz\\\"\n * ```\n *\n * @param value - The literal value.\n * @returns The `superstruct` struct, which validates that the value is equal\n * to the literal value.\n */\nexport function literal(value: Type) {\n return define(\n JSON.stringify(value),\n superstructLiteral(value).validator,\n );\n}\n\n/**\n * A wrapper of `superstruct`'s `union` struct that also defines the schema as\n * the union of the schemas of the structs.\n *\n * This is useful for improving the error messages returned by `superstruct`.\n *\n * @param structs - The structs to union.\n * @param structs.\"0\" - The first struct.\n * @param structs.\"1\" - The remaining structs.\n * @returns The `superstruct` struct, which validates that the value satisfies\n * one of the structs.\n */\nexport function union([\n head,\n ...tail\n]: [head: Head, ...tail: Tail]): Struct<\n Infer | InferStructTuple[number],\n [head: Head, ...tail: Tail]\n> {\n const struct = superstructUnion([head, ...tail]);\n\n return new Struct({\n ...struct,\n schema: [head, ...tail],\n });\n}\n\n/**\n * Superstruct struct for validating an enum value. This allows using both the\n * enum string values and the enum itself as values.\n *\n * @param constant - The enum to validate against.\n * @returns The superstruct struct.\n */\nexport function enumValue(\n constant: Type,\n): Struct, null> {\n return literal(constant as EnumToUnion);\n}\n","import type { Infer, Struct } from 'superstruct';\nimport type {\n AnyStruct,\n EnumSchema,\n InferStructTuple,\n IsExactMatch,\n IsMatch,\n IsRecord,\n IsTuple,\n UnionToIntersection,\n} from 'superstruct';\n\nimport type { EmptyObject } from '../types';\nimport { union } from './structs';\n\n/**\n * Check if a type is a union. Infers `true` if it is a union, otherwise\n * `false`.\n */\ntype IsUnion = [Type] extends [UnionToIntersection] ? false : true;\n\n/**\n * Get a struct schema for a type.\n *\n * This is copied from `superstruct` but fixes some issues with the original\n * implementation.\n */\ntype StructSchema = IsUnion extends true\n ? null\n : [Type] extends [EmptyObject]\n ? EmptyObject\n : [Type] extends [string | undefined | null]\n ? [Type] extends [`0x${string}`]\n ? null\n : [Type] extends [IsMatch]\n ? null\n : [Type] extends [IsUnion]\n ? EnumSchema\n : Type\n : [Type] extends [number | undefined | null]\n ? [Type] extends [IsMatch]\n ? null\n : [Type] extends [IsUnion]\n ? EnumSchema\n : Type\n : [Type] extends [boolean]\n ? [Type] extends [IsExactMatch]\n ? null\n : Type\n : Type extends\n | bigint\n | symbol\n | undefined\n | null\n // eslint-disable-next-line @typescript-eslint/ban-types\n | Function\n | Date\n | Error\n | RegExp\n | Map\n | WeakMap\n | Set\n | WeakSet\n | Promise\n ? null\n : Type extends (infer E)[]\n ? Type extends IsTuple\n ? null\n : Struct\n : Type extends object\n ? Type extends IsRecord\n ? null\n : {\n [InnerKey in keyof Type]: Describe;\n }\n : null;\n\n/**\n * Describe a struct type.\n */\nexport type Describe = Struct>;\n\n/**\n * Create a union struct that uses `null` for the schema type, for better\n * compatibility with `Describe`.\n *\n * @param structs - The structs to union.\n * @returns The `superstruct` struct, which validates that the value satisfies\n * one of the structs.\n */\nexport function nullUnion(\n structs: [head: Head, ...tail: Tail],\n) {\n return union(structs) as unknown as Struct<\n Infer | InferStructTuple[number],\n null\n >;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACiBO,SAAS,IACd,WACA,OACA,KACgB;AAChB,MAAI,OAAO,cAAc,UAAU;AAGjC,UAAM,IAAI;AAAA,MACR,qBAAqB;AAAA,QACnB;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AAEA,MAAI,CAAC,WAAW;AAGd,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEA,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","superstructUnion","element"]} +\ No newline at end of file +diff --git a/dist/jsx/jsx-dev-runtime.mjs.map b/dist/jsx/jsx-dev-runtime.mjs.map +index 969a7caaed03191c746822b48f5beb8220840536..abe0078924086a27b43e17c1a3dfd2ce03be6164 100644 +--- a/dist/jsx/jsx-dev-runtime.mjs.map ++++ b/dist/jsx/jsx-dev-runtime.mjs.map +@@ -1 +1 @@ +-{"version":3,"sources":["../../src/jsx/jsx-runtime.ts","../../src/jsx/validation.ts","../../src/internals/structs.ts","../../src/internals/jsx.ts","../../src/jsx/jsx-dev-runtime.ts"],"sourcesContent":["import type { JsonObject, Key, SnapComponent } from './component';\n\n/**\n * The JSX runtime for Snaps SDK components. This function is used to render\n * Snap components into a format that can be used by the Snaps.\n *\n * This is the \"production\" version of the runtime, which does not include\n * additional validation, as it is handled by MetaMask. To use this runtime,\n * specify `@metamask/snaps-sdk` as import source for JSX, and use `react-jsx`\n * as the pragma.\n *\n * @param component - The component to render.\n * @param props - The props to pass to the component.\n * @param key - The key of the component.\n * @returns The rendered component.\n * @see https://www.typescriptlang.org/tsconfig/#jsx\n */\nexport function jsx(\n component: SnapComponent,\n props: Props,\n key: Key | null,\n): unknown | null {\n if (typeof component === 'string') {\n // If component is a string, it is a built-in HTML element. This is not\n // supported in Snaps, so we throw an error.\n throw new Error(\n `An HTML element (\"${String(\n component,\n )}\") was used in a Snap component, which is not supported by Snaps UI. Please use one of the supported Snap components.`,\n );\n }\n\n if (!component) {\n // If component is undefined, a JSX fragment `<>...` was used, which is\n // not supported in Snaps.\n throw new Error(\n 'A JSX fragment was used in a Snap component, which is not supported by Snaps UI. Please use one of the supported Snap components.',\n );\n }\n\n return component({ ...props, key });\n}\n\n/**\n * The JSX runtime for Snaps SDK components. This function is used to render\n * Snap components into a format that can be used by the Snaps.\n *\n * The `jsxs` function is used for rendering nested components.\n *\n * This is the \"production\" version of the runtime, which does not include\n * additional validation, as it is handled by MetaMask. To use this runtime,\n * specify `@metamask/snaps-sdk` as import source for JSX, and use `react-jsx`\n * as the pragma.\n *\n * @param component - The component to render.\n * @param props - The props to pass to the component.\n * @param key - The key of the component.\n * @returns The rendered component.\n * @see https://www.typescriptlang.org/tsconfig/#jsx\n */\nexport function jsxs(\n component: SnapComponent,\n props: Props,\n key: Key | null,\n): unknown | null {\n return jsx(component, props, key);\n}\n","import {\n hasProperty,\n HexChecksumAddressStruct,\n isPlainObject,\n JsonStruct,\n} from '@metamask/utils';\nimport type { Struct } from 'superstruct';\nimport {\n is,\n boolean,\n optional,\n array,\n lazy,\n nullable,\n number,\n object,\n record,\n string,\n tuple,\n} from 'superstruct';\nimport type { ObjectSchema } from 'superstruct/dist/utils';\n\nimport type { Describe } from '../internals';\nimport { literal, nullUnion } from '../internals';\nimport type { EmptyObject } from '../types';\nimport type {\n GenericSnapElement,\n JsonObject,\n Key,\n MaybeArray,\n SnapElement,\n StringElement,\n} from './component';\nimport type {\n AddressElement,\n BoldElement,\n BoxElement,\n ButtonElement,\n CopyableElement,\n DividerElement,\n DropdownElement,\n OptionElement,\n FieldElement,\n FormElement,\n HeadingElement,\n ImageElement,\n InputElement,\n ItalicElement,\n JSXElement,\n LinkElement,\n RowElement,\n SpinnerElement,\n StandardFormattingElement,\n TextElement,\n ValueElement,\n} from './components';\n\n/**\n * A struct for the {@link Key} type.\n */\nexport const KeyStruct: Describe = nullUnion([string(), number()]);\n\n/**\n * A struct for the {@link StringElement} type.\n */\nexport const StringElementStruct: Describe = maybeArray(\n string(),\n);\n\n/**\n * A struct for the {@link GenericSnapElement} type.\n */\nexport const ElementStruct: Describe = object({\n type: string(),\n props: record(string(), JsonStruct),\n key: nullable(KeyStruct),\n});\n\n/**\n * A helper function for creating a struct for a {@link MaybeArray} type.\n *\n * @param struct - The struct for the maybe array type.\n * @returns The struct for the maybe array type.\n */\nfunction maybeArray(\n struct: Struct,\n): Struct, any> {\n return nullUnion([struct, array(struct)]);\n}\n\n/**\n * A helper function for creating a struct for a JSX element.\n *\n * @param name - The name of the element.\n * @param props - The props of the element.\n * @returns The struct for the element.\n */\nfunction element(\n name: Name,\n props: Props = {} as Props,\n) {\n return object({\n type: literal(name) as unknown as Struct,\n props: object(props),\n key: nullable(KeyStruct),\n });\n}\n\n/**\n * A struct for the {@link ButtonElement} type.\n */\nexport const ButtonStruct: Describe = element('Button', {\n children: StringElementStruct,\n name: optional(string()),\n type: optional(nullUnion([literal('button'), literal('submit')])),\n variant: optional(nullUnion([literal('primary'), literal('destructive')])),\n disabled: optional(boolean()),\n});\n\n/**\n * A struct for the {@link InputElement} type.\n */\nexport const InputStruct: Describe = element('Input', {\n name: string(),\n type: optional(\n nullUnion([literal('text'), literal('password'), literal('number')]),\n ),\n value: optional(string()),\n placeholder: optional(string()),\n});\n\n/**\n * A struct for the {@link OptionElement} type.\n */\nexport const OptionStruct: Describe = element('Option', {\n value: string(),\n children: string(),\n});\n\n/**\n * A struct for the {@link DropdownElement} type.\n */\nexport const DropdownStruct: Describe = element('Dropdown', {\n name: string(),\n value: optional(string()),\n children: maybeArray(OptionStruct),\n});\n\n/**\n * A struct for the {@link FieldElement} type.\n */\nexport const FieldStruct: Describe = element('Field', {\n label: optional(string()),\n error: optional(string()),\n children: nullUnion([\n tuple([InputStruct, ButtonStruct]),\n InputStruct,\n DropdownStruct,\n ]),\n});\n\n/**\n * A struct for the {@link FormElement} type.\n */\nexport const FormStruct: Describe = element('Form', {\n children: maybeArray(nullUnion([FieldStruct, ButtonStruct])),\n name: string(),\n});\n\n/**\n * A struct for the {@link BoldElement} type.\n */\nexport const BoldStruct: Describe = element('Bold', {\n children: maybeArray(\n nullable(\n nullUnion([\n string(),\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n lazy(() => ItalicStruct) as unknown as Struct<\n SnapElement\n >,\n ]),\n ),\n ),\n});\n\n/**\n * A struct for the {@link ItalicElement} type.\n */\nexport const ItalicStruct: Describe = element('Italic', {\n children: maybeArray(\n nullable(\n nullUnion([\n string(),\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n lazy(() => BoldStruct) as unknown as Struct<\n SnapElement\n >,\n ]),\n ),\n ),\n});\n\nexport const FormattingStruct: Describe = nullUnion([\n BoldStruct,\n ItalicStruct,\n]);\n\n/**\n * A struct for the {@link AddressElement} type.\n */\nexport const AddressStruct: Describe = element('Address', {\n address: HexChecksumAddressStruct,\n});\n\n/**\n * A struct for the {@link BoxElement} type.\n */\nexport const BoxStruct: Describe = element('Box', {\n children: maybeArray(\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n nullable(lazy(() => BoxChildStruct)),\n ) as unknown as Struct, null>,\n direction: optional(nullUnion([literal('horizontal'), literal('vertical')])),\n alignment: optional(\n nullUnion([\n literal('start'),\n literal('center'),\n literal('end'),\n literal('space-between'),\n literal('space-around'),\n ]),\n ),\n});\n\n/**\n * A struct for the {@link CopyableElement} type.\n */\nexport const CopyableStruct: Describe = element('Copyable', {\n value: string(),\n sensitive: optional(boolean()),\n});\n\n/**\n * A struct for the {@link DividerElement} type.\n */\nexport const DividerStruct: Describe = element('Divider');\n\n/**\n * A struct for the {@link ValueElement} type.\n */\nexport const ValueStruct: Describe = element('Value', {\n value: string(),\n extra: string(),\n});\n\n/**\n * A struct for the {@link HeadingElement} type.\n */\nexport const HeadingStruct: Describe = element('Heading', {\n children: StringElementStruct,\n});\n\n/**\n * A struct for the {@link ImageElement} type.\n */\nexport const ImageStruct: Describe = element('Image', {\n src: string(),\n alt: optional(string()),\n});\n\n/**\n * A struct for the {@link LinkElement} type.\n */\nexport const LinkStruct: Describe = element('Link', {\n href: string(),\n children: maybeArray(nullable(nullUnion([FormattingStruct, string()]))),\n});\n\n/**\n * A struct for the {@link TextElement} type.\n */\nexport const TextStruct: Describe = element('Text', {\n children: maybeArray(\n nullable(nullUnion([string(), BoldStruct, ItalicStruct, LinkStruct])),\n ),\n});\n\n/**\n * A struct for the {@link RowElement} type.\n */\nexport const RowStruct: Describe = element('Row', {\n label: string(),\n children: nullUnion([AddressStruct, ImageStruct, TextStruct, ValueStruct]),\n variant: optional(\n nullUnion([literal('default'), literal('warning'), literal('error')]),\n ),\n});\n\n/**\n * A struct for the {@link SpinnerElement} type.\n */\nexport const SpinnerStruct: Describe = element('Spinner');\n\n/**\n * A subset of JSX elements that are allowed as children of the Box component.\n * This set should include all components, except components that need to be nested\n * in another component (e.g. Field must be contained in a Form).\n */\nexport const BoxChildStruct = nullUnion([\n ButtonStruct,\n InputStruct,\n FormStruct,\n BoldStruct,\n ItalicStruct,\n AddressStruct,\n BoxStruct,\n CopyableStruct,\n DividerStruct,\n HeadingStruct,\n ImageStruct,\n LinkStruct,\n RowStruct,\n SpinnerStruct,\n TextStruct,\n DropdownStruct,\n]);\n\n/**\n * For now, the allowed JSX elements at the root are the same as the allowed\n * children of the Box component.\n */\nexport const RootJSXElementStruct = BoxChildStruct;\n\n/**\n * A struct for the {@link JSXElement} type.\n */\nexport const JSXElementStruct: Describe = nullUnion([\n ButtonStruct,\n InputStruct,\n FieldStruct,\n FormStruct,\n BoldStruct,\n ItalicStruct,\n AddressStruct,\n BoxStruct,\n CopyableStruct,\n DividerStruct,\n HeadingStruct,\n ImageStruct,\n LinkStruct,\n RowStruct,\n SpinnerStruct,\n TextStruct,\n DropdownStruct,\n OptionStruct,\n ValueStruct,\n]);\n\n/**\n * Check if a value is a JSX element.\n *\n * @param value - The value to check.\n * @returns True if the value is a JSX element, false otherwise.\n */\nexport function isJSXElement(value: unknown): value is JSXElement {\n return is(value, JSXElementStruct);\n}\n\n/**\n * Check if a value is a JSX element, without validating all of its contents.\n * This is useful when you want to validate the structure of a value, but not\n * all the children.\n *\n * This should only be used when you are sure that the value is safe to use,\n * i.e., after using {@link isJSXElement}.\n *\n * @param value - The value to check.\n * @returns True if the value is a JSX element, false otherwise.\n */\nexport function isJSXElementUnsafe(value: unknown): value is JSXElement {\n return (\n isPlainObject(value) &&\n hasProperty(value, 'type') &&\n hasProperty(value, 'props') &&\n hasProperty(value, 'key')\n );\n}\n\n/**\n * Assert that a value is a JSX element.\n *\n * @param value - The value to check.\n * @throws If the value is not a JSX element.\n */\nexport function assertJSXElement(value: unknown): asserts value is JSXElement {\n // TODO: We should use the error parsing utils from `snaps-utils` to improve\n // the error messages. It currently includes colours and potentially other\n // formatting that we might not want to include in the SDK.\n if (!isJSXElement(value)) {\n throw new Error(\n `Expected a JSX element, but received ${JSON.stringify(\n value,\n )}. Please refer to the documentation for the supported JSX elements and their props.`,\n );\n }\n}\n","import type { Infer } from 'superstruct';\nimport {\n Struct,\n define,\n literal as superstructLiteral,\n union as superstructUnion,\n} from 'superstruct';\nimport type { AnyStruct, InferStructTuple } from 'superstruct/dist/utils';\n\nimport type { EnumToUnion } from './helpers';\n\n/**\n * A wrapper of `superstruct`'s `literal` struct that also defines the name of\n * the struct as the literal value.\n *\n * This is useful for improving the error messages returned by `superstruct`.\n * For example, instead of returning an error like:\n *\n * ```\n * Expected the value to satisfy a union of `literal | literal`, but received: \\\"baz\\\"\n * ```\n *\n * This struct will return an error like:\n *\n * ```\n * Expected the value to satisfy a union of `\"foo\" | \"bar\"`, but received: \\\"baz\\\"\n * ```\n *\n * @param value - The literal value.\n * @returns The `superstruct` struct, which validates that the value is equal\n * to the literal value.\n */\nexport function literal(value: Type) {\n return define(\n JSON.stringify(value),\n superstructLiteral(value).validator,\n );\n}\n\n/**\n * A wrapper of `superstruct`'s `union` struct that also defines the schema as\n * the union of the schemas of the structs.\n *\n * This is useful for improving the error messages returned by `superstruct`.\n *\n * @param structs - The structs to union.\n * @param structs.\"0\" - The first struct.\n * @param structs.\"1\" - The remaining structs.\n * @returns The `superstruct` struct, which validates that the value satisfies\n * one of the structs.\n */\nexport function union([\n head,\n ...tail\n]: [head: Head, ...tail: Tail]): Struct<\n Infer | InferStructTuple[number],\n [head: Head, ...tail: Tail]\n> {\n const struct = superstructUnion([head, ...tail]);\n\n return new Struct({\n ...struct,\n schema: [head, ...tail],\n });\n}\n\n/**\n * Superstruct struct for validating an enum value. This allows using both the\n * enum string values and the enum itself as values.\n *\n * @param constant - The enum to validate against.\n * @returns The superstruct struct.\n */\nexport function enumValue(\n constant: Type,\n): Struct, null> {\n return literal(constant as EnumToUnion);\n}\n","import type { Infer, Struct } from 'superstruct';\nimport type {\n AnyStruct,\n EnumSchema,\n InferStructTuple,\n IsExactMatch,\n IsMatch,\n IsRecord,\n IsTuple,\n UnionToIntersection,\n} from 'superstruct/dist/utils';\n\nimport type { EmptyObject } from '../types';\nimport { union } from './structs';\n\n/**\n * Check if a type is a union. Infers `true` if it is a union, otherwise\n * `false`.\n */\ntype IsUnion = [Type] extends [UnionToIntersection] ? false : true;\n\n/**\n * Get a struct schema for a type.\n *\n * This is copied from `superstruct` but fixes some issues with the original\n * implementation.\n */\ntype StructSchema = IsUnion extends true\n ? null\n : [Type] extends [EmptyObject]\n ? EmptyObject\n : [Type] extends [string | undefined | null]\n ? [Type] extends [`0x${string}`]\n ? null\n : [Type] extends [IsMatch]\n ? null\n : [Type] extends [IsUnion]\n ? EnumSchema\n : Type\n : [Type] extends [number | undefined | null]\n ? [Type] extends [IsMatch]\n ? null\n : [Type] extends [IsUnion]\n ? EnumSchema\n : Type\n : [Type] extends [boolean]\n ? [Type] extends [IsExactMatch]\n ? null\n : Type\n : Type extends\n | bigint\n | symbol\n | undefined\n | null\n // eslint-disable-next-line @typescript-eslint/ban-types\n | Function\n | Date\n | Error\n | RegExp\n | Map\n | WeakMap\n | Set\n | WeakSet\n | Promise\n ? null\n : Type extends (infer E)[]\n ? Type extends IsTuple\n ? null\n : Struct\n : Type extends object\n ? Type extends IsRecord\n ? null\n : {\n [InnerKey in keyof Type]: Describe;\n }\n : null;\n\n/**\n * Describe a struct type.\n */\nexport type Describe = Struct>;\n\n/**\n * Create a union struct that uses `null` for the schema type, for better\n * compatibility with `Describe`.\n *\n * @param structs - The structs to union.\n * @returns The `superstruct` struct, which validates that the value satisfies\n * one of the structs.\n */\nexport function nullUnion(\n structs: [head: Head, ...tail: Tail],\n) {\n return union(structs) as unknown as Struct<\n Infer | InferStructTuple[number],\n null\n >;\n}\n","import type { JsonObject, Key, SnapComponent } from './component';\nimport { jsx } from './jsx-runtime';\nimport { assertJSXElement } from './validation';\n\n/**\n * The JSX runtime for Snaps SDK components. This function is used to render\n * Snap components into a format that can be used by the Snaps.\n *\n * This is the \"development\" version of the runtime, which includes additional\n * validation, which is otherwise handled by MetaMask. To use this runtime,\n * specify `@metamask/snaps-sdk` as import source for JSX, and use\n * `react-jsxdev` as the pragma.\n *\n * @param component - The component to render.\n * @param props - The props to pass to the component.\n * @param key - The key of the component.\n * @returns The rendered component.\n * @see https://www.typescriptlang.org/tsconfig/#jsx\n */\nexport function jsxDEV(\n component: SnapComponent,\n props: Props,\n key: Key | null,\n): unknown | null {\n const element = jsx(component, props, key);\n assertJSXElement(element);\n\n return element;\n}\n"],"mappings":";AAiBO,SAAS,IACd,WACA,OACA,KACgB;AAChB,MAAI,OAAO,cAAc,UAAU;AAGjC,UAAM,IAAI;AAAA,MACR,qBAAqB;AAAA,QACnB;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AAEA,MAAI,CAAC,WAAW;AAGd,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEA,SAAO,UAAU,EAAE,GAAG,OAAO,IAAI,CAAC;AACpC;;;ACzCA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;AClBP;AAAA,EACE;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX,SAAS;AAAA,OACJ;AA0BA,SAAS,QAAgD,OAAa;AAC3E,SAAO;AAAA,IACL,KAAK,UAAU,KAAK;AAAA,IACpB,mBAAmB,KAAK,EAAE;AAAA,EAC5B;AACF;AAcO,SAAS,MAAwD;AAAA,EACtE;AAAA,EACA,GAAG;AACL,GAGE;AACA,QA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KM,IAAM,gBAA0C,QAAQ,SAAS;AAOjE,IAAM,iBAAiB,UAAU;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAWM,IAAM,mBAAyC,UAAU;AAAA,EAC9D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAQM,SAAS,aAAa,OAAqC;AAChE,SAAO,GAAG,OAAO,gBAAgB;AACnC;AA4BO,SAAS,iBAAiB,OAA6C;AAI5E,MAAI,CAAC,aAAa,KAAK,GAAG;AACxB,UAAM,IAAI;AAAA,MACR,wCAAwC,KAAK;AAAA,QAC3C;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AACF;;;AGnYO,SAAS,OACd,WACA,OACA,KACgB;AAChB,QAAMA,WAAU,IAAI,WAAW,OAAO,GAAG;AACzC,mBAAiBA,QAAO;AAExB,SAAOA;AACT;","names":["element"]} +\ No newline at end of file ++{"version":3,"sources":["../../src/jsx/jsx-runtime.ts","../../src/jsx/validation.ts","../../src/internals/structs.ts","../../src/internals/jsx.ts","../../src/jsx/jsx-dev-runtime.ts"],"sourcesContent":["import type { JsonObject, Key, SnapComponent } from './component';\n\n/**\n * The JSX runtime for Snaps SDK components. This function is used to render\n * Snap components into a format that can be used by the Snaps.\n *\n * This is the \"production\" version of the runtime, which does not include\n * additional validation, as it is handled by MetaMask. To use this runtime,\n * specify `@metamask/snaps-sdk` as import source for JSX, and use `react-jsx`\n * as the pragma.\n *\n * @param component - The component to render.\n * @param props - The props to pass to the component.\n * @param key - The key of the component.\n * @returns The rendered component.\n * @see https://www.typescriptlang.org/tsconfig/#jsx\n */\nexport function jsx(\n component: SnapComponent,\n props: Props,\n key: Key | null,\n): unknown | null {\n if (typeof component === 'string') {\n // If component is a string, it is a built-in HTML element. This is not\n // supported in Snaps, so we throw an error.\n throw new Error(\n `An HTML element (\"${String(\n component,\n )}\") was used in a Snap component, which is not supported by Snaps UI. Please use one of the supported Snap components.`,\n );\n }\n\n if (!component) {\n // If component is undefined, a JSX fragment `<>...` was used, which is\n // not supported in Snaps.\n throw new Error(\n 'A JSX fragment was used in a Snap component, which is not supported by Snaps UI. Please use one of the supported Snap components.',\n );\n }\n\n return component({ ...props, key });\n}\n\n/**\n * The JSX runtime for Snaps SDK components. This function is used to render\n * Snap components into a format that can be used by the Snaps.\n *\n * The `jsxs` function is used for rendering nested components.\n *\n * This is the \"production\" version of the runtime, which does not include\n * additional validation, as it is handled by MetaMask. To use this runtime,\n * specify `@metamask/snaps-sdk` as import source for JSX, and use `react-jsx`\n * as the pragma.\n *\n * @param component - The component to render.\n * @param props - The props to pass to the component.\n * @param key - The key of the component.\n * @returns The rendered component.\n * @see https://www.typescriptlang.org/tsconfig/#jsx\n */\nexport function jsxs(\n component: SnapComponent,\n props: Props,\n key: Key | null,\n): unknown | null {\n return jsx(component, props, key);\n}\n","import {\n hasProperty,\n HexChecksumAddressStruct,\n isPlainObject,\n JsonStruct,\n} from '@metamask/utils';\nimport type { Struct } from 'superstruct';\nimport {\n is,\n boolean,\n optional,\n array,\n lazy,\n nullable,\n number,\n object,\n record,\n string,\n tuple,\n} from 'superstruct';\nimport type { ObjectSchema } from 'superstruct';\n\nimport type { Describe } from '../internals';\nimport { literal, nullUnion } from '../internals';\nimport type { EmptyObject } from '../types';\nimport type {\n GenericSnapElement,\n JsonObject,\n Key,\n MaybeArray,\n SnapElement,\n StringElement,\n} from './component';\nimport type {\n AddressElement,\n BoldElement,\n BoxElement,\n ButtonElement,\n CopyableElement,\n DividerElement,\n DropdownElement,\n OptionElement,\n FieldElement,\n FormElement,\n HeadingElement,\n ImageElement,\n InputElement,\n ItalicElement,\n JSXElement,\n LinkElement,\n RowElement,\n SpinnerElement,\n StandardFormattingElement,\n TextElement,\n ValueElement,\n} from './components';\n\n/**\n * A struct for the {@link Key} type.\n */\nexport const KeyStruct: Describe = nullUnion([string(), number()]);\n\n/**\n * A struct for the {@link StringElement} type.\n */\nexport const StringElementStruct: Describe = maybeArray(\n string(),\n);\n\n/**\n * A struct for the {@link GenericSnapElement} type.\n */\nexport const ElementStruct: Describe = object({\n type: string(),\n props: record(string(), JsonStruct),\n key: nullable(KeyStruct),\n});\n\n/**\n * A helper function for creating a struct for a {@link MaybeArray} type.\n *\n * @param struct - The struct for the maybe array type.\n * @returns The struct for the maybe array type.\n */\nfunction maybeArray(\n struct: Struct,\n): Struct, any> {\n return nullUnion([struct, array(struct)]);\n}\n\n/**\n * A helper function for creating a struct for a JSX element.\n *\n * @param name - The name of the element.\n * @param props - The props of the element.\n * @returns The struct for the element.\n */\nfunction element(\n name: Name,\n props: Props = {} as Props,\n) {\n return object({\n type: literal(name) as unknown as Struct,\n props: object(props),\n key: nullable(KeyStruct),\n });\n}\n\n/**\n * A struct for the {@link ButtonElement} type.\n */\nexport const ButtonStruct: Describe = element('Button', {\n children: StringElementStruct,\n name: optional(string()),\n type: optional(nullUnion([literal('button'), literal('submit')])),\n variant: optional(nullUnion([literal('primary'), literal('destructive')])),\n disabled: optional(boolean()),\n});\n\n/**\n * A struct for the {@link InputElement} type.\n */\nexport const InputStruct: Describe = element('Input', {\n name: string(),\n type: optional(\n nullUnion([literal('text'), literal('password'), literal('number')]),\n ),\n value: optional(string()),\n placeholder: optional(string()),\n});\n\n/**\n * A struct for the {@link OptionElement} type.\n */\nexport const OptionStruct: Describe = element('Option', {\n value: string(),\n children: string(),\n});\n\n/**\n * A struct for the {@link DropdownElement} type.\n */\nexport const DropdownStruct: Describe = element('Dropdown', {\n name: string(),\n value: optional(string()),\n children: maybeArray(OptionStruct),\n});\n\n/**\n * A struct for the {@link FieldElement} type.\n */\nexport const FieldStruct: Describe = element('Field', {\n label: optional(string()),\n error: optional(string()),\n children: nullUnion([\n tuple([InputStruct, ButtonStruct]),\n InputStruct,\n DropdownStruct,\n ]),\n});\n\n/**\n * A struct for the {@link FormElement} type.\n */\nexport const FormStruct: Describe = element('Form', {\n children: maybeArray(nullUnion([FieldStruct, ButtonStruct])),\n name: string(),\n});\n\n/**\n * A struct for the {@link BoldElement} type.\n */\nexport const BoldStruct: Describe = element('Bold', {\n children: maybeArray(\n nullable(\n nullUnion([\n string(),\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n lazy(() => ItalicStruct) as unknown as Struct<\n SnapElement\n >,\n ]),\n ),\n ),\n});\n\n/**\n * A struct for the {@link ItalicElement} type.\n */\nexport const ItalicStruct: Describe = element('Italic', {\n children: maybeArray(\n nullable(\n nullUnion([\n string(),\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n lazy(() => BoldStruct) as unknown as Struct<\n SnapElement\n >,\n ]),\n ),\n ),\n});\n\nexport const FormattingStruct: Describe = nullUnion([\n BoldStruct,\n ItalicStruct,\n]);\n\n/**\n * A struct for the {@link AddressElement} type.\n */\nexport const AddressStruct: Describe = element('Address', {\n address: HexChecksumAddressStruct,\n});\n\n/**\n * A struct for the {@link BoxElement} type.\n */\nexport const BoxStruct: Describe = element('Box', {\n children: maybeArray(\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n nullable(lazy(() => BoxChildStruct)),\n ) as unknown as Struct, null>,\n direction: optional(nullUnion([literal('horizontal'), literal('vertical')])),\n alignment: optional(\n nullUnion([\n literal('start'),\n literal('center'),\n literal('end'),\n literal('space-between'),\n literal('space-around'),\n ]),\n ),\n});\n\n/**\n * A struct for the {@link CopyableElement} type.\n */\nexport const CopyableStruct: Describe = element('Copyable', {\n value: string(),\n sensitive: optional(boolean()),\n});\n\n/**\n * A struct for the {@link DividerElement} type.\n */\nexport const DividerStruct: Describe = element('Divider');\n\n/**\n * A struct for the {@link ValueElement} type.\n */\nexport const ValueStruct: Describe = element('Value', {\n value: string(),\n extra: string(),\n});\n\n/**\n * A struct for the {@link HeadingElement} type.\n */\nexport const HeadingStruct: Describe = element('Heading', {\n children: StringElementStruct,\n});\n\n/**\n * A struct for the {@link ImageElement} type.\n */\nexport const ImageStruct: Describe = element('Image', {\n src: string(),\n alt: optional(string()),\n});\n\n/**\n * A struct for the {@link LinkElement} type.\n */\nexport const LinkStruct: Describe = element('Link', {\n href: string(),\n children: maybeArray(nullable(nullUnion([FormattingStruct, string()]))),\n});\n\n/**\n * A struct for the {@link TextElement} type.\n */\nexport const TextStruct: Describe = element('Text', {\n children: maybeArray(\n nullable(nullUnion([string(), BoldStruct, ItalicStruct, LinkStruct])),\n ),\n});\n\n/**\n * A struct for the {@link RowElement} type.\n */\nexport const RowStruct: Describe = element('Row', {\n label: string(),\n children: nullUnion([AddressStruct, ImageStruct, TextStruct, ValueStruct]),\n variant: optional(\n nullUnion([literal('default'), literal('warning'), literal('error')]),\n ),\n});\n\n/**\n * A struct for the {@link SpinnerElement} type.\n */\nexport const SpinnerStruct: Describe = element('Spinner');\n\n/**\n * A subset of JSX elements that are allowed as children of the Box component.\n * This set should include all components, except components that need to be nested\n * in another component (e.g. Field must be contained in a Form).\n */\nexport const BoxChildStruct = nullUnion([\n ButtonStruct,\n InputStruct,\n FormStruct,\n BoldStruct,\n ItalicStruct,\n AddressStruct,\n BoxStruct,\n CopyableStruct,\n DividerStruct,\n HeadingStruct,\n ImageStruct,\n LinkStruct,\n RowStruct,\n SpinnerStruct,\n TextStruct,\n DropdownStruct,\n]);\n\n/**\n * For now, the allowed JSX elements at the root are the same as the allowed\n * children of the Box component.\n */\nexport const RootJSXElementStruct = BoxChildStruct;\n\n/**\n * A struct for the {@link JSXElement} type.\n */\nexport const JSXElementStruct: Describe = nullUnion([\n ButtonStruct,\n InputStruct,\n FieldStruct,\n FormStruct,\n BoldStruct,\n ItalicStruct,\n AddressStruct,\n BoxStruct,\n CopyableStruct,\n DividerStruct,\n HeadingStruct,\n ImageStruct,\n LinkStruct,\n RowStruct,\n SpinnerStruct,\n TextStruct,\n DropdownStruct,\n OptionStruct,\n ValueStruct,\n]);\n\n/**\n * Check if a value is a JSX element.\n *\n * @param value - The value to check.\n * @returns True if the value is a JSX element, false otherwise.\n */\nexport function isJSXElement(value: unknown): value is JSXElement {\n return is(value, JSXElementStruct);\n}\n\n/**\n * Check if a value is a JSX element, without validating all of its contents.\n * This is useful when you want to validate the structure of a value, but not\n * all the children.\n *\n * This should only be used when you are sure that the value is safe to use,\n * i.e., after using {@link isJSXElement}.\n *\n * @param value - The value to check.\n * @returns True if the value is a JSX element, false otherwise.\n */\nexport function isJSXElementUnsafe(value: unknown): value is JSXElement {\n return (\n isPlainObject(value) &&\n hasProperty(value, 'type') &&\n hasProperty(value, 'props') &&\n hasProperty(value, 'key')\n );\n}\n\n/**\n * Assert that a value is a JSX element.\n *\n * @param value - The value to check.\n * @throws If the value is not a JSX element.\n */\nexport function assertJSXElement(value: unknown): asserts value is JSXElement {\n // TODO: We should use the error parsing utils from `snaps-utils` to improve\n // the error messages. It currently includes colours and potentially other\n // formatting that we might not want to include in the SDK.\n if (!isJSXElement(value)) {\n throw new Error(\n `Expected a JSX element, but received ${JSON.stringify(\n value,\n )}. Please refer to the documentation for the supported JSX elements and their props.`,\n );\n }\n}\n","import type { Infer } from 'superstruct';\nimport {\n Struct,\n define,\n literal as superstructLiteral,\n union as superstructUnion,\n} from 'superstruct';\nimport type { AnyStruct, InferStructTuple } from 'superstruct';\n\nimport type { EnumToUnion } from './helpers';\n\n/**\n * A wrapper of `superstruct`'s `literal` struct that also defines the name of\n * the struct as the literal value.\n *\n * This is useful for improving the error messages returned by `superstruct`.\n * For example, instead of returning an error like:\n *\n * ```\n * Expected the value to satisfy a union of `literal | literal`, but received: \\\"baz\\\"\n * ```\n *\n * This struct will return an error like:\n *\n * ```\n * Expected the value to satisfy a union of `\"foo\" | \"bar\"`, but received: \\\"baz\\\"\n * ```\n *\n * @param value - The literal value.\n * @returns The `superstruct` struct, which validates that the value is equal\n * to the literal value.\n */\nexport function literal(value: Type) {\n return define(\n JSON.stringify(value),\n superstructLiteral(value).validator,\n );\n}\n\n/**\n * A wrapper of `superstruct`'s `union` struct that also defines the schema as\n * the union of the schemas of the structs.\n *\n * This is useful for improving the error messages returned by `superstruct`.\n *\n * @param structs - The structs to union.\n * @param structs.\"0\" - The first struct.\n * @param structs.\"1\" - The remaining structs.\n * @returns The `superstruct` struct, which validates that the value satisfies\n * one of the structs.\n */\nexport function union([\n head,\n ...tail\n]: [head: Head, ...tail: Tail]): Struct<\n Infer | InferStructTuple[number],\n [head: Head, ...tail: Tail]\n> {\n const struct = superstructUnion([head, ...tail]);\n\n return new Struct({\n ...struct,\n schema: [head, ...tail],\n });\n}\n\n/**\n * Superstruct struct for validating an enum value. This allows using both the\n * enum string values and the enum itself as values.\n *\n * @param constant - The enum to validate against.\n * @returns The superstruct struct.\n */\nexport function enumValue(\n constant: Type,\n): Struct, null> {\n return literal(constant as EnumToUnion);\n}\n","import type { Infer, Struct } from 'superstruct';\nimport type {\n AnyStruct,\n EnumSchema,\n InferStructTuple,\n IsExactMatch,\n IsMatch,\n IsRecord,\n IsTuple,\n UnionToIntersection,\n} from 'superstruct';\n\nimport type { EmptyObject } from '../types';\nimport { union } from './structs';\n\n/**\n * Check if a type is a union. Infers `true` if it is a union, otherwise\n * `false`.\n */\ntype IsUnion = [Type] extends [UnionToIntersection] ? false : true;\n\n/**\n * Get a struct schema for a type.\n *\n * This is copied from `superstruct` but fixes some issues with the original\n * implementation.\n */\ntype StructSchema = IsUnion extends true\n ? null\n : [Type] extends [EmptyObject]\n ? EmptyObject\n : [Type] extends [string | undefined | null]\n ? [Type] extends [`0x${string}`]\n ? null\n : [Type] extends [IsMatch]\n ? null\n : [Type] extends [IsUnion]\n ? EnumSchema\n : Type\n : [Type] extends [number | undefined | null]\n ? [Type] extends [IsMatch]\n ? null\n : [Type] extends [IsUnion]\n ? EnumSchema\n : Type\n : [Type] extends [boolean]\n ? [Type] extends [IsExactMatch]\n ? null\n : Type\n : Type extends\n | bigint\n | symbol\n | undefined\n | null\n // eslint-disable-next-line @typescript-eslint/ban-types\n | Function\n | Date\n | Error\n | RegExp\n | Map\n | WeakMap\n | Set\n | WeakSet\n | Promise\n ? null\n : Type extends (infer E)[]\n ? Type extends IsTuple\n ? null\n : Struct\n : Type extends object\n ? Type extends IsRecord\n ? null\n : {\n [InnerKey in keyof Type]: Describe;\n }\n : null;\n\n/**\n * Describe a struct type.\n */\nexport type Describe = Struct>;\n\n/**\n * Create a union struct that uses `null` for the schema type, for better\n * compatibility with `Describe`.\n *\n * @param structs - The structs to union.\n * @returns The `superstruct` struct, which validates that the value satisfies\n * one of the structs.\n */\nexport function nullUnion(\n structs: [head: Head, ...tail: Tail],\n) {\n return union(structs) as unknown as Struct<\n Infer | InferStructTuple[number],\n null\n >;\n}\n","import type { JsonObject, Key, SnapComponent } from './component';\nimport { jsx } from './jsx-runtime';\nimport { assertJSXElement } from './validation';\n\n/**\n * The JSX runtime for Snaps SDK components. This function is used to render\n * Snap components into a format that can be used by the Snaps.\n *\n * This is the \"development\" version of the runtime, which includes additional\n * validation, which is otherwise handled by MetaMask. To use this runtime,\n * specify `@metamask/snaps-sdk` as import source for JSX, and use\n * `react-jsxdev` as the pragma.\n *\n * @param component - The component to render.\n * @param props - The props to pass to the component.\n * @param key - The key of the component.\n * @returns The rendered component.\n * @see https://www.typescriptlang.org/tsconfig/#jsx\n */\nexport function jsxDEV(\n component: SnapComponent,\n props: Props,\n key: Key | null,\n): unknown | null {\n const element = jsx(component, props, key);\n assertJSXElement(element);\n\n return element;\n}\n"],"mappings":";AAiBO,SAAS,IACd,WACA,OACA,KACgB;AAChB,MAAI,OAAO,cAAc,UAAU;AAGjC,UAAM,IAAI;AAAA,MACR,qBAAqB;AAAA,QACnB;AAAA,MACF,CAAC;AAAA,IACH;AAAA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;AAAA,MACR,wCAAwC,KAAK;AAAA,QAC3C;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AACF;;;AGnYO,SAAS,OACd,WACA,OACA,KACgB;AAChB,QAAMA,WAAU,IAAI,WAAW,OAAO,GAAG;AACzC,mBAAiBA,QAAO;AAExB,SAAOA;AACT;","names":["element"]} +\ No newline at end of file +diff --git a/dist/tsconfig.build.tsbuildinfo b/dist/tsconfig.build.tsbuildinfo +index e7e9da52b4541db95e7e7c67522dc5006a76adb9..381d393659da9e27e8f43843f54bd9fe9fbfb254 100644 +--- a/dist/tsconfig.build.tsbuildinfo ++++ b/dist/tsconfig.build.tsbuildinfo +@@ -1 +1 @@ +-{"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/superstruct/dist/error.d.ts","../../../node_modules/superstruct/dist/utils.d.ts","../../../node_modules/superstruct/dist/struct.d.ts","../../../node_modules/superstruct/dist/structs/coercions.d.ts","../../../node_modules/superstruct/dist/structs/refinements.d.ts","../../../node_modules/superstruct/dist/structs/types.d.ts","../../../node_modules/superstruct/dist/structs/utilities.d.ts","../../../node_modules/superstruct/dist/index.d.ts","../../../node_modules/@metamask/utils/dist/types/assert.d.ts","../../../node_modules/@metamask/utils/dist/types/base64.d.ts","../../../node_modules/@metamask/utils/dist/types/hex.d.ts","../../../node_modules/@metamask/utils/dist/types/bytes.d.ts","../../../node_modules/@metamask/utils/dist/types/caip-types.d.ts","../../../node_modules/@metamask/utils/dist/types/checksum.d.ts","../../../node_modules/@metamask/utils/dist/types/coercers.d.ts","../../../node_modules/@metamask/utils/dist/types/collections.d.ts","../../../node_modules/@metamask/utils/dist/types/encryption-types.d.ts","../../../node_modules/@metamask/utils/dist/types/errors.d.ts","../../../node_modules/@metamask/utils/dist/types/json.d.ts","../../../node_modules/@types/node/ts4.8/assert.d.ts","../../../node_modules/@types/node/ts4.8/assert/strict.d.ts","../../../node_modules/@types/node/ts4.8/globals.d.ts","../../../node_modules/@types/node/ts4.8/async_hooks.d.ts","../../../node_modules/@types/node/ts4.8/buffer.d.ts","../../../node_modules/@types/node/ts4.8/child_process.d.ts","../../../node_modules/@types/node/ts4.8/cluster.d.ts","../../../node_modules/@types/node/ts4.8/console.d.ts","../../../node_modules/@types/node/ts4.8/constants.d.ts","../../../node_modules/@types/node/ts4.8/crypto.d.ts","../../../node_modules/@types/node/ts4.8/dgram.d.ts","../../../node_modules/@types/node/ts4.8/diagnostics_channel.d.ts","../../../node_modules/@types/node/ts4.8/dns.d.ts","../../../node_modules/@types/node/ts4.8/dns/promises.d.ts","../../../node_modules/@types/node/ts4.8/domain.d.ts","../../../node_modules/@types/node/ts4.8/dom-events.d.ts","../../../node_modules/@types/node/ts4.8/events.d.ts","../../../node_modules/@types/node/ts4.8/fs.d.ts","../../../node_modules/@types/node/ts4.8/fs/promises.d.ts","../../../node_modules/@types/node/ts4.8/http.d.ts","../../../node_modules/@types/node/ts4.8/http2.d.ts","../../../node_modules/@types/node/ts4.8/https.d.ts","../../../node_modules/@types/node/ts4.8/inspector.d.ts","../../../node_modules/@types/node/ts4.8/module.d.ts","../../../node_modules/@types/node/ts4.8/net.d.ts","../../../node_modules/@types/node/ts4.8/os.d.ts","../../../node_modules/@types/node/ts4.8/path.d.ts","../../../node_modules/@types/node/ts4.8/perf_hooks.d.ts","../../../node_modules/@types/node/ts4.8/process.d.ts","../../../node_modules/@types/node/ts4.8/punycode.d.ts","../../../node_modules/@types/node/ts4.8/querystring.d.ts","../../../node_modules/@types/node/ts4.8/readline.d.ts","../../../node_modules/@types/node/ts4.8/readline/promises.d.ts","../../../node_modules/@types/node/ts4.8/repl.d.ts","../../../node_modules/@types/node/ts4.8/stream.d.ts","../../../node_modules/@types/node/ts4.8/stream/promises.d.ts","../../../node_modules/@types/node/ts4.8/stream/consumers.d.ts","../../../node_modules/@types/node/ts4.8/stream/web.d.ts","../../../node_modules/@types/node/ts4.8/string_decoder.d.ts","../../../node_modules/@types/node/ts4.8/test.d.ts","../../../node_modules/@types/node/ts4.8/timers.d.ts","../../../node_modules/@types/node/ts4.8/timers/promises.d.ts","../../../node_modules/@types/node/ts4.8/tls.d.ts","../../../node_modules/@types/node/ts4.8/trace_events.d.ts","../../../node_modules/@types/node/ts4.8/tty.d.ts","../../../node_modules/@types/node/ts4.8/url.d.ts","../../../node_modules/@types/node/ts4.8/util.d.ts","../../../node_modules/@types/node/ts4.8/v8.d.ts","../../../node_modules/@types/node/ts4.8/vm.d.ts","../../../node_modules/@types/node/ts4.8/wasi.d.ts","../../../node_modules/@types/node/ts4.8/worker_threads.d.ts","../../../node_modules/@types/node/ts4.8/zlib.d.ts","../../../node_modules/@types/node/ts4.8/globals.global.d.ts","../../../node_modules/@types/node/ts4.8/index.d.ts","../../../node_modules/@ethereumjs/common/dist/enums.d.ts","../../../node_modules/@ethereumjs/common/dist/types.d.ts","../../../node_modules/buffer/index.d.ts","../../../node_modules/@ethereumjs/util/dist/constants.d.ts","../../../node_modules/@ethereumjs/util/dist/units.d.ts","../../../node_modules/@ethereumjs/util/dist/address.d.ts","../../../node_modules/@ethereumjs/util/dist/bytes.d.ts","../../../node_modules/@ethereumjs/util/dist/types.d.ts","../../../node_modules/@ethereumjs/util/dist/account.d.ts","../../../node_modules/@ethereumjs/util/dist/withdrawal.d.ts","../../../node_modules/@ethereumjs/util/dist/signature.d.ts","../../../node_modules/@ethereumjs/util/dist/encoding.d.ts","../../../node_modules/@ethereumjs/util/dist/asyncEventEmitter.d.ts","../../../node_modules/@ethereumjs/util/dist/internal.d.ts","../../../node_modules/@ethereumjs/util/dist/lock.d.ts","../../../node_modules/@ethereumjs/util/dist/provider.d.ts","../../../node_modules/@ethereumjs/util/dist/index.d.ts","../../../node_modules/@ethereumjs/common/dist/common.d.ts","../../../node_modules/@ethereumjs/common/dist/utils.d.ts","../../../node_modules/@ethereumjs/common/dist/index.d.ts","../../../node_modules/@ethereumjs/tx/dist/eip2930Transaction.d.ts","../../../node_modules/@ethereumjs/tx/dist/legacyTransaction.d.ts","../../../node_modules/@ethereumjs/tx/dist/types.d.ts","../../../node_modules/@ethereumjs/tx/dist/baseTransaction.d.ts","../../../node_modules/@ethereumjs/tx/dist/eip1559Transaction.d.ts","../../../node_modules/@ethereumjs/tx/dist/transactionFactory.d.ts","../../../node_modules/@ethereumjs/tx/dist/index.d.ts","../../../node_modules/@metamask/utils/dist/types/keyring.d.ts","../../../node_modules/@types/ms/index.d.ts","../../../node_modules/@types/debug/index.d.ts","../../../node_modules/@metamask/utils/dist/types/logging.d.ts","../../../node_modules/@metamask/utils/dist/types/misc.d.ts","../../../node_modules/@metamask/utils/dist/types/number.d.ts","../../../node_modules/@metamask/utils/dist/types/opaque.d.ts","../../../node_modules/@metamask/utils/dist/types/promise.d.ts","../../../node_modules/@metamask/utils/dist/types/time.d.ts","../../../node_modules/@metamask/utils/dist/types/transaction-types.d.ts","../../../node_modules/@metamask/utils/dist/types/versions.d.ts","../../../node_modules/@metamask/utils/dist/types/index.d.ts","../src/jsx/component.ts","../src/jsx/jsx-runtime.ts","../../../node_modules/@metamask/rpc-errors/dist/types/utils.d.ts","../../../node_modules/@metamask/rpc-errors/dist/types/classes.d.ts","../../../node_modules/@metamask/rpc-errors/dist/types/errors.d.ts","../../../node_modules/@metamask/rpc-errors/dist/types/error-constants.d.ts","../../../node_modules/@metamask/rpc-errors/dist/types/index.d.ts","../src/errors.ts","../src/internals/error-wrappers.ts","../src/internals/errors.ts","../src/internals/helpers.ts","../src/internals/structs.ts","../../../node_modules/@metamask/safe-event-emitter/dist/cjs/index.d.ts","../../../node_modules/@metamask/json-rpc-engine/dist/types/JsonRpcEngine.d.ts","../../../node_modules/@metamask/json-rpc-engine/dist/types/createAsyncMiddleware.d.ts","../../../node_modules/@metamask/json-rpc-engine/dist/types/createScaffoldMiddleware.d.ts","../../../node_modules/@metamask/json-rpc-engine/dist/types/getUniqueId.d.ts","../../../node_modules/@metamask/json-rpc-engine/dist/types/idRemapMiddleware.d.ts","../../../node_modules/@metamask/json-rpc-engine/dist/types/mergeMiddleware.d.ts","../../../node_modules/@metamask/json-rpc-engine/dist/types/index.d.ts","../../../node_modules/@metamask/providers/dist/types/utils.d.ts","../../../node_modules/@metamask/providers/dist/types/BaseProvider.d.ts","../../../node_modules/@metamask/providers/dist/types/EIP6963.d.ts","../../../node_modules/@types/readable-stream/node_modules/safe-buffer/index.d.ts","../../../node_modules/@types/readable-stream/index.d.ts","../../../node_modules/@metamask/providers/dist/types/StreamProvider.d.ts","../../../node_modules/@metamask/providers/dist/types/extension-provider/createExternalExtensionProvider.d.ts","../../../node_modules/@metamask/providers/dist/types/MetaMaskInpageProvider.d.ts","../../../node_modules/@metamask/providers/dist/types/initializeInpageProvider.d.ts","../../../node_modules/@metamask/providers/dist/types/shimWeb3.d.ts","../../../node_modules/@metamask/providers/dist/types/index.d.ts","../src/types/methods/create-interface.ts","../src/types/methods/dialog.ts","../../../node_modules/@metamask/key-tree/dist/constants.d.cts","../../../node_modules/@noble/curves/abstract/modular.d.ts","../../../node_modules/@noble/curves/abstract/utils.d.ts","../../../node_modules/@noble/curves/abstract/curve.d.ts","../../../node_modules/@metamask/key-tree/dist/curves/ed25519.d.cts","../../../node_modules/@metamask/key-tree/dist/curves/ed25519Bip32.d.cts","../../../node_modules/@noble/curves/abstract/weierstrass.d.ts","../../../node_modules/@metamask/key-tree/dist/curves/secp256k1.d.cts","../../../node_modules/@metamask/key-tree/dist/curves/curve.d.cts","../../../node_modules/@metamask/key-tree/dist/curves/index.d.cts","../../../node_modules/@metamask/key-tree/dist/utils.d.cts","../../../node_modules/@metamask/key-tree/dist/BIP44CoinTypeNode.d.cts","../../../node_modules/@metamask/key-tree/dist/SLIP10Node.d.cts","../../../node_modules/@metamask/key-tree/dist/BIP44Node.d.cts","../../../node_modules/@metamask/key-tree/dist/derivers/bip32.d.cts","../../../node_modules/@metamask/key-tree/dist/derivers/bip39.d.cts","../../../node_modules/@metamask/key-tree/dist/derivers/cip3.d.cts","../../../node_modules/@metamask/key-tree/dist/derivers/slip10.d.cts","../../../node_modules/@metamask/key-tree/dist/derivers/index.d.cts","../../../node_modules/@metamask/key-tree/dist/index.d.cts","../src/types/caip.ts","../src/types/permissions.ts","../src/types/methods/get-bip32-entropy.ts","../src/types/methods/get-bip32-public-key.ts","../src/types/methods/get-bip44-entropy.ts","../src/types/methods/get-client-status.ts","../src/types/methods/get-entropy.ts","../src/types/methods/get-file.ts","../src/jsx/components/Address.ts","../src/jsx/components/Box.ts","../src/jsx/components/Copyable.ts","../src/jsx/components/Divider.ts","../src/jsx/components/form/Button.ts","../src/jsx/components/form/Option.ts","../src/jsx/components/form/Dropdown.ts","../src/jsx/components/form/Input.ts","../src/jsx/components/form/Field.ts","../src/jsx/components/form/Form.ts","../src/jsx/components/form/index.ts","../src/jsx/components/Link.ts","../src/jsx/components/Text.ts","../src/jsx/components/formatting/Bold.ts","../src/jsx/components/formatting/Italic.ts","../src/jsx/components/formatting/index.ts","../src/jsx/components/Heading.ts","../src/jsx/components/Image.ts","../src/jsx/components/Value.ts","../src/jsx/components/Row.ts","../src/jsx/components/Spinner.ts","../src/jsx/components/index.ts","../src/jsx/validation.ts","../src/jsx/jsx-dev-runtime.ts","../src/jsx/index.ts","../src/ui/nodes.ts","../src/ui/builder.ts","../src/ui/components/address.ts","../src/ui/components/copyable.ts","../src/ui/components/divider.ts","../src/ui/components/heading.ts","../src/ui/components/image.ts","../src/ui/components/button.ts","../src/ui/components/input.ts","../src/ui/components/form.ts","../src/ui/components/text.ts","../src/ui/components/row.ts","../src/ui/components/spinner.ts","../src/ui/components/panel.ts","../src/ui/components/index.ts","../src/ui/component.ts","../src/ui/index.ts","../src/types/interface.ts","../src/types/methods/get-interface-state.ts","../src/types/methods/get-locale.ts","../src/types/snap.ts","../src/types/methods/get-snaps.ts","../src/types/methods/invoke-snap.ts","../src/types/methods/invoke-keyring.ts","../src/types/methods/manage-accounts.ts","../src/types/methods/manage-state.ts","../src/types/methods/notify.ts","../src/types/methods/request-snaps.ts","../src/types/methods/update-interface.ts","../src/types/methods/methods.ts","../src/types/methods/index.ts","../src/types/provider.ts","../src/types/global.ts","../src/types/images.ts","../src/types/handlers/cronjob.ts","../src/types/handlers/home-page.ts","../src/types/handlers/keyring.ts","../src/types/handlers/lifecycle.ts","../src/types/handlers/name-lookup.ts","../src/types/handlers/rpc-request.ts","../src/types/handlers/transaction.ts","../src/types/handlers/signature.ts","../src/types/handlers/user-input.ts","../src/types/handlers/index.ts","../src/types/index.ts","../src/internals/jsx.ts","../../../node_modules/fast-xml-parser/src/fxp.d.ts","../src/internals/svg.ts","../src/internals/index.ts","../src/error-wrappers.ts","../src/images.ts","../src/index.ts","../../../node_modules/@types/aria-query/index.d.ts","../../../node_modules/@babel/types/lib/index.d.ts","../../../node_modules/@types/babel__generator/index.d.ts","../../../node_modules/@babel/parser/typings/babel-parser.d.ts","../../../node_modules/@types/babel__template/index.d.ts","../../../node_modules/@types/babel__traverse/index.d.ts","../../../node_modules/@types/babel__core/index.d.ts","../../../node_modules/@types/bn.js/index.d.ts","../../../node_modules/@types/connect/index.d.ts","../../../node_modules/@types/body-parser/index.d.ts","../../../node_modules/@types/bonjour/index.d.ts","../../../node_modules/@types/insert-module-globals/index.d.ts","../../../node_modules/@types/browserify/index.d.ts","../../../node_modules/@types/har-format/index.d.ts","../../../node_modules/@types/chrome/har-format/index.d.ts","../../../node_modules/@types/chrome/chrome-cast/index.d.ts","../../../node_modules/@types/filewriter/index.d.ts","../../../node_modules/@types/filesystem/index.d.ts","../../../node_modules/@types/chrome/index.d.ts","../../../node_modules/@types/concat-stream/index.d.ts","../../../node_modules/@types/mime/index.d.ts","../../../node_modules/@types/send/index.d.ts","../../../node_modules/@types/range-parser/index.d.ts","../../../node_modules/@types/qs/index.d.ts","../../../node_modules/@types/express-serve-static-core/index.d.ts","../../../node_modules/@types/connect-history-api-fallback/index.d.ts","../../../node_modules/@types/convert-source-map/index.d.ts","../../../node_modules/@types/deep-freeze-strict/index.d.ts","../../../node_modules/@types/eslint/helpers.d.ts","../../../node_modules/@types/json-schema/index.d.ts","../../../node_modules/@types/estree/index.d.ts","../../../node_modules/@types/eslint/index.d.ts","../../../node_modules/@types/eslint-scope/index.d.ts","../../../node_modules/@types/serve-static/node_modules/@types/mime/Mime.d.ts","../../../node_modules/@types/serve-static/node_modules/@types/mime/index.d.ts","../../../node_modules/@types/serve-static/index.d.ts","../../../node_modules/@types/express/index.d.ts","../../../node_modules/minimatch/dist/cjs/escape.d.ts","../../../node_modules/minimatch/dist/cjs/unescape.d.ts","../../../node_modules/minimatch/dist/cjs/index.d.ts","../../../node_modules/@types/glob/index.d.ts","../../../node_modules/@types/graceful-fs/index.d.ts","../../../node_modules/@types/gunzip-maybe/index.d.ts","../../../node_modules/@types/unist/index.d.ts","../../../node_modules/@types/hast/index.d.ts","../../../node_modules/@types/react/ts5.0/global.d.ts","../../../node_modules/csstype/index.d.ts","../../../node_modules/@types/prop-types/index.d.ts","../../../node_modules/@types/scheduler/tracing.d.ts","../../../node_modules/@types/react/ts5.0/index.d.ts","../../../node_modules/@types/hoist-non-react-statics/index.d.ts","../../../node_modules/@types/html-minifier-terser/index.d.ts","../../../node_modules/@types/http-cache-semantics/index.d.ts","../../../node_modules/@types/http-proxy/index.d.ts","../../../node_modules/@types/istanbul-lib-coverage/index.d.ts","../../../node_modules/@types/istanbul-lib-report/index.d.ts","../../../node_modules/source-map/source-map.d.ts","../../../node_modules/@types/istanbul-lib-source-maps/index.d.ts","../../../node_modules/@types/istanbul-reports/index.d.ts","../../../node_modules/chalk/index.d.ts","../../../node_modules/@types/jest/node_modules/jest-diff/build/cleanupSemantic.d.ts","../../../node_modules/@types/jest/node_modules/pretty-format/build/types.d.ts","../../../node_modules/@types/jest/node_modules/pretty-format/build/index.d.ts","../../../node_modules/@types/jest/node_modules/jest-diff/build/types.d.ts","../../../node_modules/@types/jest/node_modules/jest-diff/build/diffLines.d.ts","../../../node_modules/@types/jest/node_modules/jest-diff/build/printDiffs.d.ts","../../../node_modules/@types/jest/node_modules/jest-diff/build/index.d.ts","../../../node_modules/@types/jest/node_modules/jest-matcher-utils/build/index.d.ts","../../../node_modules/@types/jest/index.d.ts","../../../node_modules/parse5/dist/common/html.d.ts","../../../node_modules/parse5/dist/common/token.d.ts","../../../node_modules/parse5/dist/common/error-codes.d.ts","../../../node_modules/parse5/dist/tokenizer/preprocessor.d.ts","../../../node_modules/parse5/dist/tokenizer/index.d.ts","../../../node_modules/parse5/dist/tree-adapters/interface.d.ts","../../../node_modules/parse5/dist/parser/open-element-stack.d.ts","../../../node_modules/parse5/dist/parser/formatting-element-list.d.ts","../../../node_modules/parse5/dist/parser/index.d.ts","../../../node_modules/parse5/dist/tree-adapters/default.d.ts","../../../node_modules/parse5/dist/serializer/index.d.ts","../../../node_modules/parse5/dist/common/foreign-content.d.ts","../../../node_modules/parse5/dist/index.d.ts","../../../node_modules/@types/tough-cookie/index.d.ts","../../../node_modules/@types/jsdom/base.d.ts","../../../node_modules/@types/jsdom/index.d.ts","../../../node_modules/@types/json5/index.d.ts","../../../node_modules/@types/lodash/common/common.d.ts","../../../node_modules/@types/lodash/common/array.d.ts","../../../node_modules/@types/lodash/common/collection.d.ts","../../../node_modules/@types/lodash/common/date.d.ts","../../../node_modules/@types/lodash/common/function.d.ts","../../../node_modules/@types/lodash/common/lang.d.ts","../../../node_modules/@types/lodash/common/math.d.ts","../../../node_modules/@types/lodash/common/number.d.ts","../../../node_modules/@types/lodash/common/object.d.ts","../../../node_modules/@types/lodash/common/seq.d.ts","../../../node_modules/@types/lodash/common/string.d.ts","../../../node_modules/@types/lodash/common/util.d.ts","../../../node_modules/@types/lodash/index.d.ts","../../../node_modules/@types/lodash.mergewith/index.d.ts","../../../node_modules/@types/mdast/index.d.ts","../../../node_modules/@types/minimatch/index.d.ts","../../../node_modules/@types/mocha/index.d.ts","../../../node_modules/@types/normalize-package-data/index.d.ts","../../../node_modules/@types/parse-json/index.d.ts","../../../node_modules/@types/prettier/index.d.ts","../../../node_modules/@types/punycode/index.d.ts","../../../node_modules/@types/react-dom/index.d.ts","../../../node_modules/@types/react-transition-group/Transition.d.ts","../../../node_modules/@types/react-transition-group/CSSTransition.d.ts","../../../node_modules/@types/react-transition-group/TransitionGroup.d.ts","../../../node_modules/@types/react-transition-group/SwitchTransition.d.ts","../../../node_modules/@types/react-transition-group/config.d.ts","../../../node_modules/@types/react-transition-group/index.d.ts","../../../node_modules/@types/resolve/index.d.ts","../../../node_modules/@types/retry/index.d.ts","../../../node_modules/@types/rimraf/index.d.ts","../../../node_modules/@types/scheduler/index.d.ts","../../../node_modules/@types/semver/classes/semver.d.ts","../../../node_modules/@types/semver/functions/parse.d.ts","../../../node_modules/@types/semver/functions/valid.d.ts","../../../node_modules/@types/semver/functions/clean.d.ts","../../../node_modules/@types/semver/functions/inc.d.ts","../../../node_modules/@types/semver/functions/diff.d.ts","../../../node_modules/@types/semver/functions/major.d.ts","../../../node_modules/@types/semver/functions/minor.d.ts","../../../node_modules/@types/semver/functions/patch.d.ts","../../../node_modules/@types/semver/functions/prerelease.d.ts","../../../node_modules/@types/semver/functions/compare.d.ts","../../../node_modules/@types/semver/functions/rcompare.d.ts","../../../node_modules/@types/semver/functions/compare-loose.d.ts","../../../node_modules/@types/semver/functions/compare-build.d.ts","../../../node_modules/@types/semver/functions/sort.d.ts","../../../node_modules/@types/semver/functions/rsort.d.ts","../../../node_modules/@types/semver/functions/gt.d.ts","../../../node_modules/@types/semver/functions/lt.d.ts","../../../node_modules/@types/semver/functions/eq.d.ts","../../../node_modules/@types/semver/functions/neq.d.ts","../../../node_modules/@types/semver/functions/gte.d.ts","../../../node_modules/@types/semver/functions/lte.d.ts","../../../node_modules/@types/semver/functions/cmp.d.ts","../../../node_modules/@types/semver/functions/coerce.d.ts","../../../node_modules/@types/semver/classes/comparator.d.ts","../../../node_modules/@types/semver/classes/range.d.ts","../../../node_modules/@types/semver/functions/satisfies.d.ts","../../../node_modules/@types/semver/ranges/max-satisfying.d.ts","../../../node_modules/@types/semver/ranges/min-satisfying.d.ts","../../../node_modules/@types/semver/ranges/to-comparators.d.ts","../../../node_modules/@types/semver/ranges/min-version.d.ts","../../../node_modules/@types/semver/ranges/valid.d.ts","../../../node_modules/@types/semver/ranges/outside.d.ts","../../../node_modules/@types/semver/ranges/gtr.d.ts","../../../node_modules/@types/semver/ranges/ltr.d.ts","../../../node_modules/@types/semver/ranges/intersects.d.ts","../../../node_modules/@types/semver/ranges/simplify.d.ts","../../../node_modules/@types/semver/ranges/subset.d.ts","../../../node_modules/@types/semver/internals/identifiers.d.ts","../../../node_modules/@types/semver/index.d.ts","../../../node_modules/@types/serve-handler/index.d.ts","../../../node_modules/@types/serve-index/index.d.ts","../../../node_modules/@types/sockjs/index.d.ts","../../../node_modules/@types/source-list-map/index.d.ts","../../../node_modules/@types/stack-utils/index.d.ts","../../../node_modules/@types/tar-stream/index.d.ts","../../../node_modules/@types/use-sync-external-store/index.d.ts","../../../node_modules/@types/validate-npm-package-name/index.d.ts","../../../node_modules/@types/warning/index.d.ts","../../../node_modules/@types/webpack-env/index.d.ts","../../../node_modules/@types/webpack-sources/node_modules/source-map/source-map.d.ts","../../../node_modules/@types/webpack-sources/lib/Source.d.ts","../../../node_modules/@types/webpack-sources/lib/CompatSource.d.ts","../../../node_modules/@types/webpack-sources/lib/ConcatSource.d.ts","../../../node_modules/@types/webpack-sources/lib/OriginalSource.d.ts","../../../node_modules/@types/webpack-sources/lib/PrefixSource.d.ts","../../../node_modules/@types/webpack-sources/lib/RawSource.d.ts","../../../node_modules/@types/webpack-sources/lib/ReplaceSource.d.ts","../../../node_modules/@types/webpack-sources/lib/SizeOnlySource.d.ts","../../../node_modules/@types/webpack-sources/lib/SourceMapSource.d.ts","../../../node_modules/@types/webpack-sources/lib/index.d.ts","../../../node_modules/@types/webpack-sources/lib/CachedSource.d.ts","../../../node_modules/@types/webpack-sources/index.d.ts","../../../node_modules/@types/which/index.d.ts","../../../node_modules/@types/ws/index.d.ts","../../../node_modules/@types/yargs-parser/index.d.ts","../../../node_modules/@types/yargs/index.d.ts","../../../node_modules/@types/yauzl/index.d.ts"],"fileInfos":[{"version":"f20c05dbfe50a208301d2a1da37b9931bce0466eb5a1f4fe240971b4ecc82b67","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9",{"version":"9b087de7268e4efc5f215347a62656663933d63c0b1d7b624913240367b999ea","affectsGlobalScope":true},{"version":"3260e3386d9535b804205bdddb5618a9a27735bd22927f48ad54363abcd23d45","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"8cc8c5a3bac513368b0157f3d8b31cfdcfe78b56d3724f30f80ed9715e404af8","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"55f400eec64d17e888e278f4def2f254b41b89515d3b88ad75d5e05f019daddd","affectsGlobalScope":true},{"version":"181f1784c6c10b751631b24ce60c7f78b20665db4550b335be179217bacc0d5f","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"81cac4cbc92c0c839c70f8ffb94eb61e2d32dc1c3cf6d95844ca099463cf37ea","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"d7f680a43f8cd12a6b6122c07c54ba40952b0c8aa140dcfcf32eb9e6cb028596","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"775d9c9fd150d5de79e0450f35bc8b8f94ae64e3eb5da12725ff2a649dccc777","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"52d1bb7ab7a3306fd0375c8bff560feed26ed676a5b0457fa8027b563aecb9a4","affectsGlobalScope":true},"e475453e7140e95542332943d3052fe4c7430ad1efce42b3e9157f1fee8cbc5f","ebfdf904255ce746c9d30117c2edef355fb19bf7650478d2405f39f0e4f302e6","f3f63b48addb8e2ea9d20bb671c3c306413b3daa39996d0ae52f63d8e32158e1","a50599c08934a62f11657bdbe0dc929ab66da1b1f09974408fd9a33ec1bb8060","5a20e7d6c630b91be15e9b837853173829d00273197481dc8d3e94df61105a71","8d478048d71cc16f806d4b71b252ecb67c7444ccf4f4b09b29a312712184f859","b4000a0a525fa921e896cbdb32ae802c9684f0fd371b5fc69e7310f7918cc2c3","9df4662ca3dbc2522bc115833ee04faa1afbb4e249a85ef4a0a09c621346bd08","b25d9065cf1c1f537a140bbc508e953ed2262f77134574c432d206ff36f4bdbf","1b103313097041aa9cd705a682c652f08613cb5cf8663321061c0902f845e81c","68ccec8662818911d8a12b8ed028bc5729fb4f1d34793c4701265ba60bc73cf4","5f85b8b79dc4d36af672c035b2beb71545de63a5d60bccbeee64c260941672ab","b3d48529ae61dc27d0bfbfa2cb3e0dff8189644bd155bdf5df1e8e14669f7043","40fe4b689225816b31fe5794c0fbf3534568819709e40295ead998a2bc1ab237","f65b5e33b9ad545a1eebbd6afe857314725ad42aaf069913e33f928ab3e4990a","fb6f2a87beb7fb1f4c2b762d0c76a9459fc91f557231569b0ee21399e22aa13d","31c858dc85996fac4b7fa944e1016d5c72f514930a72357ab5001097bf6511c7","3de30a871b3340be8b679c52aa12f90dd1c8c60874517be58968fdbcc4d79445","6fd985bd31eaf77542625306fb0404d32bff978990f0a06428e5f0b9a3b58109","7e771891adaa85b690266bc37bd6eb43bc57eecc4b54693ead36467e7369952a","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"02873d070f9cb79f50833fbf4a9a27ac578a2edf8ddb8421eba1b37faba83bfb","affectsGlobalScope":true},"11e2d554398d2bd460e7d06b2fa5827a297c8acfbe00b4f894a224ac0862857f",{"version":"a8c260f87bca4da5d28dbc255c17656831e64d173a6cbbc2748e5cc12b77731c","affectsGlobalScope":true},"374ca798f244e464346f14301dc2a8b4b111af1a83b49fffef5906c338a1f922","5a94487653355b56018122d92392beb2e5f4a6c63ba5cef83bbe1c99775ef713",{"version":"d5135ad93b33adcce80b18f8065087934cdc1730d63db58562edcf017e1aad9b","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","5eb881ed2a0d5b17ea36df5cd4c4be500e460c412f270c3170e906bec65580ac","bb9c4ffa5e6290c6980b63c815cdd1625876dadb2efaf77edbe82984be93e55e","489532ff54b714f0e0939947a1c560e516d3ae93d51d639ab02e907a0e950114","f30bb836526d930a74593f7b0f5c1c46d10856415a8f69e5e2fc3db80371e362","14b5aa23c5d0ae1907bc696ac7b6915d88f7d85799cc0dc2dcf98fbce2c5a67c","5c439dafdc09abe4d6c260a96b822fa0ba5be7203c71a63ab1f1423cd9e838ea",{"version":"6b526a5ec4a401ca7c26cfe6a48e641d8f30af76673bad3b06a1b4504594a960","affectsGlobalScope":true},{"version":"816ad2e607a96de5bcac7d437f843f5afd8957f1fa5eefa6bba8e4ed7ca8fd84","affectsGlobalScope":true},"cec36af22f514322f870e81d30675c78df82ae8bf4863f5fd4e4424c040c678d","d903fafe96674bc0b2ac38a5be4a8fc07b14c2548d1cdb165a80ea24c44c0c54","5eec82ac21f84d83586c59a16b9b8502d34505d1393393556682fe7e7fde9ef2","04eb6578a588d6a46f50299b55f30e3a04ef27d0c5a46c57d8fcc211cd530faa","8d3c583a07e0c37e876908c2d5da575019f689df8d9fa4c081d99119d53dba22","2c828a5405191d006115ab34e191b8474bc6c86ffdc401d1a9864b1b6e088a58",{"version":"e630e5528e899219ae319e83bef54bf3bcb91b01d76861ecf881e8e614b167f0","affectsGlobalScope":true},"2c45b35f4850881ab132f80d3cb51e8a359a4d8fafdc5ff2401d260dc27862f4","7c013aa892414a7fdcfd861ae524a668eaa3ede8c7c0acafaf611948122c8d93","b0973c3cbcdc59b37bf477731d468696ecaf442593ec51bab497a613a580fe30",{"version":"4989e92ba5b69b182d2caaea6295af52b7dc73a4f7a2e336a676722884e7139d","affectsGlobalScope":true},{"version":"b3624aed92dab6da8484280d3cb3e2f4130ec3f4ef3f8201c95144ae9e898bb6","affectsGlobalScope":true},"5153a2fd150e46ce57bb3f8db1318d33f6ad3261ed70ceeff92281c0608c74a3","210d54cd652ec0fec8c8916e4af59bb341065576ecda039842f9ffb2e908507c","36b03690b628eab08703d63f04eaa89c5df202e5f1edf3989f13ad389cd2c091","0effadd232a20498b11308058e334d3339cc5bf8c4c858393e38d9d4c0013dcf","25846d43937c672bab7e8195f3d881f93495df712ee901860effc109918938cc","3163f47436da41706c6e2b3c1511f3b7cce9f9f3905b2f3e01246c48b4ba7d14","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff","69ee23dd0d215b09907ad30d23f88b7790c93329d1faf31d7835552a10cf7cbf","44b8b584a338b190a59f4f6929d072431950c7bd92ec2694821c11bce180c8a5","23b89798789dffbd437c0c423f5d02d11f9736aea73d6abf16db4f812ff36eda","09326ae5f7e3d49be5cd9ea00eb814770e71870a438faa2efd8bdd9b4db21320",{"version":"970a90f76d4d219ad60819d61f5994514087ba94c985647a3474a5a3d12714ed","affectsGlobalScope":true},"e10177274a35a9d07c825615340b2fcde2f610f53f3fb40269fd196b4288dda6","c4577fb855ca259bdbf3ea663ca73988ce5f84251a92b4aef80a1f4122b6f98e","3c13ef48634e7b5012fcf7e8fce7496352c2d779a7201389ca96a2a81ee4314d","5d0a25ec910fa36595f85a67ac992d7a53dd4064a1ba6aea1c9f14ab73a023f2",{"version":"f0900cd5d00fe1263ff41201fb8073dbeb984397e4af3b8002a5c207a30bdc33","affectsGlobalScope":true},{"version":"ff07a9a03c65732ccc59b3c65bc584173da093bd563a6565411c01f5703bd3cb","affectsGlobalScope":true},"06d7c42d256f0ce6afe1b2b6cfbc97ab391f29dadb00dd0ae8e8f23f5bc916c3","ec4bd1b200670fb567920db572d6701ed42a9641d09c4ff6869768c8f81b404c","e59a892d87e72733e2a9ca21611b9beb52977be2696c7ba4b216cbbb9a48f5aa",{"version":"da26af7362f53d122283bc69fed862b9a9fe27e01bc6a69d1d682e0e5a4df3e6","affectsGlobalScope":true},"8a300fa9b698845a1f9c41ecbe2c5966634582a8e2020d51abcace9b55aa959e",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"652ee9c5103e89102d87bc20d167a02a0e3e5e53665674466c8cfea8a9e418c7","175323e2a79a6076e0bada8a390d535a3ea817158bf1b1f46e31efca9028a0a2","7a10053aadc19335532a4d02756db4865974fd69bea5439ddcc5bfdf062d9476","4967529644e391115ca5592184d4b63980569adf60ee685f968fd59ab1557188","aed9e712a9b168345362e8f3a949f16c99ca1e05d21328f05735dfdbb24414ef","b04fe6922ed3db93afdbd49cdda8576aa75f744592fceea96fb0d5f32158c4f5","ed8d6c8de90fc2a4faaebc28e91f2469928738efd5208fb75ade0fa607e892b7","d7c52b198d680fe65b1a8d1b001f0173ffa2536ca2e7082431d726ce1f6714cd","c07f251e1c4e415a838e5498380b55cfea94f3513229de292d2aa85ae52fc3e9","0ed401424892d6bf294a5374efe512d6951b54a71e5dd0290c55b6d0d915f6f7","b945be6da6a3616ef3a250bfe223362b1c7c6872e775b0c4d82a1bf7a28ff902","beea49237dd7c7110fabf3c7509919c9cb9da841d847c53cac162dc3479e2f87","0f45f8a529c450d8f394106cc622bff79e44a1716e1ac9c3cc68b43f7ecf65ee","c624ce90b04c27ce4f318ba6330d39bde3d4e306f0f497ce78d4bda5ab8e22ca","9b8253aa5cb2c82d505f72afdbf96e83b15cc6b9a6f4fadbbbab46210d5f1977","86a8f52e4b1ac49155e889376bcfa8528a634c90c27fec65aa0e949f77b740c5","aab5dd41c1e2316cc0b42a7dd15684f8582d5a1d16c0516276a2a8a7d0fecd9c","59948226626ee210045296ba1fc6cb0fe748d1ff613204e08e7157ab6862dee7","ec3e54d8b713c170fdc8110a7e4a6a97513a7ab6b05ac9e1100cb064d2bb7349","43beb30ecb39a603fde4376554887310b0699f25f7f39c5c91e3147b51bb3a26","666b77d7f06f49da114b090a399abbfa66d5b6c01a3fd9dc4f063a52ace28507","31997714a93fbc570f52d47d6a8ebfb021a34a68ea9ba58bbb69cdec9565657e","6032e4262822160128e644de3fc4410bcd7517c2f137525fd2623d2bb23cb0d3","8bd5c9b1016629c144fd228983395b9dbf0676a576716bc3d316cab612c33cd5","2ed90bd3925b23aed8f859ffd0e885250be0424ca2b57e9866dabef152e1d6b7","93f6bd17d92dab9db7897e1430a5aeaa03bcf51623156213d8397710367a76ce","3f62b770a42e8c47c7008726f95aa383e69d97e85e680d237b99fcb0ee601dd8","5b84cfe78028c35c3bb89c042f18bf08d09da11e82d275c378ae4d07d8477e6c","980d21b0081cbf81774083b1e3a46f4bbdcd2b68858df0f66d7fad9c82bc34bc","6a9c5127096b35264eb7cd21b2417bfc1d42cceca9ba4ce2bb0c3410b7816042","78828b06c0d3b586954015e9ebde5480b009e166c71244763bda328ec0920f41","b17f3bb7d8333479c7e45e5f3d876761b9bca58f97594eca3f6a944fd825e632","3c1f1236cce6d6e0c4e2c1b4371e6f72d7c14842ecd76a98ed0748ee5730c8f3","6d7f58d5ea72d7834946fd7104a734dc7d40661be8b2e1eaced1ddce3268ebaf","4c26222991e6c97d5a8f541d4f2c67585eda9e8b33cf9f52931b098045236e88","277983d414aa99d78655186c3ee1e1c38c302e336aff1d77b47fcdc39d8273fe","47383b45796d525a4039cd22d2840ac55a1ff03a43d027f7f867ba7314a9cf53","6548773b3abbc18de29176c2141f766d4e437e40596ee480447abf83575445ad","6ddd27af0436ce59dd4c1896e2bfdb2bdb2529847d078b83ce67a144dff05491","816264799aef3fd5a09a3b6c25217d5ec26a9dfc7465eac7d6073bcdc7d88f3f",{"version":"3bca0ae756174a48ad9a47c865776f41788793ace1d85736aec31a60fa6ad960","signature":"c467dada8fea6d60dff8a8be2675f737cacc76e14e50b72daa0f0710376df84b"},{"version":"e0e6891afe2986f8f41995f02c784c0141f0785f9039c04f42873b041324b738","signature":"31b5f53e3d57470830e87f9e03c02d4569ac81d4a758fdda75092f9a3f58beba"},"9f9e5bae412fa5909fae636d6733aee27a108cc2ed5b13980611016336774d3c","662fe197bba64bd3f17ee118058cd2d0d2dbe33d7c0c865fd6365d90bfc44e1e","030519c351f800551cac2658038804969ca4584d2c0175a710602ac234ca1340","0278a6939ca83cd040b08ff8c5fc7838b6693ddc52f22526bf158e6b10e0246c","c2d6206e5ba4fd3063b01218c2b3b997afc1cfbeb49fcee991fa8595842ce53d",{"version":"7f21c0f417540d8f7049665fe143fdc126f0f49b54be9396346d13f5365656b0","signature":"6a8096993458a3d71229031aa7415974eb5b47b320213e29660adfb519d6a3f4"},{"version":"5c6af5bcd08565be7bdb15556b7f0ec2a28ba3f9acda87136fbd75871aa2f2bb","signature":"cb7996a1af5b1d276483cd0c9b9de6540eff021abc90a720511ff4464519a2ff"},{"version":"cf25f0c4e8c185e7235b00e6da5cd1118a54a42a6b03cf400e46ef543b28590d","signature":"9df6ec68878d65bc690ea3a33ce3ef5aa8254c36bc5f8346c0c2fd1f3b88a35c"},{"version":"35cf4c47da07028e95286e6b4d78b702cb101beb27b1d1d712209921508ee5d0","signature":"a4fad04c4acc8a4b195cbbccef4c55019104753d547d5c94441643ccc89108a0"},{"version":"d0ddd632c4f010cb2a048d8a606e3544f9a8a67a6c1487858e8aa08b6fdeda73","signature":"0244c23ea642361f7c192c1f0cfff9c12cfa5f51f9b155edd5c0a89fef308d34"},"fcc8beef29f39f09b1d9c9f99c42f9fed605ab1c28d2a630185f732b9ba53763","d6e6620a30d582182acc3f0a992a0c311adc589f111096aea11ab83fc09a5ccc","6213b8f686f56beab22b59a0f468590fd3a4c5fa931236a017efeca91d7c9584","c451cec9a588b1f105a5ea2c6063d4fca112b9d70105cacdadda0e1ef67e9379","cb047832dc68f5a2c41c62c5e95ddcacbae3a8b034d40cd15319a8cb7f25104a","980336ccdfc3c08f3c3b201aa6662e6016e20f15847f8465b68f3e8e67b4665c","5a3493939995f46ff3d9073cd534fb8961c3bf4e08c71db27066ff03d906dea8","bb5a2ac327605ebebf831c469b05bd34a33a6a46ee8c1edd9f3310aad32cf6a1","d1f010c19eb9c8190bd0859fa3b6f4975543b912b8b85e20bbb0b5bfbdf4d2b3","de4ccc96cef3f97fab148640799abb32a24b567a902a8233913f98481e3131bf",{"version":"801934aa449fe6df584bccdcc5d5b9280295cb7ac84918b6014fc5086e6f9ff6","affectsGlobalScope":true},"5e379df3d61561c2ed7789b5995b9ba2143bbba21a905e2381e16efe7d1fa424","f07a137bbe2de7a122c37bfea00e761975fb264c49f18003d398d71b3fb35a5f","6af760fb9ea02dc807c5053d8aee86389c4fce72fbb26af7b9568cac6c4710d5","c62c4ba5e910b4523f7e7adf4a55ec45c2bac99d9d8e9b0fe0c2a800a6f641b9","92131434f876fdd6fcbc40bd54a9d7500c66974362b16bd42641f990468587f4","8cf023c0bd57992fdd2ce6a7030a1874f49c8edc62eaffa9bfffcf18d2a2a1a2","8ea8f3040e38fb50d7dc3653f3b8a0dbb5244e82111576f99ce096bdc0fbf94c","48ed788ad126545a6156fcc37cd3bcf17de18a3e3fe6b6ef62cfb8140d1a45a2",{"version":"d5d9407858477b9fb1d5127bb1da9d0532799e98f2d765ca0f83d7e0617aead9","signature":"c7298e68632ab03155f6de963d3d09cc4a5874c28a81524f56c667d8a052e538"},{"version":"9f64beb0e02869eecb1d65c682e6951b18f7d735acc669c4aa666b10802fad58","signature":"3c69a83bde847af6fc3a53e1bb6b13cd06d38a27a142814b8dacc374f3b93284"},"5b46f7113f54565e7ffc83f2b474f557a1f54c7e5946769d5be220454656be73","fb58035d39c5759283cb73cfb3548aefe370aa3ad4e81fdb4e46f0979eb7669f","44412cd78df82b6698ea95aa28b4df68a2962fb84e66802802f58f11e2658d96","d0b3609e8e7afed0fd0570152255458407e67249b94f6603afdfd68599423f21","17f4c5a1d6eaa87ea27eadcdff9085af3190533d98f799dda79a3af6f9a630ea","3e6f734ddf40e2e99ff7fff9568b7d9720663af9a0632c26a352c8d3270a3f0e","628bc7c0dd29c0ce9faf446e606e16b2d31930f7d96c7a1a050034859bac9756","a3fc57dbaa7f1efb010399ad4ef4fd9b462aa4e93bf74a9a34b099b97ffcc9cb","ffddd7ec6a450b0cb6f2f73f80de1df963ead312d7c81a8440268f34146ecb87","5d6a36ca0087fd6876df654d1b4192f0e402adfde994ad47e5c065da33692f9c","eb157a09c5f543d98644e2a99a785f9e0e91f054f9fecbf1c3e15831ff5d63a7","edd5530e2b1ccdf65093296e40a8634fcb11ecda3c164c31383a8c34cb04bc9d","9dfaf96d090fe8d96143465d85b4837661ae535143eea9ef99cd20df2e66338e","209d45c27e03c1417c42985252de6c25a2ec23abdc199d88e6139c88b93abd11","0ee5cdba58cfde3012bb9ff2e9edcc4e35a651373a2aa2c83ff9eb7df635419a","540f4dca27ea5a232828b6d91e1b2fce2720bdabaa4c1f3fbf59b672cc58bd8a","ba086b99d545ec6c9ff356989f076b5652ea1b09bcc65b87dfc43a5195a2efcc","c85d9776b36166b928ab1488d9224ebf970d41b0a35f09a3ee0b9bee3e698061","683196f606c5dab1c8c4a24a66d26e00f16f2d4b2a5abe25ebedd37d2954f930","9c3a1b01cba1238fb723ce06b6c163ef6c53be755394406782564d5c42c636b2",{"version":"8840aa6b6e639356fe03fb90dcf4b5c0f692e19ea21769dfefa87fb4986d0f39","signature":"6e795e6270d39e918c7a0e62ac73793cda06fcf4b3692ee46583e15f5bf57ab8"},{"version":"3c3bd88dce55082490f23b03004ecd8c0240286b78f0f3a8522741d85149daef","signature":"0e821ef1eb67fa6144ea4de4277d913f5b1982d7407afd5f93754a8239d41554"},{"version":"75338b5765638e8ebb9db41409c44c7f518ff075659dfa5d9e098b8275d693c0","signature":"5c09195ef359ffa9c6bbdb4fefb101d87ede4b9e9c28213faf5b45d102e4c609"},{"version":"77365935c04df781293bef31693df1f39ab6a1277e5c80b6e6afbb1261ba2e7e","signature":"80b4d93a4dcc90a12f6f4bb7c6851a8182ae29e556716d0d80b5c012a5ef554a"},{"version":"f079c0793e2a122623b2a06b69d2eac67c0eb0d0dd93697934575df2c2dc1e5c","signature":"2556ef9d1820e0b6bbca6dd65a50ea64f525c4d8247ab50dff44c3f0d14a5643"},{"version":"747d15f60efe408b2591768b982c1c6245aef0e3d723293eab22b72ba3a585d6","signature":"cbd1c836db190d6e3add07165afc228f04e1f6170e1fe3aa5e6fc24a7e9573a3"},{"version":"deccdcc30a0da9b7ab2fa9a72ad35b30e23811adb665ebc785cba2e73b8c5675","signature":"9b13881feb958237232586d888a10a39d47cdffe3ee34688ed41888fa7baad94"},{"version":"36232364518da824c104338b98b4b07a47e1d217662a58e114393931aa02594d","signature":"122fe82cf5af80f0b26832b258b537b7dfe3ec28449c301b259ab10204b50d45"},{"version":"aa805fc7ff02a27db26c2a528940a8aeca1f750c3a3643bacef479e3257d3662","signature":"9cb80bba611c2dd155a446ce424fe4bb1df2129751bc9416b7e42c055d1ddbff"},{"version":"89c7df2ac4b33507472aa18cfbdac688e7e0b749ee584d9d41884721c4e603c6","signature":"6ee568039016b81ed70292a595ab781ab978cba4243a5fe49507040ee4f7ac8a"},{"version":"d8554032764ddef0e0bbbe2e99c833eb8f7578c2b625f5b8eab091188610196b","signature":"043783bebe87efb440183c9ebc8c4fdc1bb92060a5a0f7ce847e30dee7013ac3"},{"version":"cb8e681140450ef21ae1a541655fb0c1fefa0d5bbc8570f7530ea7ab13db0608","signature":"e3dc0a97a59dea936b4fb7b1f6f4117b4aac9c86d0cd08b69bab2d0532a8a5e3"},{"version":"c9d671faef655f35974718a841388e5808f3bd94e282e244a9a0d99b14cff495","signature":"5d897601f8a4fe913057019d8211b99b06e3138f625a0cfb601d074f4278271d"},{"version":"a3c40e930415aa32fdcdb14f90688010d19fda009833d7dd93abcc71e03dd8af","signature":"a68bb369c4ba8ab43a78f3fad2d3ec130e1418bc946521b9c84e9b336d6e88f1"},{"version":"0b4c309c6b8685487f97d6fd6a7441b93dd4ca3c4a8f2bcc96a55e5f9d28eee2","signature":"65f219e6e1f9d27c677a49d41ae7989b83bf6baa56debbeb50d95c3ab21632e2"},{"version":"bfba5e8c8dcb1c4b329dd468ae054a418938168396429902a293f33c3b98d236","signature":"cfde5d194dd858ad68f910defaed5b0d28730f8bf38359a9265a93ab29bc7bef"},{"version":"854caddc363811a2917620e1ef1a986fceec21e1c695561c7122859df49e0431","signature":"c89354ae268153d965011e484150f0c92faa87f3f66507c25b496973178e0400"},{"version":"2a81ff1c24917005c9736de2a457c5564c9c6e11e4d76874da07cf11be8cff91","signature":"f20aae41b169cddcbf3fde8ac380443182c8d7225194e788c404d9e11e6dc75d"},{"version":"a1d7df4a3dbe98d0633eeca6be38c65827d29865fe8d48a1005e9aad0fa3cbb9","signature":"a6f4816a634bb1ceb513634c1ef7c0535f461ed2565336eed69f6ac2babbe15b"},{"version":"6f618692c560c2032484b73f789cc4d591e3412cadf56f36a3effcc007a9f1c9","signature":"5cc8b8e18fe7fefab4b3c53a39467b5a0deb4200abae7f063ff0624b9e856c51"},{"version":"d6f732b597e4238c26241989600859e24ee24a294586c9536c6ac89be3bfcfd2","signature":"8e990781eb0107c25429b1274a31a4f3866a9a46290cce40f354b2a6e71c6c21"},{"version":"d176c6e4f4c68955817dc696e3aa55bc3f52753cc410d321ffd9353a2359586b","signature":"c48566cb13403fca44192b4528e3f2ac993869d39526bd42cd2f2167c0285add"},{"version":"472e325503cfcec80d6ed23ff121080f612558400d18fc69bf62fedc4119d930","signature":"efae20e0c581240c7522e04829da4f0453ca263068596554d4b0e27878c7dfac"},{"version":"14b9194f7e782ea4f7bcc1f63e7fc228382f109528615eae5f93ec35fd7c45ab","signature":"3af68ef927788cda7daab34be513fa4508229fdc6e5130d564a0a1ccb3fefafe"},{"version":"75a97812955173bde7ff29c0981c309c0e3c68c8fb609289606973d3192dea6a","signature":"bbbd2cbb15a37d5f4dd54ad8c7c537d3df8352117523030fcec7dcbe62a05a58"},{"version":"615827be9e17301849518c65b22cf55d38fd70752b35ae4bc56f4f1a168856c5","signature":"b50d24ebc117f8805332e7e260e9587f572bb7b2ff0ca1ff6cfafb38015781f3"},{"version":"d1121f9f0f812490afd777a543b1412ea50ea95da6f5e83f5d8b8617c2ca0ec4","signature":"608c45069e89c4c8f0ab29f896cc93c6553808072d6304b23611b6c6de3c24bb"},{"version":"1db66cc3eb3ef433289a7fcbac5c9bd9bfdde251188cc5886e016b8e60953aa7","signature":"22cbabe752781b5f35482af9d1fcf1455cb1ece74e8b84700d4abcb44abe3776"},{"version":"10051fca57c12434ef48fb3e45136705e09b61de4e7a5f7adfc35f367385f912","signature":"b9ce4613536386a98897f1e3d8f61a851ce6cb34dc3c9db4f2ef5f55f007e9e1"},{"version":"8bdd4f7af884080d0c18ee346e3ffcc433824d67fde761a71879fea59c8648d3","signature":"a5d1209c7bf277af86281392d46e12ce3dd6052586053f757fb2e606cc75c0f3"},{"version":"ad21d1b3fe8673f3e0dc0e8a592016ca4158a9414471c6d6531aff27713c3e51","signature":"c1f11d9b42bfb0823d34d93c58df91ffb6690b5a717b7d310d83f258f1784e58"},{"version":"b453a055e870914ff0aadc94ebbcedeb5d1e25585f881ac432983f08c4b7d2aa","signature":"d765fbab22fd7003a65ed670100362ec1c90d55a772e6773a774135594e7ea41"},{"version":"710e8c05b091c0294e0d0df1a734f78fc32293cbf10f51cc91880bc9e0b0a0c6","signature":"775b207f00d4df5b3b0b536aa696d572cdd2cabe8ea18dd28e8b52f691fa2a55"},{"version":"a0e09506f2484d4e384e2a9dca23e7dcd921897b295e5da09b0dec2939524ad3","signature":"f75cd30f162c2af5e5aca39c01c1a521bfa034fae523793de872815a3468bc08"},{"version":"c7c13905a14cf51163e521fba0cc2c62017be95b7ed0e64f7c44e86136b80dc8","signature":"e5a9e27b21ee4961fd8d6a7ff23d361830af7a58097e7afac6cde0258bdaf5ae"},{"version":"913f612848ddd2d0b5aedc12a997e907dbfdc59d1cd622a11e1d82148dd57631","signature":"0cf1123db73dabd86466a462375a6addae52f58d23030c6033f8aadc23539a36"},{"version":"f15fc9bd6077dd21863501c7923fae152febccb1db16d4788e33fd1a3e5c2ff9","signature":"e29cef4158591ed213b1c2cba8988237b1ff369f7a6ecd8cb8ac0302bad1fba8"},{"version":"f619bacccdd064647a99e7f781ec966475ce960d6a5a9d78d8f0eee2057d99b8","signature":"5307876e4d0021ea01235eb2f7c24671f3d8b37590f4b446cd132a4e1dc9a335"},{"version":"0096c0417f84febf396d181166f8c1d97c2d9aadc864dfba9904f7300ae85705","signature":"92550acd737790dc60c4c130e6aac78656dd48a8334a4882f40e7f86bdf7a590"},{"version":"39c4c6d0c2ece1c74188517b655ef41dce04140da60bb60513e30f65a3ceb227","signature":"3df821880914f8bb3c8107b1107be75c8ddbe2120a2cefabbaf9b65936b5f4dd"},{"version":"14d01e1e345e2722c953982c22572cb07ab093d9b274fcc0de53b909b083d308","signature":"2d01884891da6495cb4a2f060e4898209a507e711464c4c1480df85264e863ed"},{"version":"e4293d5c29b8c2dba0317689cab23a4bbd8c76e3f637d8d1e25805aa02a87043","signature":"c485c6497f7587314c4c4a59b74850cbca4c0c4bc08146a918cfd237ef821dbb"},{"version":"6ef30dfff2b71cf8a0959957c00ff50b66751f5fcf91af940837512028fb5675","signature":"e9eec004735b1bf7015edf5400aeb914a53132134d230e93786590d904d094cc"},{"version":"e539ad450c129a431e31e82517acbf357c95613ff0e20d23ff0a331964cdefa4","signature":"68b139ebb9a7f3ee4ded6286d74f978a47968727665120f3bfc560476ce33c4d"},{"version":"fb8d6b6816a3f530d7e8f59a01509f14b4c672a381ffcbed29ce2a0c39f6d07d","signature":"56d02c29b2fd39b1b1a1265df291f3f98e6ec3e6119aff9f4cfa44fe888efaa7"},{"version":"0ef62a227d5e796142ca01e185b99b60529ef08e7ea7b3afed2dd9e0e13028a7","signature":"078b7043bea0968860374bf4671ed74dd9f6be4e28ab659517d81f74be463c51"},{"version":"a23e9f251ac37df49fa29d2731be383716fba64c0af54b8acbaa31d55fc4dcd9","signature":"f46ba7c6fa7fcc8b3d57c4618c18db3f4d8bfe1fcab5551d7f6d9a82cf4d6078"},"080b1aa93227952b4dd74b9d2c6e4f6002eb8403533749116a1c53bb9961c02d",{"version":"cb971e4549197d366f5764a70e718c8dc65c93c5b8f76312a0d91db657a6ed7c","signature":"874087eec1d457f6e3baf5ac46c42ea200e55040b394fac667aa3a64c49f5f6c"},"6e8a5b04a18abb192abc89d7219b9c6f633cb3136777ec808673a65f111ca749",{"version":"977f9752e7185453337e20609747d21846556482c0f1658e29edd182985cafbc","signature":"4e7ac7e5dd58a6c29c724728b031669e3068b194b62c2b83f92e76a36cb34dbb"},{"version":"7194ae36630e7745ebdfb8a33acd43331c6b695e1368cb0fc27477a2e0a44e87","signature":"d74d2a92b54f95e47d2b76bd5ee516aab7ae93afb79cd34c6681dd29eb09e72a"},{"version":"6d6cb1dcc82f5f7df5feefa8ffec0ce2995690e5c870c933b9aa4cc140790604","signature":"747e6326a724bc54f799a466a5b5c4978a601a04a063a5bdabe150af2f25b9e2"},{"version":"45dd87bd3c199e616337ac7f1ca7826c9dea2c43580b807b9918ca2bf03858cf","signature":"b57e22e53b56cca7a57bfcfb234aa6a66f9b9e4c07159d7388f94f17a3eaee2c"},{"version":"155e91439c11573358dfdd29cf6db5b9fb0ec26af0773c52d77d0c1bd38e7cb7","signature":"e47709ec4d1618ef429648cd8ef967aef2005526b34fcbfac33037add347dc71"},{"version":"eba7fe6f15dc85d0f14693bc7cc91869bcfa398fb8cce430d094a55beec66762","signature":"b81abb3e47fbbb3af41fa75bada89bbcfa4b0feed9a0d6d4b19ed1ce1033b53c"},{"version":"60b1efafbe6dc5a6eac33a5aa4c80e2894f5b5984b174d7bb630801145ed6365","signature":"15b330546e9784461058e5fd6e2346bf272140fa6f0cda34e193ae501d8b17b1"},{"version":"b3d915c41553c532571b2b6adf887bc743c4791c3b656d104f04836aa39906d0","signature":"4d8ce72fd080bf9a46bdcc274bcbacccedd66d84e203966b197ac25a96932183"},{"version":"cf26def8f42aa7645de3b98ded20f1e5da75cf77809b7a5ca4df0fc1eddf6a2b","signature":"73327e6ae34e3f6591877fb75b451cf620cbbd76ee2b678213a9f793633cd0d3"},{"version":"07d27bd68c19c15bcf82a6fd1fc0b4b21c62b251cf71c478895432096e5ce24a","signature":"3f1ba2f69944fa346789db7f60d53c9bec00032de0d797967978dea42e77b941"},{"version":"bf51306f6124a51ecd19fd14f6f67e63944b92c138c0a51fdc2fc026fc1768ab","signature":"3f5df31539fee4816b97d4e45b4344fbdaf3ca59f6df941f8d780ee441e92cc1"},{"version":"2d972af17a22a21af0173edd55611f5f397a132104c6cf7067cd6ee953e9499a","signature":"50aaf44eb4d0e086af13729b3471a0a7dce95ea35ebd21c762ba26e203134b2e"},{"version":"b33c7ac4fbbb473638b5dcf53f15fd2d5ccdac13f5718d4f1d0f643b5b07b5c2","signature":"3857c1773b8503c3ca45b7bc09ac89c3930c85ce93021054503f73d5d9101b5c"},"72702bd07fd6fb3ef64aadbcb909103aadfe71ee76e9fdeb11e0c92693cff6cb",{"version":"b8a6a1a3ecda08d4bcb2342108064184718fb08d54d09186e509da3ea3241b09","signature":"f0dd6f7c9783637655478db7d7caf6becd41a79d54482aa59578ce88ab38e9bf"},{"version":"5e8a906e566ed2daddaf42da1bc3f54432b9f97da14ebd5be28f097369ce9a33","signature":"cd756ccdabf433dd02b84d755383e489f14b3c1aede0477783aa04830fd5d695","affectsGlobalScope":true},{"version":"3d97a5f282bb3fd4669c955c0eb57bd6d47fffe53bc7fff27b235405d7c95068","signature":"a4c88dbecdf8ee0c79f5b7c2bf31cd77e593f5d78384e2b674f67d754a549a9e"},{"version":"78c0f255d6e5581ed186e5fae30cc0ea27760dac79d8d6be8309ca4e81234b1c","signature":"9cbdff04326da794ba008c0fc977ab062d1fe3fa2e9759654c72ffbe54b64a7c"},{"version":"12f23c9e1c06cb41e66b4b20676aafcf06e018074e1302365a11b84b44e6b034","signature":"aa60f8d20d36116fe05edaab24adee3c275209f71b65e272692cf99daf9489e1"},{"version":"bd9dc889befb6250db377168f2becb95cf85d480710d6b0b862e921915269dce","signature":"150855f967a6490161d5aeed4cc4adf31fcb8f5dbe54b75799c12b8687fc9cc2"},{"version":"82c5caf9da87baeacfa390572521720578ce4951590a8539482aed97b8c18514","signature":"79576487ac18e047e8192fc582ff488ce375fe4df0cb028a17f831cf42b976f2"},{"version":"ea718b0ce2917cf32bf3f78ae0fccf90fb478e7c75425cc64b4bb1ba2c23f68a","signature":"47ddb601df40bfa01cebdd06ee8b87d0b72aa1259a4ceba3ad3b5cf68130112a"},{"version":"87781cc736755404a6c7cbee849566d5afd1131c8c017e9d438e6b47c9ee3fff","signature":"6b6392704ddb3f50e647dbbb716782bdd0cf8ea9cc134aae256a26223e632b47"},{"version":"74948fbd51f0ebdac36a95b604e13f59430d07abc56f772d2398d7cea5b98e64","signature":"afc3ad2a50f7f4de908e26fcf467e09ab8528c0e90f91e602b4865d953839228"},{"version":"a0802ca154382ebff327d4fe90e5be8cddc57637f49196ab0b5fcc40c467bbcb","signature":"df90b0c6b1d81851364c4d97fa23b91a993482bcf4a7bed7c7a24aa41632d494"},{"version":"518d468edb1e58fe5187cd892d3096ae7764a5f6c759303c508a5172a1ec0e62","signature":"db34610570eed46b8b72bc662a91261200b8578af0ac02781ce7d9aca99bc683"},"11ee9ab699b4619d217c640d917ca198f58066a86bd58c2917197d62aa6601e0",{"version":"f904bd507cc8652fb7adf6da46937f45b80c7d47cc08858ae7bfdabd368f4d73","signature":"cf9d589d9e73bf32c8e7a6cae6b4a1cf9bef39e5594072533fdce985581a6ddc"},{"version":"c448b3e4d245f40915336a743340dd0837c394e4b55e747abde3217b3e506376","signature":"959544feb1ca2df29eec6c500f27ea10f4885df245ebd8418fb4b87914614383"},"65d0a893c5b0e0f5ab4e0757e892357dfc7728d01a5918f7c89eb53f4a6b6095",{"version":"67753d9f9797653d8a645a6cc6adfb13014445d3c0bfb164cb17cf8a5a718914","signature":"6548ab4b57eb9d092471a04513091673345f2fd95d5b876f600402ea8d603ee0"},"2793e8c6a023d26f78d6777a6d7f20fae3a9a8169863d46d8d54c73071851232",{"version":"2ab795906a583472af6cec042e646e1830a41b0024ba78a4ace977b35982aeb1","signature":"d0f11e830aa1350a31d9c00a0197243e9711e4882947aef53a96c629f405cb10"},{"version":"abbf31a9c0dcf2d54e279e85ca9f1a4bbf4ee4c56a64c4a727c721c227df942a","signature":"6610b9f45f1f71d2b1fb67df49cbcabe3f9e668a1ccb7d8328a51407b259ffb3"},{"version":"569d4ba57bfd18f09c0f6c1df0bf527d58e0a38a87611dc7ceecce413f88b501","signature":"abbcc437e0792ab2fe08797ceca1ec85a95ec413c51612313b18ab8e75f690f6"},"21522c0f405e58c8dd89cd97eb3d1aa9865ba017fde102d01f86ab50b44e5610","ddb0b9fcd2670bce028e60ca5768719c5d21508b00dc83acf6af25cbe1fcc5ec","b25c5f2970d06c729f464c0aeaa64b1a5b5f1355aa93554bb5f9c199b8624b1e","8041cfce439ff29d339742389de04c136e3029d6b1817f07b2d7fcbfb7534990","3051751533eee92572241b3cef28333212401408c4e7aa21718714b793c0f4ed","9d38964b57191567a14b396422c87488cecd48f405c642daa734159875ee81d9","5426e62886b7be7806312d31a00e8f7dccd6fe63ba9bbefe99ee2eab29cc48a3","8aceb205dcc6f814ad99635baf1e40b6e01d06d3fe27b72fd766c6d0b8c0c600","6d829824ead8999f87b6df21200df3c6150391b894b4e80662caa462bd48d073","afc559c1b93df37c25aef6b3dfa2d64325b0e112e887ee18bf7e6f4ec383fc90","d78e5898c8de5e0f934eee83f680262de005caa268d137101b833fd932f95e07","6b25a715df346d7356999c26939b5ea4412f67865f06c55a59dd643817d77a56","1461d03b5381ca3164aed35de1d8565b419e0d7a978ead6b495e3925f1f3f263","edaff827b058523df8cfb6d7812a5084afa6648d4ff5fb01351da8eafe2f0232",{"version":"be7abf1df570aea13a80f9e26c48e4ec51ee5b5c807326fc730eadba8a118905","affectsGlobalScope":true},{"version":"f375b4a3555152aba61fd2d765bb8b618aef03031d271083d614e4b6f3089b6c","affectsGlobalScope":true},{"version":"b63a86ef33f79196f0af1ddfbefbf2ec6860daa4bd34bb8f6cdf0adc69c2fb1c","affectsGlobalScope":true},{"version":"b61b844b8d784ccf5131fe9780ce8ada9a5ae2f89919e4ac241dbca817dfd980","affectsGlobalScope":true},{"version":"379889dd93efc659283b3b88d8c0fd0738e557d8bdf5c9fbf10cee6da71aa9cb","affectsGlobalScope":true},"0bcda522a4bb74c79e11a2c932db88eaca087a6fb11eb3fda4aaa4d655b1783e","84e3bbd6f80983d468260fdbfeeb431cc81f7ea98d284d836e4d168e36875e86","aad5ffa61406b8e19524738fcf0e6fda8b3485bba98626268fdf252d1b2b630a","16d51f964ec125ad2024cf03f0af444b3bc3ec3614d9345cc54d09bab45c9a4c","ba601641fac98c229ccd4a303f747de376d761babb33229bb7153bed9356c9cc",{"version":"352fc8497a30bc806d7defa0043d85802e5f35a7688731ee9a21456f5cb32a94","affectsGlobalScope":true},"9c230a07d657b3c65ad79e819b0c362a8ebcc0730f9a3d552a26ea632e2bfd53","c1ea344dc311b2c539ed1e3b4e17e9f4853dc7f348366b51f1d8a09a40fb223f","9990f9e566bc3c2c6e38df81294fb756e7f5b7b0e5bb17ab75384e190548b4b6",{"version":"64d4b35c5456adf258d2cf56c341e203a073253f229ef3208fc0d5020253b241","affectsGlobalScope":true},"f3e604694b624fa3f83f6684185452992088f5efb2cf136b62474aa106d6f1b6","ee7d8894904b465b072be0d2e4b45cf6b887cdba16a467645c4e200982ece7ea","8566fa84085caa46340393b1704ecd368491918fb45bd688d6e89736aec73a2f","dc33ce27fbeaf0ea3da556c80a6cc8af9d13eb443088c8f25cdc39fca8e756f6","5b9ecf7da4d71cf3832dbb8336150fa924631811f488ad4690c2dfec2b4fb1d7","951c85f75aac041dddbedfedf565886a7b494e29ec1532e2a9b4a6180560b50e","e6f0cb9d8cb2e38bec66e032e73caa3e7c6671f21ed7196acb821aec462051f2","43cdd474c5aa3340da4816bb8f1ae7f3b1bcf9e70d997afc36a0f2c432378c84","b589d625dde2d63aafbe88143e5fbd7b98dd6aca9782747eafb6e88a3f43f8bc","3f9cc1bdf9e8700facd05b9828032cc01dbc3e500fda6afb2d92509b8442ab2c","13d03ed8573272bf7ff7c574db49f49451bdc84c05cd777d059ae3d36f3a9bce","9aacb691f7080baee1dacad69f91cde282375649e96d8020425cb37d3344b39e","3ebae8c00411116a66fca65b08228ea0cf0b72724701f9b854442100aab55aba","31128279dfc964ec361141757bd7872bce19adc3625102f7a1b36ea9dea5a7bc","cddf5c26907c0b8378bc05543161c11637b830da9fadf59e02a11e675d11e180","3d2cd8f3047fff04a71e7037a6a4cb9f4accb28dbd8c0d83164d414811025af0",{"version":"549df62b64a71004aee17685b445a8289013daf96246ce4d9b087d13d7a27a61","affectsGlobalScope":true},"4c68749a564a6facdf675416d75789ee5a557afda8960e0803cf6711fa569288","6a386ff939f180ae8ef064699d8b7b6e62bc2731a62d7fbf5e02589383838dea","f5a8b384f182b3851cec3596ccc96cb7464f8d3469f48c74bf2befb782a19de5",{"version":"300c86d156193bfa3d2d42e730d166e56f9312f4ae4318230ff0f378728349fb","affectsGlobalScope":true},"bfe1b52cf71aea9bf8815810cc5d9490fa9617313e3d3c2ee3809a28b80d0bb4","ee65fe452abe1309389c5f50710f24114e08a302d40708101c4aa950a2a7d044","cab425b5559edac18327eb2c3c0f47e7e9f71b667290b7689faafd28aac69eae","1d96568a72657f762763c920d3804868db48d638abd87ddcd82bcb200ef9625c","de18acda71730bac52f4b256ce7511bb56cc21f6f114c59c46782eff2f632857","7eb06594824ada538b1d8b48c3925a83e7db792f47a081a62cf3e5c4e23cf0ee","2887592574fcdfd087647c539dcb0fbe5af2521270dad4a37f9d17c16190d579","42e8e804d18c78b8fba17c6926b584ec600709c7b4c2f689d45914b15c414b74","905c3e8f7ddaa6c391b60c05b2f4c3931d7127ad717a080359db3df510b7bdab","0d14fa22c41fdc7277e6f71473b20ebc07f40f00e38875142335d5b63cdfc9d2","d8aab31ba8e618cc3eea10b0945de81cb93b7e8150a013a482332263b9305322","462bccdf75fcafc1ae8c30400c9425e1a4681db5d605d1a0edb4f990a54d8094","5923d8facbac6ecf7c84739a5c701a57af94a6f6648d6229a6c768cf28f0f8cb","7adecb2c3238794c378d336a8182d4c3dd2c4fa6fa1785e2797a3db550edea62","dc12dc0e5aa06f4e1a7692149b78f89116af823b9e1f1e4eae140cd3e0e674e6","1bfc6565b90c8771615cd8cfcf9b36efc0275e5e83ac7d9181307e96eb495161","8a8a96898906f065f296665e411f51010b51372fa260d5373bf9f64356703190","7f82ef88bdb67d9a850dd1c7cd2d690f33e0f0acd208e3c9eba086f3670d4f73",{"version":"4564f780fd20582c57ae218a4cd017717181ab0e228639d905ef054288655b5e","affectsGlobalScope":true},"ba600bf38b5c1a5dffa1b99dd7a783549082bbba3b4fe9497eaaf5e4c1764b20","ae8cd6af37275eac75f5369cdb5f01063bcf1f48d74cb434303ee50ec446acfe","2518830a2fda9c272ba48798d0e7b857037443b06594db8e42c87e86944ee9e4","95c1cf650d16b197525b5bfdf8dd7abba0a49d99ddb12a4ba66466a8a6903e49","1fe0aabe758d56ad72495d6e6c7b6ae75619faaeaaf03f0ddf1948eea4cfac84","bbc57966c8c48ee78fd58aadb893784025be056ae538ae22d1e83c502a987e68","5e5d6f6697e378b0660b567866bf67d099d0ea754f8810c0dabe737805f5cf03","99ab49d4732fdc98cf5c495925e65e796544cb4086fe42afc235dfc02bcf2351","af8339d509c40da075088e544c28ed37b519876e5c4d36a48644ebfb3c6ae6c8","d393adc32e520d4274bb4c3dfdcdb342b806a230b66ef0f82b35bffbc4aa2590","c26af7eaedb4f710984634e419ab15e54e5bb99a0b3cae71188c2fff572276de","38b58ef018d0aeee42ef74c42978bb5805503233fdeeb82cd2aed2199fb0d013","3b6040253231d44e6778eb6861cc86c1758562e77783d21b7ecbc73322ded539","cc256fd958b33576ed32c7338c64adb0d08fc0c2c6525010202fab83f32745da","fd0589ca571ad090b531d8c095e26caa53d4825c64d3ff2b2b1ab95d72294175",{"version":"669843ecafb89ae1e944df06360e8966219e4c1c34c0d28aa2503272cdd444a7","affectsGlobalScope":true},"96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538","675e702f2032766a91eeadee64f51014c64688525da99dccd8178f0c599f13a8","458111fc89d11d2151277c822dfdc1a28fa5b6b2493cf942e37d4cd0a6ee5f22","d70c026dd2eeaa974f430ea229230a1897fdb897dc74659deebe2afd4feeb08f","187119ff4f9553676a884e296089e131e8cc01691c546273b1d0089c3533ce42","febf0b2de54781102b00f61653b21377390a048fbf5262718c91860d11ff34a6","98f9d826db9cd99d27a01a59ee5f22863df00ccf1aaf43e1d7db80ebf716f7c3","0aaef8cded245bf5036a7a40b65622dd6c4da71f7a35343112edbe112b348a1e","00baffbe8a2f2e4875367479489b5d43b5fc1429ecb4a4cc98cfc3009095f52a","dcd91d3b697cb650b95db5471189b99815af5db2a1cd28760f91e0b12ede8ed5","3c92b6dfd43cc1c2485d9eba5ff0b74a19bb8725b692773ef1d66dac48cda4bd","3cf0d343c2276842a5b617f22ba82af6322c7cfe8bb52238ffc0c491a3c21019","df996e25faa505f85aeb294d15ebe61b399cf1d1e49959cdfaf2cc0815c203f9",{"version":"f2eff8704452659641164876c1ef0df4174659ce7311b0665798ea3f556fa9ad","affectsGlobalScope":true},"9beb1014927166017e49ed264a564350d28e8bc48b84044efc763b7e213709cb","5774751340e987a6a9e4a5dcc03ff68a6515adc2b91423e1af2f660fc8f30e81","8841e2aa774b89bd23302dede20663306dc1b9902431ac64b24be8b8d0e3f649",{"version":"d27f28f8a18ec93bda158dfd6e8e632a5976c37b2cc9e2fe948f648b3575e870","affectsGlobalScope":true},"6fa0008bf91a4cc9c8963bace4bba0bd6865cbfa29c3e3ccc461155660fb113a","2b8264b2fefd7367e0f20e2c04eed5d3038831fe00f5efbc110ff0131aab899b","65455ea1b00bae7bd26d3c8c2401eb3d10401c09c55192d6f3b8b2275eda20c2","2494cf4a1e8a989c83f9a9dbb9cd3658d4d496bedd381be5787dec0e2802c800","a95b76aef31395752eb5cb7b386be2e287fdc32dfdf7bdbbb666e333133b1ef7","332c7ccf95426d3156ebedb7295979ef2435bd1c1a940024a4d068da3418718f","e03334588c63840b7054accd0b90f29c5890db6a6555ac0869a78a23297f1396","c3052485f32a96bfde75a2976c1238995522584ba464f04ff16a8a40af5e50d1","c220410b8e956fa157ce4e5e6ac871f0f433aa120c334d906ff1f5e2c7369e95","960a68ced7820108787135bdae5265d2cc4b511b7dcfd5b8f213432a8483daf1","5e8db4872785292074b394d821ae2fc10e4f8edc597776368aebbe8aefb24422","8baa5d0febc68db886c40bf341e5c90dc215a90cd64552e47e8184be6b7e3358","199f9ead0daf25ae4c5632e3d1f42570af59685294a38123eef457407e13f365","f4cf5f0ad1cfb0ceebbe4fbe8aaf0aa728e899c99cc36ec6c0c4b8f6e8a84c83","7ccce4adb23a87a044c257685613126b47160f6975b224cea5f6af36c7f37514","2b93035328f7778d200252681c1d86285d501ed424825a18f81e4c3028aa51d9","2ac9c8332c5f8510b8bdd571f8271e0f39b0577714d5e95c1e79a12b2616f069","42c21aa963e7b86fa00801d96e88b36803188018d5ad91db2a9101bccd40b3ff","d31eb848cdebb4c55b4893b335a7c0cca95ad66dee13cbb7d0893810c0a9c301","b9f96255e1048ed2ea33ec553122716f0e57fc1c3ad778e9aa15f5b46547bd23","7a9e0a564fee396cacf706523b5aeed96e04c6b871a8bebefad78499fbffc5bc","906c751ef5822ec0dadcea2f0e9db64a33fb4ee926cc9f7efa38afe5d5371b2a","5387c049e9702f2d2d7ece1a74836a14b47fbebe9bbeb19f94c580a37c855351","c68391fb9efad5d99ff332c65b1606248c4e4a9f1dd9a087204242b56c7126d6","e9cf02252d3a0ced987d24845dcb1f11c1be5541f17e5daa44c6de2d18138d0c","e8b02b879754d85f48489294f99147aeccc352c760d95a6fe2b6e49cd400b2fe","9f6908ab3d8a86c68b86e38578afc7095114e66b2fc36a2a96e9252aac3998e0","0eedb2344442b143ddcd788f87096961cd8572b64f10b4afc3356aa0460171c6","71405cc70f183d029cc5018375f6c35117ffdaf11846c35ebf85ee3956b1b2a6","c68baff4d8ba346130e9753cefe2e487a16731bf17e05fdacc81e8c9a26aae9d","2cd15528d8bb5d0453aa339b4b52e0696e8b07e790c153831c642c3dea5ac8af","479d622e66283ffa9883fbc33e441f7fc928b2277ff30aacbec7b7761b4e9579","ade307876dc5ca267ca308d09e737b611505e015c535863f22420a11fffc1c54","f8cdefa3e0dee639eccbe9794b46f90291e5fd3989fcba60d2f08fde56179fb9","86c5a62f99aac7053976e317dbe9acb2eaf903aaf3d2e5bb1cafe5c2df7b37a8","2b300954ce01a8343866f737656e13243e86e5baef51bd0631b21dcef1f6e954","a2d409a9ffd872d6b9d78ead00baa116bbc73cfa959fce9a2f29d3227876b2a1","b288936f560cd71f4a6002953290de9ff8dfbfbf37f5a9391be5c83322324898","61178a781ef82e0ff54f9430397e71e8f365fc1e3725e0e5346f2de7b0d50dfa","6a6ccb37feb3aad32d9be026a3337db195979cd5727a616fc0f557e974101a54","c649ea79205c029a02272ef55b7ab14ada0903db26144d2205021f24727ac7a3","38e2b02897c6357bbcff729ef84c736727b45cc152abe95a7567caccdfad2a1d","d6610ea7e0b1a7686dba062a1e5544dd7d34140f4545305b7c6afaebfb348341","3dee35db743bdba2c8d19aece7ac049bde6fa587e195d86547c882784e6ba34c","b15e55c5fa977c2f25ca0b1db52cfa2d1fd4bf0baf90a8b90d4a7678ca462ff1","f41d30972724714763a2698ae949fbc463afb203b5fa7c4ad7e4de0871129a17","843dd7b6a7c6269fd43827303f5cbe65c1fecabc30b4670a50d5a15d57daeeb9","f06d8b8567ee9fd799bf7f806efe93b67683ef24f4dea5b23ef12edff4434d9d","6017384f697ff38bc3ef6a546df5b230c3c31329db84cbfe686c83bec011e2b2","e1a5b30d9248549ca0c0bb1d653bafae20c64c4aa5928cc4cd3017b55c2177b0","a593632d5878f17295bd53e1c77f27bf4c15212822f764a2bfc1702f4b413fa0","a868a534ba1c2ca9060b8a13b0ffbbbf78b4be7b0ff80d8c75b02773f7192c29","da7545aba8f54a50fde23e2ede00158dc8112560d934cee58098dfb03aae9b9d","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","a1a261624efb3a00ff346b13580f70f3463b8cdcc58b60f5793ff11785d52cab","d51a4e4450ee23d941db79652c660ca2612691dba235fd5d14d4b2a622c72312","acebfe99678cf7cddcddc3435222cf132052b1226e902daac9fbb495c321a9b5","82b1f9a6eefef7386aebe22ac49f23b806421e82dbf35c6e5b7132d79e4165da","67fc055eb86a0632e2e072838f889ffe1754083cb13c8c80a06a7d895d877aae","c6c4fea9acc55d5e38ff2b70d57ab0b5cdbd08f8bc5d7a226e322cea128c5b57","7e77ad30462ed3caffe335308e44a778fe9ad8d590d914d2260e5d456abd1462","61f41da9aaa809e5142b1d849d4e70f3e09913a5cb32c629bf6e61ef27967ff7","3bae0eca953639d7c2e03211cdf1ad452cf50d48e9779b1ecb56542ad3254a24","abd79d61be476addd783d0e0bace2e3c02bb3e38ec23bdfd236adc421b038939",{"version":"43050667654463f27c2290b98bcd6c01ac33849b0f032c0a66a203b0642c9de4","affectsGlobalScope":true},"b90c59ac4682368a01c83881b814738eb151de8a58f52eb7edadea2bcffb11b9","8560a87b2e9f8e2c3808c8f6172c9b7eb6c9b08cb9f937db71c285ecf292c81d","ffe3931ff864f28d80ae2f33bd11123ad3d7bad9896b910a1e61504cc093e1f5","083c1bd82f8dc3a1ed6fc9e8eaddf141f7c05df418eca386598821e045253af9","274ebe605bd7f71ce161f9f5328febc7d547a2929f803f04b44ec4a7d8729517","6ca0207e70d985a24396583f55836b10dc181063ab6069733561bfde404d1bad","5908142efeaab38ffdf43927ee0af681ae77e0d7672b956dfb8b6c705dbfe106","f772b188b943549b5c5eb803133314b8aa7689eced80eed0b70e2f30ca07ab9c","0026b816ef05cfbf290e8585820eef0f13250438669107dfc44482bac007b14f","05d64cc1118031b29786632a9a0f6d7cf1dcacb303f27023a466cf3cdc860538","e0fff9119e1a5d2fdd46345734126cd6cb99c2d98a9debf0257047fe3937cc3f","d84398556ba4595ee6be554671da142cfe964cbdebb2f0c517a10f76f2b016c0","e275297155ec3251200abbb334c7f5641fecc68b2a9573e40eed50dff7584762","9cbfee0d2998dc92715f33d94e0cf9650b5e07f74cb40331dcccbbeaf4f36872","2dd1d4cea14cead7a7fc9eec8f40593089dff0de8c0199458446143c9b8c4ea9","3bdd93ec24853e61bfa4c63ebaa425ff3e474156e87a47d90122e1d8cc717c1f","e9eb1b173aa166892f3eddab182e49cfe59aa2e14d33aedb6b49d175ed6a3750","65dfa4bc49ccd1355789abb6ae215b302a5b050fdee9651124fe7e826f33113c"],"options":{"composite":true,"declaration":true,"emitDeclarationOnly":true,"esModuleInterop":true,"inlineSources":true,"jsx":4,"jsxImportSource":"@metamask/snaps-sdk","module":6,"outDir":"./types","rootDir":"../src","sourceMap":true,"strict":true,"target":7,"useUnknownInCatchVariables":false},"fileIdsList":[[108,294],[108],[78,108,115,116,117,132],[108,116,117,133,134],[108,115,116],[108,115,132,135,138],[108,115,135,138,139],[108,136,137,138,140,141],[108,115,138],[108,115,132,135,136,137,140],[108,115,123],[108,115],[78,108,115],[66,108,115],[108,119,120,121,122,123,124,125,126,127,128,129,130,131],[108,115,121,122],[108,115,121,123],[108,154,167],[108,154,168],[108,168,169,170,171,172,173],[108,188,197,198,201],[108,188,197,200],[108,188,197,199,201],[108,189,192,193,195],[108,189,190,191],[108,192,193,195,196],[108,189,190,194],[108,200,206],[108,188,197,200,206],[108,197,200,206],[108,197,200,202,203,204,205],[108,188,197,198,199,200,201,206],[108,188,197],[108,154,167,174,175],[108,176],[108,115,154,176,179,180],[108,115,154,167,174,176,179],[108,180],[108,175,176,177,180,181,182,183,184],[108,115,177,179,182],[108,175,182],[108,154,174],[108,154,157],[108,157,158],[108,157,158,159,160],[108,154],[50,108],[53,108],[50,53,108],[51,52,53,54,55,56,57,58,59,60,61,108,143,146,147,148,149,150,151,152,153],[44,50,51,108],[53,59,61,108,142],[108,145],[53,54,108],[50,108,149],[108,189],[108,294,295,296,297,298],[108,294,296],[81,108,115,301],[72,108,115],[108,115,304],[108,306],[108,307,308,310],[96,108,115],[107,108,115,317],[81,108,115],[108,144],[108,323,324],[108,321,322,323],[78,81,108,115,314,315,316],[108,302,316,317,328],[108,309],[78,108,115,332],[79,108,115],[108,336],[108,342],[78,81,83,86,96,107,108,115],[108,347],[108,347,349],[108,348],[108,355,360],[108,353,356],[108,353,356,357,358],[108,355],[108,352,359],[108,354],[78,108,110,115,374,375,377],[108,376],[108,391],[108,379,381,382,383,384,385,386,387,388,389,390,391],[108,379,380,382,383,384,385,386,387,388,389,390,391],[108,380,381,382,383,384,385,386,387,388,389,390,391],[108,379,380,381,383,384,385,386,387,388,389,390,391],[108,379,380,381,382,384,385,386,387,388,389,390,391],[108,379,380,381,382,383,385,386,387,388,389,390,391],[108,379,380,381,382,383,384,386,387,388,389,390,391],[108,379,380,381,382,383,384,385,387,388,389,390,391],[108,379,380,381,382,383,384,385,386,388,389,390,391],[108,379,380,381,382,383,384,385,386,387,389,390,391],[108,379,380,381,382,383,384,385,386,387,388,390,391],[108,379,380,381,382,383,384,385,386,387,388,389,391],[108,379,380,381,382,383,384,385,386,387,388,389,390],[62,108],[65,108],[66,71,99,108],[67,78,79,86,96,107,108],[67,68,78,86,108],[69,108],[70,71,79,87,108],[71,96,104,108],[72,74,78,86,108],[73,108],[74,75,108],[78,108],[76,78,108],[78,79,80,96,107,108],[78,79,80,93,96,99,108],[108,112],[74,81,86,96,107,108],[78,79,81,82,86,96,104,107,108],[81,83,96,104,107,108],[62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114],[78,84,108],[85,107,108],[74,78,86,96,108],[87,108],[88,108],[65,89,108],[90,106,108,112],[91,108],[92,108],[78,93,94,108],[93,95,108,110],[66,78,96,97,98,99,108],[66,96,98,108],[96,97,108],[99,108],[100,108],[78,102,103,108],[102,103,108],[71,86,96,104,108],[105,108],[86,106,108],[66,81,92,107,108],[71,108],[96,108,109],[108,110],[108,111],[66,71,78,80,89,96,107,108,110,112],[96,108,113],[108,342,401],[108,401,402,403,404,405],[108,338,339,340,341],[108,115,178],[79,108,115,333],[108,411,450],[108,411,435,450],[108,450],[108,411],[108,411,436,450],[108,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449],[108,436,450],[79,96,108,115,313],[79,81,108,115],[79,108,329],[81,108,115,327],[108,327],[108,326],[108,115,462,463,464,465,466,467,468,469,470,471,472],[108,461,462,471],[108,462,471],[108,454,461,462,471],[108,462],[71,108,461,471],[108,461,462,463,464,465,466,467,468,469,470,472],[78,81,83,96,104,107,108,113,115],[108,476],[78,96,108,115],[108,332],[108,330,331],[108,363],[108,362,363],[108,362],[108,362,363,364,366,367,370,371,372,373],[108,363,367],[108,362,363,364,366,367,368,369],[108,362,367],[108,367,371],[108,363,364,365],[108,364],[108,362,363,367],[43,45,46,47,48,49,108],[43,44,108],[45,108],[44,45,108],[43,45,108],[108,156,161,289],[108,154,156,289],[108,154,156,257],[108,154,156,162,257,285,289,290,291],[108,154,156,161,162],[108,154,156],[108,156,163,164,165,166,286,288],[44,50,108,156,166,285],[44,50,108,156,165],[108,154,156,287],[108,155,156],[108,155,156,231],[108,155,156,216,228,233,234],[108,155,156,227,231],[108,155,156,221],[108,155,156,220,222,223],[108,155,156,220,224],[108,156,220,221,222,223,224,225],[108,155,156,228],[108,156,229,230],[108,156,216,217,218,219,226,227,228,231,232,233,234,235,236],[108,155,156,237,238,239],[108,155,156,238],[44,50,108,154,155,156,237,285,289],[108,156],[108,156,272],[108,156,285],[108,156,275,276,277,278,279,280,281,282,283],[108,154,156,208],[108,156,257,281,289],[108,156,208,285,289],[50,108,156,258],[108,156,208,209,258,261,271,272,273,284],[50,108,154,156,240,257],[108,156,285,289],[108,156,207,209],[108,156,209],[108,156,289],[108,156,258],[108,154,156,261],[108,156,186,187,210,211,212,213,214,215,259,260,262,263,264,265,266,267,268,269,270],[108,154,156,263],[108,156,186,187,210,211,212,213,214,215,259,260,262,263,264,265,266,267,268,269,289],[108,154,156,207,208],[108,156,185,271],[108,154,156,209],[50,108,154,156,241,255],[50,108,154,156,255],[50,108,154,156,241,242],[50,108,156,241,242,289],[50,108,156,241,242],[50,108,156,241,242,248,249],[108,156,243,244,245,246,247,248,249,250,251,252,253,254],[50,108,156,241,242,243,244,245,246,247,248,249,250,251,252,253],[50,108,156,241,242,243,247,251,289],[108,156,241,255,256],[50,108,156],[154,162],[154,289],[257],[154,162,257,285,289,290,291],[154,161,162],[154],[44,50,285],[44,50,165],[155],[155,231],[155,216,228,233,234],[155,227,231],[155,221],[155,220,222,223],[155,220,224],[220,221,222,223,224,225],[229,230],[216,217,218,219,226,227,228,231,232,233,234,235,236],[155,156,237,238,239],[50,155,237,289],[272],[285],[154,208],[257,281,289],[208,285,289],[50,258],[208,209,258,261,271,272,273,284],[50,154,240,257],[285,289],[207,209],[209],[289],[258],[154,261],[154,263],[186,187,210,211,212,213,214,215,259,260,262,263,264,265,266,267,268,269,289],[154,207,208],[185,271],[154,209],[50,241,255],[255],[50,241],[50]],"referencedMap":[[296,1],[294,2],[133,3],[116,2],[135,4],[117,5],[134,2],[139,6],[140,7],[136,7],[142,8],[137,7],[141,9],[138,10],[124,11],[121,12],[128,13],[122,11],[119,14],[127,2],[132,15],[129,2],[130,2],[131,2],[126,12],[123,16],[120,2],[125,17],[168,18],[169,19],[170,19],[171,2],[172,19],[174,20],[173,19],[199,21],[201,22],[200,23],[188,2],[196,24],[192,25],[193,25],[197,26],[195,27],[202,28],[203,29],[204,30],[206,31],[205,28],[207,32],[198,33],[176,34],[177,35],[182,36],[180,37],[181,38],[185,39],[183,40],[184,41],[175,42],[158,43],[160,2],[159,44],[161,45],[157,46],[167,13],[51,47],[52,47],[54,48],[55,47],[56,47],[57,49],[58,2],[59,2],[60,2],[53,47],[154,50],[61,51],[143,52],[146,53],[147,2],[148,2],[149,2],[150,2],[151,2],[152,54],[153,55],[191,56],[189,2],[190,2],[194,25],[293,2],[299,57],[295,1],[297,58],[298,1],[300,12],[302,59],[303,60],[305,61],[308,2],[307,62],[311,63],[312,64],[318,65],[301,66],[319,2],[145,67],[320,2],[325,68],[321,2],[324,69],[323,2],[317,70],[329,71],[310,72],[309,2],[333,73],[334,74],[335,64],[306,2],[337,75],[343,76],[344,2],[345,2],[346,77],[304,64],[347,2],[348,78],[350,79],[351,80],[361,81],[353,2],[357,82],[359,83],[358,82],[356,84],[360,85],[355,86],[354,2],[376,87],[377,88],[322,2],[378,2],[392,89],[380,90],[381,91],[379,92],[382,93],[383,94],[384,95],[385,96],[386,97],[387,98],[388,99],[389,100],[390,101],[391,102],[393,75],[313,2],[394,2],[395,2],[144,2],[62,103],[63,103],[65,104],[66,105],[67,106],[68,107],[69,108],[70,109],[71,110],[72,111],[73,112],[74,113],[75,113],[77,114],[76,115],[78,114],[79,116],[80,117],[64,118],[114,2],[81,119],[82,120],[83,121],[115,122],[84,123],[85,124],[86,125],[87,126],[88,127],[89,128],[90,129],[91,130],[92,131],[93,132],[94,132],[95,133],[96,134],[98,135],[97,136],[99,137],[100,138],[101,2],[102,139],[103,140],[104,141],[105,142],[106,143],[107,144],[108,145],[109,146],[110,147],[111,148],[112,149],[113,150],[396,2],[397,2],[398,2],[340,2],[399,2],[316,2],[315,2],[400,76],[402,151],[404,76],[401,76],[403,151],[405,2],[406,152],[338,2],[342,153],[179,154],[178,2],[407,2],[408,2],[409,155],[410,2],[341,2],[435,156],[436,157],[411,158],[414,158],[433,156],[434,156],[424,156],[423,159],[421,156],[416,156],[429,156],[427,156],[431,156],[415,156],[428,156],[432,156],[417,156],[418,156],[430,156],[412,156],[419,156],[420,156],[422,156],[426,156],[437,160],[425,156],[413,156],[450,161],[449,2],[444,160],[446,162],[445,160],[438,160],[439,160],[441,160],[443,160],[447,162],[448,162],[440,162],[442,162],[314,163],[451,164],[452,165],[328,166],[326,167],[327,168],[453,66],[454,2],[455,2],[456,64],[375,2],[336,2],[457,2],[458,2],[459,2],[460,2],[473,169],[472,170],[463,171],[464,172],[465,172],[466,171],[467,171],[468,171],[469,173],[462,174],[470,170],[471,175],[461,2],[474,2],[475,176],[476,2],[477,177],[478,178],[118,2],[352,2],[339,2],[287,2],[330,179],[332,180],[331,179],[364,181],[373,182],[362,2],[363,183],[374,184],[369,185],[370,186],[368,187],[372,188],[366,189],[365,190],[371,191],[367,182],[349,2],[43,2],[50,192],[45,193],[46,194],[47,194],[48,195],[49,195],[44,196],[8,2],[9,2],[11,2],[10,2],[2,2],[12,2],[13,2],[14,2],[15,2],[16,2],[17,2],[18,2],[19,2],[3,2],[4,2],[23,2],[20,2],[21,2],[22,2],[24,2],[25,2],[26,2],[5,2],[27,2],[28,2],[29,2],[30,2],[6,2],[31,2],[32,2],[33,2],[34,2],[7,2],[35,2],[40,2],[41,2],[36,2],[37,2],[38,2],[39,2],[1,2],[42,2],[290,197],[162,198],[291,199],[292,200],[163,201],[164,202],[165,202],[289,203],[286,204],[166,205],[288,206],[155,202],[216,207],[217,207],[218,207],[219,207],[232,207],[233,207],[227,208],[235,209],[236,207],[228,210],[234,207],[220,207],[222,211],[224,212],[225,213],[223,207],[221,207],[226,214],[229,215],[230,207],[231,216],[237,217],[240,218],[239,219],[156,207],[238,220],[208,221],[273,222],[275,202],[276,223],[284,224],[277,202],[278,221],[279,225],[280,202],[282,226],[281,227],[283,228],[274,2],[285,229],[258,230],[186,223],[187,231],[210,232],[211,233],[212,232],[213,221],[214,202],[215,234],[259,235],[260,221],[262,236],[271,237],[264,238],[263,202],[265,202],[266,198],[270,239],[267,234],[268,236],[269,223],[209,240],[272,241],[261,242],[242,243],[256,244],[243,245],[248,246],[244,247],[245,247],[250,248],[246,247],[247,246],[255,249],[249,246],[254,250],[252,251],[253,247],[251,247],[257,252],[241,253]],"exportedModulesMap":[[296,1],[294,2],[133,3],[116,2],[135,4],[117,5],[134,2],[139,6],[140,7],[136,7],[142,8],[137,7],[141,9],[138,10],[124,11],[121,12],[128,13],[122,11],[119,14],[127,2],[132,15],[129,2],[130,2],[131,2],[126,12],[123,16],[120,2],[125,17],[168,18],[169,19],[170,19],[171,2],[172,19],[174,20],[173,19],[199,21],[201,22],[200,23],[188,2],[196,24],[192,25],[193,25],[197,26],[195,27],[202,28],[203,29],[204,30],[206,31],[205,28],[207,32],[198,33],[176,34],[177,35],[182,36],[180,37],[181,38],[185,39],[183,40],[184,41],[175,42],[158,43],[160,2],[159,44],[161,45],[157,46],[167,13],[51,47],[52,47],[54,48],[55,47],[56,47],[57,49],[58,2],[59,2],[60,2],[53,47],[154,50],[61,51],[143,52],[146,53],[147,2],[148,2],[149,2],[150,2],[151,2],[152,54],[153,55],[191,56],[189,2],[190,2],[194,25],[293,2],[299,57],[295,1],[297,58],[298,1],[300,12],[302,59],[303,60],[305,61],[308,2],[307,62],[311,63],[312,64],[318,65],[301,66],[319,2],[145,67],[320,2],[325,68],[321,2],[324,69],[323,2],[317,70],[329,71],[310,72],[309,2],[333,73],[334,74],[335,64],[306,2],[337,75],[343,76],[344,2],[345,2],[346,77],[304,64],[347,2],[348,78],[350,79],[351,80],[361,81],[353,2],[357,82],[359,83],[358,82],[356,84],[360,85],[355,86],[354,2],[376,87],[377,88],[322,2],[378,2],[392,89],[380,90],[381,91],[379,92],[382,93],[383,94],[384,95],[385,96],[386,97],[387,98],[388,99],[389,100],[390,101],[391,102],[393,75],[313,2],[394,2],[395,2],[144,2],[62,103],[63,103],[65,104],[66,105],[67,106],[68,107],[69,108],[70,109],[71,110],[72,111],[73,112],[74,113],[75,113],[77,114],[76,115],[78,114],[79,116],[80,117],[64,118],[114,2],[81,119],[82,120],[83,121],[115,122],[84,123],[85,124],[86,125],[87,126],[88,127],[89,128],[90,129],[91,130],[92,131],[93,132],[94,132],[95,133],[96,134],[98,135],[97,136],[99,137],[100,138],[101,2],[102,139],[103,140],[104,141],[105,142],[106,143],[107,144],[108,145],[109,146],[110,147],[111,148],[112,149],[113,150],[396,2],[397,2],[398,2],[340,2],[399,2],[316,2],[315,2],[400,76],[402,151],[404,76],[401,76],[403,151],[405,2],[406,152],[338,2],[342,153],[179,154],[178,2],[407,2],[408,2],[409,155],[410,2],[341,2],[435,156],[436,157],[411,158],[414,158],[433,156],[434,156],[424,156],[423,159],[421,156],[416,156],[429,156],[427,156],[431,156],[415,156],[428,156],[432,156],[417,156],[418,156],[430,156],[412,156],[419,156],[420,156],[422,156],[426,156],[437,160],[425,156],[413,156],[450,161],[449,2],[444,160],[446,162],[445,160],[438,160],[439,160],[441,160],[443,160],[447,162],[448,162],[440,162],[442,162],[314,163],[451,164],[452,165],[328,166],[326,167],[327,168],[453,66],[454,2],[455,2],[456,64],[375,2],[336,2],[457,2],[458,2],[459,2],[460,2],[473,169],[472,170],[463,171],[464,172],[465,172],[466,171],[467,171],[468,171],[469,173],[462,174],[470,170],[471,175],[461,2],[474,2],[475,176],[476,2],[477,177],[478,178],[118,2],[352,2],[339,2],[287,2],[330,179],[332,180],[331,179],[364,181],[373,182],[362,2],[363,183],[374,184],[369,185],[370,186],[368,187],[372,188],[366,189],[365,190],[371,191],[367,182],[349,2],[43,2],[50,192],[45,193],[46,194],[47,194],[48,195],[49,195],[44,196],[8,2],[9,2],[11,2],[10,2],[2,2],[12,2],[13,2],[14,2],[15,2],[16,2],[17,2],[18,2],[19,2],[3,2],[4,2],[23,2],[20,2],[21,2],[22,2],[24,2],[25,2],[26,2],[5,2],[27,2],[28,2],[29,2],[30,2],[6,2],[31,2],[32,2],[33,2],[34,2],[7,2],[35,2],[40,2],[41,2],[36,2],[37,2],[38,2],[39,2],[1,2],[42,2],[290,254],[162,255],[291,256],[292,257],[163,258],[164,259],[165,259],[289,203],[286,260],[166,261],[155,259],[216,262],[217,262],[218,262],[219,262],[232,262],[233,262],[227,263],[235,264],[236,262],[228,265],[234,262],[220,262],[222,266],[224,267],[225,268],[223,262],[221,262],[226,269],[229,262],[230,262],[231,270],[237,271],[240,272],[239,262],[156,262],[238,273],[273,274],[275,259],[276,275],[284,224],[277,259],[279,276],[280,259],[282,277],[281,278],[283,279],[285,280],[258,281],[186,275],[187,282],[210,283],[211,284],[212,283],[214,259],[215,285],[259,286],[262,287],[271,237],[264,288],[263,259],[265,259],[266,255],[270,289],[267,285],[268,287],[269,275],[209,290],[272,291],[261,292],[242,293],[256,294],[243,295],[248,295],[244,295],[245,295],[250,295],[246,295],[247,295],[255,249],[249,295],[254,295],[252,295],[253,295],[251,295],[257,252],[241,296]],"semanticDiagnosticsPerFile":[296,294,133,116,135,117,134,139,140,136,142,137,141,138,124,121,128,122,119,127,132,129,130,131,126,123,120,125,168,169,170,171,172,174,173,199,201,200,188,196,192,193,197,195,202,203,204,206,205,207,198,176,177,182,180,181,185,183,184,175,158,160,159,161,157,167,51,52,54,55,56,57,58,59,60,53,154,61,143,146,147,148,149,150,151,152,153,191,189,190,194,293,299,295,297,298,300,302,303,305,308,307,311,312,318,301,319,145,320,325,321,324,323,317,329,310,309,333,334,335,306,337,343,344,345,346,304,347,348,350,351,361,353,357,359,358,356,360,355,354,376,377,322,378,392,380,381,379,382,383,384,385,386,387,388,389,390,391,393,313,394,395,144,62,63,65,66,67,68,69,70,71,72,73,74,75,77,76,78,79,80,64,114,81,82,83,115,84,85,86,87,88,89,90,91,92,93,94,95,96,98,97,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,396,397,398,340,399,316,315,400,402,404,401,403,405,406,338,342,179,178,407,408,409,410,341,435,436,411,414,433,434,424,423,421,416,429,427,431,415,428,432,417,418,430,412,419,420,422,426,437,425,413,450,449,444,446,445,438,439,441,443,447,448,440,442,314,451,452,328,326,327,453,454,455,456,375,336,457,458,459,460,473,472,463,464,465,466,467,468,469,462,470,471,461,474,475,476,477,478,118,352,339,287,330,332,331,364,373,362,363,374,369,370,368,372,366,365,371,367,349,43,50,45,46,47,48,49,44,8,9,11,10,2,12,13,14,15,16,17,18,19,3,4,23,20,21,22,24,25,26,5,27,28,29,30,6,31,32,33,34,7,35,40,41,36,37,38,39,1,42,290,162,291,292,163,164,165,289,286,166,288,155,216,217,218,219,232,233,227,235,236,228,234,220,222,224,225,223,221,226,229,230,231,237,240,239,156,238,208,273,275,276,284,277,278,279,280,282,281,283,274,285,258,186,187,210,211,212,213,214,215,259,260,262,271,264,263,265,266,270,267,268,269,209,272,261,242,256,243,248,244,245,250,246,247,255,249,254,252,253,251,257,241],"latestChangedDtsFile":"./types/index.d.ts"},"version":"4.8.4"} +\ No newline at end of file ++{"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/superstruct/dist/error.d.ts","../../../node_modules/superstruct.d.ts","../../../node_modules/superstruct/dist/struct.d.ts","../../../node_modules/superstruct/dist/structs/coercions.d.ts","../../../node_modules/superstruct/dist/structs/refinements.d.ts","../../../node_modules/superstruct/dist/structs/types.d.ts","../../../node_modules/superstruct/dist/structs/utilities.d.ts","../../../node_modules/superstruct/dist/index.d.ts","../../../node_modules/@metamask/utils/dist/types/assert.d.ts","../../../node_modules/@metamask/utils/dist/types/base64.d.ts","../../../node_modules/@metamask/utils/dist/types/hex.d.ts","../../../node_modules/@metamask/utils/dist/types/bytes.d.ts","../../../node_modules/@metamask/utils/dist/types/caip-types.d.ts","../../../node_modules/@metamask/utils/dist/types/checksum.d.ts","../../../node_modules/@metamask/utils/dist/types/coercers.d.ts","../../../node_modules/@metamask/utils/dist/types/collections.d.ts","../../../node_modules/@metamask/utils/dist/types/encryption-types.d.ts","../../../node_modules/@metamask/utils/dist/types/errors.d.ts","../../../node_modules/@metamask/utils/dist/types/json.d.ts","../../../node_modules/@types/node/ts4.8/assert.d.ts","../../../node_modules/@types/node/ts4.8/assert/strict.d.ts","../../../node_modules/@types/node/ts4.8/globals.d.ts","../../../node_modules/@types/node/ts4.8/async_hooks.d.ts","../../../node_modules/@types/node/ts4.8/buffer.d.ts","../../../node_modules/@types/node/ts4.8/child_process.d.ts","../../../node_modules/@types/node/ts4.8/cluster.d.ts","../../../node_modules/@types/node/ts4.8/console.d.ts","../../../node_modules/@types/node/ts4.8/constants.d.ts","../../../node_modules/@types/node/ts4.8/crypto.d.ts","../../../node_modules/@types/node/ts4.8/dgram.d.ts","../../../node_modules/@types/node/ts4.8/diagnostics_channel.d.ts","../../../node_modules/@types/node/ts4.8/dns.d.ts","../../../node_modules/@types/node/ts4.8/dns/promises.d.ts","../../../node_modules/@types/node/ts4.8/domain.d.ts","../../../node_modules/@types/node/ts4.8/dom-events.d.ts","../../../node_modules/@types/node/ts4.8/events.d.ts","../../../node_modules/@types/node/ts4.8/fs.d.ts","../../../node_modules/@types/node/ts4.8/fs/promises.d.ts","../../../node_modules/@types/node/ts4.8/http.d.ts","../../../node_modules/@types/node/ts4.8/http2.d.ts","../../../node_modules/@types/node/ts4.8/https.d.ts","../../../node_modules/@types/node/ts4.8/inspector.d.ts","../../../node_modules/@types/node/ts4.8/module.d.ts","../../../node_modules/@types/node/ts4.8/net.d.ts","../../../node_modules/@types/node/ts4.8/os.d.ts","../../../node_modules/@types/node/ts4.8/path.d.ts","../../../node_modules/@types/node/ts4.8/perf_hooks.d.ts","../../../node_modules/@types/node/ts4.8/process.d.ts","../../../node_modules/@types/node/ts4.8/punycode.d.ts","../../../node_modules/@types/node/ts4.8/querystring.d.ts","../../../node_modules/@types/node/ts4.8/readline.d.ts","../../../node_modules/@types/node/ts4.8/readline/promises.d.ts","../../../node_modules/@types/node/ts4.8/repl.d.ts","../../../node_modules/@types/node/ts4.8/stream.d.ts","../../../node_modules/@types/node/ts4.8/stream/promises.d.ts","../../../node_modules/@types/node/ts4.8/stream/consumers.d.ts","../../../node_modules/@types/node/ts4.8/stream/web.d.ts","../../../node_modules/@types/node/ts4.8/string_decoder.d.ts","../../../node_modules/@types/node/ts4.8/test.d.ts","../../../node_modules/@types/node/ts4.8/timers.d.ts","../../../node_modules/@types/node/ts4.8/timers/promises.d.ts","../../../node_modules/@types/node/ts4.8/tls.d.ts","../../../node_modules/@types/node/ts4.8/trace_events.d.ts","../../../node_modules/@types/node/ts4.8/tty.d.ts","../../../node_modules/@types/node/ts4.8/url.d.ts","../../../node_modules/@types/node/ts4.8/util.d.ts","../../../node_modules/@types/node/ts4.8/v8.d.ts","../../../node_modules/@types/node/ts4.8/vm.d.ts","../../../node_modules/@types/node/ts4.8/wasi.d.ts","../../../node_modules/@types/node/ts4.8/worker_threads.d.ts","../../../node_modules/@types/node/ts4.8/zlib.d.ts","../../../node_modules/@types/node/ts4.8/globals.global.d.ts","../../../node_modules/@types/node/ts4.8/index.d.ts","../../../node_modules/@ethereumjs/common/dist/enums.d.ts","../../../node_modules/@ethereumjs/common/dist/types.d.ts","../../../node_modules/buffer/index.d.ts","../../../node_modules/@ethereumjs/util/dist/constants.d.ts","../../../node_modules/@ethereumjs/util/dist/units.d.ts","../../../node_modules/@ethereumjs/util/dist/address.d.ts","../../../node_modules/@ethereumjs/util/dist/bytes.d.ts","../../../node_modules/@ethereumjs/util/dist/types.d.ts","../../../node_modules/@ethereumjs/util/dist/account.d.ts","../../../node_modules/@ethereumjs/util/dist/withdrawal.d.ts","../../../node_modules/@ethereumjs/util/dist/signature.d.ts","../../../node_modules/@ethereumjs/util/dist/encoding.d.ts","../../../node_modules/@ethereumjs/util/dist/asyncEventEmitter.d.ts","../../../node_modules/@ethereumjs/util/dist/internal.d.ts","../../../node_modules/@ethereumjs/util/dist/lock.d.ts","../../../node_modules/@ethereumjs/util/dist/provider.d.ts","../../../node_modules/@ethereumjs/util/dist/index.d.ts","../../../node_modules/@ethereumjs/common/dist/common.d.ts","../../../node_modules/@ethereumjs/common/dist/utils.d.ts","../../../node_modules/@ethereumjs/common/dist/index.d.ts","../../../node_modules/@ethereumjs/tx/dist/eip2930Transaction.d.ts","../../../node_modules/@ethereumjs/tx/dist/legacyTransaction.d.ts","../../../node_modules/@ethereumjs/tx/dist/types.d.ts","../../../node_modules/@ethereumjs/tx/dist/baseTransaction.d.ts","../../../node_modules/@ethereumjs/tx/dist/eip1559Transaction.d.ts","../../../node_modules/@ethereumjs/tx/dist/transactionFactory.d.ts","../../../node_modules/@ethereumjs/tx/dist/index.d.ts","../../../node_modules/@metamask/utils/dist/types/keyring.d.ts","../../../node_modules/@types/ms/index.d.ts","../../../node_modules/@types/debug/index.d.ts","../../../node_modules/@metamask/utils/dist/types/logging.d.ts","../../../node_modules/@metamask/utils/dist/types/misc.d.ts","../../../node_modules/@metamask/utils/dist/types/number.d.ts","../../../node_modules/@metamask/utils/dist/types/opaque.d.ts","../../../node_modules/@metamask/utils/dist/types/promise.d.ts","../../../node_modules/@metamask/utils/dist/types/time.d.ts","../../../node_modules/@metamask/utils/dist/types/transaction-types.d.ts","../../../node_modules/@metamask/utils/dist/types/versions.d.ts","../../../node_modules/@metamask/utils/dist/types/index.d.ts","../src/jsx/component.ts","../src/jsx/jsx-runtime.ts","../../../node_modules/@metamask/rpc-errors/dist/types/utils.d.ts","../../../node_modules/@metamask/rpc-errors/dist/types/classes.d.ts","../../../node_modules/@metamask/rpc-errors/dist/types/errors.d.ts","../../../node_modules/@metamask/rpc-errors/dist/types/error-constants.d.ts","../../../node_modules/@metamask/rpc-errors/dist/types/index.d.ts","../src/errors.ts","../src/internals/error-wrappers.ts","../src/internals/errors.ts","../src/internals/helpers.ts","../src/internals/structs.ts","../../../node_modules/@metamask/safe-event-emitter/dist/cjs/index.d.ts","../../../node_modules/@metamask/json-rpc-engine/dist/types/JsonRpcEngine.d.ts","../../../node_modules/@metamask/json-rpc-engine/dist/types/createAsyncMiddleware.d.ts","../../../node_modules/@metamask/json-rpc-engine/dist/types/createScaffoldMiddleware.d.ts","../../../node_modules/@metamask/json-rpc-engine/dist/types/getUniqueId.d.ts","../../../node_modules/@metamask/json-rpc-engine/dist/types/idRemapMiddleware.d.ts","../../../node_modules/@metamask/json-rpc-engine/dist/types/mergeMiddleware.d.ts","../../../node_modules/@metamask/json-rpc-engine/dist/types/index.d.ts","../../../node_modules/@metamask/providers/dist/types/utils.d.ts","../../../node_modules/@metamask/providers/dist/types/BaseProvider.d.ts","../../../node_modules/@metamask/providers/dist/types/EIP6963.d.ts","../../../node_modules/@types/readable-stream/node_modules/safe-buffer/index.d.ts","../../../node_modules/@types/readable-stream/index.d.ts","../../../node_modules/@metamask/providers/dist/types/StreamProvider.d.ts","../../../node_modules/@metamask/providers/dist/types/extension-provider/createExternalExtensionProvider.d.ts","../../../node_modules/@metamask/providers/dist/types/MetaMaskInpageProvider.d.ts","../../../node_modules/@metamask/providers/dist/types/initializeInpageProvider.d.ts","../../../node_modules/@metamask/providers/dist/types/shimWeb3.d.ts","../../../node_modules/@metamask/providers/dist/types/index.d.ts","../src/types/methods/create-interface.ts","../src/types/methods/dialog.ts","../../../node_modules/@metamask/key-tree/dist/constants.d.cts","../../../node_modules/@noble/curves/abstract/modular.d.ts","../../../node_modules/@noble/curves/abstract/utils.d.ts","../../../node_modules/@noble/curves/abstract/curve.d.ts","../../../node_modules/@metamask/key-tree/dist/curves/ed25519.d.cts","../../../node_modules/@metamask/key-tree/dist/curves/ed25519Bip32.d.cts","../../../node_modules/@noble/curves/abstract/weierstrass.d.ts","../../../node_modules/@metamask/key-tree/dist/curves/secp256k1.d.cts","../../../node_modules/@metamask/key-tree/dist/curves/curve.d.cts","../../../node_modules/@metamask/key-tree/dist/curves/index.d.cts","../../../node_modules/@metamask/key-tree/dist/utils.d.cts","../../../node_modules/@metamask/key-tree/dist/BIP44CoinTypeNode.d.cts","../../../node_modules/@metamask/key-tree/dist/SLIP10Node.d.cts","../../../node_modules/@metamask/key-tree/dist/BIP44Node.d.cts","../../../node_modules/@metamask/key-tree/dist/derivers/bip32.d.cts","../../../node_modules/@metamask/key-tree/dist/derivers/bip39.d.cts","../../../node_modules/@metamask/key-tree/dist/derivers/cip3.d.cts","../../../node_modules/@metamask/key-tree/dist/derivers/slip10.d.cts","../../../node_modules/@metamask/key-tree/dist/derivers/index.d.cts","../../../node_modules/@metamask/key-tree/dist/index.d.cts","../src/types/caip.ts","../src/types/permissions.ts","../src/types/methods/get-bip32-entropy.ts","../src/types/methods/get-bip32-public-key.ts","../src/types/methods/get-bip44-entropy.ts","../src/types/methods/get-client-status.ts","../src/types/methods/get-entropy.ts","../src/types/methods/get-file.ts","../src/jsx/components/Address.ts","../src/jsx/components/Box.ts","../src/jsx/components/Copyable.ts","../src/jsx/components/Divider.ts","../src/jsx/components/form/Button.ts","../src/jsx/components/form/Option.ts","../src/jsx/components/form/Dropdown.ts","../src/jsx/components/form/Input.ts","../src/jsx/components/form/Field.ts","../src/jsx/components/form/Form.ts","../src/jsx/components/form/index.ts","../src/jsx/components/Link.ts","../src/jsx/components/Text.ts","../src/jsx/components/formatting/Bold.ts","../src/jsx/components/formatting/Italic.ts","../src/jsx/components/formatting/index.ts","../src/jsx/components/Heading.ts","../src/jsx/components/Image.ts","../src/jsx/components/Value.ts","../src/jsx/components/Row.ts","../src/jsx/components/Spinner.ts","../src/jsx/components/index.ts","../src/jsx/validation.ts","../src/jsx/jsx-dev-runtime.ts","../src/jsx/index.ts","../src/ui/nodes.ts","../src/ui/builder.ts","../src/ui/components/address.ts","../src/ui/components/copyable.ts","../src/ui/components/divider.ts","../src/ui/components/heading.ts","../src/ui/components/image.ts","../src/ui/components/button.ts","../src/ui/components/input.ts","../src/ui/components/form.ts","../src/ui/components/text.ts","../src/ui/components/row.ts","../src/ui/components/spinner.ts","../src/ui/components/panel.ts","../src/ui/components/index.ts","../src/ui/component.ts","../src/ui/index.ts","../src/types/interface.ts","../src/types/methods/get-interface-state.ts","../src/types/methods/get-locale.ts","../src/types/snap.ts","../src/types/methods/get-snaps.ts","../src/types/methods/invoke-snap.ts","../src/types/methods/invoke-keyring.ts","../src/types/methods/manage-accounts.ts","../src/types/methods/manage-state.ts","../src/types/methods/notify.ts","../src/types/methods/request-snaps.ts","../src/types/methods/update-interface.ts","../src/types/methods/methods.ts","../src/types/methods/index.ts","../src/types/provider.ts","../src/types/global.ts","../src/types/images.ts","../src/types/handlers/cronjob.ts","../src/types/handlers/home-page.ts","../src/types/handlers/keyring.ts","../src/types/handlers/lifecycle.ts","../src/types/handlers/name-lookup.ts","../src/types/handlers/rpc-request.ts","../src/types/handlers/transaction.ts","../src/types/handlers/signature.ts","../src/types/handlers/user-input.ts","../src/types/handlers/index.ts","../src/types/index.ts","../src/internals/jsx.ts","../../../node_modules/fast-xml-parser/src/fxp.d.ts","../src/internals/svg.ts","../src/internals/index.ts","../src/error-wrappers.ts","../src/images.ts","../src/index.ts","../../../node_modules/@types/aria-query/index.d.ts","../../../node_modules/@babel/types/lib/index.d.ts","../../../node_modules/@types/babel__generator/index.d.ts","../../../node_modules/@babel/parser/typings/babel-parser.d.ts","../../../node_modules/@types/babel__template/index.d.ts","../../../node_modules/@types/babel__traverse/index.d.ts","../../../node_modules/@types/babel__core/index.d.ts","../../../node_modules/@types/bn.js/index.d.ts","../../../node_modules/@types/connect/index.d.ts","../../../node_modules/@types/body-parser/index.d.ts","../../../node_modules/@types/bonjour/index.d.ts","../../../node_modules/@types/insert-module-globals/index.d.ts","../../../node_modules/@types/browserify/index.d.ts","../../../node_modules/@types/har-format/index.d.ts","../../../node_modules/@types/chrome/har-format/index.d.ts","../../../node_modules/@types/chrome/chrome-cast/index.d.ts","../../../node_modules/@types/filewriter/index.d.ts","../../../node_modules/@types/filesystem/index.d.ts","../../../node_modules/@types/chrome/index.d.ts","../../../node_modules/@types/concat-stream/index.d.ts","../../../node_modules/@types/mime/index.d.ts","../../../node_modules/@types/send/index.d.ts","../../../node_modules/@types/range-parser/index.d.ts","../../../node_modules/@types/qs/index.d.ts","../../../node_modules/@types/express-serve-static-core/index.d.ts","../../../node_modules/@types/connect-history-api-fallback/index.d.ts","../../../node_modules/@types/convert-source-map/index.d.ts","../../../node_modules/@types/deep-freeze-strict/index.d.ts","../../../node_modules/@types/eslint/helpers.d.ts","../../../node_modules/@types/json-schema/index.d.ts","../../../node_modules/@types/estree/index.d.ts","../../../node_modules/@types/eslint/index.d.ts","../../../node_modules/@types/eslint-scope/index.d.ts","../../../node_modules/@types/serve-static/node_modules/@types/mime/Mime.d.ts","../../../node_modules/@types/serve-static/node_modules/@types/mime/index.d.ts","../../../node_modules/@types/serve-static/index.d.ts","../../../node_modules/@types/express/index.d.ts","../../../node_modules/minimatch/dist/cjs/escape.d.ts","../../../node_modules/minimatch/dist/cjs/unescape.d.ts","../../../node_modules/minimatch/dist/cjs/index.d.ts","../../../node_modules/@types/glob/index.d.ts","../../../node_modules/@types/graceful-fs/index.d.ts","../../../node_modules/@types/gunzip-maybe/index.d.ts","../../../node_modules/@types/unist/index.d.ts","../../../node_modules/@types/hast/index.d.ts","../../../node_modules/@types/react/ts5.0/global.d.ts","../../../node_modules/csstype/index.d.ts","../../../node_modules/@types/prop-types/index.d.ts","../../../node_modules/@types/scheduler/tracing.d.ts","../../../node_modules/@types/react/ts5.0/index.d.ts","../../../node_modules/@types/hoist-non-react-statics/index.d.ts","../../../node_modules/@types/html-minifier-terser/index.d.ts","../../../node_modules/@types/http-cache-semantics/index.d.ts","../../../node_modules/@types/http-proxy/index.d.ts","../../../node_modules/@types/istanbul-lib-coverage/index.d.ts","../../../node_modules/@types/istanbul-lib-report/index.d.ts","../../../node_modules/source-map/source-map.d.ts","../../../node_modules/@types/istanbul-lib-source-maps/index.d.ts","../../../node_modules/@types/istanbul-reports/index.d.ts","../../../node_modules/chalk/index.d.ts","../../../node_modules/@types/jest/node_modules/jest-diff/build/cleanupSemantic.d.ts","../../../node_modules/@types/jest/node_modules/pretty-format/build/types.d.ts","../../../node_modules/@types/jest/node_modules/pretty-format/build/index.d.ts","../../../node_modules/@types/jest/node_modules/jest-diff/build/types.d.ts","../../../node_modules/@types/jest/node_modules/jest-diff/build/diffLines.d.ts","../../../node_modules/@types/jest/node_modules/jest-diff/build/printDiffs.d.ts","../../../node_modules/@types/jest/node_modules/jest-diff/build/index.d.ts","../../../node_modules/@types/jest/node_modules/jest-matcher-utils/build/index.d.ts","../../../node_modules/@types/jest/index.d.ts","../../../node_modules/parse5/dist/common/html.d.ts","../../../node_modules/parse5/dist/common/token.d.ts","../../../node_modules/parse5/dist/common/error-codes.d.ts","../../../node_modules/parse5/dist/tokenizer/preprocessor.d.ts","../../../node_modules/parse5/dist/tokenizer/index.d.ts","../../../node_modules/parse5/dist/tree-adapters/interface.d.ts","../../../node_modules/parse5/dist/parser/open-element-stack.d.ts","../../../node_modules/parse5/dist/parser/formatting-element-list.d.ts","../../../node_modules/parse5/dist/parser/index.d.ts","../../../node_modules/parse5/dist/tree-adapters/default.d.ts","../../../node_modules/parse5/dist/serializer/index.d.ts","../../../node_modules/parse5/dist/common/foreign-content.d.ts","../../../node_modules/parse5/dist/index.d.ts","../../../node_modules/@types/tough-cookie/index.d.ts","../../../node_modules/@types/jsdom/base.d.ts","../../../node_modules/@types/jsdom/index.d.ts","../../../node_modules/@types/json5/index.d.ts","../../../node_modules/@types/lodash/common/common.d.ts","../../../node_modules/@types/lodash/common/array.d.ts","../../../node_modules/@types/lodash/common/collection.d.ts","../../../node_modules/@types/lodash/common/date.d.ts","../../../node_modules/@types/lodash/common/function.d.ts","../../../node_modules/@types/lodash/common/lang.d.ts","../../../node_modules/@types/lodash/common/math.d.ts","../../../node_modules/@types/lodash/common/number.d.ts","../../../node_modules/@types/lodash/common/object.d.ts","../../../node_modules/@types/lodash/common/seq.d.ts","../../../node_modules/@types/lodash/common/string.d.ts","../../../node_modules/@types/lodash/common/util.d.ts","../../../node_modules/@types/lodash/index.d.ts","../../../node_modules/@types/lodash.mergewith/index.d.ts","../../../node_modules/@types/mdast/index.d.ts","../../../node_modules/@types/minimatch/index.d.ts","../../../node_modules/@types/mocha/index.d.ts","../../../node_modules/@types/normalize-package-data/index.d.ts","../../../node_modules/@types/parse-json/index.d.ts","../../../node_modules/@types/prettier/index.d.ts","../../../node_modules/@types/punycode/index.d.ts","../../../node_modules/@types/react-dom/index.d.ts","../../../node_modules/@types/react-transition-group/Transition.d.ts","../../../node_modules/@types/react-transition-group/CSSTransition.d.ts","../../../node_modules/@types/react-transition-group/TransitionGroup.d.ts","../../../node_modules/@types/react-transition-group/SwitchTransition.d.ts","../../../node_modules/@types/react-transition-group/config.d.ts","../../../node_modules/@types/react-transition-group/index.d.ts","../../../node_modules/@types/resolve/index.d.ts","../../../node_modules/@types/retry/index.d.ts","../../../node_modules/@types/rimraf/index.d.ts","../../../node_modules/@types/scheduler/index.d.ts","../../../node_modules/@types/semver/classes/semver.d.ts","../../../node_modules/@types/semver/functions/parse.d.ts","../../../node_modules/@types/semver/functions/valid.d.ts","../../../node_modules/@types/semver/functions/clean.d.ts","../../../node_modules/@types/semver/functions/inc.d.ts","../../../node_modules/@types/semver/functions/diff.d.ts","../../../node_modules/@types/semver/functions/major.d.ts","../../../node_modules/@types/semver/functions/minor.d.ts","../../../node_modules/@types/semver/functions/patch.d.ts","../../../node_modules/@types/semver/functions/prerelease.d.ts","../../../node_modules/@types/semver/functions/compare.d.ts","../../../node_modules/@types/semver/functions/rcompare.d.ts","../../../node_modules/@types/semver/functions/compare-loose.d.ts","../../../node_modules/@types/semver/functions/compare-build.d.ts","../../../node_modules/@types/semver/functions/sort.d.ts","../../../node_modules/@types/semver/functions/rsort.d.ts","../../../node_modules/@types/semver/functions/gt.d.ts","../../../node_modules/@types/semver/functions/lt.d.ts","../../../node_modules/@types/semver/functions/eq.d.ts","../../../node_modules/@types/semver/functions/neq.d.ts","../../../node_modules/@types/semver/functions/gte.d.ts","../../../node_modules/@types/semver/functions/lte.d.ts","../../../node_modules/@types/semver/functions/cmp.d.ts","../../../node_modules/@types/semver/functions/coerce.d.ts","../../../node_modules/@types/semver/classes/comparator.d.ts","../../../node_modules/@types/semver/classes/range.d.ts","../../../node_modules/@types/semver/functions/satisfies.d.ts","../../../node_modules/@types/semver/ranges/max-satisfying.d.ts","../../../node_modules/@types/semver/ranges/min-satisfying.d.ts","../../../node_modules/@types/semver/ranges/to-comparators.d.ts","../../../node_modules/@types/semver/ranges/min-version.d.ts","../../../node_modules/@types/semver/ranges/valid.d.ts","../../../node_modules/@types/semver/ranges/outside.d.ts","../../../node_modules/@types/semver/ranges/gtr.d.ts","../../../node_modules/@types/semver/ranges/ltr.d.ts","../../../node_modules/@types/semver/ranges/intersects.d.ts","../../../node_modules/@types/semver/ranges/simplify.d.ts","../../../node_modules/@types/semver/ranges/subset.d.ts","../../../node_modules/@types/semver/internals/identifiers.d.ts","../../../node_modules/@types/semver/index.d.ts","../../../node_modules/@types/serve-handler/index.d.ts","../../../node_modules/@types/serve-index/index.d.ts","../../../node_modules/@types/sockjs/index.d.ts","../../../node_modules/@types/source-list-map/index.d.ts","../../../node_modules/@types/stack-utils/index.d.ts","../../../node_modules/@types/tar-stream/index.d.ts","../../../node_modules/@types/use-sync-external-store/index.d.ts","../../../node_modules/@types/validate-npm-package-name/index.d.ts","../../../node_modules/@types/warning/index.d.ts","../../../node_modules/@types/webpack-env/index.d.ts","../../../node_modules/@types/webpack-sources/node_modules/source-map/source-map.d.ts","../../../node_modules/@types/webpack-sources/lib/Source.d.ts","../../../node_modules/@types/webpack-sources/lib/CompatSource.d.ts","../../../node_modules/@types/webpack-sources/lib/ConcatSource.d.ts","../../../node_modules/@types/webpack-sources/lib/OriginalSource.d.ts","../../../node_modules/@types/webpack-sources/lib/PrefixSource.d.ts","../../../node_modules/@types/webpack-sources/lib/RawSource.d.ts","../../../node_modules/@types/webpack-sources/lib/ReplaceSource.d.ts","../../../node_modules/@types/webpack-sources/lib/SizeOnlySource.d.ts","../../../node_modules/@types/webpack-sources/lib/SourceMapSource.d.ts","../../../node_modules/@types/webpack-sources/lib/index.d.ts","../../../node_modules/@types/webpack-sources/lib/CachedSource.d.ts","../../../node_modules/@types/webpack-sources/index.d.ts","../../../node_modules/@types/which/index.d.ts","../../../node_modules/@types/ws/index.d.ts","../../../node_modules/@types/yargs-parser/index.d.ts","../../../node_modules/@types/yargs/index.d.ts","../../../node_modules/@types/yauzl/index.d.ts"],"fileInfos":[{"version":"f20c05dbfe50a208301d2a1da37b9931bce0466eb5a1f4fe240971b4ecc82b67","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9",{"version":"9b087de7268e4efc5f215347a62656663933d63c0b1d7b624913240367b999ea","affectsGlobalScope":true},{"version":"3260e3386d9535b804205bdddb5618a9a27735bd22927f48ad54363abcd23d45","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"8cc8c5a3bac513368b0157f3d8b31cfdcfe78b56d3724f30f80ed9715e404af8","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"55f400eec64d17e888e278f4def2f254b41b89515d3b88ad75d5e05f019daddd","affectsGlobalScope":true},{"version":"181f1784c6c10b751631b24ce60c7f78b20665db4550b335be179217bacc0d5f","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"81cac4cbc92c0c839c70f8ffb94eb61e2d32dc1c3cf6d95844ca099463cf37ea","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"d7f680a43f8cd12a6b6122c07c54ba40952b0c8aa140dcfcf32eb9e6cb028596","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"775d9c9fd150d5de79e0450f35bc8b8f94ae64e3eb5da12725ff2a649dccc777","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"52d1bb7ab7a3306fd0375c8bff560feed26ed676a5b0457fa8027b563aecb9a4","affectsGlobalScope":true},"e475453e7140e95542332943d3052fe4c7430ad1efce42b3e9157f1fee8cbc5f","ebfdf904255ce746c9d30117c2edef355fb19bf7650478d2405f39f0e4f302e6","f3f63b48addb8e2ea9d20bb671c3c306413b3daa39996d0ae52f63d8e32158e1","a50599c08934a62f11657bdbe0dc929ab66da1b1f09974408fd9a33ec1bb8060","5a20e7d6c630b91be15e9b837853173829d00273197481dc8d3e94df61105a71","8d478048d71cc16f806d4b71b252ecb67c7444ccf4f4b09b29a312712184f859","b4000a0a525fa921e896cbdb32ae802c9684f0fd371b5fc69e7310f7918cc2c3","9df4662ca3dbc2522bc115833ee04faa1afbb4e249a85ef4a0a09c621346bd08","b25d9065cf1c1f537a140bbc508e953ed2262f77134574c432d206ff36f4bdbf","1b103313097041aa9cd705a682c652f08613cb5cf8663321061c0902f845e81c","68ccec8662818911d8a12b8ed028bc5729fb4f1d34793c4701265ba60bc73cf4","5f85b8b79dc4d36af672c035b2beb71545de63a5d60bccbeee64c260941672ab","b3d48529ae61dc27d0bfbfa2cb3e0dff8189644bd155bdf5df1e8e14669f7043","40fe4b689225816b31fe5794c0fbf3534568819709e40295ead998a2bc1ab237","f65b5e33b9ad545a1eebbd6afe857314725ad42aaf069913e33f928ab3e4990a","fb6f2a87beb7fb1f4c2b762d0c76a9459fc91f557231569b0ee21399e22aa13d","31c858dc85996fac4b7fa944e1016d5c72f514930a72357ab5001097bf6511c7","3de30a871b3340be8b679c52aa12f90dd1c8c60874517be58968fdbcc4d79445","6fd985bd31eaf77542625306fb0404d32bff978990f0a06428e5f0b9a3b58109","7e771891adaa85b690266bc37bd6eb43bc57eecc4b54693ead36467e7369952a","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"02873d070f9cb79f50833fbf4a9a27ac578a2edf8ddb8421eba1b37faba83bfb","affectsGlobalScope":true},"11e2d554398d2bd460e7d06b2fa5827a297c8acfbe00b4f894a224ac0862857f",{"version":"a8c260f87bca4da5d28dbc255c17656831e64d173a6cbbc2748e5cc12b77731c","affectsGlobalScope":true},"374ca798f244e464346f14301dc2a8b4b111af1a83b49fffef5906c338a1f922","5a94487653355b56018122d92392beb2e5f4a6c63ba5cef83bbe1c99775ef713",{"version":"d5135ad93b33adcce80b18f8065087934cdc1730d63db58562edcf017e1aad9b","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","5eb881ed2a0d5b17ea36df5cd4c4be500e460c412f270c3170e906bec65580ac","bb9c4ffa5e6290c6980b63c815cdd1625876dadb2efaf77edbe82984be93e55e","489532ff54b714f0e0939947a1c560e516d3ae93d51d639ab02e907a0e950114","f30bb836526d930a74593f7b0f5c1c46d10856415a8f69e5e2fc3db80371e362","14b5aa23c5d0ae1907bc696ac7b6915d88f7d85799cc0dc2dcf98fbce2c5a67c","5c439dafdc09abe4d6c260a96b822fa0ba5be7203c71a63ab1f1423cd9e838ea",{"version":"6b526a5ec4a401ca7c26cfe6a48e641d8f30af76673bad3b06a1b4504594a960","affectsGlobalScope":true},{"version":"816ad2e607a96de5bcac7d437f843f5afd8957f1fa5eefa6bba8e4ed7ca8fd84","affectsGlobalScope":true},"cec36af22f514322f870e81d30675c78df82ae8bf4863f5fd4e4424c040c678d","d903fafe96674bc0b2ac38a5be4a8fc07b14c2548d1cdb165a80ea24c44c0c54","5eec82ac21f84d83586c59a16b9b8502d34505d1393393556682fe7e7fde9ef2","04eb6578a588d6a46f50299b55f30e3a04ef27d0c5a46c57d8fcc211cd530faa","8d3c583a07e0c37e876908c2d5da575019f689df8d9fa4c081d99119d53dba22","2c828a5405191d006115ab34e191b8474bc6c86ffdc401d1a9864b1b6e088a58",{"version":"e630e5528e899219ae319e83bef54bf3bcb91b01d76861ecf881e8e614b167f0","affectsGlobalScope":true},"2c45b35f4850881ab132f80d3cb51e8a359a4d8fafdc5ff2401d260dc27862f4","7c013aa892414a7fdcfd861ae524a668eaa3ede8c7c0acafaf611948122c8d93","b0973c3cbcdc59b37bf477731d468696ecaf442593ec51bab497a613a580fe30",{"version":"4989e92ba5b69b182d2caaea6295af52b7dc73a4f7a2e336a676722884e7139d","affectsGlobalScope":true},{"version":"b3624aed92dab6da8484280d3cb3e2f4130ec3f4ef3f8201c95144ae9e898bb6","affectsGlobalScope":true},"5153a2fd150e46ce57bb3f8db1318d33f6ad3261ed70ceeff92281c0608c74a3","210d54cd652ec0fec8c8916e4af59bb341065576ecda039842f9ffb2e908507c","36b03690b628eab08703d63f04eaa89c5df202e5f1edf3989f13ad389cd2c091","0effadd232a20498b11308058e334d3339cc5bf8c4c858393e38d9d4c0013dcf","25846d43937c672bab7e8195f3d881f93495df712ee901860effc109918938cc","3163f47436da41706c6e2b3c1511f3b7cce9f9f3905b2f3e01246c48b4ba7d14","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff","69ee23dd0d215b09907ad30d23f88b7790c93329d1faf31d7835552a10cf7cbf","44b8b584a338b190a59f4f6929d072431950c7bd92ec2694821c11bce180c8a5","23b89798789dffbd437c0c423f5d02d11f9736aea73d6abf16db4f812ff36eda","09326ae5f7e3d49be5cd9ea00eb814770e71870a438faa2efd8bdd9b4db21320",{"version":"970a90f76d4d219ad60819d61f5994514087ba94c985647a3474a5a3d12714ed","affectsGlobalScope":true},"e10177274a35a9d07c825615340b2fcde2f610f53f3fb40269fd196b4288dda6","c4577fb855ca259bdbf3ea663ca73988ce5f84251a92b4aef80a1f4122b6f98e","3c13ef48634e7b5012fcf7e8fce7496352c2d779a7201389ca96a2a81ee4314d","5d0a25ec910fa36595f85a67ac992d7a53dd4064a1ba6aea1c9f14ab73a023f2",{"version":"f0900cd5d00fe1263ff41201fb8073dbeb984397e4af3b8002a5c207a30bdc33","affectsGlobalScope":true},{"version":"ff07a9a03c65732ccc59b3c65bc584173da093bd563a6565411c01f5703bd3cb","affectsGlobalScope":true},"06d7c42d256f0ce6afe1b2b6cfbc97ab391f29dadb00dd0ae8e8f23f5bc916c3","ec4bd1b200670fb567920db572d6701ed42a9641d09c4ff6869768c8f81b404c","e59a892d87e72733e2a9ca21611b9beb52977be2696c7ba4b216cbbb9a48f5aa",{"version":"da26af7362f53d122283bc69fed862b9a9fe27e01bc6a69d1d682e0e5a4df3e6","affectsGlobalScope":true},"8a300fa9b698845a1f9c41ecbe2c5966634582a8e2020d51abcace9b55aa959e",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"652ee9c5103e89102d87bc20d167a02a0e3e5e53665674466c8cfea8a9e418c7","175323e2a79a6076e0bada8a390d535a3ea817158bf1b1f46e31efca9028a0a2","7a10053aadc19335532a4d02756db4865974fd69bea5439ddcc5bfdf062d9476","4967529644e391115ca5592184d4b63980569adf60ee685f968fd59ab1557188","aed9e712a9b168345362e8f3a949f16c99ca1e05d21328f05735dfdbb24414ef","b04fe6922ed3db93afdbd49cdda8576aa75f744592fceea96fb0d5f32158c4f5","ed8d6c8de90fc2a4faaebc28e91f2469928738efd5208fb75ade0fa607e892b7","d7c52b198d680fe65b1a8d1b001f0173ffa2536ca2e7082431d726ce1f6714cd","c07f251e1c4e415a838e5498380b55cfea94f3513229de292d2aa85ae52fc3e9","0ed401424892d6bf294a5374efe512d6951b54a71e5dd0290c55b6d0d915f6f7","b945be6da6a3616ef3a250bfe223362b1c7c6872e775b0c4d82a1bf7a28ff902","beea49237dd7c7110fabf3c7509919c9cb9da841d847c53cac162dc3479e2f87","0f45f8a529c450d8f394106cc622bff79e44a1716e1ac9c3cc68b43f7ecf65ee","c624ce90b04c27ce4f318ba6330d39bde3d4e306f0f497ce78d4bda5ab8e22ca","9b8253aa5cb2c82d505f72afdbf96e83b15cc6b9a6f4fadbbbab46210d5f1977","86a8f52e4b1ac49155e889376bcfa8528a634c90c27fec65aa0e949f77b740c5","aab5dd41c1e2316cc0b42a7dd15684f8582d5a1d16c0516276a2a8a7d0fecd9c","59948226626ee210045296ba1fc6cb0fe748d1ff613204e08e7157ab6862dee7","ec3e54d8b713c170fdc8110a7e4a6a97513a7ab6b05ac9e1100cb064d2bb7349","43beb30ecb39a603fde4376554887310b0699f25f7f39c5c91e3147b51bb3a26","666b77d7f06f49da114b090a399abbfa66d5b6c01a3fd9dc4f063a52ace28507","31997714a93fbc570f52d47d6a8ebfb021a34a68ea9ba58bbb69cdec9565657e","6032e4262822160128e644de3fc4410bcd7517c2f137525fd2623d2bb23cb0d3","8bd5c9b1016629c144fd228983395b9dbf0676a576716bc3d316cab612c33cd5","2ed90bd3925b23aed8f859ffd0e885250be0424ca2b57e9866dabef152e1d6b7","93f6bd17d92dab9db7897e1430a5aeaa03bcf51623156213d8397710367a76ce","3f62b770a42e8c47c7008726f95aa383e69d97e85e680d237b99fcb0ee601dd8","5b84cfe78028c35c3bb89c042f18bf08d09da11e82d275c378ae4d07d8477e6c","980d21b0081cbf81774083b1e3a46f4bbdcd2b68858df0f66d7fad9c82bc34bc","6a9c5127096b35264eb7cd21b2417bfc1d42cceca9ba4ce2bb0c3410b7816042","78828b06c0d3b586954015e9ebde5480b009e166c71244763bda328ec0920f41","b17f3bb7d8333479c7e45e5f3d876761b9bca58f97594eca3f6a944fd825e632","3c1f1236cce6d6e0c4e2c1b4371e6f72d7c14842ecd76a98ed0748ee5730c8f3","6d7f58d5ea72d7834946fd7104a734dc7d40661be8b2e1eaced1ddce3268ebaf","4c26222991e6c97d5a8f541d4f2c67585eda9e8b33cf9f52931b098045236e88","277983d414aa99d78655186c3ee1e1c38c302e336aff1d77b47fcdc39d8273fe","47383b45796d525a4039cd22d2840ac55a1ff03a43d027f7f867ba7314a9cf53","6548773b3abbc18de29176c2141f766d4e437e40596ee480447abf83575445ad","6ddd27af0436ce59dd4c1896e2bfdb2bdb2529847d078b83ce67a144dff05491","816264799aef3fd5a09a3b6c25217d5ec26a9dfc7465eac7d6073bcdc7d88f3f",{"version":"3bca0ae756174a48ad9a47c865776f41788793ace1d85736aec31a60fa6ad960","signature":"c467dada8fea6d60dff8a8be2675f737cacc76e14e50b72daa0f0710376df84b"},{"version":"e0e6891afe2986f8f41995f02c784c0141f0785f9039c04f42873b041324b738","signature":"31b5f53e3d57470830e87f9e03c02d4569ac81d4a758fdda75092f9a3f58beba"},"9f9e5bae412fa5909fae636d6733aee27a108cc2ed5b13980611016336774d3c","662fe197bba64bd3f17ee118058cd2d0d2dbe33d7c0c865fd6365d90bfc44e1e","030519c351f800551cac2658038804969ca4584d2c0175a710602ac234ca1340","0278a6939ca83cd040b08ff8c5fc7838b6693ddc52f22526bf158e6b10e0246c","c2d6206e5ba4fd3063b01218c2b3b997afc1cfbeb49fcee991fa8595842ce53d",{"version":"7f21c0f417540d8f7049665fe143fdc126f0f49b54be9396346d13f5365656b0","signature":"6a8096993458a3d71229031aa7415974eb5b47b320213e29660adfb519d6a3f4"},{"version":"5c6af5bcd08565be7bdb15556b7f0ec2a28ba3f9acda87136fbd75871aa2f2bb","signature":"cb7996a1af5b1d276483cd0c9b9de6540eff021abc90a720511ff4464519a2ff"},{"version":"cf25f0c4e8c185e7235b00e6da5cd1118a54a42a6b03cf400e46ef543b28590d","signature":"9df6ec68878d65bc690ea3a33ce3ef5aa8254c36bc5f8346c0c2fd1f3b88a35c"},{"version":"35cf4c47da07028e95286e6b4d78b702cb101beb27b1d1d712209921508ee5d0","signature":"a4fad04c4acc8a4b195cbbccef4c55019104753d547d5c94441643ccc89108a0"},{"version":"d0ddd632c4f010cb2a048d8a606e3544f9a8a67a6c1487858e8aa08b6fdeda73","signature":"0244c23ea642361f7c192c1f0cfff9c12cfa5f51f9b155edd5c0a89fef308d34"},"fcc8beef29f39f09b1d9c9f99c42f9fed605ab1c28d2a630185f732b9ba53763","d6e6620a30d582182acc3f0a992a0c311adc589f111096aea11ab83fc09a5ccc","6213b8f686f56beab22b59a0f468590fd3a4c5fa931236a017efeca91d7c9584","c451cec9a588b1f105a5ea2c6063d4fca112b9d70105cacdadda0e1ef67e9379","cb047832dc68f5a2c41c62c5e95ddcacbae3a8b034d40cd15319a8cb7f25104a","980336ccdfc3c08f3c3b201aa6662e6016e20f15847f8465b68f3e8e67b4665c","5a3493939995f46ff3d9073cd534fb8961c3bf4e08c71db27066ff03d906dea8","bb5a2ac327605ebebf831c469b05bd34a33a6a46ee8c1edd9f3310aad32cf6a1","d1f010c19eb9c8190bd0859fa3b6f4975543b912b8b85e20bbb0b5bfbdf4d2b3","de4ccc96cef3f97fab148640799abb32a24b567a902a8233913f98481e3131bf",{"version":"801934aa449fe6df584bccdcc5d5b9280295cb7ac84918b6014fc5086e6f9ff6","affectsGlobalScope":true},"5e379df3d61561c2ed7789b5995b9ba2143bbba21a905e2381e16efe7d1fa424","f07a137bbe2de7a122c37bfea00e761975fb264c49f18003d398d71b3fb35a5f","6af760fb9ea02dc807c5053d8aee86389c4fce72fbb26af7b9568cac6c4710d5","c62c4ba5e910b4523f7e7adf4a55ec45c2bac99d9d8e9b0fe0c2a800a6f641b9","92131434f876fdd6fcbc40bd54a9d7500c66974362b16bd42641f990468587f4","8cf023c0bd57992fdd2ce6a7030a1874f49c8edc62eaffa9bfffcf18d2a2a1a2","8ea8f3040e38fb50d7dc3653f3b8a0dbb5244e82111576f99ce096bdc0fbf94c","48ed788ad126545a6156fcc37cd3bcf17de18a3e3fe6b6ef62cfb8140d1a45a2",{"version":"d5d9407858477b9fb1d5127bb1da9d0532799e98f2d765ca0f83d7e0617aead9","signature":"c7298e68632ab03155f6de963d3d09cc4a5874c28a81524f56c667d8a052e538"},{"version":"9f64beb0e02869eecb1d65c682e6951b18f7d735acc669c4aa666b10802fad58","signature":"3c69a83bde847af6fc3a53e1bb6b13cd06d38a27a142814b8dacc374f3b93284"},"5b46f7113f54565e7ffc83f2b474f557a1f54c7e5946769d5be220454656be73","fb58035d39c5759283cb73cfb3548aefe370aa3ad4e81fdb4e46f0979eb7669f","44412cd78df82b6698ea95aa28b4df68a2962fb84e66802802f58f11e2658d96","d0b3609e8e7afed0fd0570152255458407e67249b94f6603afdfd68599423f21","17f4c5a1d6eaa87ea27eadcdff9085af3190533d98f799dda79a3af6f9a630ea","3e6f734ddf40e2e99ff7fff9568b7d9720663af9a0632c26a352c8d3270a3f0e","628bc7c0dd29c0ce9faf446e606e16b2d31930f7d96c7a1a050034859bac9756","a3fc57dbaa7f1efb010399ad4ef4fd9b462aa4e93bf74a9a34b099b97ffcc9cb","ffddd7ec6a450b0cb6f2f73f80de1df963ead312d7c81a8440268f34146ecb87","5d6a36ca0087fd6876df654d1b4192f0e402adfde994ad47e5c065da33692f9c","eb157a09c5f543d98644e2a99a785f9e0e91f054f9fecbf1c3e15831ff5d63a7","edd5530e2b1ccdf65093296e40a8634fcb11ecda3c164c31383a8c34cb04bc9d","9dfaf96d090fe8d96143465d85b4837661ae535143eea9ef99cd20df2e66338e","209d45c27e03c1417c42985252de6c25a2ec23abdc199d88e6139c88b93abd11","0ee5cdba58cfde3012bb9ff2e9edcc4e35a651373a2aa2c83ff9eb7df635419a","540f4dca27ea5a232828b6d91e1b2fce2720bdabaa4c1f3fbf59b672cc58bd8a","ba086b99d545ec6c9ff356989f076b5652ea1b09bcc65b87dfc43a5195a2efcc","c85d9776b36166b928ab1488d9224ebf970d41b0a35f09a3ee0b9bee3e698061","683196f606c5dab1c8c4a24a66d26e00f16f2d4b2a5abe25ebedd37d2954f930","9c3a1b01cba1238fb723ce06b6c163ef6c53be755394406782564d5c42c636b2",{"version":"8840aa6b6e639356fe03fb90dcf4b5c0f692e19ea21769dfefa87fb4986d0f39","signature":"6e795e6270d39e918c7a0e62ac73793cda06fcf4b3692ee46583e15f5bf57ab8"},{"version":"3c3bd88dce55082490f23b03004ecd8c0240286b78f0f3a8522741d85149daef","signature":"0e821ef1eb67fa6144ea4de4277d913f5b1982d7407afd5f93754a8239d41554"},{"version":"75338b5765638e8ebb9db41409c44c7f518ff075659dfa5d9e098b8275d693c0","signature":"5c09195ef359ffa9c6bbdb4fefb101d87ede4b9e9c28213faf5b45d102e4c609"},{"version":"77365935c04df781293bef31693df1f39ab6a1277e5c80b6e6afbb1261ba2e7e","signature":"80b4d93a4dcc90a12f6f4bb7c6851a8182ae29e556716d0d80b5c012a5ef554a"},{"version":"f079c0793e2a122623b2a06b69d2eac67c0eb0d0dd93697934575df2c2dc1e5c","signature":"2556ef9d1820e0b6bbca6dd65a50ea64f525c4d8247ab50dff44c3f0d14a5643"},{"version":"747d15f60efe408b2591768b982c1c6245aef0e3d723293eab22b72ba3a585d6","signature":"cbd1c836db190d6e3add07165afc228f04e1f6170e1fe3aa5e6fc24a7e9573a3"},{"version":"deccdcc30a0da9b7ab2fa9a72ad35b30e23811adb665ebc785cba2e73b8c5675","signature":"9b13881feb958237232586d888a10a39d47cdffe3ee34688ed41888fa7baad94"},{"version":"36232364518da824c104338b98b4b07a47e1d217662a58e114393931aa02594d","signature":"122fe82cf5af80f0b26832b258b537b7dfe3ec28449c301b259ab10204b50d45"},{"version":"aa805fc7ff02a27db26c2a528940a8aeca1f750c3a3643bacef479e3257d3662","signature":"9cb80bba611c2dd155a446ce424fe4bb1df2129751bc9416b7e42c055d1ddbff"},{"version":"89c7df2ac4b33507472aa18cfbdac688e7e0b749ee584d9d41884721c4e603c6","signature":"6ee568039016b81ed70292a595ab781ab978cba4243a5fe49507040ee4f7ac8a"},{"version":"d8554032764ddef0e0bbbe2e99c833eb8f7578c2b625f5b8eab091188610196b","signature":"043783bebe87efb440183c9ebc8c4fdc1bb92060a5a0f7ce847e30dee7013ac3"},{"version":"cb8e681140450ef21ae1a541655fb0c1fefa0d5bbc8570f7530ea7ab13db0608","signature":"e3dc0a97a59dea936b4fb7b1f6f4117b4aac9c86d0cd08b69bab2d0532a8a5e3"},{"version":"c9d671faef655f35974718a841388e5808f3bd94e282e244a9a0d99b14cff495","signature":"5d897601f8a4fe913057019d8211b99b06e3138f625a0cfb601d074f4278271d"},{"version":"a3c40e930415aa32fdcdb14f90688010d19fda009833d7dd93abcc71e03dd8af","signature":"a68bb369c4ba8ab43a78f3fad2d3ec130e1418bc946521b9c84e9b336d6e88f1"},{"version":"0b4c309c6b8685487f97d6fd6a7441b93dd4ca3c4a8f2bcc96a55e5f9d28eee2","signature":"65f219e6e1f9d27c677a49d41ae7989b83bf6baa56debbeb50d95c3ab21632e2"},{"version":"bfba5e8c8dcb1c4b329dd468ae054a418938168396429902a293f33c3b98d236","signature":"cfde5d194dd858ad68f910defaed5b0d28730f8bf38359a9265a93ab29bc7bef"},{"version":"854caddc363811a2917620e1ef1a986fceec21e1c695561c7122859df49e0431","signature":"c89354ae268153d965011e484150f0c92faa87f3f66507c25b496973178e0400"},{"version":"2a81ff1c24917005c9736de2a457c5564c9c6e11e4d76874da07cf11be8cff91","signature":"f20aae41b169cddcbf3fde8ac380443182c8d7225194e788c404d9e11e6dc75d"},{"version":"a1d7df4a3dbe98d0633eeca6be38c65827d29865fe8d48a1005e9aad0fa3cbb9","signature":"a6f4816a634bb1ceb513634c1ef7c0535f461ed2565336eed69f6ac2babbe15b"},{"version":"6f618692c560c2032484b73f789cc4d591e3412cadf56f36a3effcc007a9f1c9","signature":"5cc8b8e18fe7fefab4b3c53a39467b5a0deb4200abae7f063ff0624b9e856c51"},{"version":"d6f732b597e4238c26241989600859e24ee24a294586c9536c6ac89be3bfcfd2","signature":"8e990781eb0107c25429b1274a31a4f3866a9a46290cce40f354b2a6e71c6c21"},{"version":"d176c6e4f4c68955817dc696e3aa55bc3f52753cc410d321ffd9353a2359586b","signature":"c48566cb13403fca44192b4528e3f2ac993869d39526bd42cd2f2167c0285add"},{"version":"472e325503cfcec80d6ed23ff121080f612558400d18fc69bf62fedc4119d930","signature":"efae20e0c581240c7522e04829da4f0453ca263068596554d4b0e27878c7dfac"},{"version":"14b9194f7e782ea4f7bcc1f63e7fc228382f109528615eae5f93ec35fd7c45ab","signature":"3af68ef927788cda7daab34be513fa4508229fdc6e5130d564a0a1ccb3fefafe"},{"version":"75a97812955173bde7ff29c0981c309c0e3c68c8fb609289606973d3192dea6a","signature":"bbbd2cbb15a37d5f4dd54ad8c7c537d3df8352117523030fcec7dcbe62a05a58"},{"version":"615827be9e17301849518c65b22cf55d38fd70752b35ae4bc56f4f1a168856c5","signature":"b50d24ebc117f8805332e7e260e9587f572bb7b2ff0ca1ff6cfafb38015781f3"},{"version":"d1121f9f0f812490afd777a543b1412ea50ea95da6f5e83f5d8b8617c2ca0ec4","signature":"608c45069e89c4c8f0ab29f896cc93c6553808072d6304b23611b6c6de3c24bb"},{"version":"1db66cc3eb3ef433289a7fcbac5c9bd9bfdde251188cc5886e016b8e60953aa7","signature":"22cbabe752781b5f35482af9d1fcf1455cb1ece74e8b84700d4abcb44abe3776"},{"version":"10051fca57c12434ef48fb3e45136705e09b61de4e7a5f7adfc35f367385f912","signature":"b9ce4613536386a98897f1e3d8f61a851ce6cb34dc3c9db4f2ef5f55f007e9e1"},{"version":"8bdd4f7af884080d0c18ee346e3ffcc433824d67fde761a71879fea59c8648d3","signature":"a5d1209c7bf277af86281392d46e12ce3dd6052586053f757fb2e606cc75c0f3"},{"version":"ad21d1b3fe8673f3e0dc0e8a592016ca4158a9414471c6d6531aff27713c3e51","signature":"c1f11d9b42bfb0823d34d93c58df91ffb6690b5a717b7d310d83f258f1784e58"},{"version":"b453a055e870914ff0aadc94ebbcedeb5d1e25585f881ac432983f08c4b7d2aa","signature":"d765fbab22fd7003a65ed670100362ec1c90d55a772e6773a774135594e7ea41"},{"version":"710e8c05b091c0294e0d0df1a734f78fc32293cbf10f51cc91880bc9e0b0a0c6","signature":"775b207f00d4df5b3b0b536aa696d572cdd2cabe8ea18dd28e8b52f691fa2a55"},{"version":"a0e09506f2484d4e384e2a9dca23e7dcd921897b295e5da09b0dec2939524ad3","signature":"f75cd30f162c2af5e5aca39c01c1a521bfa034fae523793de872815a3468bc08"},{"version":"c7c13905a14cf51163e521fba0cc2c62017be95b7ed0e64f7c44e86136b80dc8","signature":"e5a9e27b21ee4961fd8d6a7ff23d361830af7a58097e7afac6cde0258bdaf5ae"},{"version":"913f612848ddd2d0b5aedc12a997e907dbfdc59d1cd622a11e1d82148dd57631","signature":"0cf1123db73dabd86466a462375a6addae52f58d23030c6033f8aadc23539a36"},{"version":"f15fc9bd6077dd21863501c7923fae152febccb1db16d4788e33fd1a3e5c2ff9","signature":"e29cef4158591ed213b1c2cba8988237b1ff369f7a6ecd8cb8ac0302bad1fba8"},{"version":"f619bacccdd064647a99e7f781ec966475ce960d6a5a9d78d8f0eee2057d99b8","signature":"5307876e4d0021ea01235eb2f7c24671f3d8b37590f4b446cd132a4e1dc9a335"},{"version":"0096c0417f84febf396d181166f8c1d97c2d9aadc864dfba9904f7300ae85705","signature":"92550acd737790dc60c4c130e6aac78656dd48a8334a4882f40e7f86bdf7a590"},{"version":"39c4c6d0c2ece1c74188517b655ef41dce04140da60bb60513e30f65a3ceb227","signature":"3df821880914f8bb3c8107b1107be75c8ddbe2120a2cefabbaf9b65936b5f4dd"},{"version":"14d01e1e345e2722c953982c22572cb07ab093d9b274fcc0de53b909b083d308","signature":"2d01884891da6495cb4a2f060e4898209a507e711464c4c1480df85264e863ed"},{"version":"e4293d5c29b8c2dba0317689cab23a4bbd8c76e3f637d8d1e25805aa02a87043","signature":"c485c6497f7587314c4c4a59b74850cbca4c0c4bc08146a918cfd237ef821dbb"},{"version":"6ef30dfff2b71cf8a0959957c00ff50b66751f5fcf91af940837512028fb5675","signature":"e9eec004735b1bf7015edf5400aeb914a53132134d230e93786590d904d094cc"},{"version":"e539ad450c129a431e31e82517acbf357c95613ff0e20d23ff0a331964cdefa4","signature":"68b139ebb9a7f3ee4ded6286d74f978a47968727665120f3bfc560476ce33c4d"},{"version":"fb8d6b6816a3f530d7e8f59a01509f14b4c672a381ffcbed29ce2a0c39f6d07d","signature":"56d02c29b2fd39b1b1a1265df291f3f98e6ec3e6119aff9f4cfa44fe888efaa7"},{"version":"0ef62a227d5e796142ca01e185b99b60529ef08e7ea7b3afed2dd9e0e13028a7","signature":"078b7043bea0968860374bf4671ed74dd9f6be4e28ab659517d81f74be463c51"},{"version":"a23e9f251ac37df49fa29d2731be383716fba64c0af54b8acbaa31d55fc4dcd9","signature":"f46ba7c6fa7fcc8b3d57c4618c18db3f4d8bfe1fcab5551d7f6d9a82cf4d6078"},"080b1aa93227952b4dd74b9d2c6e4f6002eb8403533749116a1c53bb9961c02d",{"version":"cb971e4549197d366f5764a70e718c8dc65c93c5b8f76312a0d91db657a6ed7c","signature":"874087eec1d457f6e3baf5ac46c42ea200e55040b394fac667aa3a64c49f5f6c"},"6e8a5b04a18abb192abc89d7219b9c6f633cb3136777ec808673a65f111ca749",{"version":"977f9752e7185453337e20609747d21846556482c0f1658e29edd182985cafbc","signature":"4e7ac7e5dd58a6c29c724728b031669e3068b194b62c2b83f92e76a36cb34dbb"},{"version":"7194ae36630e7745ebdfb8a33acd43331c6b695e1368cb0fc27477a2e0a44e87","signature":"d74d2a92b54f95e47d2b76bd5ee516aab7ae93afb79cd34c6681dd29eb09e72a"},{"version":"6d6cb1dcc82f5f7df5feefa8ffec0ce2995690e5c870c933b9aa4cc140790604","signature":"747e6326a724bc54f799a466a5b5c4978a601a04a063a5bdabe150af2f25b9e2"},{"version":"45dd87bd3c199e616337ac7f1ca7826c9dea2c43580b807b9918ca2bf03858cf","signature":"b57e22e53b56cca7a57bfcfb234aa6a66f9b9e4c07159d7388f94f17a3eaee2c"},{"version":"155e91439c11573358dfdd29cf6db5b9fb0ec26af0773c52d77d0c1bd38e7cb7","signature":"e47709ec4d1618ef429648cd8ef967aef2005526b34fcbfac33037add347dc71"},{"version":"eba7fe6f15dc85d0f14693bc7cc91869bcfa398fb8cce430d094a55beec66762","signature":"b81abb3e47fbbb3af41fa75bada89bbcfa4b0feed9a0d6d4b19ed1ce1033b53c"},{"version":"60b1efafbe6dc5a6eac33a5aa4c80e2894f5b5984b174d7bb630801145ed6365","signature":"15b330546e9784461058e5fd6e2346bf272140fa6f0cda34e193ae501d8b17b1"},{"version":"b3d915c41553c532571b2b6adf887bc743c4791c3b656d104f04836aa39906d0","signature":"4d8ce72fd080bf9a46bdcc274bcbacccedd66d84e203966b197ac25a96932183"},{"version":"cf26def8f42aa7645de3b98ded20f1e5da75cf77809b7a5ca4df0fc1eddf6a2b","signature":"73327e6ae34e3f6591877fb75b451cf620cbbd76ee2b678213a9f793633cd0d3"},{"version":"07d27bd68c19c15bcf82a6fd1fc0b4b21c62b251cf71c478895432096e5ce24a","signature":"3f1ba2f69944fa346789db7f60d53c9bec00032de0d797967978dea42e77b941"},{"version":"bf51306f6124a51ecd19fd14f6f67e63944b92c138c0a51fdc2fc026fc1768ab","signature":"3f5df31539fee4816b97d4e45b4344fbdaf3ca59f6df941f8d780ee441e92cc1"},{"version":"2d972af17a22a21af0173edd55611f5f397a132104c6cf7067cd6ee953e9499a","signature":"50aaf44eb4d0e086af13729b3471a0a7dce95ea35ebd21c762ba26e203134b2e"},{"version":"b33c7ac4fbbb473638b5dcf53f15fd2d5ccdac13f5718d4f1d0f643b5b07b5c2","signature":"3857c1773b8503c3ca45b7bc09ac89c3930c85ce93021054503f73d5d9101b5c"},"72702bd07fd6fb3ef64aadbcb909103aadfe71ee76e9fdeb11e0c92693cff6cb",{"version":"b8a6a1a3ecda08d4bcb2342108064184718fb08d54d09186e509da3ea3241b09","signature":"f0dd6f7c9783637655478db7d7caf6becd41a79d54482aa59578ce88ab38e9bf"},{"version":"5e8a906e566ed2daddaf42da1bc3f54432b9f97da14ebd5be28f097369ce9a33","signature":"cd756ccdabf433dd02b84d755383e489f14b3c1aede0477783aa04830fd5d695","affectsGlobalScope":true},{"version":"3d97a5f282bb3fd4669c955c0eb57bd6d47fffe53bc7fff27b235405d7c95068","signature":"a4c88dbecdf8ee0c79f5b7c2bf31cd77e593f5d78384e2b674f67d754a549a9e"},{"version":"78c0f255d6e5581ed186e5fae30cc0ea27760dac79d8d6be8309ca4e81234b1c","signature":"9cbdff04326da794ba008c0fc977ab062d1fe3fa2e9759654c72ffbe54b64a7c"},{"version":"12f23c9e1c06cb41e66b4b20676aafcf06e018074e1302365a11b84b44e6b034","signature":"aa60f8d20d36116fe05edaab24adee3c275209f71b65e272692cf99daf9489e1"},{"version":"bd9dc889befb6250db377168f2becb95cf85d480710d6b0b862e921915269dce","signature":"150855f967a6490161d5aeed4cc4adf31fcb8f5dbe54b75799c12b8687fc9cc2"},{"version":"82c5caf9da87baeacfa390572521720578ce4951590a8539482aed97b8c18514","signature":"79576487ac18e047e8192fc582ff488ce375fe4df0cb028a17f831cf42b976f2"},{"version":"ea718b0ce2917cf32bf3f78ae0fccf90fb478e7c75425cc64b4bb1ba2c23f68a","signature":"47ddb601df40bfa01cebdd06ee8b87d0b72aa1259a4ceba3ad3b5cf68130112a"},{"version":"87781cc736755404a6c7cbee849566d5afd1131c8c017e9d438e6b47c9ee3fff","signature":"6b6392704ddb3f50e647dbbb716782bdd0cf8ea9cc134aae256a26223e632b47"},{"version":"74948fbd51f0ebdac36a95b604e13f59430d07abc56f772d2398d7cea5b98e64","signature":"afc3ad2a50f7f4de908e26fcf467e09ab8528c0e90f91e602b4865d953839228"},{"version":"a0802ca154382ebff327d4fe90e5be8cddc57637f49196ab0b5fcc40c467bbcb","signature":"df90b0c6b1d81851364c4d97fa23b91a993482bcf4a7bed7c7a24aa41632d494"},{"version":"518d468edb1e58fe5187cd892d3096ae7764a5f6c759303c508a5172a1ec0e62","signature":"db34610570eed46b8b72bc662a91261200b8578af0ac02781ce7d9aca99bc683"},"11ee9ab699b4619d217c640d917ca198f58066a86bd58c2917197d62aa6601e0",{"version":"f904bd507cc8652fb7adf6da46937f45b80c7d47cc08858ae7bfdabd368f4d73","signature":"cf9d589d9e73bf32c8e7a6cae6b4a1cf9bef39e5594072533fdce985581a6ddc"},{"version":"c448b3e4d245f40915336a743340dd0837c394e4b55e747abde3217b3e506376","signature":"959544feb1ca2df29eec6c500f27ea10f4885df245ebd8418fb4b87914614383"},"65d0a893c5b0e0f5ab4e0757e892357dfc7728d01a5918f7c89eb53f4a6b6095",{"version":"67753d9f9797653d8a645a6cc6adfb13014445d3c0bfb164cb17cf8a5a718914","signature":"6548ab4b57eb9d092471a04513091673345f2fd95d5b876f600402ea8d603ee0"},"2793e8c6a023d26f78d6777a6d7f20fae3a9a8169863d46d8d54c73071851232",{"version":"2ab795906a583472af6cec042e646e1830a41b0024ba78a4ace977b35982aeb1","signature":"d0f11e830aa1350a31d9c00a0197243e9711e4882947aef53a96c629f405cb10"},{"version":"abbf31a9c0dcf2d54e279e85ca9f1a4bbf4ee4c56a64c4a727c721c227df942a","signature":"6610b9f45f1f71d2b1fb67df49cbcabe3f9e668a1ccb7d8328a51407b259ffb3"},{"version":"569d4ba57bfd18f09c0f6c1df0bf527d58e0a38a87611dc7ceecce413f88b501","signature":"abbcc437e0792ab2fe08797ceca1ec85a95ec413c51612313b18ab8e75f690f6"},"21522c0f405e58c8dd89cd97eb3d1aa9865ba017fde102d01f86ab50b44e5610","ddb0b9fcd2670bce028e60ca5768719c5d21508b00dc83acf6af25cbe1fcc5ec","b25c5f2970d06c729f464c0aeaa64b1a5b5f1355aa93554bb5f9c199b8624b1e","8041cfce439ff29d339742389de04c136e3029d6b1817f07b2d7fcbfb7534990","3051751533eee92572241b3cef28333212401408c4e7aa21718714b793c0f4ed","9d38964b57191567a14b396422c87488cecd48f405c642daa734159875ee81d9","5426e62886b7be7806312d31a00e8f7dccd6fe63ba9bbefe99ee2eab29cc48a3","8aceb205dcc6f814ad99635baf1e40b6e01d06d3fe27b72fd766c6d0b8c0c600","6d829824ead8999f87b6df21200df3c6150391b894b4e80662caa462bd48d073","afc559c1b93df37c25aef6b3dfa2d64325b0e112e887ee18bf7e6f4ec383fc90","d78e5898c8de5e0f934eee83f680262de005caa268d137101b833fd932f95e07","6b25a715df346d7356999c26939b5ea4412f67865f06c55a59dd643817d77a56","1461d03b5381ca3164aed35de1d8565b419e0d7a978ead6b495e3925f1f3f263","edaff827b058523df8cfb6d7812a5084afa6648d4ff5fb01351da8eafe2f0232",{"version":"be7abf1df570aea13a80f9e26c48e4ec51ee5b5c807326fc730eadba8a118905","affectsGlobalScope":true},{"version":"f375b4a3555152aba61fd2d765bb8b618aef03031d271083d614e4b6f3089b6c","affectsGlobalScope":true},{"version":"b63a86ef33f79196f0af1ddfbefbf2ec6860daa4bd34bb8f6cdf0adc69c2fb1c","affectsGlobalScope":true},{"version":"b61b844b8d784ccf5131fe9780ce8ada9a5ae2f89919e4ac241dbca817dfd980","affectsGlobalScope":true},{"version":"379889dd93efc659283b3b88d8c0fd0738e557d8bdf5c9fbf10cee6da71aa9cb","affectsGlobalScope":true},"0bcda522a4bb74c79e11a2c932db88eaca087a6fb11eb3fda4aaa4d655b1783e","84e3bbd6f80983d468260fdbfeeb431cc81f7ea98d284d836e4d168e36875e86","aad5ffa61406b8e19524738fcf0e6fda8b3485bba98626268fdf252d1b2b630a","16d51f964ec125ad2024cf03f0af444b3bc3ec3614d9345cc54d09bab45c9a4c","ba601641fac98c229ccd4a303f747de376d761babb33229bb7153bed9356c9cc",{"version":"352fc8497a30bc806d7defa0043d85802e5f35a7688731ee9a21456f5cb32a94","affectsGlobalScope":true},"9c230a07d657b3c65ad79e819b0c362a8ebcc0730f9a3d552a26ea632e2bfd53","c1ea344dc311b2c539ed1e3b4e17e9f4853dc7f348366b51f1d8a09a40fb223f","9990f9e566bc3c2c6e38df81294fb756e7f5b7b0e5bb17ab75384e190548b4b6",{"version":"64d4b35c5456adf258d2cf56c341e203a073253f229ef3208fc0d5020253b241","affectsGlobalScope":true},"f3e604694b624fa3f83f6684185452992088f5efb2cf136b62474aa106d6f1b6","ee7d8894904b465b072be0d2e4b45cf6b887cdba16a467645c4e200982ece7ea","8566fa84085caa46340393b1704ecd368491918fb45bd688d6e89736aec73a2f","dc33ce27fbeaf0ea3da556c80a6cc8af9d13eb443088c8f25cdc39fca8e756f6","5b9ecf7da4d71cf3832dbb8336150fa924631811f488ad4690c2dfec2b4fb1d7","951c85f75aac041dddbedfedf565886a7b494e29ec1532e2a9b4a6180560b50e","e6f0cb9d8cb2e38bec66e032e73caa3e7c6671f21ed7196acb821aec462051f2","43cdd474c5aa3340da4816bb8f1ae7f3b1bcf9e70d997afc36a0f2c432378c84","b589d625dde2d63aafbe88143e5fbd7b98dd6aca9782747eafb6e88a3f43f8bc","3f9cc1bdf9e8700facd05b9828032cc01dbc3e500fda6afb2d92509b8442ab2c","13d03ed8573272bf7ff7c574db49f49451bdc84c05cd777d059ae3d36f3a9bce","9aacb691f7080baee1dacad69f91cde282375649e96d8020425cb37d3344b39e","3ebae8c00411116a66fca65b08228ea0cf0b72724701f9b854442100aab55aba","31128279dfc964ec361141757bd7872bce19adc3625102f7a1b36ea9dea5a7bc","cddf5c26907c0b8378bc05543161c11637b830da9fadf59e02a11e675d11e180","3d2cd8f3047fff04a71e7037a6a4cb9f4accb28dbd8c0d83164d414811025af0",{"version":"549df62b64a71004aee17685b445a8289013daf96246ce4d9b087d13d7a27a61","affectsGlobalScope":true},"4c68749a564a6facdf675416d75789ee5a557afda8960e0803cf6711fa569288","6a386ff939f180ae8ef064699d8b7b6e62bc2731a62d7fbf5e02589383838dea","f5a8b384f182b3851cec3596ccc96cb7464f8d3469f48c74bf2befb782a19de5",{"version":"300c86d156193bfa3d2d42e730d166e56f9312f4ae4318230ff0f378728349fb","affectsGlobalScope":true},"bfe1b52cf71aea9bf8815810cc5d9490fa9617313e3d3c2ee3809a28b80d0bb4","ee65fe452abe1309389c5f50710f24114e08a302d40708101c4aa950a2a7d044","cab425b5559edac18327eb2c3c0f47e7e9f71b667290b7689faafd28aac69eae","1d96568a72657f762763c920d3804868db48d638abd87ddcd82bcb200ef9625c","de18acda71730bac52f4b256ce7511bb56cc21f6f114c59c46782eff2f632857","7eb06594824ada538b1d8b48c3925a83e7db792f47a081a62cf3e5c4e23cf0ee","2887592574fcdfd087647c539dcb0fbe5af2521270dad4a37f9d17c16190d579","42e8e804d18c78b8fba17c6926b584ec600709c7b4c2f689d45914b15c414b74","905c3e8f7ddaa6c391b60c05b2f4c3931d7127ad717a080359db3df510b7bdab","0d14fa22c41fdc7277e6f71473b20ebc07f40f00e38875142335d5b63cdfc9d2","d8aab31ba8e618cc3eea10b0945de81cb93b7e8150a013a482332263b9305322","462bccdf75fcafc1ae8c30400c9425e1a4681db5d605d1a0edb4f990a54d8094","5923d8facbac6ecf7c84739a5c701a57af94a6f6648d6229a6c768cf28f0f8cb","7adecb2c3238794c378d336a8182d4c3dd2c4fa6fa1785e2797a3db550edea62","dc12dc0e5aa06f4e1a7692149b78f89116af823b9e1f1e4eae140cd3e0e674e6","1bfc6565b90c8771615cd8cfcf9b36efc0275e5e83ac7d9181307e96eb495161","8a8a96898906f065f296665e411f51010b51372fa260d5373bf9f64356703190","7f82ef88bdb67d9a850dd1c7cd2d690f33e0f0acd208e3c9eba086f3670d4f73",{"version":"4564f780fd20582c57ae218a4cd017717181ab0e228639d905ef054288655b5e","affectsGlobalScope":true},"ba600bf38b5c1a5dffa1b99dd7a783549082bbba3b4fe9497eaaf5e4c1764b20","ae8cd6af37275eac75f5369cdb5f01063bcf1f48d74cb434303ee50ec446acfe","2518830a2fda9c272ba48798d0e7b857037443b06594db8e42c87e86944ee9e4","95c1cf650d16b197525b5bfdf8dd7abba0a49d99ddb12a4ba66466a8a6903e49","1fe0aabe758d56ad72495d6e6c7b6ae75619faaeaaf03f0ddf1948eea4cfac84","bbc57966c8c48ee78fd58aadb893784025be056ae538ae22d1e83c502a987e68","5e5d6f6697e378b0660b567866bf67d099d0ea754f8810c0dabe737805f5cf03","99ab49d4732fdc98cf5c495925e65e796544cb4086fe42afc235dfc02bcf2351","af8339d509c40da075088e544c28ed37b519876e5c4d36a48644ebfb3c6ae6c8","d393adc32e520d4274bb4c3dfdcdb342b806a230b66ef0f82b35bffbc4aa2590","c26af7eaedb4f710984634e419ab15e54e5bb99a0b3cae71188c2fff572276de","38b58ef018d0aeee42ef74c42978bb5805503233fdeeb82cd2aed2199fb0d013","3b6040253231d44e6778eb6861cc86c1758562e77783d21b7ecbc73322ded539","cc256fd958b33576ed32c7338c64adb0d08fc0c2c6525010202fab83f32745da","fd0589ca571ad090b531d8c095e26caa53d4825c64d3ff2b2b1ab95d72294175",{"version":"669843ecafb89ae1e944df06360e8966219e4c1c34c0d28aa2503272cdd444a7","affectsGlobalScope":true},"96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538","675e702f2032766a91eeadee64f51014c64688525da99dccd8178f0c599f13a8","458111fc89d11d2151277c822dfdc1a28fa5b6b2493cf942e37d4cd0a6ee5f22","d70c026dd2eeaa974f430ea229230a1897fdb897dc74659deebe2afd4feeb08f","187119ff4f9553676a884e296089e131e8cc01691c546273b1d0089c3533ce42","febf0b2de54781102b00f61653b21377390a048fbf5262718c91860d11ff34a6","98f9d826db9cd99d27a01a59ee5f22863df00ccf1aaf43e1d7db80ebf716f7c3","0aaef8cded245bf5036a7a40b65622dd6c4da71f7a35343112edbe112b348a1e","00baffbe8a2f2e4875367479489b5d43b5fc1429ecb4a4cc98cfc3009095f52a","dcd91d3b697cb650b95db5471189b99815af5db2a1cd28760f91e0b12ede8ed5","3c92b6dfd43cc1c2485d9eba5ff0b74a19bb8725b692773ef1d66dac48cda4bd","3cf0d343c2276842a5b617f22ba82af6322c7cfe8bb52238ffc0c491a3c21019","df996e25faa505f85aeb294d15ebe61b399cf1d1e49959cdfaf2cc0815c203f9",{"version":"f2eff8704452659641164876c1ef0df4174659ce7311b0665798ea3f556fa9ad","affectsGlobalScope":true},"9beb1014927166017e49ed264a564350d28e8bc48b84044efc763b7e213709cb","5774751340e987a6a9e4a5dcc03ff68a6515adc2b91423e1af2f660fc8f30e81","8841e2aa774b89bd23302dede20663306dc1b9902431ac64b24be8b8d0e3f649",{"version":"d27f28f8a18ec93bda158dfd6e8e632a5976c37b2cc9e2fe948f648b3575e870","affectsGlobalScope":true},"6fa0008bf91a4cc9c8963bace4bba0bd6865cbfa29c3e3ccc461155660fb113a","2b8264b2fefd7367e0f20e2c04eed5d3038831fe00f5efbc110ff0131aab899b","65455ea1b00bae7bd26d3c8c2401eb3d10401c09c55192d6f3b8b2275eda20c2","2494cf4a1e8a989c83f9a9dbb9cd3658d4d496bedd381be5787dec0e2802c800","a95b76aef31395752eb5cb7b386be2e287fdc32dfdf7bdbbb666e333133b1ef7","332c7ccf95426d3156ebedb7295979ef2435bd1c1a940024a4d068da3418718f","e03334588c63840b7054accd0b90f29c5890db6a6555ac0869a78a23297f1396","c3052485f32a96bfde75a2976c1238995522584ba464f04ff16a8a40af5e50d1","c220410b8e956fa157ce4e5e6ac871f0f433aa120c334d906ff1f5e2c7369e95","960a68ced7820108787135bdae5265d2cc4b511b7dcfd5b8f213432a8483daf1","5e8db4872785292074b394d821ae2fc10e4f8edc597776368aebbe8aefb24422","8baa5d0febc68db886c40bf341e5c90dc215a90cd64552e47e8184be6b7e3358","199f9ead0daf25ae4c5632e3d1f42570af59685294a38123eef457407e13f365","f4cf5f0ad1cfb0ceebbe4fbe8aaf0aa728e899c99cc36ec6c0c4b8f6e8a84c83","7ccce4adb23a87a044c257685613126b47160f6975b224cea5f6af36c7f37514","2b93035328f7778d200252681c1d86285d501ed424825a18f81e4c3028aa51d9","2ac9c8332c5f8510b8bdd571f8271e0f39b0577714d5e95c1e79a12b2616f069","42c21aa963e7b86fa00801d96e88b36803188018d5ad91db2a9101bccd40b3ff","d31eb848cdebb4c55b4893b335a7c0cca95ad66dee13cbb7d0893810c0a9c301","b9f96255e1048ed2ea33ec553122716f0e57fc1c3ad778e9aa15f5b46547bd23","7a9e0a564fee396cacf706523b5aeed96e04c6b871a8bebefad78499fbffc5bc","906c751ef5822ec0dadcea2f0e9db64a33fb4ee926cc9f7efa38afe5d5371b2a","5387c049e9702f2d2d7ece1a74836a14b47fbebe9bbeb19f94c580a37c855351","c68391fb9efad5d99ff332c65b1606248c4e4a9f1dd9a087204242b56c7126d6","e9cf02252d3a0ced987d24845dcb1f11c1be5541f17e5daa44c6de2d18138d0c","e8b02b879754d85f48489294f99147aeccc352c760d95a6fe2b6e49cd400b2fe","9f6908ab3d8a86c68b86e38578afc7095114e66b2fc36a2a96e9252aac3998e0","0eedb2344442b143ddcd788f87096961cd8572b64f10b4afc3356aa0460171c6","71405cc70f183d029cc5018375f6c35117ffdaf11846c35ebf85ee3956b1b2a6","c68baff4d8ba346130e9753cefe2e487a16731bf17e05fdacc81e8c9a26aae9d","2cd15528d8bb5d0453aa339b4b52e0696e8b07e790c153831c642c3dea5ac8af","479d622e66283ffa9883fbc33e441f7fc928b2277ff30aacbec7b7761b4e9579","ade307876dc5ca267ca308d09e737b611505e015c535863f22420a11fffc1c54","f8cdefa3e0dee639eccbe9794b46f90291e5fd3989fcba60d2f08fde56179fb9","86c5a62f99aac7053976e317dbe9acb2eaf903aaf3d2e5bb1cafe5c2df7b37a8","2b300954ce01a8343866f737656e13243e86e5baef51bd0631b21dcef1f6e954","a2d409a9ffd872d6b9d78ead00baa116bbc73cfa959fce9a2f29d3227876b2a1","b288936f560cd71f4a6002953290de9ff8dfbfbf37f5a9391be5c83322324898","61178a781ef82e0ff54f9430397e71e8f365fc1e3725e0e5346f2de7b0d50dfa","6a6ccb37feb3aad32d9be026a3337db195979cd5727a616fc0f557e974101a54","c649ea79205c029a02272ef55b7ab14ada0903db26144d2205021f24727ac7a3","38e2b02897c6357bbcff729ef84c736727b45cc152abe95a7567caccdfad2a1d","d6610ea7e0b1a7686dba062a1e5544dd7d34140f4545305b7c6afaebfb348341","3dee35db743bdba2c8d19aece7ac049bde6fa587e195d86547c882784e6ba34c","b15e55c5fa977c2f25ca0b1db52cfa2d1fd4bf0baf90a8b90d4a7678ca462ff1","f41d30972724714763a2698ae949fbc463afb203b5fa7c4ad7e4de0871129a17","843dd7b6a7c6269fd43827303f5cbe65c1fecabc30b4670a50d5a15d57daeeb9","f06d8b8567ee9fd799bf7f806efe93b67683ef24f4dea5b23ef12edff4434d9d","6017384f697ff38bc3ef6a546df5b230c3c31329db84cbfe686c83bec011e2b2","e1a5b30d9248549ca0c0bb1d653bafae20c64c4aa5928cc4cd3017b55c2177b0","a593632d5878f17295bd53e1c77f27bf4c15212822f764a2bfc1702f4b413fa0","a868a534ba1c2ca9060b8a13b0ffbbbf78b4be7b0ff80d8c75b02773f7192c29","da7545aba8f54a50fde23e2ede00158dc8112560d934cee58098dfb03aae9b9d","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","a1a261624efb3a00ff346b13580f70f3463b8cdcc58b60f5793ff11785d52cab","d51a4e4450ee23d941db79652c660ca2612691dba235fd5d14d4b2a622c72312","acebfe99678cf7cddcddc3435222cf132052b1226e902daac9fbb495c321a9b5","82b1f9a6eefef7386aebe22ac49f23b806421e82dbf35c6e5b7132d79e4165da","67fc055eb86a0632e2e072838f889ffe1754083cb13c8c80a06a7d895d877aae","c6c4fea9acc55d5e38ff2b70d57ab0b5cdbd08f8bc5d7a226e322cea128c5b57","7e77ad30462ed3caffe335308e44a778fe9ad8d590d914d2260e5d456abd1462","61f41da9aaa809e5142b1d849d4e70f3e09913a5cb32c629bf6e61ef27967ff7","3bae0eca953639d7c2e03211cdf1ad452cf50d48e9779b1ecb56542ad3254a24","abd79d61be476addd783d0e0bace2e3c02bb3e38ec23bdfd236adc421b038939",{"version":"43050667654463f27c2290b98bcd6c01ac33849b0f032c0a66a203b0642c9de4","affectsGlobalScope":true},"b90c59ac4682368a01c83881b814738eb151de8a58f52eb7edadea2bcffb11b9","8560a87b2e9f8e2c3808c8f6172c9b7eb6c9b08cb9f937db71c285ecf292c81d","ffe3931ff864f28d80ae2f33bd11123ad3d7bad9896b910a1e61504cc093e1f5","083c1bd82f8dc3a1ed6fc9e8eaddf141f7c05df418eca386598821e045253af9","274ebe605bd7f71ce161f9f5328febc7d547a2929f803f04b44ec4a7d8729517","6ca0207e70d985a24396583f55836b10dc181063ab6069733561bfde404d1bad","5908142efeaab38ffdf43927ee0af681ae77e0d7672b956dfb8b6c705dbfe106","f772b188b943549b5c5eb803133314b8aa7689eced80eed0b70e2f30ca07ab9c","0026b816ef05cfbf290e8585820eef0f13250438669107dfc44482bac007b14f","05d64cc1118031b29786632a9a0f6d7cf1dcacb303f27023a466cf3cdc860538","e0fff9119e1a5d2fdd46345734126cd6cb99c2d98a9debf0257047fe3937cc3f","d84398556ba4595ee6be554671da142cfe964cbdebb2f0c517a10f76f2b016c0","e275297155ec3251200abbb334c7f5641fecc68b2a9573e40eed50dff7584762","9cbfee0d2998dc92715f33d94e0cf9650b5e07f74cb40331dcccbbeaf4f36872","2dd1d4cea14cead7a7fc9eec8f40593089dff0de8c0199458446143c9b8c4ea9","3bdd93ec24853e61bfa4c63ebaa425ff3e474156e87a47d90122e1d8cc717c1f","e9eb1b173aa166892f3eddab182e49cfe59aa2e14d33aedb6b49d175ed6a3750","65dfa4bc49ccd1355789abb6ae215b302a5b050fdee9651124fe7e826f33113c"],"options":{"composite":true,"declaration":true,"emitDeclarationOnly":true,"esModuleInterop":true,"inlineSources":true,"jsx":4,"jsxImportSource":"@metamask/snaps-sdk","module":6,"outDir":"./types","rootDir":"../src","sourceMap":true,"strict":true,"target":7,"useUnknownInCatchVariables":false},"fileIdsList":[[108,294],[108],[78,108,115,116,117,132],[108,116,117,133,134],[108,115,116],[108,115,132,135,138],[108,115,135,138,139],[108,136,137,138,140,141],[108,115,138],[108,115,132,135,136,137,140],[108,115,123],[108,115],[78,108,115],[66,108,115],[108,119,120,121,122,123,124,125,126,127,128,129,130,131],[108,115,121,122],[108,115,121,123],[108,154,167],[108,154,168],[108,168,169,170,171,172,173],[108,188,197,198,201],[108,188,197,200],[108,188,197,199,201],[108,189,192,193,195],[108,189,190,191],[108,192,193,195,196],[108,189,190,194],[108,200,206],[108,188,197,200,206],[108,197,200,206],[108,197,200,202,203,204,205],[108,188,197,198,199,200,201,206],[108,188,197],[108,154,167,174,175],[108,176],[108,115,154,176,179,180],[108,115,154,167,174,176,179],[108,180],[108,175,176,177,180,181,182,183,184],[108,115,177,179,182],[108,175,182],[108,154,174],[108,154,157],[108,157,158],[108,157,158,159,160],[108,154],[50,108],[53,108],[50,53,108],[51,52,53,54,55,56,57,58,59,60,61,108,143,146,147,148,149,150,151,152,153],[44,50,51,108],[53,59,61,108,142],[108,145],[53,54,108],[50,108,149],[108,189],[108,294,295,296,297,298],[108,294,296],[81,108,115,301],[72,108,115],[108,115,304],[108,306],[108,307,308,310],[96,108,115],[107,108,115,317],[81,108,115],[108,144],[108,323,324],[108,321,322,323],[78,81,108,115,314,315,316],[108,302,316,317,328],[108,309],[78,108,115,332],[79,108,115],[108,336],[108,342],[78,81,83,86,96,107,108,115],[108,347],[108,347,349],[108,348],[108,355,360],[108,353,356],[108,353,356,357,358],[108,355],[108,352,359],[108,354],[78,108,110,115,374,375,377],[108,376],[108,391],[108,379,381,382,383,384,385,386,387,388,389,390,391],[108,379,380,382,383,384,385,386,387,388,389,390,391],[108,380,381,382,383,384,385,386,387,388,389,390,391],[108,379,380,381,383,384,385,386,387,388,389,390,391],[108,379,380,381,382,384,385,386,387,388,389,390,391],[108,379,380,381,382,383,385,386,387,388,389,390,391],[108,379,380,381,382,383,384,386,387,388,389,390,391],[108,379,380,381,382,383,384,385,387,388,389,390,391],[108,379,380,381,382,383,384,385,386,388,389,390,391],[108,379,380,381,382,383,384,385,386,387,389,390,391],[108,379,380,381,382,383,384,385,386,387,388,390,391],[108,379,380,381,382,383,384,385,386,387,388,389,391],[108,379,380,381,382,383,384,385,386,387,388,389,390],[62,108],[65,108],[66,71,99,108],[67,78,79,86,96,107,108],[67,68,78,86,108],[69,108],[70,71,79,87,108],[71,96,104,108],[72,74,78,86,108],[73,108],[74,75,108],[78,108],[76,78,108],[78,79,80,96,107,108],[78,79,80,93,96,99,108],[108,112],[74,81,86,96,107,108],[78,79,81,82,86,96,104,107,108],[81,83,96,104,107,108],[62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114],[78,84,108],[85,107,108],[74,78,86,96,108],[87,108],[88,108],[65,89,108],[90,106,108,112],[91,108],[92,108],[78,93,94,108],[93,95,108,110],[66,78,96,97,98,99,108],[66,96,98,108],[96,97,108],[99,108],[100,108],[78,102,103,108],[102,103,108],[71,86,96,104,108],[105,108],[86,106,108],[66,81,92,107,108],[71,108],[96,108,109],[108,110],[108,111],[66,71,78,80,89,96,107,108,110,112],[96,108,113],[108,342,401],[108,401,402,403,404,405],[108,338,339,340,341],[108,115,178],[79,108,115,333],[108,411,450],[108,411,435,450],[108,450],[108,411],[108,411,436,450],[108,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449],[108,436,450],[79,96,108,115,313],[79,81,108,115],[79,108,329],[81,108,115,327],[108,327],[108,326],[108,115,462,463,464,465,466,467,468,469,470,471,472],[108,461,462,471],[108,462,471],[108,454,461,462,471],[108,462],[71,108,461,471],[108,461,462,463,464,465,466,467,468,469,470,472],[78,81,83,96,104,107,108,113,115],[108,476],[78,96,108,115],[108,332],[108,330,331],[108,363],[108,362,363],[108,362],[108,362,363,364,366,367,370,371,372,373],[108,363,367],[108,362,363,364,366,367,368,369],[108,362,367],[108,367,371],[108,363,364,365],[108,364],[108,362,363,367],[43,45,46,47,48,49,108],[43,44,108],[45,108],[44,45,108],[43,45,108],[108,156,161,289],[108,154,156,289],[108,154,156,257],[108,154,156,162,257,285,289,290,291],[108,154,156,161,162],[108,154,156],[108,156,163,164,165,166,286,288],[44,50,108,156,166,285],[44,50,108,156,165],[108,154,156,287],[108,155,156],[108,155,156,231],[108,155,156,216,228,233,234],[108,155,156,227,231],[108,155,156,221],[108,155,156,220,222,223],[108,155,156,220,224],[108,156,220,221,222,223,224,225],[108,155,156,228],[108,156,229,230],[108,156,216,217,218,219,226,227,228,231,232,233,234,235,236],[108,155,156,237,238,239],[108,155,156,238],[44,50,108,154,155,156,237,285,289],[108,156],[108,156,272],[108,156,285],[108,156,275,276,277,278,279,280,281,282,283],[108,154,156,208],[108,156,257,281,289],[108,156,208,285,289],[50,108,156,258],[108,156,208,209,258,261,271,272,273,284],[50,108,154,156,240,257],[108,156,285,289],[108,156,207,209],[108,156,209],[108,156,289],[108,156,258],[108,154,156,261],[108,156,186,187,210,211,212,213,214,215,259,260,262,263,264,265,266,267,268,269,270],[108,154,156,263],[108,156,186,187,210,211,212,213,214,215,259,260,262,263,264,265,266,267,268,269,289],[108,154,156,207,208],[108,156,185,271],[108,154,156,209],[50,108,154,156,241,255],[50,108,154,156,255],[50,108,154,156,241,242],[50,108,156,241,242,289],[50,108,156,241,242],[50,108,156,241,242,248,249],[108,156,243,244,245,246,247,248,249,250,251,252,253,254],[50,108,156,241,242,243,244,245,246,247,248,249,250,251,252,253],[50,108,156,241,242,243,247,251,289],[108,156,241,255,256],[50,108,156],[154,162],[154,289],[257],[154,162,257,285,289,290,291],[154,161,162],[154],[44,50,285],[44,50,165],[155],[155,231],[155,216,228,233,234],[155,227,231],[155,221],[155,220,222,223],[155,220,224],[220,221,222,223,224,225],[229,230],[216,217,218,219,226,227,228,231,232,233,234,235,236],[155,156,237,238,239],[50,155,237,289],[272],[285],[154,208],[257,281,289],[208,285,289],[50,258],[208,209,258,261,271,272,273,284],[50,154,240,257],[285,289],[207,209],[209],[289],[258],[154,261],[154,263],[186,187,210,211,212,213,214,215,259,260,262,263,264,265,266,267,268,269,289],[154,207,208],[185,271],[154,209],[50,241,255],[255],[50,241],[50]],"referencedMap":[[296,1],[294,2],[133,3],[116,2],[135,4],[117,5],[134,2],[139,6],[140,7],[136,7],[142,8],[137,7],[141,9],[138,10],[124,11],[121,12],[128,13],[122,11],[119,14],[127,2],[132,15],[129,2],[130,2],[131,2],[126,12],[123,16],[120,2],[125,17],[168,18],[169,19],[170,19],[171,2],[172,19],[174,20],[173,19],[199,21],[201,22],[200,23],[188,2],[196,24],[192,25],[193,25],[197,26],[195,27],[202,28],[203,29],[204,30],[206,31],[205,28],[207,32],[198,33],[176,34],[177,35],[182,36],[180,37],[181,38],[185,39],[183,40],[184,41],[175,42],[158,43],[160,2],[159,44],[161,45],[157,46],[167,13],[51,47],[52,47],[54,48],[55,47],[56,47],[57,49],[58,2],[59,2],[60,2],[53,47],[154,50],[61,51],[143,52],[146,53],[147,2],[148,2],[149,2],[150,2],[151,2],[152,54],[153,55],[191,56],[189,2],[190,2],[194,25],[293,2],[299,57],[295,1],[297,58],[298,1],[300,12],[302,59],[303,60],[305,61],[308,2],[307,62],[311,63],[312,64],[318,65],[301,66],[319,2],[145,67],[320,2],[325,68],[321,2],[324,69],[323,2],[317,70],[329,71],[310,72],[309,2],[333,73],[334,74],[335,64],[306,2],[337,75],[343,76],[344,2],[345,2],[346,77],[304,64],[347,2],[348,78],[350,79],[351,80],[361,81],[353,2],[357,82],[359,83],[358,82],[356,84],[360,85],[355,86],[354,2],[376,87],[377,88],[322,2],[378,2],[392,89],[380,90],[381,91],[379,92],[382,93],[383,94],[384,95],[385,96],[386,97],[387,98],[388,99],[389,100],[390,101],[391,102],[393,75],[313,2],[394,2],[395,2],[144,2],[62,103],[63,103],[65,104],[66,105],[67,106],[68,107],[69,108],[70,109],[71,110],[72,111],[73,112],[74,113],[75,113],[77,114],[76,115],[78,114],[79,116],[80,117],[64,118],[114,2],[81,119],[82,120],[83,121],[115,122],[84,123],[85,124],[86,125],[87,126],[88,127],[89,128],[90,129],[91,130],[92,131],[93,132],[94,132],[95,133],[96,134],[98,135],[97,136],[99,137],[100,138],[101,2],[102,139],[103,140],[104,141],[105,142],[106,143],[107,144],[108,145],[109,146],[110,147],[111,148],[112,149],[113,150],[396,2],[397,2],[398,2],[340,2],[399,2],[316,2],[315,2],[400,76],[402,151],[404,76],[401,76],[403,151],[405,2],[406,152],[338,2],[342,153],[179,154],[178,2],[407,2],[408,2],[409,155],[410,2],[341,2],[435,156],[436,157],[411,158],[414,158],[433,156],[434,156],[424,156],[423,159],[421,156],[416,156],[429,156],[427,156],[431,156],[415,156],[428,156],[432,156],[417,156],[418,156],[430,156],[412,156],[419,156],[420,156],[422,156],[426,156],[437,160],[425,156],[413,156],[450,161],[449,2],[444,160],[446,162],[445,160],[438,160],[439,160],[441,160],[443,160],[447,162],[448,162],[440,162],[442,162],[314,163],[451,164],[452,165],[328,166],[326,167],[327,168],[453,66],[454,2],[455,2],[456,64],[375,2],[336,2],[457,2],[458,2],[459,2],[460,2],[473,169],[472,170],[463,171],[464,172],[465,172],[466,171],[467,171],[468,171],[469,173],[462,174],[470,170],[471,175],[461,2],[474,2],[475,176],[476,2],[477,177],[478,178],[118,2],[352,2],[339,2],[287,2],[330,179],[332,180],[331,179],[364,181],[373,182],[362,2],[363,183],[374,184],[369,185],[370,186],[368,187],[372,188],[366,189],[365,190],[371,191],[367,182],[349,2],[43,2],[50,192],[45,193],[46,194],[47,194],[48,195],[49,195],[44,196],[8,2],[9,2],[11,2],[10,2],[2,2],[12,2],[13,2],[14,2],[15,2],[16,2],[17,2],[18,2],[19,2],[3,2],[4,2],[23,2],[20,2],[21,2],[22,2],[24,2],[25,2],[26,2],[5,2],[27,2],[28,2],[29,2],[30,2],[6,2],[31,2],[32,2],[33,2],[34,2],[7,2],[35,2],[40,2],[41,2],[36,2],[37,2],[38,2],[39,2],[1,2],[42,2],[290,197],[162,198],[291,199],[292,200],[163,201],[164,202],[165,202],[289,203],[286,204],[166,205],[288,206],[155,202],[216,207],[217,207],[218,207],[219,207],[232,207],[233,207],[227,208],[235,209],[236,207],[228,210],[234,207],[220,207],[222,211],[224,212],[225,213],[223,207],[221,207],[226,214],[229,215],[230,207],[231,216],[237,217],[240,218],[239,219],[156,207],[238,220],[208,221],[273,222],[275,202],[276,223],[284,224],[277,202],[278,221],[279,225],[280,202],[282,226],[281,227],[283,228],[274,2],[285,229],[258,230],[186,223],[187,231],[210,232],[211,233],[212,232],[213,221],[214,202],[215,234],[259,235],[260,221],[262,236],[271,237],[264,238],[263,202],[265,202],[266,198],[270,239],[267,234],[268,236],[269,223],[209,240],[272,241],[261,242],[242,243],[256,244],[243,245],[248,246],[244,247],[245,247],[250,248],[246,247],[247,246],[255,249],[249,246],[254,250],[252,251],[253,247],[251,247],[257,252],[241,253]],"exportedModulesMap":[[296,1],[294,2],[133,3],[116,2],[135,4],[117,5],[134,2],[139,6],[140,7],[136,7],[142,8],[137,7],[141,9],[138,10],[124,11],[121,12],[128,13],[122,11],[119,14],[127,2],[132,15],[129,2],[130,2],[131,2],[126,12],[123,16],[120,2],[125,17],[168,18],[169,19],[170,19],[171,2],[172,19],[174,20],[173,19],[199,21],[201,22],[200,23],[188,2],[196,24],[192,25],[193,25],[197,26],[195,27],[202,28],[203,29],[204,30],[206,31],[205,28],[207,32],[198,33],[176,34],[177,35],[182,36],[180,37],[181,38],[185,39],[183,40],[184,41],[175,42],[158,43],[160,2],[159,44],[161,45],[157,46],[167,13],[51,47],[52,47],[54,48],[55,47],[56,47],[57,49],[58,2],[59,2],[60,2],[53,47],[154,50],[61,51],[143,52],[146,53],[147,2],[148,2],[149,2],[150,2],[151,2],[152,54],[153,55],[191,56],[189,2],[190,2],[194,25],[293,2],[299,57],[295,1],[297,58],[298,1],[300,12],[302,59],[303,60],[305,61],[308,2],[307,62],[311,63],[312,64],[318,65],[301,66],[319,2],[145,67],[320,2],[325,68],[321,2],[324,69],[323,2],[317,70],[329,71],[310,72],[309,2],[333,73],[334,74],[335,64],[306,2],[337,75],[343,76],[344,2],[345,2],[346,77],[304,64],[347,2],[348,78],[350,79],[351,80],[361,81],[353,2],[357,82],[359,83],[358,82],[356,84],[360,85],[355,86],[354,2],[376,87],[377,88],[322,2],[378,2],[392,89],[380,90],[381,91],[379,92],[382,93],[383,94],[384,95],[385,96],[386,97],[387,98],[388,99],[389,100],[390,101],[391,102],[393,75],[313,2],[394,2],[395,2],[144,2],[62,103],[63,103],[65,104],[66,105],[67,106],[68,107],[69,108],[70,109],[71,110],[72,111],[73,112],[74,113],[75,113],[77,114],[76,115],[78,114],[79,116],[80,117],[64,118],[114,2],[81,119],[82,120],[83,121],[115,122],[84,123],[85,124],[86,125],[87,126],[88,127],[89,128],[90,129],[91,130],[92,131],[93,132],[94,132],[95,133],[96,134],[98,135],[97,136],[99,137],[100,138],[101,2],[102,139],[103,140],[104,141],[105,142],[106,143],[107,144],[108,145],[109,146],[110,147],[111,148],[112,149],[113,150],[396,2],[397,2],[398,2],[340,2],[399,2],[316,2],[315,2],[400,76],[402,151],[404,76],[401,76],[403,151],[405,2],[406,152],[338,2],[342,153],[179,154],[178,2],[407,2],[408,2],[409,155],[410,2],[341,2],[435,156],[436,157],[411,158],[414,158],[433,156],[434,156],[424,156],[423,159],[421,156],[416,156],[429,156],[427,156],[431,156],[415,156],[428,156],[432,156],[417,156],[418,156],[430,156],[412,156],[419,156],[420,156],[422,156],[426,156],[437,160],[425,156],[413,156],[450,161],[449,2],[444,160],[446,162],[445,160],[438,160],[439,160],[441,160],[443,160],[447,162],[448,162],[440,162],[442,162],[314,163],[451,164],[452,165],[328,166],[326,167],[327,168],[453,66],[454,2],[455,2],[456,64],[375,2],[336,2],[457,2],[458,2],[459,2],[460,2],[473,169],[472,170],[463,171],[464,172],[465,172],[466,171],[467,171],[468,171],[469,173],[462,174],[470,170],[471,175],[461,2],[474,2],[475,176],[476,2],[477,177],[478,178],[118,2],[352,2],[339,2],[287,2],[330,179],[332,180],[331,179],[364,181],[373,182],[362,2],[363,183],[374,184],[369,185],[370,186],[368,187],[372,188],[366,189],[365,190],[371,191],[367,182],[349,2],[43,2],[50,192],[45,193],[46,194],[47,194],[48,195],[49,195],[44,196],[8,2],[9,2],[11,2],[10,2],[2,2],[12,2],[13,2],[14,2],[15,2],[16,2],[17,2],[18,2],[19,2],[3,2],[4,2],[23,2],[20,2],[21,2],[22,2],[24,2],[25,2],[26,2],[5,2],[27,2],[28,2],[29,2],[30,2],[6,2],[31,2],[32,2],[33,2],[34,2],[7,2],[35,2],[40,2],[41,2],[36,2],[37,2],[38,2],[39,2],[1,2],[42,2],[290,254],[162,255],[291,256],[292,257],[163,258],[164,259],[165,259],[289,203],[286,260],[166,261],[155,259],[216,262],[217,262],[218,262],[219,262],[232,262],[233,262],[227,263],[235,264],[236,262],[228,265],[234,262],[220,262],[222,266],[224,267],[225,268],[223,262],[221,262],[226,269],[229,262],[230,262],[231,270],[237,271],[240,272],[239,262],[156,262],[238,273],[273,274],[275,259],[276,275],[284,224],[277,259],[279,276],[280,259],[282,277],[281,278],[283,279],[285,280],[258,281],[186,275],[187,282],[210,283],[211,284],[212,283],[214,259],[215,285],[259,286],[262,287],[271,237],[264,288],[263,259],[265,259],[266,255],[270,289],[267,285],[268,287],[269,275],[209,290],[272,291],[261,292],[242,293],[256,294],[243,295],[248,295],[244,295],[245,295],[250,295],[246,295],[247,295],[255,249],[249,295],[254,295],[252,295],[253,295],[251,295],[257,252],[241,296]],"semanticDiagnosticsPerFile":[296,294,133,116,135,117,134,139,140,136,142,137,141,138,124,121,128,122,119,127,132,129,130,131,126,123,120,125,168,169,170,171,172,174,173,199,201,200,188,196,192,193,197,195,202,203,204,206,205,207,198,176,177,182,180,181,185,183,184,175,158,160,159,161,157,167,51,52,54,55,56,57,58,59,60,53,154,61,143,146,147,148,149,150,151,152,153,191,189,190,194,293,299,295,297,298,300,302,303,305,308,307,311,312,318,301,319,145,320,325,321,324,323,317,329,310,309,333,334,335,306,337,343,344,345,346,304,347,348,350,351,361,353,357,359,358,356,360,355,354,376,377,322,378,392,380,381,379,382,383,384,385,386,387,388,389,390,391,393,313,394,395,144,62,63,65,66,67,68,69,70,71,72,73,74,75,77,76,78,79,80,64,114,81,82,83,115,84,85,86,87,88,89,90,91,92,93,94,95,96,98,97,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,396,397,398,340,399,316,315,400,402,404,401,403,405,406,338,342,179,178,407,408,409,410,341,435,436,411,414,433,434,424,423,421,416,429,427,431,415,428,432,417,418,430,412,419,420,422,426,437,425,413,450,449,444,446,445,438,439,441,443,447,448,440,442,314,451,452,328,326,327,453,454,455,456,375,336,457,458,459,460,473,472,463,464,465,466,467,468,469,462,470,471,461,474,475,476,477,478,118,352,339,287,330,332,331,364,373,362,363,374,369,370,368,372,366,365,371,367,349,43,50,45,46,47,48,49,44,8,9,11,10,2,12,13,14,15,16,17,18,19,3,4,23,20,21,22,24,25,26,5,27,28,29,30,6,31,32,33,34,7,35,40,41,36,37,38,39,1,42,290,162,291,292,163,164,165,289,286,166,288,155,216,217,218,219,232,233,227,235,236,228,234,220,222,224,225,223,221,226,229,230,231,237,240,239,156,238,208,273,275,276,284,277,278,279,280,282,281,283,274,285,258,186,187,210,211,212,213,214,215,259,260,262,271,264,263,265,266,270,267,268,269,209,272,261,242,256,243,248,244,245,250,246,247,255,249,254,252,253,251,257,241],"latestChangedDtsFile":"./types/index.d.ts"},"version":"4.8.4"} +\ No newline at end of file +diff --git a/dist/types/internals/jsx.d.ts b/dist/types/internals/jsx.d.ts +index 95a075622f84c1a90d0156f4c4fe30e3b3274aed..6bd2d13a1f3796273616630e0adb6b1961c5fdf9 100644 +--- a/dist/types/internals/jsx.d.ts ++++ b/dist/types/internals/jsx.d.ts +@@ -1,5 +1,4 @@ +-import type { Infer, Struct } from 'superstruct'; +-import type { AnyStruct, EnumSchema, InferStructTuple, IsExactMatch, IsMatch, IsRecord, IsTuple, UnionToIntersection } from 'superstruct/dist/utils'; ++import type { AnyStruct, EnumSchema, Infer, InferStructTuple, IsExactMatch, IsMatch, IsRecord, IsTuple, Struct, UnionToIntersection } from 'superstruct'; + import type { EmptyObject } from '../types'; + /** + * Check if a type is a union. Infers `true` if it is a union, otherwise +diff --git a/dist/types/internals/structs.d.ts b/dist/types/internals/structs.d.ts +index bbfc1289001614aa48dca8aef392f619be8281bb..956456ec616180c31647145a1ecc08efee8fcb2c 100644 +--- a/dist/types/internals/structs.d.ts ++++ b/dist/types/internals/structs.d.ts +@@ -1,6 +1,5 @@ +-import type { Infer } from 'superstruct'; ++import type { AnyStruct, Infer, InferStructTuple } from 'superstruct'; + import { Struct } from 'superstruct'; +-import type { AnyStruct, InferStructTuple } from 'superstruct/dist/utils'; + import type { EnumToUnion } from './helpers'; + /** + * A wrapper of `superstruct`'s `literal` struct that also defines the name of diff --git a/package.json b/package.json index e313488f44b..949aa067a20 100644 --- a/package.json +++ b/package.json @@ -47,8 +47,9 @@ "@metamask/keyring-api@^6.4.0": "patch:@metamask/keyring-api@npm%3A6.4.0#./.yarn/patches/@metamask-keyring-api-npm-6.4.0-3a5b2ed69f.patch", "@metamask/snaps-sdk@^4.0.0": "patch:@metamask/snaps-sdk@npm%3A4.2.0#./.yarn/patches/@metamask-snaps-sdk-npm-4.2.0-68c745cc62.patch", "@metamask/snaps-sdk@^4.0.1": "patch:@metamask/snaps-sdk@npm%3A4.2.0#./.yarn/patches/@metamask-snaps-sdk-npm-4.2.0-68c745cc62.patch", - "@metamask/snaps-sdk@^4.1.0": "patch:@metamask/snaps-sdk@npm%3A4.2.0#./.yarn/patches/@metamask-snaps-sdk-npm-4.2.0-68c745cc62.patch", - "@metamask/snaps-sdk@^4.2.0": "patch:@metamask/snaps-sdk@npm%3A4.2.0#./.yarn/patches/@metamask-snaps-sdk-npm-4.2.0-68c745cc62.patch", + "@metamask/snaps-sdk@^4.1.0": "patch:@metamask/snaps-sdk@npm%3A4.4.1#./.yarn/patches/@metamask-snaps-sdk-npm-4.4.1-f1f7bb22cb.patch", + "@metamask/snaps-sdk@^4.2.0": "patch:@metamask/snaps-sdk@npm%3A4.4.1#./.yarn/patches/@metamask-snaps-sdk-npm-4.4.1-f1f7bb22cb.patch", + "@metamask/snaps-sdk@^4.4.1": "patch:@metamask/snaps-sdk@npm%3A4.4.1#./.yarn/patches/@metamask-snaps-sdk-npm-4.4.1-f1f7bb22cb.patch", "@metamask/snaps-utils@^7.0.3": "patch:@metamask/snaps-utils@npm%3A7.4.0#./.yarn/patches/@metamask-snaps-utils-npm-7.4.0-61301b942a.patch", "@metamask/snaps-utils@^7.1.0": "patch:@metamask/snaps-utils@npm%3A7.4.0#./.yarn/patches/@metamask-snaps-utils-npm-7.4.0-61301b942a.patch", "@metamask/snaps-utils@^7.3.0": "patch:@metamask/snaps-utils@npm%3A7.4.0#./.yarn/patches/@metamask-snaps-utils-npm-7.4.0-61301b942a.patch", diff --git a/yarn.lock b/yarn.lock index 1182b731dd7..97069576063 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1,3 +1,6 @@ +# This file is generated by running "yarn install" inside your project. +# Manual changes might be lost - proceed with caution! + __metadata: version: 6 cacheKey: 8 @@ -2225,24 +2228,6 @@ __metadata: languageName: node linkType: hard -"@metamask/eth-snap-keyring@npm:^4.1.1": - version: 4.2.1 - resolution: "@metamask/eth-snap-keyring@npm:4.2.1" - dependencies: - "@ethereumjs/tx": ^4.2.0 - "@metamask/eth-sig-util": ^7.0.1 - "@metamask/keyring-api": ^6.3.1 - "@metamask/snaps-controllers": ^8.1.1 - "@metamask/snaps-sdk": ^4.2.0 - "@metamask/snaps-utils": ^7.4.0 - "@metamask/utils": ^8.4.0 - "@types/uuid": ^9.0.1 - superstruct: ^1.0.3 - uuid: ^9.0.0 - checksum: cd4eb41c878e619ea3f270439fc32e68f1d75ce92cf0232d5a21d62b6b62b2d9f2d7085078b5d2d85eb94690fd027045de1f741fce73ae7222f67935ec63c2ac - languageName: node - linkType: hard - "@metamask/eth-snap-keyring@npm:^4.2.1": version: 4.2.1 resolution: "@metamask/eth-snap-keyring@npm:4.2.1" @@ -2467,32 +2452,6 @@ __metadata: languageName: unknown linkType: soft -"@metamask/key-tree@npm:^9.0.0, @metamask/key-tree@npm:^9.1.0, @metamask/key-tree@npm:^9.1.1": - version: 9.1.1 - resolution: "@metamask/key-tree@npm:9.1.1" - dependencies: - "@metamask/scure-bip39": ^2.1.1 - "@metamask/utils": ^8.3.0 - "@noble/curves": ^1.2.0 - "@noble/hashes": ^1.3.2 - "@scure/base": ^1.0.0 - checksum: 4de5f92e4d9408829552bb569b998613ed940f289613fe86f9a5f0a66e392ec386d70b2365943c216b83c9ff249877fd731f2f791240a622ff186fd047d81f9e - languageName: node - linkType: hard - -"@metamask/key-tree@npm:^9.1.0": - version: 9.1.0 - resolution: "@metamask/key-tree@npm:9.1.0" - dependencies: - "@metamask/scure-bip39": ^2.1.1 - "@metamask/utils": ^8.3.0 - "@noble/curves": ^1.2.0 - "@noble/hashes": ^1.3.2 - "@scure/base": ^1.0.0 - checksum: 02709493f87c4cf8ebe3b81a47d3239d4d0b15fd73ac877047d0907652ff740d307966392f6f31d2f7871ab84315dddb4310edbf4edb976941a53d4e9ae04404 - languageName: node - linkType: hard - "@metamask/key-tree@npm:^9.1.1": version: 9.1.1 resolution: "@metamask/key-tree@npm:9.1.1" @@ -2506,22 +2465,6 @@ __metadata: languageName: node linkType: hard -"@metamask/keyring-api@npm:6.1.0": - version: 6.1.0 - resolution: "@metamask/keyring-api@npm:6.1.0" - dependencies: - "@metamask/snaps-sdk": ^4.0.0 - "@metamask/utils": ^8.3.0 - "@types/uuid": ^9.0.1 - bech32: ^2.0.0 - superstruct: ^1.0.3 - uuid: ^9.0.1 - peerDependencies: - "@metamask/providers": ">=15 <17" - checksum: 493aff0569b2f62a9cbbda82e5b9df709562f5f11d32f5d97224a7d29be1bbd7139e23f1384d9d888e2e90d3858e64ff499c03780b3664d31724a054722b4e0a - languageName: node - linkType: hard - "@metamask/keyring-api@npm:6.4.0": version: 6.4.0 resolution: "@metamask/keyring-api@npm:6.4.0" @@ -2538,70 +2481,6 @@ __metadata: languageName: node linkType: hard -"@metamask/keyring-api@npm:^6.1.1": - version: 6.1.1 - resolution: "@metamask/keyring-api@npm:6.1.1" - dependencies: - "@metamask/snaps-sdk": ^4.2.0 - "@metamask/utils": ^8.4.0 - "@types/uuid": ^9.0.8 - bech32: ^2.0.0 - superstruct: ^1.0.3 - uuid: ^9.0.1 - peerDependencies: - "@metamask/providers": ">=15 <18" - checksum: 7845ed5fa73db3165703c2142b6062d03ca5fea329b54d28f424dee2bb393edc1f9a015e771289ef7236c31f30355bf2c52ad74bb47cf531c09c5eec66e06b00 - languageName: node - linkType: hard - -"@metamask/keyring-api@npm:^6.3.1": - version: 6.4.0 - resolution: "@metamask/keyring-api@npm:6.4.0" - dependencies: - "@metamask/snaps-sdk": ^4.2.0 - "@metamask/utils": ^8.4.0 - "@types/uuid": ^9.0.8 - bech32: ^2.0.0 - superstruct: ^1.0.3 - uuid: ^9.0.1 - peerDependencies: - "@metamask/providers": ">=15 <18" - checksum: 7845ed5fa73db3165703c2142b6062d03ca5fea329b54d28f424dee2bb393edc1f9a015e771289ef7236c31f30355bf2c52ad74bb47cf531c09c5eec66e06b00 - languageName: node - linkType: hard - -"@metamask/keyring-api@npm:^6.3.1, @metamask/keyring-api@npm:^6.4.0": - version: 6.4.0 - resolution: "@metamask/keyring-api@npm:6.4.0" - dependencies: - "@metamask/snaps-sdk": ^4.2.0 - "@metamask/utils": ^8.4.0 - "@types/uuid": ^9.0.8 - bech32: ^2.0.0 - superstruct: ^1.0.3 - uuid: ^9.0.1 - peerDependencies: - "@metamask/providers": ">=15 <18" - checksum: 7845ed5fa73db3165703c2142b6062d03ca5fea329b54d28f424dee2bb393edc1f9a015e771289ef7236c31f30355bf2c52ad74bb47cf531c09c5eec66e06b00 - languageName: node - linkType: hard - -"@metamask/keyring-api@patch:@metamask/keyring-api@npm%3A6.1.0#./.yarn/patches/@metamask-keyring-api-npm-6.1.0-1b3da6f710.patch::locator=%40metamask%2Fcore-monorepo%40workspace%3A.": - version: 6.1.0 - resolution: "@metamask/keyring-api@patch:@metamask/keyring-api@npm%3A6.1.0#./.yarn/patches/@metamask-keyring-api-npm-6.1.0-1b3da6f710.patch::version=6.1.0&hash=b59588&locator=%40metamask%2Fcore-monorepo%40workspace%3A." - dependencies: - "@metamask/snaps-sdk": ^4.2.0 - "@metamask/utils": ^8.4.0 - "@types/uuid": ^9.0.8 - bech32: ^2.0.0 - superstruct: ^1.0.3 - uuid: ^9.0.1 - peerDependencies: - "@metamask/providers": ">=15 <18" - checksum: 723b2022fe2967c14ebd2410137e13402cccc25185d23d8dc1649e135b27c2e00467764cb7b2f4f37ef14f22d2dfa73951b52106f46658dbb5cf6879ea9f6e46 - languageName: node - linkType: hard - "@metamask/keyring-api@patch:@metamask/keyring-api@npm%3A6.4.0#./.yarn/patches/@metamask-keyring-api-npm-6.4.0-3a5b2ed69f.patch::locator=%40metamask%2Fcore-monorepo%40workspace%3A.": version: 6.4.0 resolution: "@metamask/keyring-api@patch:@metamask/keyring-api@npm%3A6.4.0#./.yarn/patches/@metamask-keyring-api-npm-6.4.0-3a5b2ed69f.patch::version=6.4.0&hash=a2bdfd&locator=%40metamask%2Fcore-monorepo%40workspace%3A." @@ -3219,21 +3098,7 @@ __metadata: languageName: node linkType: hard -"@metamask/snaps-sdk@npm:4.2.0": - version: 4.2.0 - resolution: "@metamask/snaps-sdk@npm:4.2.0" - dependencies: - "@metamask/key-tree": ^9.1.1 - "@metamask/providers": ^17.0.0 - "@metamask/rpc-errors": ^6.2.1 - "@metamask/utils": ^8.3.0 - fast-xml-parser: ^4.3.4 - superstruct: ^1.0.3 - checksum: 29dfc36821e77d033ddc1b8f1b8924b4880aca41a25e1767741b50659990a79d3026f3975613090342e98d0cf8d876a0e003edb23ff39d2927dc6473d5c441f9 - languageName: node - linkType: hard - -"@metamask/snaps-sdk@npm:^4.2.0, @metamask/snaps-sdk@npm:^4.4.1": +"@metamask/snaps-sdk@npm:4.4.1": version: 4.4.1 resolution: "@metamask/snaps-sdk@npm:4.4.1" dependencies: @@ -3247,9 +3112,9 @@ __metadata: languageName: node linkType: hard -"@metamask/snaps-sdk@npm:^4.4.1": +"@metamask/snaps-sdk@patch:@metamask/snaps-sdk@npm%3A4.4.1#./.yarn/patches/@metamask-snaps-sdk-npm-4.4.1-f1f7bb22cb.patch::locator=%40metamask%2Fcore-monorepo%40workspace%3A.": version: 4.4.1 - resolution: "@metamask/snaps-sdk@npm:4.4.1" + resolution: "@metamask/snaps-sdk@patch:@metamask/snaps-sdk@npm%3A4.4.1#./.yarn/patches/@metamask-snaps-sdk-npm-4.4.1-f1f7bb22cb.patch::version=4.4.1&hash=d41693&locator=%40metamask%2Fcore-monorepo%40workspace%3A." dependencies: "@metamask/key-tree": ^9.1.1 "@metamask/providers": ^17.0.0 @@ -3257,51 +3122,7 @@ __metadata: "@metamask/utils": ^8.3.0 fast-xml-parser: ^4.3.4 superstruct: ^1.0.3 - checksum: 29dfc36821e77d033ddc1b8f1b8924b4880aca41a25e1767741b50659990a79d3026f3975613090342e98d0cf8d876a0e003edb23ff39d2927dc6473d5c441f9 - languageName: node - linkType: hard - -"@metamask/snaps-sdk@patch:@metamask/snaps-sdk@npm%3A4.2.0#./.yarn/patches/@metamask-snaps-sdk-npm-4.2.0-68c745cc62.patch::locator=%40metamask%2Fcore-monorepo%40workspace%3A.": - version: 4.2.0 - resolution: "@metamask/snaps-sdk@patch:@metamask/snaps-sdk@npm%3A4.2.0#./.yarn/patches/@metamask-snaps-sdk-npm-4.2.0-68c745cc62.patch::version=4.2.0&hash=3dabd5&locator=%40metamask%2Fcore-monorepo%40workspace%3A." - dependencies: - "@metamask/key-tree": ^9.1.0 - "@metamask/providers": ^16.1.0 - "@metamask/rpc-errors": ^6.2.1 - "@metamask/utils": ^8.3.0 - fast-xml-parser: ^4.3.4 - superstruct: ^1.0.3 - checksum: cf8e270fc47ca72736fa12f0e77b7f0a25536e7c003ead1720f8be914039e22c49e111104db1278c41b623451a0494fe6f7422bc7685c9689f1430c7976c240b - languageName: node - linkType: hard - -"@metamask/snaps-utils@npm:7.4.0, @metamask/snaps-utils@npm:^7.4.0": - version: 7.4.0 - resolution: "@metamask/snaps-utils@npm:7.4.0" - dependencies: - "@babel/core": ^7.23.2 - "@babel/types": ^7.23.0 - "@metamask/base-controller": ^5.0.2 - "@metamask/key-tree": ^9.1.1 - "@metamask/permission-controller": ^9.0.2 - "@metamask/rpc-errors": ^6.2.1 - "@metamask/slip44": ^3.1.0 - "@metamask/snaps-registry": ^3.1.0 - "@metamask/snaps-sdk": ^4.4.1 - "@metamask/utils": ^8.3.0 - "@noble/hashes": ^1.3.1 - "@scure/base": ^1.1.1 - chalk: ^4.1.2 - cron-parser: ^4.5.0 - fast-deep-equal: ^3.1.3 - fast-json-stable-stringify: ^2.1.0 - marked: ^12.0.1 - rfdc: ^1.3.0 - semver: ^7.5.4 - ses: ^1.1.0 - superstruct: ^1.0.3 - validate-npm-package-name: ^5.0.0 - checksum: d1d6d3c769c33df88fb6e4fc852cdfe1e400b25b1cae020e729f1bfe8a094804cf901700afbbf1372cc1e95f697127b5847bf3a85b46b403ba2ae64ee5750d22 + checksum: 332ee26fb8eac652f403defa0c65bc2b4339f6e6d1fdb49b54d38db6ffbe3c29442faa20f48675c36342cba647e827f360fe508bc6bdcc359d82c7dc70ef8a20 languageName: node linkType: hard @@ -3335,66 +3156,6 @@ __metadata: languageName: node linkType: hard -"@metamask/snaps-utils@npm:^7.4.1": - version: 7.4.1 - resolution: "@metamask/snaps-utils@npm:7.4.1" - dependencies: - "@babel/core": ^7.23.2 - "@babel/types": ^7.23.0 - "@metamask/base-controller": ^5.0.2 - "@metamask/key-tree": ^9.1.1 - "@metamask/permission-controller": ^9.0.2 - "@metamask/rpc-errors": ^6.2.1 - "@metamask/slip44": ^3.1.0 - "@metamask/snaps-registry": ^3.1.0 - "@metamask/snaps-sdk": ^4.4.1 - "@metamask/utils": ^8.3.0 - "@noble/hashes": ^1.3.1 - "@scure/base": ^1.1.1 - chalk: ^4.1.2 - cron-parser: ^4.5.0 - fast-deep-equal: ^3.1.3 - fast-json-stable-stringify: ^2.1.0 - marked: ^12.0.1 - rfdc: ^1.3.0 - semver: ^7.5.4 - ses: ^1.1.0 - superstruct: ^1.0.3 - validate-npm-package-name: ^5.0.0 - checksum: d1d6d3c769c33df88fb6e4fc852cdfe1e400b25b1cae020e729f1bfe8a094804cf901700afbbf1372cc1e95f697127b5847bf3a85b46b403ba2ae64ee5750d22 - languageName: node - linkType: hard - -"@metamask/snaps-utils@patch:@metamask/snaps-utils@npm%3A7.4.0#./.yarn/patches/@metamask-snaps-utils-npm-7.4.0-61301b942a.patch::locator=%40metamask%2Fcore-monorepo%40workspace%3A.": - version: 7.4.0 - resolution: "@metamask/snaps-utils@patch:@metamask/snaps-utils@npm%3A7.4.0#./.yarn/patches/@metamask-snaps-utils-npm-7.4.0-61301b942a.patch::version=7.4.0&hash=7bdd25&locator=%40metamask%2Fcore-monorepo%40workspace%3A." - dependencies: - "@babel/core": ^7.23.2 - "@babel/types": ^7.23.0 - "@metamask/base-controller": ^5.0.2 - "@metamask/key-tree": ^9.1.0 - "@metamask/permission-controller": ^9.0.2 - "@metamask/rpc-errors": ^6.2.1 - "@metamask/slip44": ^3.1.0 - "@metamask/snaps-registry": ^3.1.0 - "@metamask/snaps-sdk": ^4.2.0 - "@metamask/utils": ^8.3.0 - "@noble/hashes": ^1.3.1 - "@scure/base": ^1.1.1 - chalk: ^4.1.2 - cron-parser: ^4.5.0 - fast-deep-equal: ^3.1.3 - fast-json-stable-stringify: ^2.1.0 - marked: ^12.0.1 - rfdc: ^1.3.0 - semver: ^7.5.4 - ses: ^1.1.0 - superstruct: ^1.0.3 - validate-npm-package-name: ^5.0.0 - checksum: eb6a0d3a51ed7f2af8e018cbf56c9af39e52161e01e987ff42fd640b82755cafc1f803119bbe317fc860447590787ae647d7b355bd897c1b577d3171ab6dfde5 - languageName: node - linkType: hard - "@metamask/superstruct@npm:^2.0.0": version: 2.0.0 resolution: "@metamask/superstruct@npm:2.0.0"