@raster-app/sanity-plugin-raster
Version:
A Sanity Studio plugin that integrates [Raster](https://raster.app) - a modern Digital Asset Management (DAM) platform that helps teams organize, optimize, and deliver their media assets with powerful AI features and an intuitive interface.
1 lines • 194 kB
Source Map (JSON)
{"version":3,"file":"refractor-D-NNQgE0.cjs","sources":["../node_modules/.pnpm/property-information@7.1.0/node_modules/property-information/lib/util/schema.js","../node_modules/.pnpm/property-information@7.1.0/node_modules/property-information/lib/util/merge.js","../node_modules/.pnpm/property-information@7.1.0/node_modules/property-information/lib/normalize.js","../node_modules/.pnpm/property-information@7.1.0/node_modules/property-information/lib/util/info.js","../node_modules/.pnpm/property-information@7.1.0/node_modules/property-information/lib/util/types.js","../node_modules/.pnpm/property-information@7.1.0/node_modules/property-information/lib/util/defined-info.js","../node_modules/.pnpm/property-information@7.1.0/node_modules/property-information/lib/util/create.js","../node_modules/.pnpm/property-information@7.1.0/node_modules/property-information/lib/aria.js","../node_modules/.pnpm/property-information@7.1.0/node_modules/property-information/lib/util/case-sensitive-transform.js","../node_modules/.pnpm/property-information@7.1.0/node_modules/property-information/lib/util/case-insensitive-transform.js","../node_modules/.pnpm/property-information@7.1.0/node_modules/property-information/lib/html.js","../node_modules/.pnpm/property-information@7.1.0/node_modules/property-information/lib/svg.js","../node_modules/.pnpm/property-information@7.1.0/node_modules/property-information/lib/xlink.js","../node_modules/.pnpm/property-information@7.1.0/node_modules/property-information/lib/xmlns.js","../node_modules/.pnpm/property-information@7.1.0/node_modules/property-information/lib/xml.js","../node_modules/.pnpm/property-information@7.1.0/node_modules/property-information/lib/find.js","../node_modules/.pnpm/property-information@7.1.0/node_modules/property-information/index.js","../node_modules/.pnpm/comma-separated-tokens@2.0.3/node_modules/comma-separated-tokens/index.js","../node_modules/.pnpm/hast-util-parse-selector@4.0.0/node_modules/hast-util-parse-selector/lib/index.js","../node_modules/.pnpm/space-separated-tokens@2.0.2/node_modules/space-separated-tokens/index.js","../node_modules/.pnpm/hastscript@9.0.1/node_modules/hastscript/lib/create-h.js","../node_modules/.pnpm/hastscript@9.0.1/node_modules/hastscript/lib/svg-case-sensitive-tag-names.js","../node_modules/.pnpm/hastscript@9.0.1/node_modules/hastscript/lib/index.js","../node_modules/.pnpm/character-entities-legacy@3.0.0/node_modules/character-entities-legacy/index.js","../node_modules/.pnpm/character-reference-invalid@2.0.1/node_modules/character-reference-invalid/index.js","../node_modules/.pnpm/is-decimal@2.0.1/node_modules/is-decimal/index.js","../node_modules/.pnpm/is-hexadecimal@2.0.1/node_modules/is-hexadecimal/index.js","../node_modules/.pnpm/is-alphabetical@2.0.1/node_modules/is-alphabetical/index.js","../node_modules/.pnpm/is-alphanumerical@2.0.1/node_modules/is-alphanumerical/index.js","../node_modules/.pnpm/decode-named-character-reference@1.2.0/node_modules/decode-named-character-reference/index.dom.js","../node_modules/.pnpm/parse-entities@4.0.2/node_modules/parse-entities/lib/index.js","../node_modules/.pnpm/refractor@5.0.0/node_modules/refractor/lib/prism-core.js","../node_modules/.pnpm/refractor@5.0.0/node_modules/refractor/lib/core.js","../node_modules/.pnpm/unist-util-is@6.0.0/node_modules/unist-util-is/lib/index.js","../node_modules/.pnpm/unist-util-filter@5.0.1/node_modules/unist-util-filter/lib/index.js","../node_modules/.pnpm/unist-util-visit-parents@6.0.1/node_modules/unist-util-visit-parents/lib/color.js","../node_modules/.pnpm/unist-util-visit-parents@6.0.1/node_modules/unist-util-visit-parents/lib/index.js","../node_modules/.pnpm/react-refractor@4.0.0_react@19.0.0/node_modules/react-refractor/dist/index.js","../node_modules/.pnpm/@sanity+ui@3.0.14_@emotion+is-prop-valid@1.2.2_react-dom@19.0.0_react@19.0.0__react-is@19.1.1_h5cm4yqxoim56vupcr5nuqcdya/node_modules/@sanity/ui/dist/_chunks-es/refractor.mjs"],"sourcesContent":["/**\n * @import {Schema as SchemaType, Space} from 'property-information'\n */\n\n/** @type {SchemaType} */\nexport class Schema {\n /**\n * @param {SchemaType['property']} property\n * Property.\n * @param {SchemaType['normal']} normal\n * Normal.\n * @param {Space | undefined} [space]\n * Space.\n * @returns\n * Schema.\n */\n constructor(property, normal, space) {\n this.normal = normal\n this.property = property\n\n if (space) {\n this.space = space\n }\n }\n}\n\nSchema.prototype.normal = {}\nSchema.prototype.property = {}\nSchema.prototype.space = undefined\n","/**\n * @import {Info, Space} from 'property-information'\n */\n\nimport {Schema} from './schema.js'\n\n/**\n * @param {ReadonlyArray<Schema>} definitions\n * Definitions.\n * @param {Space | undefined} [space]\n * Space.\n * @returns {Schema}\n * Schema.\n */\nexport function merge(definitions, space) {\n /** @type {Record<string, Info>} */\n const property = {}\n /** @type {Record<string, string>} */\n const normal = {}\n\n for (const definition of definitions) {\n Object.assign(property, definition.property)\n Object.assign(normal, definition.normal)\n }\n\n return new Schema(property, normal, space)\n}\n","/**\n * Get the cleaned case insensitive form of an attribute or property.\n *\n * @param {string} value\n * An attribute-like or property-like name.\n * @returns {string}\n * Value that can be used to look up the properly cased property on a\n * `Schema`.\n */\nexport function normalize(value) {\n return value.toLowerCase()\n}\n","/**\n * @import {Info as InfoType} from 'property-information'\n */\n\n/** @type {InfoType} */\nexport class Info {\n /**\n * @param {string} property\n * Property.\n * @param {string} attribute\n * Attribute.\n * @returns\n * Info.\n */\n constructor(property, attribute) {\n this.attribute = attribute\n this.property = property\n }\n}\n\nInfo.prototype.attribute = ''\nInfo.prototype.booleanish = false\nInfo.prototype.boolean = false\nInfo.prototype.commaOrSpaceSeparated = false\nInfo.prototype.commaSeparated = false\nInfo.prototype.defined = false\nInfo.prototype.mustUseProperty = false\nInfo.prototype.number = false\nInfo.prototype.overloadedBoolean = false\nInfo.prototype.property = ''\nInfo.prototype.spaceSeparated = false\nInfo.prototype.space = undefined\n","let powers = 0\n\nexport const boolean = increment()\nexport const booleanish = increment()\nexport const overloadedBoolean = increment()\nexport const number = increment()\nexport const spaceSeparated = increment()\nexport const commaSeparated = increment()\nexport const commaOrSpaceSeparated = increment()\n\nfunction increment() {\n return 2 ** ++powers\n}\n","/**\n * @import {Space} from 'property-information'\n */\n\nimport {Info} from './info.js'\nimport * as types from './types.js'\n\nconst checks = /** @type {ReadonlyArray<keyof typeof types>} */ (\n Object.keys(types)\n)\n\nexport class DefinedInfo extends Info {\n /**\n * @constructor\n * @param {string} property\n * Property.\n * @param {string} attribute\n * Attribute.\n * @param {number | null | undefined} [mask]\n * Mask.\n * @param {Space | undefined} [space]\n * Space.\n * @returns\n * Info.\n */\n constructor(property, attribute, mask, space) {\n let index = -1\n\n super(property, attribute)\n\n mark(this, 'space', space)\n\n if (typeof mask === 'number') {\n while (++index < checks.length) {\n const check = checks[index]\n mark(this, checks[index], (mask & types[check]) === types[check])\n }\n }\n }\n}\n\nDefinedInfo.prototype.defined = true\n\n/**\n * @template {keyof DefinedInfo} Key\n * Key type.\n * @param {DefinedInfo} values\n * Info.\n * @param {Key} key\n * Key.\n * @param {DefinedInfo[Key]} value\n * Value.\n * @returns {undefined}\n * Nothing.\n */\nfunction mark(values, key, value) {\n if (value) {\n values[key] = value\n }\n}\n","/**\n * @import {Info, Space} from 'property-information'\n */\n\n/**\n * @typedef Definition\n * Definition of a schema.\n * @property {Record<string, string> | undefined} [attributes]\n * Normalzed names to special attribute case.\n * @property {ReadonlyArray<string> | undefined} [mustUseProperty]\n * Normalized names that must be set as properties.\n * @property {Record<string, number | null>} properties\n * Property names to their types.\n * @property {Space | undefined} [space]\n * Space.\n * @property {Transform} transform\n * Transform a property name.\n */\n\n/**\n * @callback Transform\n * Transform.\n * @param {Record<string, string>} attributes\n * Attributes.\n * @param {string} property\n * Property.\n * @returns {string}\n * Attribute.\n */\n\nimport {normalize} from '../normalize.js'\nimport {DefinedInfo} from './defined-info.js'\nimport {Schema} from './schema.js'\n\n/**\n * @param {Definition} definition\n * Definition.\n * @returns {Schema}\n * Schema.\n */\nexport function create(definition) {\n /** @type {Record<string, Info>} */\n const properties = {}\n /** @type {Record<string, string>} */\n const normals = {}\n\n for (const [property, value] of Object.entries(definition.properties)) {\n const info = new DefinedInfo(\n property,\n definition.transform(definition.attributes || {}, property),\n value,\n definition.space\n )\n\n if (\n definition.mustUseProperty &&\n definition.mustUseProperty.includes(property)\n ) {\n info.mustUseProperty = true\n }\n\n properties[property] = info\n\n normals[normalize(property)] = property\n normals[normalize(info.attribute)] = property\n }\n\n return new Schema(properties, normals, definition.space)\n}\n","import {create} from './util/create.js'\nimport {booleanish, number, spaceSeparated} from './util/types.js'\n\nexport const aria = create({\n properties: {\n ariaActiveDescendant: null,\n ariaAtomic: booleanish,\n ariaAutoComplete: null,\n ariaBusy: booleanish,\n ariaChecked: booleanish,\n ariaColCount: number,\n ariaColIndex: number,\n ariaColSpan: number,\n ariaControls: spaceSeparated,\n ariaCurrent: null,\n ariaDescribedBy: spaceSeparated,\n ariaDetails: null,\n ariaDisabled: booleanish,\n ariaDropEffect: spaceSeparated,\n ariaErrorMessage: null,\n ariaExpanded: booleanish,\n ariaFlowTo: spaceSeparated,\n ariaGrabbed: booleanish,\n ariaHasPopup: null,\n ariaHidden: booleanish,\n ariaInvalid: null,\n ariaKeyShortcuts: null,\n ariaLabel: null,\n ariaLabelledBy: spaceSeparated,\n ariaLevel: number,\n ariaLive: null,\n ariaModal: booleanish,\n ariaMultiLine: booleanish,\n ariaMultiSelectable: booleanish,\n ariaOrientation: null,\n ariaOwns: spaceSeparated,\n ariaPlaceholder: null,\n ariaPosInSet: number,\n ariaPressed: booleanish,\n ariaReadOnly: booleanish,\n ariaRelevant: null,\n ariaRequired: booleanish,\n ariaRoleDescription: spaceSeparated,\n ariaRowCount: number,\n ariaRowIndex: number,\n ariaRowSpan: number,\n ariaSelected: booleanish,\n ariaSetSize: number,\n ariaSort: null,\n ariaValueMax: number,\n ariaValueMin: number,\n ariaValueNow: number,\n ariaValueText: null,\n role: null\n },\n transform(_, property) {\n return property === 'role'\n ? property\n : 'aria-' + property.slice(4).toLowerCase()\n }\n})\n","/**\n * @param {Record<string, string>} attributes\n * Attributes.\n * @param {string} attribute\n * Attribute.\n * @returns {string}\n * Transformed attribute.\n */\nexport function caseSensitiveTransform(attributes, attribute) {\n return attribute in attributes ? attributes[attribute] : attribute\n}\n","import {caseSensitiveTransform} from './case-sensitive-transform.js'\n\n/**\n * @param {Record<string, string>} attributes\n * Attributes.\n * @param {string} property\n * Property.\n * @returns {string}\n * Transformed property.\n */\nexport function caseInsensitiveTransform(attributes, property) {\n return caseSensitiveTransform(attributes, property.toLowerCase())\n}\n","import {caseInsensitiveTransform} from './util/case-insensitive-transform.js'\nimport {create} from './util/create.js'\nimport {\n booleanish,\n boolean,\n commaSeparated,\n number,\n overloadedBoolean,\n spaceSeparated\n} from './util/types.js'\n\nexport const html = create({\n attributes: {\n acceptcharset: 'accept-charset',\n classname: 'class',\n htmlfor: 'for',\n httpequiv: 'http-equiv'\n },\n mustUseProperty: ['checked', 'multiple', 'muted', 'selected'],\n properties: {\n // Standard Properties.\n abbr: null,\n accept: commaSeparated,\n acceptCharset: spaceSeparated,\n accessKey: spaceSeparated,\n action: null,\n allow: null,\n allowFullScreen: boolean,\n allowPaymentRequest: boolean,\n allowUserMedia: boolean,\n alt: null,\n as: null,\n async: boolean,\n autoCapitalize: null,\n autoComplete: spaceSeparated,\n autoFocus: boolean,\n autoPlay: boolean,\n blocking: spaceSeparated,\n capture: null,\n charSet: null,\n checked: boolean,\n cite: null,\n className: spaceSeparated,\n cols: number,\n colSpan: null,\n content: null,\n contentEditable: booleanish,\n controls: boolean,\n controlsList: spaceSeparated,\n coords: number | commaSeparated,\n crossOrigin: null,\n data: null,\n dateTime: null,\n decoding: null,\n default: boolean,\n defer: boolean,\n dir: null,\n dirName: null,\n disabled: boolean,\n download: overloadedBoolean,\n draggable: booleanish,\n encType: null,\n enterKeyHint: null,\n fetchPriority: null,\n form: null,\n formAction: null,\n formEncType: null,\n formMethod: null,\n formNoValidate: boolean,\n formTarget: null,\n headers: spaceSeparated,\n height: number,\n hidden: overloadedBoolean,\n high: number,\n href: null,\n hrefLang: null,\n htmlFor: spaceSeparated,\n httpEquiv: spaceSeparated,\n id: null,\n imageSizes: null,\n imageSrcSet: null,\n inert: boolean,\n inputMode: null,\n integrity: null,\n is: null,\n isMap: boolean,\n itemId: null,\n itemProp: spaceSeparated,\n itemRef: spaceSeparated,\n itemScope: boolean,\n itemType: spaceSeparated,\n kind: null,\n label: null,\n lang: null,\n language: null,\n list: null,\n loading: null,\n loop: boolean,\n low: number,\n manifest: null,\n max: null,\n maxLength: number,\n media: null,\n method: null,\n min: null,\n minLength: number,\n multiple: boolean,\n muted: boolean,\n name: null,\n nonce: null,\n noModule: boolean,\n noValidate: boolean,\n onAbort: null,\n onAfterPrint: null,\n onAuxClick: null,\n onBeforeMatch: null,\n onBeforePrint: null,\n onBeforeToggle: null,\n onBeforeUnload: null,\n onBlur: null,\n onCancel: null,\n onCanPlay: null,\n onCanPlayThrough: null,\n onChange: null,\n onClick: null,\n onClose: null,\n onContextLost: null,\n onContextMenu: null,\n onContextRestored: null,\n onCopy: null,\n onCueChange: null,\n onCut: null,\n onDblClick: null,\n onDrag: null,\n onDragEnd: null,\n onDragEnter: null,\n onDragExit: null,\n onDragLeave: null,\n onDragOver: null,\n onDragStart: null,\n onDrop: null,\n onDurationChange: null,\n onEmptied: null,\n onEnded: null,\n onError: null,\n onFocus: null,\n onFormData: null,\n onHashChange: null,\n onInput: null,\n onInvalid: null,\n onKeyDown: null,\n onKeyPress: null,\n onKeyUp: null,\n onLanguageChange: null,\n onLoad: null,\n onLoadedData: null,\n onLoadedMetadata: null,\n onLoadEnd: null,\n onLoadStart: null,\n onMessage: null,\n onMessageError: null,\n onMouseDown: null,\n onMouseEnter: null,\n onMouseLeave: null,\n onMouseMove: null,\n onMouseOut: null,\n onMouseOver: null,\n onMouseUp: null,\n onOffline: null,\n onOnline: null,\n onPageHide: null,\n onPageShow: null,\n onPaste: null,\n onPause: null,\n onPlay: null,\n onPlaying: null,\n onPopState: null,\n onProgress: null,\n onRateChange: null,\n onRejectionHandled: null,\n onReset: null,\n onResize: null,\n onScroll: null,\n onScrollEnd: null,\n onSecurityPolicyViolation: null,\n onSeeked: null,\n onSeeking: null,\n onSelect: null,\n onSlotChange: null,\n onStalled: null,\n onStorage: null,\n onSubmit: null,\n onSuspend: null,\n onTimeUpdate: null,\n onToggle: null,\n onUnhandledRejection: null,\n onUnload: null,\n onVolumeChange: null,\n onWaiting: null,\n onWheel: null,\n open: boolean,\n optimum: number,\n pattern: null,\n ping: spaceSeparated,\n placeholder: null,\n playsInline: boolean,\n popover: null,\n popoverTarget: null,\n popoverTargetAction: null,\n poster: null,\n preload: null,\n readOnly: boolean,\n referrerPolicy: null,\n rel: spaceSeparated,\n required: boolean,\n reversed: boolean,\n rows: number,\n rowSpan: number,\n sandbox: spaceSeparated,\n scope: null,\n scoped: boolean,\n seamless: boolean,\n selected: boolean,\n shadowRootClonable: boolean,\n shadowRootDelegatesFocus: boolean,\n shadowRootMode: null,\n shape: null,\n size: number,\n sizes: null,\n slot: null,\n span: number,\n spellCheck: booleanish,\n src: null,\n srcDoc: null,\n srcLang: null,\n srcSet: null,\n start: number,\n step: null,\n style: null,\n tabIndex: number,\n target: null,\n title: null,\n translate: null,\n type: null,\n typeMustMatch: boolean,\n useMap: null,\n value: booleanish,\n width: number,\n wrap: null,\n writingSuggestions: null,\n\n // Legacy.\n // See: https://html.spec.whatwg.org/#other-elements,-attributes-and-apis\n align: null, // Several. Use CSS `text-align` instead,\n aLink: null, // `<body>`. Use CSS `a:active {color}` instead\n archive: spaceSeparated, // `<object>`. List of URIs to archives\n axis: null, // `<td>` and `<th>`. Use `scope` on `<th>`\n background: null, // `<body>`. Use CSS `background-image` instead\n bgColor: null, // `<body>` and table elements. Use CSS `background-color` instead\n border: number, // `<table>`. Use CSS `border-width` instead,\n borderColor: null, // `<table>`. Use CSS `border-color` instead,\n bottomMargin: number, // `<body>`\n cellPadding: null, // `<table>`\n cellSpacing: null, // `<table>`\n char: null, // Several table elements. When `align=char`, sets the character to align on\n charOff: null, // Several table elements. When `char`, offsets the alignment\n classId: null, // `<object>`\n clear: null, // `<br>`. Use CSS `clear` instead\n code: null, // `<object>`\n codeBase: null, // `<object>`\n codeType: null, // `<object>`\n color: null, // `<font>` and `<hr>`. Use CSS instead\n compact: boolean, // Lists. Use CSS to reduce space between items instead\n declare: boolean, // `<object>`\n event: null, // `<script>`\n face: null, // `<font>`. Use CSS instead\n frame: null, // `<table>`\n frameBorder: null, // `<iframe>`. Use CSS `border` instead\n hSpace: number, // `<img>` and `<object>`\n leftMargin: number, // `<body>`\n link: null, // `<body>`. Use CSS `a:link {color: *}` instead\n longDesc: null, // `<frame>`, `<iframe>`, and `<img>`. Use an `<a>`\n lowSrc: null, // `<img>`. Use a `<picture>`\n marginHeight: number, // `<body>`\n marginWidth: number, // `<body>`\n noResize: boolean, // `<frame>`\n noHref: boolean, // `<area>`. Use no href instead of an explicit `nohref`\n noShade: boolean, // `<hr>`. Use background-color and height instead of borders\n noWrap: boolean, // `<td>` and `<th>`\n object: null, // `<applet>`\n profile: null, // `<head>`\n prompt: null, // `<isindex>`\n rev: null, // `<link>`\n rightMargin: number, // `<body>`\n rules: null, // `<table>`\n scheme: null, // `<meta>`\n scrolling: booleanish, // `<frame>`. Use overflow in the child context\n standby: null, // `<object>`\n summary: null, // `<table>`\n text: null, // `<body>`. Use CSS `color` instead\n topMargin: number, // `<body>`\n valueType: null, // `<param>`\n version: null, // `<html>`. Use a doctype.\n vAlign: null, // Several. Use CSS `vertical-align` instead\n vLink: null, // `<body>`. Use CSS `a:visited {color}` instead\n vSpace: number, // `<img>` and `<object>`\n\n // Non-standard Properties.\n allowTransparency: null,\n autoCorrect: null,\n autoSave: null,\n disablePictureInPicture: boolean,\n disableRemotePlayback: boolean,\n prefix: null,\n property: null,\n results: number,\n security: null,\n unselectable: null\n },\n space: 'html',\n transform: caseInsensitiveTransform\n})\n","import {caseSensitiveTransform} from './util/case-sensitive-transform.js'\nimport {create} from './util/create.js'\nimport {\n boolean,\n commaOrSpaceSeparated,\n commaSeparated,\n number,\n spaceSeparated\n} from './util/types.js'\n\nexport const svg = create({\n attributes: {\n accentHeight: 'accent-height',\n alignmentBaseline: 'alignment-baseline',\n arabicForm: 'arabic-form',\n baselineShift: 'baseline-shift',\n capHeight: 'cap-height',\n className: 'class',\n clipPath: 'clip-path',\n clipRule: 'clip-rule',\n colorInterpolation: 'color-interpolation',\n colorInterpolationFilters: 'color-interpolation-filters',\n colorProfile: 'color-profile',\n colorRendering: 'color-rendering',\n crossOrigin: 'crossorigin',\n dataType: 'datatype',\n dominantBaseline: 'dominant-baseline',\n enableBackground: 'enable-background',\n fillOpacity: 'fill-opacity',\n fillRule: 'fill-rule',\n floodColor: 'flood-color',\n floodOpacity: 'flood-opacity',\n fontFamily: 'font-family',\n fontSize: 'font-size',\n fontSizeAdjust: 'font-size-adjust',\n fontStretch: 'font-stretch',\n fontStyle: 'font-style',\n fontVariant: 'font-variant',\n fontWeight: 'font-weight',\n glyphName: 'glyph-name',\n glyphOrientationHorizontal: 'glyph-orientation-horizontal',\n glyphOrientationVertical: 'glyph-orientation-vertical',\n hrefLang: 'hreflang',\n horizAdvX: 'horiz-adv-x',\n horizOriginX: 'horiz-origin-x',\n horizOriginY: 'horiz-origin-y',\n imageRendering: 'image-rendering',\n letterSpacing: 'letter-spacing',\n lightingColor: 'lighting-color',\n markerEnd: 'marker-end',\n markerMid: 'marker-mid',\n markerStart: 'marker-start',\n navDown: 'nav-down',\n navDownLeft: 'nav-down-left',\n navDownRight: 'nav-down-right',\n navLeft: 'nav-left',\n navNext: 'nav-next',\n navPrev: 'nav-prev',\n navRight: 'nav-right',\n navUp: 'nav-up',\n navUpLeft: 'nav-up-left',\n navUpRight: 'nav-up-right',\n onAbort: 'onabort',\n onActivate: 'onactivate',\n onAfterPrint: 'onafterprint',\n onBeforePrint: 'onbeforeprint',\n onBegin: 'onbegin',\n onCancel: 'oncancel',\n onCanPlay: 'oncanplay',\n onCanPlayThrough: 'oncanplaythrough',\n onChange: 'onchange',\n onClick: 'onclick',\n onClose: 'onclose',\n onCopy: 'oncopy',\n onCueChange: 'oncuechange',\n onCut: 'oncut',\n onDblClick: 'ondblclick',\n onDrag: 'ondrag',\n onDragEnd: 'ondragend',\n onDragEnter: 'ondragenter',\n onDragExit: 'ondragexit',\n onDragLeave: 'ondragleave',\n onDragOver: 'ondragover',\n onDragStart: 'ondragstart',\n onDrop: 'ondrop',\n onDurationChange: 'ondurationchange',\n onEmptied: 'onemptied',\n onEnd: 'onend',\n onEnded: 'onended',\n onError: 'onerror',\n onFocus: 'onfocus',\n onFocusIn: 'onfocusin',\n onFocusOut: 'onfocusout',\n onHashChange: 'onhashchange',\n onInput: 'oninput',\n onInvalid: 'oninvalid',\n onKeyDown: 'onkeydown',\n onKeyPress: 'onkeypress',\n onKeyUp: 'onkeyup',\n onLoad: 'onload',\n onLoadedData: 'onloadeddata',\n onLoadedMetadata: 'onloadedmetadata',\n onLoadStart: 'onloadstart',\n onMessage: 'onmessage',\n onMouseDown: 'onmousedown',\n onMouseEnter: 'onmouseenter',\n onMouseLeave: 'onmouseleave',\n onMouseMove: 'onmousemove',\n onMouseOut: 'onmouseout',\n onMouseOver: 'onmouseover',\n onMouseUp: 'onmouseup',\n onMouseWheel: 'onmousewheel',\n onOffline: 'onoffline',\n onOnline: 'ononline',\n onPageHide: 'onpagehide',\n onPageShow: 'onpageshow',\n onPaste: 'onpaste',\n onPause: 'onpause',\n onPlay: 'onplay',\n onPlaying: 'onplaying',\n onPopState: 'onpopstate',\n onProgress: 'onprogress',\n onRateChange: 'onratechange',\n onRepeat: 'onrepeat',\n onReset: 'onreset',\n onResize: 'onresize',\n onScroll: 'onscroll',\n onSeeked: 'onseeked',\n onSeeking: 'onseeking',\n onSelect: 'onselect',\n onShow: 'onshow',\n onStalled: 'onstalled',\n onStorage: 'onstorage',\n onSubmit: 'onsubmit',\n onSuspend: 'onsuspend',\n onTimeUpdate: 'ontimeupdate',\n onToggle: 'ontoggle',\n onUnload: 'onunload',\n onVolumeChange: 'onvolumechange',\n onWaiting: 'onwaiting',\n onZoom: 'onzoom',\n overlinePosition: 'overline-position',\n overlineThickness: 'overline-thickness',\n paintOrder: 'paint-order',\n panose1: 'panose-1',\n pointerEvents: 'pointer-events',\n referrerPolicy: 'referrerpolicy',\n renderingIntent: 'rendering-intent',\n shapeRendering: 'shape-rendering',\n stopColor: 'stop-color',\n stopOpacity: 'stop-opacity',\n strikethroughPosition: 'strikethrough-position',\n strikethroughThickness: 'strikethrough-thickness',\n strokeDashArray: 'stroke-dasharray',\n strokeDashOffset: 'stroke-dashoffset',\n strokeLineCap: 'stroke-linecap',\n strokeLineJoin: 'stroke-linejoin',\n strokeMiterLimit: 'stroke-miterlimit',\n strokeOpacity: 'stroke-opacity',\n strokeWidth: 'stroke-width',\n tabIndex: 'tabindex',\n textAnchor: 'text-anchor',\n textDecoration: 'text-decoration',\n textRendering: 'text-rendering',\n transformOrigin: 'transform-origin',\n typeOf: 'typeof',\n underlinePosition: 'underline-position',\n underlineThickness: 'underline-thickness',\n unicodeBidi: 'unicode-bidi',\n unicodeRange: 'unicode-range',\n unitsPerEm: 'units-per-em',\n vAlphabetic: 'v-alphabetic',\n vHanging: 'v-hanging',\n vIdeographic: 'v-ideographic',\n vMathematical: 'v-mathematical',\n vectorEffect: 'vector-effect',\n vertAdvY: 'vert-adv-y',\n vertOriginX: 'vert-origin-x',\n vertOriginY: 'vert-origin-y',\n wordSpacing: 'word-spacing',\n writingMode: 'writing-mode',\n xHeight: 'x-height',\n // These were camelcased in Tiny. Now lowercased in SVG 2\n playbackOrder: 'playbackorder',\n timelineBegin: 'timelinebegin'\n },\n properties: {\n about: commaOrSpaceSeparated,\n accentHeight: number,\n accumulate: null,\n additive: null,\n alignmentBaseline: null,\n alphabetic: number,\n amplitude: number,\n arabicForm: null,\n ascent: number,\n attributeName: null,\n attributeType: null,\n azimuth: number,\n bandwidth: null,\n baselineShift: null,\n baseFrequency: null,\n baseProfile: null,\n bbox: null,\n begin: null,\n bias: number,\n by: null,\n calcMode: null,\n capHeight: number,\n className: spaceSeparated,\n clip: null,\n clipPath: null,\n clipPathUnits: null,\n clipRule: null,\n color: null,\n colorInterpolation: null,\n colorInterpolationFilters: null,\n colorProfile: null,\n colorRendering: null,\n content: null,\n contentScriptType: null,\n contentStyleType: null,\n crossOrigin: null,\n cursor: null,\n cx: null,\n cy: null,\n d: null,\n dataType: null,\n defaultAction: null,\n descent: number,\n diffuseConstant: number,\n direction: null,\n display: null,\n dur: null,\n divisor: number,\n dominantBaseline: null,\n download: boolean,\n dx: null,\n dy: null,\n edgeMode: null,\n editable: null,\n elevation: number,\n enableBackground: null,\n end: null,\n event: null,\n exponent: number,\n externalResourcesRequired: null,\n fill: null,\n fillOpacity: number,\n fillRule: null,\n filter: null,\n filterRes: null,\n filterUnits: null,\n floodColor: null,\n floodOpacity: null,\n focusable: null,\n focusHighlight: null,\n fontFamily: null,\n fontSize: null,\n fontSizeAdjust: null,\n fontStretch: null,\n fontStyle: null,\n fontVariant: null,\n fontWeight: null,\n format: null,\n fr: null,\n from: null,\n fx: null,\n fy: null,\n g1: commaSeparated,\n g2: commaSeparated,\n glyphName: commaSeparated,\n glyphOrientationHorizontal: null,\n glyphOrientationVertical: null,\n glyphRef: null,\n gradientTransform: null,\n gradientUnits: null,\n handler: null,\n hanging: number,\n hatchContentUnits: null,\n hatchUnits: null,\n height: null,\n href: null,\n hrefLang: null,\n horizAdvX: number,\n horizOriginX: number,\n horizOriginY: number,\n id: null,\n ideographic: number,\n imageRendering: null,\n initialVisibility: null,\n in: null,\n in2: null,\n intercept: number,\n k: number,\n k1: number,\n k2: number,\n k3: number,\n k4: number,\n kernelMatrix: commaOrSpaceSeparated,\n kernelUnitLength: null,\n keyPoints: null, // SEMI_COLON_SEPARATED\n keySplines: null, // SEMI_COLON_SEPARATED\n keyTimes: null, // SEMI_COLON_SEPARATED\n kerning: null,\n lang: null,\n lengthAdjust: null,\n letterSpacing: null,\n lightingColor: null,\n limitingConeAngle: number,\n local: null,\n markerEnd: null,\n markerMid: null,\n markerStart: null,\n markerHeight: null,\n markerUnits: null,\n markerWidth: null,\n mask: null,\n maskContentUnits: null,\n maskUnits: null,\n mathematical: null,\n max: null,\n media: null,\n mediaCharacterEncoding: null,\n mediaContentEncodings: null,\n mediaSize: number,\n mediaTime: null,\n method: null,\n min: null,\n mode: null,\n name: null,\n navDown: null,\n navDownLeft: null,\n navDownRight: null,\n navLeft: null,\n navNext: null,\n navPrev: null,\n navRight: null,\n navUp: null,\n navUpLeft: null,\n navUpRight: null,\n numOctaves: null,\n observer: null,\n offset: null,\n onAbort: null,\n onActivate: null,\n onAfterPrint: null,\n onBeforePrint: null,\n onBegin: null,\n onCancel: null,\n onCanPlay: null,\n onCanPlayThrough: null,\n onChange: null,\n onClick: null,\n onClose: null,\n onCopy: null,\n onCueChange: null,\n onCut: null,\n onDblClick: null,\n onDrag: null,\n onDragEnd: null,\n onDragEnter: null,\n onDragExit: null,\n onDragLeave: null,\n onDragOver: null,\n onDragStart: null,\n onDrop: null,\n onDurationChange: null,\n onEmptied: null,\n onEnd: null,\n onEnded: null,\n onError: null,\n onFocus: null,\n onFocusIn: null,\n onFocusOut: null,\n onHashChange: null,\n onInput: null,\n onInvalid: null,\n onKeyDown: null,\n onKeyPress: null,\n onKeyUp: null,\n onLoad: null,\n onLoadedData: null,\n onLoadedMetadata: null,\n onLoadStart: null,\n onMessage: null,\n onMouseDown: null,\n onMouseEnter: null,\n onMouseLeave: null,\n onMouseMove: null,\n onMouseOut: null,\n onMouseOver: null,\n onMouseUp: null,\n onMouseWheel: null,\n onOffline: null,\n onOnline: null,\n onPageHide: null,\n onPageShow: null,\n onPaste: null,\n onPause: null,\n onPlay: null,\n onPlaying: null,\n onPopState: null,\n onProgress: null,\n onRateChange: null,\n onRepeat: null,\n onReset: null,\n onResize: null,\n onScroll: null,\n onSeeked: null,\n onSeeking: null,\n onSelect: null,\n onShow: null,\n onStalled: null,\n onStorage: null,\n onSubmit: null,\n onSuspend: null,\n onTimeUpdate: null,\n onToggle: null,\n onUnload: null,\n onVolumeChange: null,\n onWaiting: null,\n onZoom: null,\n opacity: null,\n operator: null,\n order: null,\n orient: null,\n orientation: null,\n origin: null,\n overflow: null,\n overlay: null,\n overlinePosition: number,\n overlineThickness: number,\n paintOrder: null,\n panose1: null,\n path: null,\n pathLength: number,\n patternContentUnits: null,\n patternTransform: null,\n patternUnits: null,\n phase: null,\n ping: spaceSeparated,\n pitch: null,\n playbackOrder: null,\n pointerEvents: null,\n points: null,\n pointsAtX: number,\n pointsAtY: number,\n pointsAtZ: number,\n preserveAlpha: null,\n preserveAspectRatio: null,\n primitiveUnits: null,\n propagate: null,\n property: commaOrSpaceSeparated,\n r: null,\n radius: null,\n referrerPolicy: null,\n refX: null,\n refY: null,\n rel: commaOrSpaceSeparated,\n rev: commaOrSpaceSeparated,\n renderingIntent: null,\n repeatCount: null,\n repeatDur: null,\n requiredExtensions: commaOrSpaceSeparated,\n requiredFeatures: commaOrSpaceSeparated,\n requiredFonts: commaOrSpaceSeparated,\n requiredFormats: commaOrSpaceSeparated,\n resource: null,\n restart: null,\n result: null,\n rotate: null,\n rx: null,\n ry: null,\n scale: null,\n seed: null,\n shapeRendering: null,\n side: null,\n slope: null,\n snapshotTime: null,\n specularConstant: number,\n specularExponent: number,\n spreadMethod: null,\n spacing: null,\n startOffset: null,\n stdDeviation: null,\n stemh: null,\n stemv: null,\n stitchTiles: null,\n stopColor: null,\n stopOpacity: null,\n strikethroughPosition: number,\n strikethroughThickness: number,\n string: null,\n stroke: null,\n strokeDashArray: commaOrSpaceSeparated,\n strokeDashOffset: null,\n strokeLineCap: null,\n strokeLineJoin: null,\n strokeMiterLimit: number,\n strokeOpacity: number,\n strokeWidth: null,\n style: null,\n surfaceScale: number,\n syncBehavior: null,\n syncBehaviorDefault: null,\n syncMaster: null,\n syncTolerance: null,\n syncToleranceDefault: null,\n systemLanguage: commaOrSpaceSeparated,\n tabIndex: number,\n tableValues: null,\n target: null,\n targetX: number,\n targetY: number,\n textAnchor: null,\n textDecoration: null,\n textRendering: null,\n textLength: null,\n timelineBegin: null,\n title: null,\n transformBehavior: null,\n type: null,\n typeOf: commaOrSpaceSeparated,\n to: null,\n transform: null,\n transformOrigin: null,\n u1: null,\n u2: null,\n underlinePosition: number,\n underlineThickness: number,\n unicode: null,\n unicodeBidi: null,\n unicodeRange: null,\n unitsPerEm: number,\n values: null,\n vAlphabetic: number,\n vMathematical: number,\n vectorEffect: null,\n vHanging: number,\n vIdeographic: number,\n version: null,\n vertAdvY: number,\n vertOriginX: number,\n vertOriginY: number,\n viewBox: null,\n viewTarget: null,\n visibility: null,\n width: null,\n widths: null,\n wordSpacing: null,\n writingMode: null,\n x: null,\n x1: null,\n x2: null,\n xChannelSelector: null,\n xHeight: number,\n y: null,\n y1: null,\n y2: null,\n yChannelSelector: null,\n z: null,\n zoomAndPan: null\n },\n space: 'svg',\n transform: caseSensitiveTransform\n})\n","import {create} from './util/create.js'\n\nexport const xlink = create({\n properties: {\n xLinkActuate: null,\n xLinkArcRole: null,\n xLinkHref: null,\n xLinkRole: null,\n xLinkShow: null,\n xLinkTitle: null,\n xLinkType: null\n },\n space: 'xlink',\n transform(_, property) {\n return 'xlink:' + property.slice(5).toLowerCase()\n }\n})\n","import {create} from './util/create.js'\nimport {caseInsensitiveTransform} from './util/case-insensitive-transform.js'\n\nexport const xmlns = create({\n attributes: {xmlnsxlink: 'xmlns:xlink'},\n properties: {xmlnsXLink: null, xmlns: null},\n space: 'xmlns',\n transform: caseInsensitiveTransform\n})\n","import {create} from './util/create.js'\n\nexport const xml = create({\n properties: {xmlBase: null, xmlLang: null, xmlSpace: null},\n space: 'xml',\n transform(_, property) {\n return 'xml:' + property.slice(3).toLowerCase()\n }\n})\n","/**\n * @import {Schema} from 'property-information'\n */\n\nimport {DefinedInfo} from './util/defined-info.js'\nimport {Info} from './util/info.js'\nimport {normalize} from './normalize.js'\n\nconst cap = /[A-Z]/g\nconst dash = /-[a-z]/g\nconst valid = /^data[-\\w.:]+$/i\n\n/**\n * Look up info on a property.\n *\n * In most cases the given `schema` contains info on the property.\n * All standard,\n * most legacy,\n * and some non-standard properties are supported.\n * For these cases,\n * the returned `Info` has hints about the value of the property.\n *\n * `name` can also be a valid data attribute or property,\n * in which case an `Info` object with the correctly cased `attribute` and\n * `property` is returned.\n *\n * `name` can be an unknown attribute,\n * in which case an `Info` object with `attribute` and `property` set to the\n * given name is returned.\n * It is not recommended to provide unsupported legacy or recently specced\n * properties.\n *\n *\n * @param {Schema} schema\n * Schema;\n * either the `html` or `svg` export.\n * @param {string} value\n * An attribute-like or property-like name;\n * it will be passed through `normalize` to hopefully find the correct info.\n * @returns {Info}\n * Info.\n */\nexport function find(schema, value) {\n const normal = normalize(value)\n let property = value\n let Type = Info\n\n if (normal in schema.normal) {\n return schema.property[schema.normal[normal]]\n }\n\n if (normal.length > 4 && normal.slice(0, 4) === 'data' && valid.test(value)) {\n // Attribute or property.\n if (value.charAt(4) === '-') {\n // Turn it into a property.\n const rest = value.slice(5).replace(dash, camelcase)\n property = 'data' + rest.charAt(0).toUpperCase() + rest.slice(1)\n } else {\n // Turn it into an attribute.\n const rest = value.slice(4)\n\n if (!dash.test(rest)) {\n let dashes = rest.replace(cap, kebab)\n\n if (dashes.charAt(0) !== '-') {\n dashes = '-' + dashes\n }\n\n value = 'data' + dashes\n }\n }\n\n Type = DefinedInfo\n }\n\n return new Type(property, value)\n}\n\n/**\n * @param {string} $0\n * Value.\n * @returns {string}\n * Kebab.\n */\nfunction kebab($0) {\n return '-' + $0.toLowerCase()\n}\n\n/**\n * @param {string} $0\n * Value.\n * @returns {string}\n * Camel.\n */\nfunction camelcase($0) {\n return $0.charAt(1).toUpperCase()\n}\n","// Note: types exposed from `index.d.ts`.\nimport {merge} from './lib/util/merge.js'\nimport {aria} from './lib/aria.js'\nimport {html as htmlBase} from './lib/html.js'\nimport {svg as svgBase} from './lib/svg.js'\nimport {xlink} from './lib/xlink.js'\nimport {xmlns} from './lib/xmlns.js'\nimport {xml} from './lib/xml.js'\n\nexport {hastToReact} from './lib/hast-to-react.js'\n\nexport const html = merge([aria, htmlBase, xlink, xmlns, xml], 'html')\n\nexport {find} from './lib/find.js'\nexport {normalize} from './lib/normalize.js'\n\nexport const svg = merge([aria, svgBase, xlink, xmlns, xml], 'svg')\n","/**\n * @typedef Options\n * Configuration for `stringify`.\n * @property {boolean} [padLeft=true]\n * Whether to pad a space before a token.\n * @property {boolean} [padRight=false]\n * Whether to pad a space after a token.\n */\n\n/**\n * @typedef {Options} StringifyOptions\n * Please use `StringifyOptions` instead.\n */\n\n/**\n * Parse comma-separated tokens to an array.\n *\n * @param {string} value\n * Comma-separated tokens.\n * @returns {Array<string>}\n * List of tokens.\n */\nexport function parse(value) {\n /** @type {Array<string>} */\n const tokens = []\n const input = String(value || '')\n let index = input.indexOf(',')\n let start = 0\n /** @type {boolean} */\n let end = false\n\n while (!end) {\n if (index === -1) {\n index = input.length\n end = true\n }\n\n const token = input.slice(start, index).trim()\n\n if (token || !end) {\n tokens.push(token)\n }\n\n start = index + 1\n index = input.indexOf(',', start)\n }\n\n return tokens\n}\n\n/**\n * Serialize an array of strings or numbers to comma-separated tokens.\n *\n * @param {Array<string|number>} values\n * List of tokens.\n * @param {Options} [options]\n * Configuration for `stringify` (optional).\n * @returns {string}\n * Comma-separated tokens.\n */\nexport function stringify(values, options) {\n const settings = options || {}\n\n // Ensure the last empty entry is seen.\n const input = values[values.length - 1] === '' ? [...values, ''] : values\n\n return input\n .join(\n (settings.padRight ? ' ' : '') +\n ',' +\n (settings.padLeft === false ? '' : ' ')\n )\n .trim()\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Properties} Properties\n */\n\n/**\n * @template {string} SimpleSelector\n * Selector type.\n * @template {string} DefaultTagName\n * Default tag name.\n * @typedef {(\n * SimpleSelector extends ''\n * ? DefaultTagName\n * : SimpleSelector extends `${infer TagName}.${infer Rest}`\n * ? ExtractTagName<TagName, DefaultTagName>\n * : SimpleSelector extends `${infer TagName}#${infer Rest}`\n * ? ExtractTagName<TagName, DefaultTagName>\n * : SimpleSelector extends string\n * ? SimpleSelector\n * : DefaultTagName\n * )} ExtractTagName\n * Extract tag name from a simple selector.\n */\n\nconst search = /[#.]/g\n\n/**\n * Create a hast element from a simple CSS selector.\n *\n * @template {string} Selector\n * Type of selector.\n * @template {string} [DefaultTagName='div']\n * Type of default tag name (default: `'div'`).\n * @param {Selector | null | undefined} [selector]\n * Simple CSS selector (optional).\n *\n * Can contain a tag name (`foo`), classes (`.bar`), and an ID (`#baz`).\n * Multiple classes are allowed.\n * Uses the last ID if multiple IDs are found.\n * @param {DefaultTagName | null | undefined} [defaultTagName='div']\n * Tag name to use if `selector` does not specify one (default: `'div'`).\n * @returns {Element & {tagName: ExtractTagName<Selector, DefaultTagName>}}\n * Built element.\n */\nexport function parseSelector(selector, defaultTagName) {\n const value = selector || ''\n /** @type {Properties} */\n const props = {}\n let start = 0\n /** @type {string | undefined} */\n let previous\n /** @type {string | undefined} */\n let tagName\n\n while (start < value.length) {\n search.lastIndex = start\n const match = search.exec(value)\n const subvalue = value.slice(start, match ? match.index : value.length)\n\n if (subvalue) {\n if (!previous) {\n tagName = subvalue\n } else if (previous === '#') {\n props.id = subvalue\n } else if (Array.isArray(props.className)) {\n props.className.push(subvalue)\n } else {\n props.className = [subvalue]\n }\n\n start += subvalue.length\n }\n\n if (match) {\n previous = match[0]\n start++\n }\n }\n\n return {\n type: 'element',\n // @ts-expect-error: tag name is parsed.\n tagName: tagName || defaultTagName || 'div',\n properties: props,\n children: []\n }\n}\n","/**\n * Parse space-separated tokens to an array of strings.\n *\n * @param {string} value\n * Space-separated tokens.\n * @returns {Array<string>}\n * List of tokens.\n */\nexport function parse(value) {\n const input = String(value || '').trim()\n return input ? input.split(/[ \\t\\n\\r\\f]+/g) : []\n}\n\n/**\n * Serialize an array of strings as space separated-tokens.\n *\n * @param {Array<string|number>} values\n * List of tokens.\n * @returns {string}\n * Space-separated tokens.\n */\nexport function stringify(values) {\n return values.join(' ').trim()\n}\n","/**\n * @import {Element, Nodes, RootContent, Root} from 'hast'\n * @import {Info, Schema} from 'property-information'\n */\n\n/**\n * @typedef {Array<Nodes | PrimitiveChild>} ArrayChildNested\n * List of children (deep).\n */\n\n/**\n * @typedef {Array<ArrayChildNested | Nodes | PrimitiveChild>} ArrayChild\n * List of children.\n */\n\n/**\n * @typedef {Array<number | string>} ArrayValue\n * List of property values for space- or comma separated values (such as `className`).\n */\n\n/**\n * @typedef {ArrayChild | Nodes | PrimitiveChild} Child\n * Acceptable child value.\n */\n\n/**\n * @typedef {number | string | null | undefined} PrimitiveChild\n * Primitive children, either ignored (nullish), or turned into text nodes.\n */\n\n/**\n * @typedef {boolean | number | string | null | undefined} PrimitiveValue\n * Primitive property value.\n */\n\n/**\n * @typedef {Record<string, PropertyValue | Style>} Properties\n * Acceptable value for element properties.\n */\n\n/**\n * @typedef {ArrayValue | PrimitiveValue} PropertyValue\n * Primitive value or list value.\n */\n\n/**\n * @typedef {Element | Root} Result\n * Result from a `h` (or `s`) call.\n */\n\n/**\n * @typedef {number | string} StyleValue\n * Value for a CSS style field.\n */\n\n/**\n * @typedef {Record<string, StyleValue>} Style\n * Supported value of a `style` prop.\n */\n\nimport {parse as parseCommas} from 'comma-separated-tokens'\nimport {parseSelector} from 'hast-util-parse-selector'\nimport {find, normalize} from 'property-information'\nimport {parse as parseSpaces} from 'space-separated-tokens'\n\n/**\n * @param {Schema} schema\n * Schema to use.\n * @param {string} defaultTagName\n * Default tag name.\n * @param {ReadonlyArray<string> | undefined} [caseSensitive]\n * Case-sensitive tag names (default: `undefined`).\n * @returns\n * `h`.\n */\nexport function createH(schema, defaultTagName, caseSensitive) {\n const adjust = caseSensitive ? createAdjustMap(caseSensitive) : undefined\n\n /**\n * Hyperscript compatible DSL for creating virtual hast trees.\n *\n * @overload\n * @param {null | undefined} [selector]\n * @param {...Child} children\n * @returns {Root}\n *\n * @overload\n * @param {string} selector\n * @param {Properties} properties\n * @param {...Child} children\n * @returns {Element}\n *\n * @overload\n * @param {string} selector\n * @param {...Child} children\n * @returns {Element}\n *\n * @param {string | null | undefined} [selector]\n * Selector.\n * @param {Child | Properties | null | undefined} [properties]\n * Properties (or first child) (default: `undefined`).\n * @param {...Child} children\n * Children.\n * @returns {Result}\n * Result.\n */\n function h(selector, properties, ...children) {\n /** @type {Result} */\n let node\n\n if (selector === null || selector === undefined) {\n node = {type: 'root', children: []}\n // Properties are not supported for roots.\n const child = /** @type {Child} */ (properties)\n children.unshift(child)\n } else {\n node = parseSelector(selector, defaultTagName)\n // Normalize the name.\n const lower = node.tagName.toLowerCase()\n const adjusted = adjust ? adjust.get(lower) : undefined\n node.tagName = adjusted || lower\n\n // Handle properties.\n if (isChild(properties)) {\n children.unshift(properties)\n } else {\n for (const [key, value] of Object.entries(properties)) {\n addProperty(schema, node.properties, key, value)\n }\n }\n }\n\n // Handle children.\n for (const child of children) {\n addChild(node.children, child)\n }\n\n if (node.type === 'element' && node.tagName === 'template') {\n node.content = {type: 'root', children: node.children}\n node.children = []\n }\n\n return node\n }\n\n return h\n}\n\n/**\n * Check if something is properties or a child.\n *\n * @param {Child | Properties} value\n * Value to check.\n * @returns {value is Child}\n * Whether `value` is definitely a child.\n */\nfunction isChild(value) {\n // Never properties if not an object.\n if (value === null || typeof value !== 'object' || Array.isArray(value)) {\n return true\n }\n\n // Never node without `type`; that’s the main discriminator.\n if (typeof value.type !== 'string') return false\n\n // Slower check: never property value if object or array with\n // non-number/strings.\n const record = /** @type {Record<string, unknown>} */ (value)\n const keys = Object.keys(value)\n\n for (const key of keys) {\n const value = record[key]\n\n if (value && typeof value === 'object') {\n if (!Array.isArray(value)) return true\n\n const list = /** @type {ReadonlyArray<unknown>} */ (value)\n\n for (const item of list) {\n if (typeof item !== 'number' && typeof item !== 'string') {\n return true\n }\n }\n }\n }\n\n // Also see empty `children` as a node.\n if ('children' in value && Array.isArray(value.children)) {\n return true\n }\n\n // Default to properties, someone can always pass an empty