{
  "version": 3,
  "sources": ["../src/raw-html.ts"],
  "sourcesContent": ["/**\n * Internal dependencies\n */\nimport { Children, createElement } from './react';\n\n/**\n * Props for the RawHTML component.\n */\nexport type RawHTMLProps = {\n\tchildren: string | string[];\n} & React.ComponentPropsWithoutRef< 'div' >;\n\n/**\n * Component used to render unescaped HTML.\n *\n * Note: The `renderElement` serializer will remove the `div` wrapper\n * unless non-children props are present; typically when preparing a block for saving.\n *\n * @example\n * ```jsx\n * import { RawHTML } from '@wordpress/element';\n *\n * const Component = () => <RawHTML><h3>Hello world</h3></RawHTML>;\n * // Edit: <div><h3>Hello world</h3></div>\n * // save: <h3>Hello world</h3>\n * ```\n *\n * @param {RawHTMLProps} props Children should be a string of HTML or an array\n *                             of strings. Other props will be passed through\n *                             to the div wrapper.\n *\n * @return Dangerously-rendering component.\n */\nexport default function RawHTML( { children, ...props }: RawHTMLProps ) {\n\tlet rawHtml = '';\n\n\t// Cast children as an array, and concatenate each element if it is a string.\n\tChildren.toArray( children ).forEach( ( child ) => {\n\t\tif ( typeof child === 'string' && child.trim() !== '' ) {\n\t\t\trawHtml += child;\n\t\t}\n\t} );\n\n\t// The `div` wrapper will be stripped by the `renderElement` serializer in\n\t// `./serialize.js` unless there are non-children props present.\n\treturn createElement( 'div', {\n\t\tdangerouslySetInnerHTML: { __html: rawHtml },\n\t\t...props,\n\t} );\n}\n"],
  "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,mBAAwC;AA8BzB,SAAR,QAA0B,EAAE,UAAU,GAAG,MAAM,GAAkB;AACvE,MAAI,UAAU;AAGd,wBAAS,QAAS,QAAS,EAAE,QAAS,CAAE,UAAW;AAClD,QAAK,OAAO,UAAU,YAAY,MAAM,KAAK,MAAM,IAAK;AACvD,iBAAW;AAAA,IACZ;AAAA,EACD,CAAE;AAIF,aAAO,4BAAe,OAAO;AAAA,IAC5B,yBAAyB,EAAE,QAAQ,QAAQ;AAAA,IAC3C,GAAG;AAAA,EACJ,CAAE;AACH;",
  "names": []
}
