{
  "version": 3,
  "sources": ["../src/serialize.ts"],
  "sourcesContent": ["/**\n * Parts of this source were derived and modified from fast-react-render,\n * released under the MIT license.\n *\n * https://github.com/alt-j/fast-react-render\n *\n * Copyright (c) 2016 Andrey Morozov\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * External dependencies\n */\nimport { isPlainObject } from 'is-plain-object';\nimport { paramCase as kebabCase } from 'change-case';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tescapeHTML,\n\tescapeAttribute,\n\tisValidAttributeName,\n} from '@wordpress/escape-html';\n\n/**\n * Internal dependencies\n */\nimport { createContext, Fragment, StrictMode, forwardRef } from './react';\nimport RawHTML from './raw-html';\n\n/** @typedef {React.ReactElement} ReactElement */\n\nconst Context = createContext( undefined );\nContext.displayName = 'ElementContext';\n\ninterface ComponentInstance {\n\trender: () => React.ReactNode;\n\tgetChildContext?: () => Record< string, any >;\n}\n\ninterface RawHTMLProps {\n\tchildren: string;\n\t[ key: string ]: any;\n}\n\ninterface StyleObject {\n\t[ property: string ]: string | number | null | undefined;\n}\n\ninterface HTMLProps {\n\tdangerouslySetInnerHTML?: {\n\t\t__html: string;\n\t};\n\tchildren?: React.ReactNode;\n\tvalue?: React.ReactNode;\n\tstyle?: StyleObject | string;\n\tclassName?: string;\n\thtmlFor?: string;\n\t[ key: string ]: any;\n}\n\nconst { Provider, Consumer } = Context;\n\nconst ForwardRef = forwardRef( () => {\n\treturn null;\n} );\n\n/**\n * Valid attribute types.\n */\nconst ATTRIBUTES_TYPES = new Set< string >( [ 'string', 'boolean', 'number' ] );\n\n/**\n * Element tags which can be self-closing.\n */\nconst SELF_CLOSING_TAGS = new Set< string >( [\n\t'area',\n\t'base',\n\t'br',\n\t'col',\n\t'command',\n\t'embed',\n\t'hr',\n\t'img',\n\t'input',\n\t'keygen',\n\t'link',\n\t'meta',\n\t'param',\n\t'source',\n\t'track',\n\t'wbr',\n] );\n\n/**\n * Boolean attributes are attributes whose presence as being assigned is\n * meaningful, even if only empty.\n *\n * See: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#boolean-attributes\n * Extracted from: https://html.spec.whatwg.org/multipage/indices.html#attributes-3\n *\n * Object.keys( [ ...document.querySelectorAll( '#attributes-1 > tbody > tr' ) ]\n *     .filter( ( tr ) => tr.lastChild.textContent.indexOf( 'Boolean attribute' ) !== -1 )\n *     .reduce( ( result, tr ) => Object.assign( result, {\n *         [ tr.firstChild.textContent.trim() ]: true\n *     } ), {} ) ).sort();\n */\nconst BOOLEAN_ATTRIBUTES = new Set< string >( [\n\t'allowfullscreen',\n\t'allowpaymentrequest',\n\t'allowusermedia',\n\t'async',\n\t'autofocus',\n\t'autoplay',\n\t'checked',\n\t'controls',\n\t'default',\n\t'defer',\n\t'disabled',\n\t'download',\n\t'formnovalidate',\n\t'hidden',\n\t'ismap',\n\t'itemscope',\n\t'loop',\n\t'multiple',\n\t'muted',\n\t'nomodule',\n\t'novalidate',\n\t'open',\n\t'playsinline',\n\t'readonly',\n\t'required',\n\t'reversed',\n\t'selected',\n\t'typemustmatch',\n] );\n\n/**\n * Enumerated attributes are attributes which must be of a specific value form.\n * Like boolean attributes, these are meaningful if specified, even if not of a\n * valid enumerated value.\n *\n * See: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#enumerated-attribute\n * Extracted from: https://html.spec.whatwg.org/multipage/indices.html#attributes-3\n *\n * Object.keys( [ ...document.querySelectorAll( '#attributes-1 > tbody > tr' ) ]\n *     .filter( ( tr ) => /^(\"(.+?)\";?\\s*)+/.test( tr.lastChild.textContent.trim() ) )\n *     .reduce( ( result, tr ) => Object.assign( result, {\n *         [ tr.firstChild.textContent.trim() ]: true\n *     } ), {} ) ).sort();\n *\n * Some notable omissions:\n *\n *  - `alt`: https://blog.whatwg.org/omit-alt\n */\nconst ENUMERATED_ATTRIBUTES = new Set< string >( [\n\t'autocapitalize',\n\t'autocomplete',\n\t'charset',\n\t'contenteditable',\n\t'crossorigin',\n\t'decoding',\n\t'dir',\n\t'draggable',\n\t'enctype',\n\t'formenctype',\n\t'formmethod',\n\t'http-equiv',\n\t'inputmode',\n\t'kind',\n\t'method',\n\t'preload',\n\t'scope',\n\t'shape',\n\t'spellcheck',\n\t'translate',\n\t'type',\n\t'wrap',\n] );\n\n/**\n * Set of CSS style properties which support assignment of unitless numbers.\n * Used in rendering of style properties, where `px` unit is assumed unless\n * property is included in this set or value is zero.\n *\n * Generated via:\n *\n * Object.entries( document.createElement( 'div' ).style )\n *     .filter( ( [ key ] ) => (\n *         ! /^(webkit|ms|moz)/.test( key ) &&\n *         ( e.style[ key ] = 10 ) &&\n *         e.style[ key ] === '10'\n *     ) )\n *     .map( ( [ key ] ) => key )\n *     .sort();\n */\nconst CSS_PROPERTIES_SUPPORTS_UNITLESS = new Set< string >( [\n\t'animation',\n\t'animationIterationCount',\n\t'baselineShift',\n\t'borderImageOutset',\n\t'borderImageSlice',\n\t'borderImageWidth',\n\t'columnCount',\n\t'cx',\n\t'cy',\n\t'fillOpacity',\n\t'flexGrow',\n\t'flexShrink',\n\t'floodOpacity',\n\t'fontWeight',\n\t'gridColumnEnd',\n\t'gridColumnStart',\n\t'gridRowEnd',\n\t'gridRowStart',\n\t'lineHeight',\n\t'opacity',\n\t'order',\n\t'orphans',\n\t'r',\n\t'rx',\n\t'ry',\n\t'shapeImageThreshold',\n\t'stopOpacity',\n\t'strokeDasharray',\n\t'strokeDashoffset',\n\t'strokeMiterlimit',\n\t'strokeOpacity',\n\t'strokeWidth',\n\t'tabSize',\n\t'widows',\n\t'x',\n\t'y',\n\t'zIndex',\n\t'zoom',\n] );\n\n/**\n * Returns true if the specified string is prefixed by one of an array of\n * possible prefixes.\n * @param string\n * @param prefixes\n */\nexport function hasPrefix( string: string, prefixes: string[] ): boolean {\n\treturn prefixes.some( ( prefix ) => string.indexOf( prefix ) === 0 );\n}\n\n/**\n * Returns true if the given prop name should be ignored in attributes\n * serialization, or false otherwise.\n * @param attribute\n */\nfunction isInternalAttribute( attribute: string ): boolean {\n\treturn 'key' === attribute || 'children' === attribute;\n}\n\n/**\n * Returns the normal form of the element's attribute value for HTML.\n * @param attribute\n * @param value\n */\nfunction getNormalAttributeValue( attribute: string, value: any ): any {\n\tswitch ( attribute ) {\n\t\tcase 'style':\n\t\t\treturn renderStyle( value );\n\t}\n\n\treturn value;\n}\n\n/**\n * This is a map of all SVG attributes that have dashes. Map(lower case prop => dashed lower case attribute).\n * We need this to render e.g strokeWidth as stroke-width.\n *\n * List from: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute.\n */\nconst SVG_ATTRIBUTE_WITH_DASHES_LIST: Record< string, string > = [\n\t'accentHeight',\n\t'alignmentBaseline',\n\t'arabicForm',\n\t'baselineShift',\n\t'capHeight',\n\t'clipPath',\n\t'clipRule',\n\t'colorInterpolation',\n\t'colorInterpolationFilters',\n\t'colorProfile',\n\t'colorRendering',\n\t'dominantBaseline',\n\t'enableBackground',\n\t'fillOpacity',\n\t'fillRule',\n\t'floodColor',\n\t'floodOpacity',\n\t'fontFamily',\n\t'fontSize',\n\t'fontSizeAdjust',\n\t'fontStretch',\n\t'fontStyle',\n\t'fontVariant',\n\t'fontWeight',\n\t'glyphName',\n\t'glyphOrientationHorizontal',\n\t'glyphOrientationVertical',\n\t'horizAdvX',\n\t'horizOriginX',\n\t'imageRendering',\n\t'letterSpacing',\n\t'lightingColor',\n\t'markerEnd',\n\t'markerMid',\n\t'markerStart',\n\t'overlinePosition',\n\t'overlineThickness',\n\t'paintOrder',\n\t'panose1',\n\t'pointerEvents',\n\t'renderingIntent',\n\t'shapeRendering',\n\t'stopColor',\n\t'stopOpacity',\n\t'strikethroughPosition',\n\t'strikethroughThickness',\n\t'strokeDasharray',\n\t'strokeDashoffset',\n\t'strokeLinecap',\n\t'strokeLinejoin',\n\t'strokeMiterlimit',\n\t'strokeOpacity',\n\t'strokeWidth',\n\t'textAnchor',\n\t'textDecoration',\n\t'textRendering',\n\t'underlinePosition',\n\t'underlineThickness',\n\t'unicodeBidi',\n\t'unicodeRange',\n\t'unitsPerEm',\n\t'vAlphabetic',\n\t'vHanging',\n\t'vIdeographic',\n\t'vMathematical',\n\t'vectorEffect',\n\t'vertAdvY',\n\t'vertOriginX',\n\t'vertOriginY',\n\t'wordSpacing',\n\t'writingMode',\n\t'xmlnsXlink',\n\t'xHeight',\n].reduce(\n\t( map, attribute ) => {\n\t\t// The keys are lower-cased for more robust lookup.\n\t\tmap[ attribute.toLowerCase() ] = attribute;\n\t\treturn map;\n\t},\n\t{} as Record< string, string >\n);\n\n/**\n * This is a map of all case-sensitive SVG attributes. Map(lowercase key => proper case attribute).\n * The keys are lower-cased for more robust lookup.\n * Note that this list only contains attributes that contain at least one capital letter.\n * Lowercase attributes don't need mapping, since we lowercase all attributes by default.\n */\nconst CASE_SENSITIVE_SVG_ATTRIBUTES: Record< string, string > = [\n\t'allowReorder',\n\t'attributeName',\n\t'attributeType',\n\t'autoReverse',\n\t'baseFrequency',\n\t'baseProfile',\n\t'calcMode',\n\t'clipPathUnits',\n\t'contentScriptType',\n\t'contentStyleType',\n\t'diffuseConstant',\n\t'edgeMode',\n\t'externalResourcesRequired',\n\t'filterRes',\n\t'filterUnits',\n\t'glyphRef',\n\t'gradientTransform',\n\t'gradientUnits',\n\t'kernelMatrix',\n\t'kernelUnitLength',\n\t'keyPoints',\n\t'keySplines',\n\t'keyTimes',\n\t'lengthAdjust',\n\t'limitingConeAngle',\n\t'markerHeight',\n\t'markerUnits',\n\t'markerWidth',\n\t'maskContentUnits',\n\t'maskUnits',\n\t'numOctaves',\n\t'pathLength',\n\t'patternContentUnits',\n\t'patternTransform',\n\t'patternUnits',\n\t'pointsAtX',\n\t'pointsAtY',\n\t'pointsAtZ',\n\t'preserveAlpha',\n\t'preserveAspectRatio',\n\t'primitiveUnits',\n\t'refX',\n\t'refY',\n\t'repeatCount',\n\t'repeatDur',\n\t'requiredExtensions',\n\t'requiredFeatures',\n\t'specularConstant',\n\t'specularExponent',\n\t'spreadMethod',\n\t'startOffset',\n\t'stdDeviation',\n\t'stitchTiles',\n\t'suppressContentEditableWarning',\n\t'suppressHydrationWarning',\n\t'surfaceScale',\n\t'systemLanguage',\n\t'tableValues',\n\t'targetX',\n\t'targetY',\n\t'textLength',\n\t'viewBox',\n\t'viewTarget',\n\t'xChannelSelector',\n\t'yChannelSelector',\n].reduce(\n\t( map, attribute ) => {\n\t\t// The keys are lower-cased for more robust lookup.\n\t\tmap[ attribute.toLowerCase() ] = attribute;\n\t\treturn map;\n\t},\n\t{} as Record< string, string >\n);\n\n/**\n * This is a map of all SVG attributes that have colons.\n * Keys are lower-cased and stripped of their colons for more robust lookup.\n */\nconst SVG_ATTRIBUTES_WITH_COLONS: Record< string, string > = [\n\t'xlink:actuate',\n\t'xlink:arcrole',\n\t'xlink:href',\n\t'xlink:role',\n\t'xlink:show',\n\t'xlink:title',\n\t'xlink:type',\n\t'xml:base',\n\t'xml:lang',\n\t'xml:space',\n\t'xmlns:xlink',\n].reduce(\n\t( map, attribute ) => {\n\t\tmap[ attribute.replace( ':', '' ).toLowerCase() ] = attribute;\n\t\treturn map;\n\t},\n\t{} as Record< string, string >\n);\n\n/**\n * Returns the normal form of the element's attribute name for HTML.\n * @param attribute\n */\nfunction getNormalAttributeName( attribute: string ): string {\n\tswitch ( attribute ) {\n\t\tcase 'htmlFor':\n\t\t\treturn 'for';\n\n\t\tcase 'className':\n\t\t\treturn 'class';\n\t}\n\tconst attributeLowerCase = attribute.toLowerCase();\n\n\tif ( CASE_SENSITIVE_SVG_ATTRIBUTES[ attributeLowerCase ] ) {\n\t\treturn CASE_SENSITIVE_SVG_ATTRIBUTES[ attributeLowerCase ];\n\t} else if ( SVG_ATTRIBUTE_WITH_DASHES_LIST[ attributeLowerCase ] ) {\n\t\treturn kebabCase(\n\t\t\tSVG_ATTRIBUTE_WITH_DASHES_LIST[ attributeLowerCase ]\n\t\t);\n\t} else if ( SVG_ATTRIBUTES_WITH_COLONS[ attributeLowerCase ] ) {\n\t\treturn SVG_ATTRIBUTES_WITH_COLONS[ attributeLowerCase ];\n\t}\n\n\treturn attributeLowerCase;\n}\n\n/**\n * Returns the normal form of the style property name for HTML.\n *\n * - Converts property names to kebab-case, e.g. 'backgroundColor' \u2192 'background-color'\n * - Leaves custom attributes alone, e.g. '--myBackgroundColor' \u2192 '--myBackgroundColor'\n * - Converts vendor-prefixed property names to -kebab-case, e.g. 'MozTransform' \u2192 '-moz-transform'\n * @param property\n */\nfunction getNormalStylePropertyName( property: string ): string {\n\tif ( property.startsWith( '--' ) ) {\n\t\treturn property;\n\t}\n\n\tif ( hasPrefix( property, [ 'ms', 'O', 'Moz', 'Webkit' ] ) ) {\n\t\treturn '-' + kebabCase( property );\n\t}\n\n\treturn kebabCase( property );\n}\n\n/**\n * Returns the normal form of the style property value for HTML. Appends a\n * default pixel unit if numeric, not a unitless property, and not zero.\n * @param property\n * @param value\n */\nfunction getNormalStylePropertyValue(\n\tproperty: string,\n\tvalue: any\n): string | number {\n\tif (\n\t\ttypeof value === 'number' &&\n\t\t0 !== value &&\n\t\t! hasPrefix( property, [ '--' ] ) &&\n\t\t! CSS_PROPERTIES_SUPPORTS_UNITLESS.has( property )\n\t) {\n\t\treturn value + 'px';\n\t}\n\n\treturn value;\n}\n\n/**\n * Serializes a React element to string.\n * @param element\n * @param context\n * @param legacyContext\n */\nexport function renderElement(\n\telement: React.ReactNode,\n\tcontext?: any,\n\tlegacyContext: Record< string, any > = {}\n): string {\n\tif ( null === element || undefined === element || false === element ) {\n\t\treturn '';\n\t}\n\n\tif ( Array.isArray( element ) ) {\n\t\treturn renderChildren( element, context, legacyContext );\n\t}\n\n\tswitch ( typeof element ) {\n\t\tcase 'string':\n\t\t\treturn escapeHTML( element );\n\n\t\tcase 'number':\n\t\t\treturn element.toString();\n\t}\n\n\tconst { type, props } = element as {\n\t\ttype?: any;\n\t\tprops?: any;\n\t};\n\n\tswitch ( type ) {\n\t\tcase StrictMode:\n\t\tcase Fragment:\n\t\t\treturn renderChildren( props.children, context, legacyContext );\n\n\t\tcase RawHTML:\n\t\t\tconst { children, ...wrapperProps } = props as RawHTMLProps;\n\n\t\t\treturn renderNativeComponent(\n\t\t\t\t! Object.keys( wrapperProps ).length ? null : 'div',\n\t\t\t\t{\n\t\t\t\t\t...wrapperProps,\n\t\t\t\t\tdangerouslySetInnerHTML: { __html: children },\n\t\t\t\t},\n\t\t\t\tcontext,\n\t\t\t\tlegacyContext\n\t\t\t);\n\t}\n\n\tswitch ( typeof type ) {\n\t\tcase 'string':\n\t\t\treturn renderNativeComponent( type, props, context, legacyContext );\n\n\t\tcase 'function':\n\t\t\tif (\n\t\t\t\ttype.prototype &&\n\t\t\t\ttypeof type.prototype.render === 'function'\n\t\t\t) {\n\t\t\t\treturn renderComponent( type, props, context, legacyContext );\n\t\t\t}\n\n\t\t\treturn renderElement(\n\t\t\t\ttype( props, legacyContext ),\n\t\t\t\tcontext,\n\t\t\t\tlegacyContext\n\t\t\t);\n\t}\n\n\tswitch ( type && type.$$typeof ) {\n\t\tcase Provider.$$typeof:\n\t\t\treturn renderChildren( props.children, props.value, legacyContext );\n\n\t\tcase Consumer.$$typeof:\n\t\t\treturn renderElement(\n\t\t\t\tprops.children( context || type._currentValue ),\n\t\t\t\tcontext,\n\t\t\t\tlegacyContext\n\t\t\t);\n\n\t\tcase ForwardRef.$$typeof:\n\t\t\treturn renderElement(\n\t\t\t\ttype.render( props ),\n\t\t\t\tcontext,\n\t\t\t\tlegacyContext\n\t\t\t);\n\t}\n\n\treturn '';\n}\n\n/**\n * Serializes a native component type to string.\n * @param type\n * @param props\n * @param context\n * @param legacyContext\n */\nexport function renderNativeComponent(\n\ttype: string | null,\n\tprops: HTMLProps,\n\tcontext?: any,\n\tlegacyContext: Record< string, any > = {}\n): string {\n\tlet content = '';\n\tif ( type === 'textarea' && props.hasOwnProperty( 'value' ) ) {\n\t\t// Textarea children can be assigned as value prop. If it is, render in\n\t\t// place of children. Ensure to omit so it is not assigned as attribute\n\t\t// as well.\n\t\tcontent = renderChildren( props.value, context, legacyContext );\n\t\tconst { value, ...restProps } = props;\n\t\tprops = restProps;\n\t} else if (\n\t\tprops.dangerouslySetInnerHTML &&\n\t\ttypeof props.dangerouslySetInnerHTML.__html === 'string'\n\t) {\n\t\t// Dangerous content is left unescaped.\n\t\tcontent = props.dangerouslySetInnerHTML.__html;\n\t} else if ( typeof props.children !== 'undefined' ) {\n\t\tcontent = renderChildren( props.children, context, legacyContext );\n\t}\n\n\tif ( ! type ) {\n\t\treturn content;\n\t}\n\n\tconst attributes = renderAttributes( props );\n\n\tif ( SELF_CLOSING_TAGS.has( type ) ) {\n\t\treturn '<' + type + attributes + '/>';\n\t}\n\n\treturn '<' + type + attributes + '>' + content + '</' + type + '>';\n}\n\n/**\n * Serializes a non-native component type to string.\n * @param Component\n * @param props\n * @param context\n * @param legacyContext\n */\nexport function renderComponent(\n\tComponent: React.ComponentClass,\n\tprops: Record< string, any >,\n\tcontext?: any,\n\tlegacyContext: Record< string, any > = {}\n): string {\n\tconst instance = new Component( props, legacyContext ) as ComponentInstance;\n\n\tif ( typeof instance.getChildContext === 'function' ) {\n\t\tObject.assign( legacyContext, instance.getChildContext() );\n\t}\n\n\tconst html = renderElement( instance.render(), context, legacyContext );\n\n\treturn html;\n}\n\n/**\n * Serializes an array of children to string.\n * @param children\n * @param context\n * @param legacyContext\n */\nfunction renderChildren(\n\tchildren: React.ReactNode,\n\tcontext?: any,\n\tlegacyContext: Record< string, any > = {}\n): string {\n\tlet result = '';\n\n\tconst childrenArray = Array.isArray( children ) ? children : [ children ];\n\n\tfor ( let i = 0; i < childrenArray.length; i++ ) {\n\t\tconst child = childrenArray[ i ];\n\n\t\tresult += renderElement( child, context, legacyContext );\n\t}\n\n\treturn result;\n}\n\n/**\n * Renders a props object as a string of HTML attributes.\n * @param props\n */\nexport function renderAttributes( props: Record< string, any > ): string {\n\tlet result = '';\n\n\tfor ( const key in props ) {\n\t\tconst attribute = getNormalAttributeName( key );\n\t\tif ( ! isValidAttributeName( attribute ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tlet value = getNormalAttributeValue( key, props[ key ] );\n\n\t\t// If value is not of serializable type, skip.\n\t\tif ( ! ATTRIBUTES_TYPES.has( typeof value ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Don't render internal attribute names.\n\t\tif ( isInternalAttribute( key ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst isBooleanAttribute = BOOLEAN_ATTRIBUTES.has( attribute );\n\n\t\t// Boolean attribute should be omitted outright if its value is false.\n\t\tif ( isBooleanAttribute && value === false ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst isMeaningfulAttribute =\n\t\t\tisBooleanAttribute ||\n\t\t\thasPrefix( key, [ 'data-', 'aria-' ] ) ||\n\t\t\tENUMERATED_ATTRIBUTES.has( attribute );\n\n\t\t// Only write boolean value as attribute if meaningful.\n\t\tif ( typeof value === 'boolean' && ! isMeaningfulAttribute ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tresult += ' ' + attribute;\n\n\t\t// Boolean attributes should write attribute name, but without value.\n\t\t// Mere presence of attribute name is effective truthiness.\n\t\tif ( isBooleanAttribute ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( typeof value === 'string' ) {\n\t\t\tvalue = escapeAttribute( value );\n\t\t}\n\n\t\tresult += '=\"' + value + '\"';\n\t}\n\n\treturn result;\n}\n\n/**\n * Renders a style object as a string attribute value.\n * @param style\n */\nexport function renderStyle( style: StyleObject | string ): string | undefined {\n\t// Only generate from object, e.g. tolerate string value.\n\tif ( ! isPlainObject( style ) ) {\n\t\treturn style as string;\n\t}\n\n\tlet result: string | undefined;\n\n\tconst styleObj = style as StyleObject;\n\tfor ( const property in styleObj ) {\n\t\tconst value = styleObj[ property ];\n\t\tif ( null === value || undefined === value ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( result ) {\n\t\t\tresult += ';';\n\t\t} else {\n\t\t\tresult = '';\n\t\t}\n\n\t\tconst normalName = getNormalStylePropertyName( property );\n\t\tconst normalValue = getNormalStylePropertyValue( property, value );\n\t\tresult += normalName + ':' + normalValue;\n\t}\n\n\treturn result;\n}\n\nexport default renderElement;\n"],
  "mappings": ";AA8BA,SAAS,qBAAqB;AAC9B,SAAS,aAAa,iBAAiB;AAKvC;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAKP,SAAS,eAAe,UAAU,YAAY,kBAAkB;AAChE,OAAO,aAAa;AAIpB,IAAM,UAAU,cAAe,MAAU;AACzC,QAAQ,cAAc;AA4BtB,IAAM,EAAE,UAAU,SAAS,IAAI;AAE/B,IAAM,aAAa,WAAY,MAAM;AACpC,SAAO;AACR,CAAE;AAKF,IAAM,mBAAmB,oBAAI,IAAe,CAAE,UAAU,WAAW,QAAS,CAAE;AAK9E,IAAM,oBAAoB,oBAAI,IAAe;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA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