{"version":3,"file":"validation.mjs","sourceRoot":"","sources":["../../src/jsx/validation.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,EAAE,EACF,OAAO,EACP,QAAQ,EACR,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,MAAM,EACN,MAAM,EACN,MAAM,EACN,KAAK,EACL,MAAM,EACN,MAAM,EACN,KAAK,EACN,8BAA8B;AAC/B,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,WAAW,EACX,wBAAwB,EACxB,aAAa,EACb,UAAU,EACX,wBAAwB;AAsDzB,OAAO,EAAE,QAAQ,EAAE,+BAAqB;AAExC,OAAO,EACL,OAAO,EACP,SAAS,EACT,cAAc,EACd,GAAG,EACH,UAAU,EACV,iBAAiB,EACjB,GAAG,EACJ,+BAAqB;AACtB,OAAO,EACL,wBAAwB,EACxB,sBAAsB,EACtB,yDAAyD,EAE1D,2BAAiB;AAElB;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAkB,SAAS,CAAC,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;AAExE;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAA4B,QAAQ,CAAC;IACnE,MAAM,EAAE;CACT,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAiC,MAAM,CAAC;IAChE,IAAI,EAAE,MAAM,EAAE;IACd,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,EAAE,UAAU,CAAC;IACnC,GAAG,EAAE,QAAQ,CAAC,SAAS,CAAC;CACzB,CAAC,CAAC;AAEH;;;;;GAKG;AACH,SAAS,QAAQ,CACf,MAA4B;IAE5B,MAAM,cAAc,GAA2B,cAAc,CAAC,CAAC,KAAK,EAAE,EAAE;QACtE,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YACzB,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC,C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M,UAAU,gBAAgB,CAAC,KAAc;IAC7C,4EAA4E;IAC5E,0EAA0E;IAC1E,2DAA2D;IAC3D,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CACb,wCAAwC,IAAI,CAAC,SAAS,CACpD,KAAK,CACN,qFAAqF,CACvF,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["import type {\n  AnyStruct,\n  Infer,\n  InferStructTuple,\n  ObjectSchema,\n  Struct,\n} from '@metamask/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  refine,\n  assign,\n  union,\n} from '@metamask/superstruct';\nimport {\n  CaipAccountIdStruct,\n  CaipChainIdStruct,\n  hasProperty,\n  HexChecksumAddressStruct,\n  isPlainObject,\n  JsonStruct,\n} from '@metamask/utils';\n\nimport type {\n  GenericSnapChildren,\n  GenericSnapElement,\n  JsonObject,\n  Key,\n  Nestable,\n  SnapElement,\n  SnapsChildren,\n  StringElement,\n} from './component';\nimport type {\n  AssetSelectorElement,\n  AvatarElement,\n  AccountSelectorElement,\n  SkeletonElement,\n  AddressElement,\n  AddressInputElement,\n  BoldElement,\n  BoxElement,\n  ButtonElement,\n  CheckboxElement,\n  CardElement,\n  CopyableElement,\n  DividerElement,\n  DropdownElement,\n  OptionElement,\n  RadioElement,\n  RadioGroupElement,\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  TooltipElement,\n  ValueElement,\n  FileInputElement,\n  ContainerElement,\n  FooterElement,\n  IconElement,\n  SectionElement,\n  SelectorElement,\n  SelectorOptionElement,\n  BannerElement,\n  DateTimePickerElement,\n} from './components';\nimport { IconName } from './components';\nimport type { Describe } from '../internals';\nimport {\n  literal,\n  nullUnion,\n  selectiveUnion,\n  svg,\n  typedUnion,\n  ISO8601DateStruct,\n  uri,\n} from '../internals';\nimport {\n  NonEip155AssetTypeStruct,\n  NonEip155ChainIdStruct,\n  NonEip155CaipAccountIdsMatchedByAddressAndNamespaceStruct,\n  type EmptyObject,\n} from '../types';\n\n/**\n * A struct for the {@link Key} type.\n */\nexport const KeyStruct: Describe<Key> = nullUnion([string(), number()]);\n\n/**\n * A struct for the {@link StringElement} type.\n */\nexport const StringElementStruct: Describe<StringElement> = children([\n  string(),\n]);\n\n/**\n * A struct for the {@link GenericSnapElement} type.\n */\nexport const ElementStruct: Describe<GenericSnapElement> = 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 Nestable} type.\n *\n * @param struct - The struct for the type to test.\n * @returns The struct for the nestable type.\n */\nfunction nestable<Type, Schema>(\n  struct: Struct<Type, Schema>,\n): Struct<Nestable<Type>, any> {\n  const nestableStruct: Struct<Nestable<Type>> = selectiveUnion((value) => {\n    if (Array.isArray(value)) {\n      return array(lazy(() => nestableStruct));\n    }\n    return struct;\n  });\n\n  return nestableStruct;\n}\n\n/**\n * A helper function for creating a struct which allows children of a specific\n * type, as well as `null` and `boolean`.\n *\n * @param structs - The structs to allow as children.\n * @returns The struct for the children.\n */\nfunction children<Head extends AnyStruct, Tail extends AnyStruct[]>(\n  structs: [head: Head, ...tail: Tail],\n): Struct<\n  Nestable<Infer<Head> | InferStructTuple<Tail>[number] | boolean | null>,\n  null\n> {\n  const potentialUnion = structs.length === 1 ? structs[0] : nullUnion(structs);\n  return nestable(\n    nullable(\n      selectiveUnion((value) => {\n        if (typeof value === 'boolean') {\n          return boolean();\n        }\n        return potentialUnion;\n      }),\n    ),\n  ) as unknown as Struct<\n    Nestable<Infer<Head> | InferStructTuple<Tail>[number] | boolean | null>,\n    null\n  >;\n}\n\n/**\n * A helper function for creating a struct which allows a single child of a specific\n * type, as well as `null` and `boolean`.\n *\n * @param struct - The struct to allow as a single child.\n * @returns The struct for the children.\n */\nfunction singleChild<Type extends AnyStruct>(\n  struct: Type,\n): Struct<Infer<Type> | boolean | null, null> {\n  return nullable(\n    selectiveUnion((value) => {\n      if (typeof value === 'boolean') {\n        return boolean();\n      }\n\n      return struct;\n    }),\n  ) as unknown as Struct<Infer<Type> | boolean | null, null>;\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<Name extends string, Props extends ObjectSchema = EmptyObject>(\n  name: Name,\n  props: Props = {} as Props,\n) {\n  return object({\n    type: literal(name) as unknown as Struct<Name, Name>,\n    props: object(props),\n    key: nullable(KeyStruct),\n  });\n}\n\n/**\n * A helper function for creating a struct for a JSX element with selective props.\n *\n * @param name - The name of the element.\n * @param selector - The selector function choosing the struct to validate with.\n * @returns The struct for the element.\n */\nfunction elementWithSelectiveProps<\n  Name extends string,\n  Selector extends (value: any) => AnyStruct,\n>(name: Name, selector: Selector) {\n  return object({\n    type: literal(name) as unknown as Struct<Name, Name>,\n    props: selectiveUnion(selector),\n    key: nullable(KeyStruct),\n  });\n}\n\n/**\n * Shared struct used to validate border radius values used by various Snaps components.\n */\nexport const BorderRadiusStruct = nullUnion([\n  literal('none'),\n  literal('medium'),\n  literal('full'),\n]);\n\n/**\n * A struct for the {@link ImageElement} type.\n */\nexport const ImageStruct: Describe<ImageElement> = element('Image', {\n  src: nullUnion([svg(), uri({ protocol: literal('https:') })]),\n  alt: optional(string()),\n  borderRadius: optional(BorderRadiusStruct),\n  width: optional(number()),\n  height: optional(number()),\n});\n\nconst IconNameStruct: Struct<`${IconName}`, null> = nullUnion(\n  Object.values(IconName).map((name) => literal(name)) as any,\n);\n\n/**\n * A struct for the {@link IconElement} type.\n */\nexport const IconStruct: Describe<IconElement> = element('Icon', {\n  name: IconNameStruct,\n  color: optional(\n    nullUnion([\n      literal('default'),\n      literal('primary'),\n      literal('muted'),\n      literal('error'),\n      literal('success'),\n      literal('warning'),\n    ]),\n  ),\n  size: optional(nullUnion([literal('md'), literal('inherit')])),\n});\n\n/**\n * A struct for the {@link ButtonElement} type.\n */\nexport const ButtonStruct: Describe<ButtonElement> = element('Button', {\n  children: children([StringElementStruct, ImageStruct, IconStruct]),\n  name: optional(string()),\n  type: optional(nullUnion([literal('button'), literal('submit')])),\n  variant: optional(nullUnion([literal('primary'), literal('destructive')])),\n  size: optional(nullUnion([literal('sm'), literal('md')])),\n  disabled: optional(boolean()),\n  loading: optional(boolean()),\n  form: optional(string()),\n});\n\n/**\n * A struct for the {@link CheckboxElement} type.\n */\nexport const CheckboxStruct: Describe<CheckboxElement> = element('Checkbox', {\n  name: string(),\n  checked: optional(boolean()),\n  label: optional(string()),\n  variant: optional(nullUnion([literal('default'), literal('toggle')])),\n  disabled: optional(boolean()),\n});\n\n/**\n * A struct for the generic input element props.\n */\nexport const GenericInputPropsStruct = object({\n  name: string(),\n  value: optional(string()),\n  placeholder: optional(string()),\n  disabled: optional(boolean()),\n});\n\n/**\n * A struct for the text type input props.\n */\nexport const TextInputPropsStruct = assign(\n  GenericInputPropsStruct,\n  object({\n    type: literal('text'),\n  }),\n);\n\n/**\n * A struct for the password type input props.\n */\nexport const PasswordInputPropsStruct = assign(\n  GenericInputPropsStruct,\n  object({\n    type: literal('password'),\n  }),\n);\n\n/**\n * A struct for the number type input props.\n */\nexport const NumberInputPropsStruct = assign(\n  GenericInputPropsStruct,\n  object({\n    type: literal('number'),\n    min: optional(number()),\n    max: optional(number()),\n    step: optional(number()),\n  }),\n);\n\n/**\n * A struct for the {@link InputElement} type.\n */\nexport const InputStruct: Describe<InputElement> = elementWithSelectiveProps(\n  'Input',\n  (value) => {\n    if (isPlainObject(value) && hasProperty(value, 'type')) {\n      switch (value.type) {\n        case 'text':\n          return TextInputPropsStruct;\n        case 'password':\n          return PasswordInputPropsStruct;\n        case 'number':\n          return NumberInputPropsStruct;\n        default:\n          return GenericInputPropsStruct;\n      }\n    }\n    return GenericInputPropsStruct;\n  },\n);\n\n/**\n * A struct for the {@link AddressInputElement} type.\n */\nexport const AddressInputStruct: Describe<AddressInputElement> = element(\n  'AddressInput',\n  {\n    name: string(),\n    chainId: CaipChainIdStruct,\n    value: optional(string()),\n    placeholder: optional(string()),\n    disabled: optional(boolean()),\n    displayAvatar: optional(boolean()),\n  },\n);\n\n/**\n * A struct for the {@link OptionElement} type.\n */\nexport const OptionStruct: Describe<OptionElement> = element('Option', {\n  value: string(),\n  children: string(),\n  disabled: optional(boolean()),\n});\n\n/**\n * A struct for the {@link DropdownElement} type.\n */\nexport const DropdownStruct: Describe<DropdownElement> = element('Dropdown', {\n  name: string(),\n  value: optional(string()),\n  children: children([OptionStruct]),\n  disabled: optional(boolean()),\n});\n\n/**\n * A struct for the {@link DateTimePickerElement} type.\n */\nexport const DateTimePickerStruct: Describe<DateTimePickerElement> = element(\n  'DateTimePicker',\n  {\n    name: string(),\n    type: optional(\n      nullUnion([literal('date'), literal('time'), literal('datetime')]),\n    ),\n    placeholder: optional(string()),\n    disabled: optional(boolean()),\n    disablePast: optional(boolean()),\n    disableFuture: optional(boolean()),\n    value: optional(ISO8601DateStruct),\n  },\n);\n\n/**\n * A struct for the {@link AddressElement} type.\n */\nexport const AddressStruct: Describe<AddressElement> = element('Address', {\n  address: selectiveUnion((value) => {\n    if (typeof value === 'string' && value.startsWith('0x')) {\n      return HexChecksumAddressStruct;\n    }\n    return CaipAccountIdStruct;\n  }),\n  truncate: optional(boolean()),\n  displayName: optional(boolean()),\n  avatar: optional(boolean()),\n});\n\n/**\n * A struct for the {@link AccountSelectorElement} type.\n */\nexport const AccountSelectorStruct: Describe<AccountSelectorElement> = element(\n  'AccountSelector',\n  {\n    name: string(),\n    hideExternalAccounts: optional(boolean()),\n    chainIds: optional(array(CaipChainIdStruct)) as unknown as Struct<\n      Infer<typeof CaipChainIdStruct>[] | undefined,\n      null\n    >,\n    switchGlobalAccount: optional(boolean()),\n    value: optional(CaipAccountIdStruct),\n    disabled: optional(boolean()),\n  },\n);\n\n/**\n * A struct for the {@link CardElement} type.\n */\nexport const CardStruct: Describe<CardElement> = element('Card', {\n  image: optional(string()),\n  title: selectiveUnion((value) => {\n    if (typeof value === 'object') {\n      return AddressStruct;\n    }\n    return string();\n  }),\n  description: optional(string()),\n  value: string(),\n  extra: optional(string()),\n});\n\n/**\n * A struct for the {@link SelectorOptionElement} type.\n */\nexport const SelectorOptionStruct: Describe<SelectorOptionElement> = element(\n  'SelectorOption',\n  {\n    value: string(),\n    children: CardStruct,\n    disabled: optional(boolean()),\n  },\n);\n\n/**\n * A struct for the {@link SelectorElement} type.\n */\nexport const SelectorStruct: Describe<SelectorElement> = element('Selector', {\n  name: string(),\n  title: string(),\n  value: optional(string()),\n  children: children([SelectorOptionStruct]),\n  disabled: optional(boolean()),\n});\n\n/**\n * A struct for the {@link AssetSelectorElement} type.\n */\nexport const AssetSelectorStruct: Describe<AssetSelectorElement> = element(\n  'AssetSelector',\n  {\n    name: string(),\n    addresses: NonEip155CaipAccountIdsMatchedByAddressAndNamespaceStruct,\n    chainIds: optional(array(NonEip155ChainIdStruct)) as unknown as Struct<\n      Infer<typeof NonEip155ChainIdStruct>[] | undefined,\n      null\n    >,\n    value: optional(NonEip155AssetTypeStruct),\n    disabled: optional(boolean()),\n  },\n);\n\n/**\n * A struct for the {@link RadioElement} type.\n */\nexport const RadioStruct: Describe<RadioElement> = element('Radio', {\n  value: string(),\n  children: string(),\n  disabled: optional(boolean()),\n});\n\n/**\n * A struct for the {@link RadioGroupElement} type.\n */\nexport const RadioGroupStruct: Describe<RadioGroupElement> = element(\n  'RadioGroup',\n  {\n    name: string(),\n    value: optional(string()),\n    children: children([RadioStruct]),\n    disabled: optional(boolean()),\n  },\n);\n\n/**\n * A struct for the {@link FileInputElement} type.\n */\nexport const FileInputStruct: Describe<FileInputElement> = element(\n  'FileInput',\n  {\n    name: string(),\n    accept: nullUnion([optional(array(string()))]),\n    compact: optional(boolean()),\n    disabled: optional(boolean()),\n  },\n);\n\n/**\n * A subset of JSX elements that represent the tuple Box + Input of the Field children.\n */\nconst BOX_INPUT_LEFT = [\n  // eslint-disable-next-line @typescript-eslint/no-use-before-define\n  singleChild(lazy(() => BoxChildStruct)),\n  InputStruct,\n] as [typeof BoxChildStruct, typeof InputStruct];\n\n/**\n * A subset of JSX elements that represent the tuple Input + Box of the Field children.\n */\nconst BOX_INPUT_RIGHT = [\n  InputStruct,\n  // eslint-disable-next-line @typescript-eslint/no-use-before-define\n  singleChild(lazy(() => BoxChildStruct)),\n] as [typeof InputStruct, typeof BoxChildStruct];\n\n/**\n * A subset of JSX elements that represent the tuple Box + Input + Box of the Field children.\n */\nconst BOX_INPUT_BOTH = [\n  // eslint-disable-next-line @typescript-eslint/no-use-before-define\n  singleChild(lazy(() => BoxChildStruct)),\n  InputStruct,\n  // eslint-disable-next-line @typescript-eslint/no-use-before-define\n  singleChild(lazy(() => BoxChildStruct)),\n] as [typeof BoxChildStruct, typeof InputStruct, typeof BoxChildStruct];\n\n/**\n * A subset of JSX elements that are allowed as single children of the Field component.\n */\nconst FIELD_CHILDREN_ARRAY = [\n  AssetSelectorStruct,\n  AddressInputStruct,\n  AccountSelectorStruct,\n  InputStruct,\n  DropdownStruct,\n  RadioGroupStruct,\n  FileInputStruct,\n  CheckboxStruct,\n  SelectorStruct,\n  DateTimePickerStruct,\n] as [\n  typeof AssetSelectorStruct,\n  typeof AddressInputStruct,\n  typeof AccountSelectorStruct,\n  typeof InputStruct,\n  typeof DropdownStruct,\n  typeof RadioGroupStruct,\n  typeof FileInputStruct,\n  typeof CheckboxStruct,\n  typeof SelectorStruct,\n  typeof DateTimePickerStruct,\n];\n\n/**\n * A union of the allowed children of the Field component.\n * This is mainly used in the simulator for validation purposes.\n */\nexport const FieldChildUnionStruct = nullUnion([\n  ...FIELD_CHILDREN_ARRAY,\n  ...BOX_INPUT_LEFT,\n  ...BOX_INPUT_RIGHT,\n  ...BOX_INPUT_BOTH,\n]);\n\n/**\n * A subset of JSX elements that are allowed as children of the Field component.\n */\nconst FieldChildStruct = selectiveUnion((value) => {\n  const isArray = Array.isArray(value);\n  if (isArray && value.length === 3) {\n    return tuple(BOX_INPUT_BOTH);\n  }\n\n  if (isArray && value.length === 2) {\n    return value[0]?.type === 'Box'\n      ? tuple(BOX_INPUT_LEFT)\n      : tuple(BOX_INPUT_RIGHT);\n  }\n\n  return typedUnion(FIELD_CHILDREN_ARRAY);\n}) as unknown as Struct<\n  | [InputElement, GenericSnapChildren]\n  | [GenericSnapChildren, InputElement]\n  | [GenericSnapChildren, InputElement, GenericSnapChildren]\n  | DropdownElement\n  | RadioGroupElement\n  | FileInputElement\n  | InputElement\n  | CheckboxElement\n  | SelectorElement\n  | DateTimePickerElement\n  | AssetSelectorElement\n  | AddressInputElement\n  | AccountSelectorElement,\n  null\n>;\n\n/**\n * A struct for the {@link FieldElement} type.\n */\nexport const FieldStruct: Describe<FieldElement> = element('Field', {\n  label: optional(string()),\n  error: optional(string()),\n  children: FieldChildStruct,\n});\n\n/**\n * A struct for the {@link BoldElement} type.\n */\nexport const BoldStruct: Describe<BoldElement> = element('Bold', {\n  children: children([\n    selectiveUnion((value) => {\n      if (typeof value === 'string') {\n        return string();\n      }\n      // eslint-disable-next-line @typescript-eslint/no-use-before-define\n      return ItalicStruct as unknown as Struct<\n        SnapElement<JsonObject, 'Italic'>\n      >;\n    }),\n  ]),\n});\n\n/**\n * A struct for the {@link ItalicElement} type.\n */\nexport const ItalicStruct: Describe<ItalicElement> = element('Italic', {\n  children: children([\n    selectiveUnion((value) => {\n      if (typeof value === 'string') {\n        return string();\n      }\n\n      return BoldStruct as unknown as Struct<SnapElement<JsonObject, 'Bold'>>;\n    }),\n  ]),\n});\n\nexport const FormattingStruct: Describe<StandardFormattingElement> = typedUnion(\n  [BoldStruct, ItalicStruct],\n);\n\n/**\n * A struct for the {@link AvatarElement} type.\n */\nexport const AvatarStruct = element('Avatar', {\n  address: CaipAccountIdStruct,\n  size: optional(nullUnion([literal('sm'), literal('md'), literal('lg')])),\n}) as unknown as Struct<AvatarElement, null>;\n\nexport const BoxChildrenStruct = children(\n  // eslint-disable-next-line @typescript-eslint/no-use-before-define\n  [lazy(() => BoxChildStruct)],\n) as unknown as Struct<SnapsChildren<GenericSnapElement>, null>;\n\n/**\n * A struct for the {@link BoxElement} type.\n */\nexport const BoxStruct: Describe<BoxElement> = element('Box', {\n  children: BoxChildrenStruct,\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  crossAlignment: optional(\n    nullUnion([literal('start'), literal('center'), literal('end')]),\n  ),\n  center: optional(boolean()),\n});\n\n/**\n * A subset of JSX elements that are allowed as children of the Form component.\n */\nexport const FormChildStruct = BoxChildrenStruct;\n\n/**\n * A struct for the {@link FormElement} type.\n */\nexport const FormStruct: Describe<FormElement> = element('Form', {\n  children: FormChildStruct,\n  name: string(),\n});\n\nconst FooterButtonStruct = refine(ButtonStruct, 'FooterButton', (value) => {\n  if (\n    typeof value.props.children === 'string' ||\n    typeof value.props.children === 'boolean' ||\n    value.props.children === null\n  ) {\n    return true;\n  }\n\n  if (Array.isArray(value.props.children)) {\n    const hasNonTextElements = value.props.children.some(\n      (child) =>\n        typeof child !== 'string' &&\n        typeof child !== 'boolean' &&\n        child !== null,\n    );\n\n    if (!hasNonTextElements) {\n      return true;\n    }\n  }\n\n  return 'Footer buttons may only contain text.';\n});\n\n/**\n * A struct for the {@link SectionElement} type.\n */\nexport const SectionStruct: Describe<SectionElement> = element('Section', {\n  children: BoxChildrenStruct,\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 subset of JSX elements that are allowed as children of the Footer component.\n * This set should include a single button or a tuple of two buttons.\n */\n\nexport const FooterChildStruct = selectiveUnion((value) => {\n  if (Array.isArray(value)) {\n    return tuple([FooterButtonStruct, FooterButtonStruct]);\n  }\n  return FooterButtonStruct;\n});\n\n/**\n * A struct for the {@link FooterElement} type.\n */\nexport const FooterStruct: Describe<FooterElement> = element('Footer', {\n  children: FooterChildStruct,\n});\n\n/**\n * A struct for the {@link CopyableElement} type.\n */\nexport const CopyableStruct: Describe<CopyableElement> = 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<DividerElement> = element('Divider');\n\n/**\n * A struct for the {@link HeadingElement} type.\n */\nexport const HeadingStruct: Describe<HeadingElement> = element('Heading', {\n  children: StringElementStruct,\n  size: optional(nullUnion([literal('sm'), literal('md'), literal('lg')])),\n});\n\n/**\n * A struct for the {@link LinkElement} type.\n */\nexport const LinkStruct: Describe<LinkElement> = element('Link', {\n  href: string(),\n  children: children([\n    selectiveUnion((value) => {\n      if (typeof value === 'string') {\n        return string();\n      }\n\n      return typedUnion([\n        FormattingStruct,\n        IconStruct,\n        ImageStruct,\n        AddressStruct,\n      ]);\n    }),\n  ]),\n});\n\n/**\n * A struct for the {@link SkeletonElement} type.\n */\nexport const SkeletonStruct: Describe<SkeletonElement> = element('Skeleton', {\n  width: optional(union([number(), string()])),\n  height: optional(union([number(), string()])),\n  borderRadius: optional(BorderRadiusStruct),\n});\n\n/**\n * A struct for the {@link TextElement} type.\n */\nexport const TextStruct: Describe<TextElement> = element('Text', {\n  children: children([\n    selectiveUnion((value) => {\n      if (typeof value === 'string') {\n        return string();\n      }\n      return typedUnion([\n        BoldStruct,\n        ItalicStruct,\n        LinkStruct,\n        IconStruct,\n        SkeletonStruct,\n      ]);\n    }),\n  ]),\n  alignment: optional(\n    nullUnion([literal('start'), literal('center'), literal('end')]),\n  ),\n  color: optional(\n    nullUnion([\n      literal('default'),\n      literal('alternative'),\n      literal('muted'),\n      literal('error'),\n      literal('success'),\n      literal('warning'),\n    ]),\n  ),\n  size: optional(nullUnion([literal('sm'), literal('md')])),\n  fontWeight: optional(\n    nullUnion([literal('regular'), literal('medium'), literal('bold')]),\n  ),\n});\n\n/**\n * A struct for the {@link ValueElement} type.\n */\nexport const ValueStruct: Describe<ValueElement> = element('Value', {\n  value: selectiveUnion((value) => {\n    if (typeof value === 'string') {\n      return string();\n    }\n\n    return TextStruct;\n  }),\n  extra: selectiveUnion((value) => {\n    if (typeof value === 'string') {\n      return string();\n    }\n\n    return TextStruct;\n  }),\n});\n\n/**\n * A subset of JSX elements that are allowed as children of the Tooltip component.\n * This set should include all text components and the Image.\n */\nexport const TooltipChildStruct = selectiveUnion((value) => {\n  if (typeof value === 'boolean') {\n    return boolean();\n  }\n  return typedUnion([\n    TextStruct,\n    BoldStruct,\n    ItalicStruct,\n    LinkStruct,\n    ImageStruct,\n    IconStruct,\n  ]);\n});\n\n/**\n * A subset of JSX elements that are allowed as content of the Tooltip component.\n * This set should include all text components.\n */\nexport const TooltipContentStruct = selectiveUnion((value) => {\n  if (typeof value === 'string') {\n    return string();\n  }\n  return typedUnion([\n    TextStruct,\n    BoldStruct,\n    ItalicStruct,\n    LinkStruct,\n    IconStruct,\n  ]);\n});\n\n/**\n * A struct for the {@link TooltipElement} type.\n */\nexport const TooltipStruct: Describe<TooltipElement> = element('Tooltip', {\n  children: nullable(TooltipChildStruct),\n  content: TooltipContentStruct,\n});\n\n/**\n * A struct for the {@link BannerElement} type.\n */\nexport const BannerStruct: Describe<BannerElement> = element('Banner', {\n  children: children([\n    typedUnion([\n      TextStruct,\n      LinkStruct,\n      IconStruct,\n      ButtonStruct,\n      BoldStruct,\n      ItalicStruct,\n      SkeletonStruct,\n    ]),\n  ]),\n  title: string(),\n  severity: union([\n    literal('danger'),\n    literal('info'),\n    literal('success'),\n    literal('warning'),\n  ]),\n});\n\n/**\n * A struct for the {@link RowElement} type.\n */\nexport const RowStruct: Describe<RowElement> = element('Row', {\n  label: string(),\n  children: lazy(() =>\n    // eslint-disable-next-line @typescript-eslint/no-use-before-define\n    typedUnion([ValueStruct, BoxChildStruct]),\n  ) as unknown as Describe<GenericSnapElement>,\n  variant: optional(\n    nullUnion([literal('default'), literal('warning'), literal('critical')]),\n  ),\n  tooltip: optional(string()),\n});\n\n/**\n * A struct for the {@link SpinnerElement} type.\n */\nexport const SpinnerStruct: Describe<SpinnerElement> = element('Spinner');\n\n/**\n * A subset of JSX elements that are allowed as children of the Box component.\n * This set includes all components, except components that need to be nested in\n * another component (e.g., Field must be contained in a Form).\n */\nexport const BoxChildStruct = typedUnion([\n  AccountSelectorStruct,\n  AddressStruct,\n  AssetSelectorStruct,\n  AddressInputStruct,\n  BoldStruct,\n  BoxStruct,\n  ButtonStruct,\n  CopyableStruct,\n  DateTimePickerStruct,\n  DividerStruct,\n  DropdownStruct,\n  RadioGroupStruct,\n  FieldStruct,\n  FileInputStruct,\n  FormStruct,\n  HeadingStruct,\n  InputStruct,\n  ImageStruct,\n  ItalicStruct,\n  LinkStruct,\n  RowStruct,\n  SpinnerStruct,\n  TextStruct,\n  TooltipStruct,\n  CheckboxStruct,\n  CardStruct,\n  IconStruct,\n  SelectorStruct,\n  SectionStruct,\n  AvatarStruct,\n  BannerStruct,\n  SkeletonStruct,\n]);\n\n/**\n * A struct for the {@link ContainerElement} type.\n */\nexport const ContainerStruct: Describe<ContainerElement> = element(\n  'Container',\n  {\n    children: selectiveUnion((value) => {\n      if (Array.isArray(value)) {\n        return tuple([BoxChildStruct, FooterStruct]);\n      }\n      return BoxChildStruct;\n    }) as unknown as Struct<\n      [GenericSnapElement, FooterElement] | GenericSnapElement,\n      null\n    >,\n    backgroundColor: optional(\n      nullUnion([literal('default'), literal('alternative')]),\n    ),\n  },\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 = typedUnion([\n  BoxChildStruct,\n  ContainerStruct,\n]);\n\n/**\n * A struct for the {@link JSXElement} type.\n */\nexport const JSXElementStruct: Describe<JSXElement> = typedUnion([\n  AssetSelectorStruct,\n  AddressInputStruct,\n  AccountSelectorStruct,\n  ButtonStruct,\n  InputStruct,\n  FileInputStruct,\n  FieldStruct,\n  FormStruct,\n  BoldStruct,\n  ItalicStruct,\n  AddressStruct,\n  BoxStruct,\n  CopyableStruct,\n  DateTimePickerStruct,\n  DividerStruct,\n  HeadingStruct,\n  ImageStruct,\n  LinkStruct,\n  RowStruct,\n  SpinnerStruct,\n  TextStruct,\n  DropdownStruct,\n  OptionStruct,\n  RadioGroupStruct,\n  RadioStruct,\n  ValueStruct,\n  TooltipStruct,\n  CheckboxStruct,\n  FooterStruct,\n  ContainerStruct,\n  CardStruct,\n  IconStruct,\n  SelectorStruct,\n  SelectorOptionStruct,\n  SectionStruct,\n  AvatarStruct,\n  BannerStruct,\n  SkeletonStruct,\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"]}