isomorfeus-preact 10.5.11 → 10.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +10 -6
  3. data/lib/preact/component/native_component_constructor.rb +2 -2
  4. data/lib/preact/version.rb +1 -1
  5. data/node_modules/.package-lock.json +3 -3
  6. data/node_modules/preact/compat/dist/compat.js +1 -1
  7. data/node_modules/preact/compat/dist/compat.js.map +1 -1
  8. data/node_modules/preact/compat/dist/compat.mjs +1 -1
  9. data/node_modules/preact/compat/dist/compat.module.js +1 -1
  10. data/node_modules/preact/compat/dist/compat.module.js.map +1 -1
  11. data/node_modules/preact/compat/dist/compat.umd.js +1 -1
  12. data/node_modules/preact/compat/dist/compat.umd.js.map +1 -1
  13. data/node_modules/preact/compat/src/index.d.ts +1 -0
  14. data/node_modules/preact/compat/src/render.js +5 -5
  15. data/node_modules/preact/devtools/dist/devtools.js +1 -1
  16. data/node_modules/preact/devtools/dist/devtools.js.map +1 -1
  17. data/node_modules/preact/devtools/dist/devtools.mjs +1 -1
  18. data/node_modules/preact/devtools/dist/devtools.module.js +1 -1
  19. data/node_modules/preact/devtools/dist/devtools.module.js.map +1 -1
  20. data/node_modules/preact/devtools/dist/devtools.umd.js +1 -1
  21. data/node_modules/preact/devtools/dist/devtools.umd.js.map +1 -1
  22. data/node_modules/preact/devtools/src/devtools.js +1 -1
  23. data/node_modules/preact/dist/preact.js +1 -1
  24. data/node_modules/preact/dist/preact.js.map +1 -1
  25. data/node_modules/preact/dist/preact.min.js +1 -1
  26. data/node_modules/preact/dist/preact.min.js.map +1 -1
  27. data/node_modules/preact/dist/preact.mjs +1 -1
  28. data/node_modules/preact/dist/preact.mjs.map +1 -1
  29. data/node_modules/preact/dist/preact.module.js +1 -1
  30. data/node_modules/preact/dist/preact.module.js.map +1 -1
  31. data/node_modules/preact/dist/preact.umd.js +1 -1
  32. data/node_modules/preact/dist/preact.umd.js.map +1 -1
  33. data/node_modules/preact/hooks/src/index.d.ts +12 -6
  34. data/node_modules/preact/package.json +12 -5
  35. data/node_modules/preact/src/diff/index.js +5 -3
  36. data/node_modules/preact/src/index.d.ts +1 -1
  37. data/package.json +1 -1
  38. metadata +14 -14
@@ -1 +1 @@
1
- {"version":3,"file":"preact.mjs","sources":["../src/constants.js","../src/options.js","../src/diff/catch-error.js","../src/diff/commit.js","../src/create-element.js","../src/diff/refs.js","../src/diff/props.js","../src/create-context.js","../src/diff/unmount.js","../src/tree.js","../src/diff/children.js","../src/diff/patch.js","../src/component.js","../src/diff/component.js","../src/diff/mount.js","../src/render.js","../src/create-root.js","../src/clone-element.js"],"sourcesContent":["// Internal._flags bitfield constants\nexport const TYPE_TEXT = 1 << 0;\nexport const TYPE_ELEMENT = 1 << 1;\nexport const TYPE_CLASS = 1 << 2;\nexport const TYPE_FUNCTION = 1 << 3;\n/** Signals this internal has a _parentDom prop that should change the parent\n * DOM node of it's children */\nexport const TYPE_ROOT = 1 << 4;\n\n/** Any type of internal representing DOM */\nexport const TYPE_DOM = TYPE_TEXT | TYPE_ELEMENT;\n/** Any type of component */\nexport const TYPE_COMPONENT = TYPE_CLASS | TYPE_FUNCTION | TYPE_ROOT;\n\n// Modes of rendering\n/** Normal hydration that attaches to a DOM tree but does not diff it. */\nexport const MODE_HYDRATE = 1 << 5;\n/** Top level render unspecified behaviour (old replaceNode parameter to render) */\nexport const MODE_MUTATIVE_HYDRATE = 1 << 6;\n/** Signifies this VNode suspended on the previous render */\nexport const MODE_SUSPENDED = 1 << 7;\n/** Signifies this VNode errored on the previous render */\nexport const MODE_ERRORED = 1 << 8;\n/** Signifies an error has been thrown and this component will be attempting to\n * handle & rerender the error on next render. In other words, on the next\n * render of this component, unset this mode and set the MODE_RERENDERING_ERROR.\n * This flag is distinct from MODE_RERENDERING_ERROR so that a component can\n * catch multiple errors thrown by its children in one render pass (see test\n * \"should handle double child throws\").\n */\nexport const MODE_PENDING_ERROR = 1 << 9;\n/** Signifies this Internal is attempting to \"handle\" an error and is\n * rerendering. This mode tracks that a component's last rerender was trying to\n * handle an error. As such, if another error is thrown while a component has\n * this flag set, it should not handle the newly thrown error since it failed to\n * successfully rerender the original error. This prevents error handling\n * infinite render loops */\nexport const MODE_RERENDERING_ERROR = 1 << 10;\n/** Signals this internal has been unmounted */\nexport const MODE_UNMOUNTING = 1 << 11;\n/** This Internal is rendered in an SVG tree */\nexport const MODE_SVG = 1 << 12;\n\n/** Signifies that bailout checks will be bypassed */\nexport const FORCE_UPDATE = 1 << 13;\n/** Signifies that a node needs to be updated */\nexport const DIRTY_BIT = 1 << 14;\n\n/** Reset all mode flags */\nexport const RESET_MODE = ~(\n\tMODE_HYDRATE |\n\tMODE_MUTATIVE_HYDRATE |\n\tMODE_SUSPENDED |\n\tMODE_ERRORED |\n\tMODE_RERENDERING_ERROR |\n\tFORCE_UPDATE\n);\n\n/** Modes a child internal inherits from their parent */\nexport const INHERITED_MODES = MODE_HYDRATE | MODE_MUTATIVE_HYDRATE | MODE_SVG;\n\nexport const EMPTY_ARR = [];\nexport const UNDEFINED = undefined;\n","import { _catchError } from './diff/catch-error';\n\n/**\n * The `option` object can potentially contain callback functions\n * that are called during various stages of our renderer. This is the\n * foundation on which all our addons like `preact/debug`, `preact/compat`,\n * and `preact/hooks` are based on. See the `Options` type in `internal.d.ts`\n * for a full list of available option hooks (most editors/IDEs allow you to\n * ctrl+click or cmd+click on mac the type definition below).\n * @type {import('./internal').Options}\n */\nconst options = {\n\t_catchError\n};\n\nexport default options;\n","import {\n\tDIRTY_BIT,\n\tMODE_RERENDERING_ERROR,\n\tMODE_PENDING_ERROR,\n\tTYPE_COMPONENT\n} from '../constants';\n\n/**\n * Find the closest error boundary to a thrown error and call it\n * @param {object} error The thrown value\n * @param {import('../internal').Internal} internal The Internal node that threw\n * the error that was caught (except for unmounting when this parameter\n * is the highest parent that was being unmounted)\n */\nexport function _catchError(error, internal) {\n\twhile ((internal = internal._parent)) {\n\t\tif (\n\t\t\tinternal._flags & TYPE_COMPONENT &&\n\t\t\t~internal._flags & MODE_RERENDERING_ERROR\n\t\t) {\n\t\t\ttry {\n\t\t\t\tif (internal.type.getDerivedStateFromError) {\n\t\t\t\t\tinternal._component.setState(\n\t\t\t\t\t\tinternal.type.getDerivedStateFromError(error)\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tif (internal._component.componentDidCatch) {\n\t\t\t\t\tinternal._component.componentDidCatch(error);\n\t\t\t\t}\n\n\t\t\t\t// NOTE: We're checking that any component in the stack got marked as dirty, even if it did so prior to this loop,\n\t\t\t\t// which is technically incorrect. However, there is no way for a component to mark itself as dirty during rendering.\n\t\t\t\t// The only way for a component to falsely intercept error bubbling would be to manually sets its internal dirty flag.\n\t\t\t\tif (internal._flags & DIRTY_BIT) {\n\t\t\t\t\tinternal._flags |= MODE_PENDING_ERROR;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\terror = e;\n\t\t\t}\n\t\t}\n\t}\n\n\tthrow error;\n}\n","import options from '../options';\n\n/**\n * @param {import('../internal').Internal} internal\n * @param {() => void} callback\n */\nexport function addCommitCallback(internal, callback) {\n\tif (internal._commitCallbacks == null) {\n\t\tinternal._commitCallbacks = [];\n\t}\n\n\tinternal._commitCallbacks.push(callback);\n}\n\n/**\n * @param {import('../internal').CommitQueue} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {import('../internal').Internal} rootInternal\n */\nexport function commitRoot(commitQueue, rootInternal) {\n\tif (options._commit) options._commit(rootInternal, commitQueue);\n\n\tcommitQueue.some(internal => {\n\t\ttry {\n\t\t\t// @ts-ignore Reuse the root variable here so the type changes\n\t\t\tcommitQueue = internal._commitCallbacks.length;\n\t\t\t// @ts-ignore See above ts-ignore comment\n\t\t\twhile (commitQueue--) {\n\t\t\t\tinternal._commitCallbacks.shift().call(internal._component);\n\t\t\t}\n\t\t} catch (e) {\n\t\t\toptions._catchError(e, internal);\n\t\t}\n\t});\n}\n","import { UNDEFINED } from './constants';\nimport options from './options';\n\nlet vnodeId = 0;\n\n/**\n * Create an virtual node (used for JSX)\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component\n * constructor for this virtual node\n * @param {object | null | undefined} [props] The properties of the virtual node\n * @param {Array<import('.').ComponentChildren>} [children] The children of the virtual node\n * @returns {import('./internal').VNode}\n */\nexport function createElement(type, props, children) {\n\tlet normalizedProps = {},\n\t\tkey,\n\t\tref,\n\t\ti;\n\tfor (i in props) {\n\t\tif (!(i === 'key' || (typeof type !== 'function' && i === 'ref')))\n\t\t\tnormalizedProps[i] = props[i];\n\t\telse if (i === 'ref') {\n\t\t\tref = props[i];\n\t\t} else if (i === 'key') {\n\t\t\tkey = props[i];\n\t\t}\n\t}\n\n\tif (arguments.length > 3) {\n\t\tchildren = [children];\n\t\t// https://github.com/preactjs/preact/issues/1916\n\t\tfor (i = 3; i < arguments.length; i++) {\n\t\t\tchildren.push(arguments[i]);\n\t\t}\n\t}\n\tif (children != null) {\n\t\tnormalizedProps.children = children;\n\t}\n\n\t// If a Component VNode, check for and apply defaultProps\n\t// Note: type may be undefined in development, must never error here.\n\tif (typeof type == 'function' && type.defaultProps != null) {\n\t\tfor (i in type.defaultProps) {\n\t\t\tif (normalizedProps[i] === UNDEFINED) {\n\t\t\t\tnormalizedProps[i] = type.defaultProps[i];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn createVNode(type, normalizedProps, key, ref, 0);\n}\n\n/**\n * Create a VNode (used internally by Preact)\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component\n * Constructor for this virtual node\n * @param {object | string | number | null} props The properties of this virtual node.\n * If this virtual node represents a text node, this is the text of the node (string or number).\n * @param {string | number | null} key The key for this virtual node, used when\n * diffing it against its children\n * @param {import('./internal').VNode[\"ref\"]} ref The ref property that will\n * receive a reference to its created child\n * @returns {import('./internal').VNode}\n */\nexport function createVNode(type, props, key, ref, original) {\n\t// V8 seems to be better at detecting type shapes if the object is allocated from the same call site\n\t// Do not inline into createElement and coerceToVNode!\n\tconst vnode = {\n\t\ttype,\n\t\tprops,\n\t\tkey,\n\t\tref,\n\t\tconstructor: undefined,\n\t\t_vnodeId: original || ++vnodeId\n\t};\n\n\tif (options.vnode != null) options.vnode(vnode);\n\n\treturn vnode;\n}\n\n/**\n * @param {import('./internal').ComponentChildren} childVNode\n * @returns {import('./internal').VNode | string | null}\n */\nexport function normalizeToVNode(childVNode) {\n\tif (childVNode == null || typeof childVNode == 'boolean') {\n\t\treturn null;\n\t}\n\t// If this newVNode is being reused (e.g. <div>{reuse}{reuse}</div>) in the same diff,\n\t// or we are rendering a component (e.g. setState) copy the oldVNodes so it can have\n\t// it's own DOM & etc. pointers\n\telse if (\n\t\ttypeof childVNode == 'number' ||\n\t\t// eslint-disable-next-line valid-typeof\n\t\ttypeof childVNode == 'bigint'\n\t) {\n\t\treturn childVNode + '';\n\t} else if (Array.isArray(childVNode)) {\n\t\treturn createVNode(Fragment, { children: childVNode }, null, null, 0);\n\t}\n\n\treturn childVNode;\n}\n\nexport function createRef() {\n\treturn { current: null };\n}\n\nexport function Fragment(props) {\n\treturn props.children;\n}\n\n/**\n * Check if a the argument is a valid Preact VNode.\n * @param {*} vnode\n * @returns {vnode is import('./internal').VNode}\n */\nexport const isValidElement = vnode =>\n\tvnode != null && vnode.constructor === UNDEFINED;\n","import options from '../options';\n\n/**\n * Invoke or update a ref, depending on whether it is a function or object ref.\n * @param {object|function} ref\n * @param {any} value\n * @param {import('../internal').Internal} internal\n */\nexport function applyRef(oldRef, ref, value, internal) {\n\tif (oldRef === ref) return;\n\n\tif (oldRef) applyRef(null, oldRef, null, internal);\n\ttry {\n\t\tif (typeof ref == 'function') ref(value);\n\t\telse ref.current = value;\n\t} catch (e) {\n\t\toptions._catchError(e, internal);\n\t}\n}\n","import options from '../options';\n\nfunction setStyle(style, key, value) {\n\tif (key[0] === '-') {\n\t\tstyle.setProperty(key, value);\n\t} else if (value == null) {\n\t\tstyle[key] = '';\n\t} else {\n\t\tstyle[key] = value;\n\t}\n}\n\n/**\n * Set a property value on a DOM node\n * @param {import('../internal').PreactElement} dom The DOM node to modify\n * @param {string} name The name of the property to set\n * @param {*} value The value to set the property to\n * @param {*} oldValue The old value the property had\n * @param {number} isSvg 0 if not an SVG element, else it is an SVG element\n */\nexport function setProperty(dom, name, value, oldValue, isSvg) {\n\tlet useCapture;\n\n\to: if (name === 'style') {\n\t\tif (typeof value == 'string') {\n\t\t\tdom.style.cssText = value;\n\t\t} else {\n\t\t\tif (typeof oldValue == 'string') {\n\t\t\t\tdom.style.cssText = oldValue = '';\n\t\t\t}\n\n\t\t\tif (oldValue) {\n\t\t\t\tfor (name in oldValue) {\n\t\t\t\t\tif (!(value && name in value)) {\n\t\t\t\t\t\tsetStyle(dom.style, name, '');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (value) {\n\t\t\t\tfor (name in value) {\n\t\t\t\t\tif (!oldValue || value[name] !== oldValue[name]) {\n\t\t\t\t\t\tsetStyle(dom.style, name, value[name]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// Benchmark for comparison: https://esbench.com/bench/574c954bdb965b9a00965ac6\n\telse if (name[0] === 'o' && name[1] === 'n') {\n\t\tuseCapture = name !== (name = name.replace(/Capture$/, ''));\n\n\t\t// Infer correct casing for DOM built-in events:\n\t\tif (name.toLowerCase() in dom) name = name.toLowerCase().slice(2);\n\t\telse name = name.slice(2);\n\n\t\tif (!dom._listeners) dom._listeners = {};\n\t\tdom._listeners[name + useCapture] = value;\n\n\t\tif (value) {\n\t\t\tif (!oldValue) {\n\t\t\t\tconst handler = useCapture ? eventProxyCapture : eventProxy;\n\t\t\t\tdom.addEventListener(name, handler, useCapture);\n\t\t\t}\n\t\t} else {\n\t\t\tconst handler = useCapture ? eventProxyCapture : eventProxy;\n\t\t\tdom.removeEventListener(name, handler, useCapture);\n\t\t}\n\t} else if (name !== 'dangerouslySetInnerHTML') {\n\t\tif (isSvg) {\n\t\t\t// Normalize incorrect prop usage for SVG:\n\t\t\t// - xlink:href / xlinkHref --> href (xlink:href was removed from SVG and isn't needed)\n\t\t\t// - className --> class\n\t\t\tname = name.replace(/xlink[H:h]/, 'h').replace(/sName$/, 's');\n\t\t} else if (\n\t\t\tname !== 'href' &&\n\t\t\tname !== 'list' &&\n\t\t\tname !== 'form' &&\n\t\t\t// Default value in browsers is `-1` and an empty string is\n\t\t\t// cast to `0` instead\n\t\t\tname !== 'tabIndex' &&\n\t\t\tname !== 'download' &&\n\t\t\tname in dom\n\t\t) {\n\t\t\ttry {\n\t\t\t\tdom[name] = value == null ? '' : value;\n\t\t\t\t// labelled break is 1b smaller here than a return statement (sorry)\n\t\t\t\tbreak o;\n\t\t\t} catch (e) {}\n\t\t}\n\n\t\t// ARIA-attributes have a different notion of boolean values.\n\t\t// The value `false` is different from the attribute not\n\t\t// existing on the DOM, so we can't remove it. For non-boolean\n\t\t// ARIA-attributes we could treat false as a removal, but the\n\t\t// amount of exceptions would cost us too many bytes. On top of\n\t\t// that other VDOM frameworks also always stringify `false`.\n\n\t\tif (typeof value === 'function') {\n\t\t\t// never serialize functions as attribute values\n\t\t} else if (\n\t\t\tvalue != null &&\n\t\t\t(value !== false || (name[0] === 'a' && name[1] === 'r'))\n\t\t) {\n\t\t\tdom.setAttribute(name, value);\n\t\t} else {\n\t\t\tdom.removeAttribute(name);\n\t\t}\n\t}\n}\n\n/**\n * Proxy an event to hooked event handlers\n * @param {Event} e The event object from the browser\n * @private\n */\nfunction eventProxy(e) {\n\tthis._listeners[e.type + false](options.event ? options.event(e) : e);\n\tif (this._isControlled) {\n\t\tif (this.value != null && (e.type === 'input' || e.type === 'change')) {\n\t\t\tthis.value = this._prevValue;\n\t\t}\n\t\tif (this.checked != null && e.type === 'change') {\n\t\t\tthis.checked = this._prevValue;\n\t\t}\n\t}\n}\n\nfunction eventProxyCapture(e) {\n\tthis._listeners[e.type + true](options.event ? options.event(e) : e);\n}\n","import { enqueueRender } from './component';\n\nexport let nextContextId = 0;\n\nconst providers = new Set();\n\nexport const unsubscribeFromContext = component => {\n\t// if this was a context provider, delete() returns true and we exit:\n\tif (providers.delete(component)) return;\n\t// ... otherwise, unsubscribe from any contexts:\n\tproviders.forEach(p => p._subs.delete(component));\n};\n\nexport const createContext = (defaultValue, contextId) => {\n\tcontextId = '__cC' + nextContextId++;\n\n\tconst context = {\n\t\t_id: contextId,\n\t\t_defaultValue: defaultValue,\n\t\t/** @type {import('./internal').FunctionComponent} */\n\t\tConsumer(props, contextValue) {\n\t\t\t// return props.children(\n\t\t\t// \tcontext[contextId] ? context[contextId].props.value : defaultValue\n\t\t\t// );\n\t\t\treturn props.children(contextValue);\n\t\t},\n\t\t/** @type {import('./internal').FunctionComponent} */\n\t\tProvider(props, ctx) {\n\t\t\t// initial setup:\n\t\t\tif (!this._subs) {\n\t\t\t\tthis._subs = new Set();\n\t\t\t\tctx = {};\n\t\t\t\tctx[contextId] = this;\n\t\t\t\tthis.getChildContext = () => ctx;\n\t\t\t}\n\t\t\t// re-render subscribers in response to value change\n\t\t\telse if (props.value !== this._prev) {\n\t\t\t\tthis._subs.forEach(enqueueRender);\n\t\t\t}\n\t\t\tthis._prev = props.value;\n\n\t\t\treturn props.children;\n\t\t}\n\t};\n\n\t// Devtools needs access to the context object when it\n\t// encounters a Provider. This is necessary to support\n\t// setting `displayName` on the context object instead\n\t// of on the component itself. See:\n\t// https://reactjs.org/docs/context.html#contextdisplayname\n\n\treturn (context.Provider._contextRef = context.Consumer.contextType = context);\n};\n","import { MODE_UNMOUNTING, TYPE_DOM, TYPE_ROOT } from '../constants';\nimport { unsubscribeFromContext } from '../create-context';\nimport options from '../options';\nimport { applyRef } from './refs';\n\n/**\n * Unmount a virtual node from the tree and apply DOM changes\n * @param {import('../internal').Internal} internal The virtual node to unmount\n * @param {import('../internal').Internal} parentInternal The parent of the VNode that\n * initiated the unmount\n * @param {number} [skipRemove] Flag that indicates that a parent node of the\n * current element is already detached from the DOM.\n */\nexport function unmount(internal, parentInternal, skipRemove) {\n\tlet r,\n\t\ti = 0;\n\tif (options.unmount) options.unmount(internal);\n\tinternal._flags |= MODE_UNMOUNTING;\n\n\tif ((r = internal.ref)) {\n\t\tif (!r.current || r.current === internal._dom)\n\t\t\tapplyRef(null, r, null, parentInternal);\n\t}\n\n\tif ((r = internal._component)) {\n\t\tunsubscribeFromContext(r);\n\n\t\tif (r.componentWillUnmount) {\n\t\t\ttry {\n\t\t\t\tr.componentWillUnmount();\n\t\t\t} catch (e) {\n\t\t\t\toptions._catchError(e, parentInternal);\n\t\t\t}\n\t\t}\n\t}\n\n\tif ((r = internal._children)) {\n\t\tfor (; i < r.length; i++) {\n\t\t\tif (r[i]) {\n\t\t\t\tunmount(\n\t\t\t\t\tr[i],\n\t\t\t\t\tparentInternal,\n\t\t\t\t\tskipRemove ? ~internal._flags & TYPE_ROOT : internal._flags & TYPE_DOM\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (!skipRemove && internal._flags & TYPE_DOM) {\n\t\tinternal._dom.remove();\n\t}\n\n\tinternal._dom = null;\n}\n","import options from './options';\nimport {\n\tTYPE_FUNCTION,\n\tTYPE_ELEMENT,\n\tTYPE_TEXT,\n\tTYPE_CLASS,\n\tTYPE_ROOT,\n\tINHERITED_MODES,\n\tTYPE_COMPONENT,\n\tTYPE_DOM,\n\tMODE_SVG,\n\tUNDEFINED\n} from './constants';\n\n/**\n * Create an internal tree node\n * @param {import('./internal').VNode | string} vnode\n * @param {import('./internal').Internal} [parentInternal]\n * @returns {import('./internal').Internal}\n */\nexport function createInternal(vnode, parentInternal) {\n\tlet type = null,\n\t\tprops,\n\t\tkey,\n\t\tref;\n\n\t/** @type {number} */\n\tlet flags = parentInternal ? parentInternal._flags & INHERITED_MODES : 0;\n\n\t// Text VNodes/Internals use NaN as an ID so that two are never equal.\n\tlet vnodeId = NaN;\n\n\tif (typeof vnode === 'string') {\n\t\t// type = null;\n\t\tflags |= TYPE_TEXT;\n\t\tprops = vnode;\n\t} else if (vnode.constructor !== UNDEFINED) {\n\t\tflags |= TYPE_TEXT;\n\t\tprops = '';\n\t} else {\n\t\ttype = vnode.type;\n\t\tprops = vnode.props || {};\n\t\tkey = vnode.key;\n\t\tref = vnode.ref;\n\t\tvnodeId = vnode._vnodeId;\n\n\t\t// @TODO re-enable this when we stop removing key+ref from VNode props\n\t\t// if (props) {\n\t\t// \tif ((key = props.key) != null) {\n\t\t// \t\tprops.key = UNDEFINED;\n\t\t// \t}\n\t\t// \tif (typeof type !== 'function' && (ref = props.ref) != null) {\n\t\t// \t\tprops.ref = UNDEFINED;\n\t\t// \t}\n\t\t// } else {\n\t\t// \tprops = {};\n\t\t// }\n\n\t\t// flags = typeof type === 'function' ? COMPONENT_NODE : ELEMENT_NODE;\n\t\tflags |=\n\t\t\ttypeof type === 'function'\n\t\t\t\t? type.prototype && 'render' in type.prototype\n\t\t\t\t\t? TYPE_CLASS\n\t\t\t\t\t: props._parentDom\n\t\t\t\t\t? TYPE_ROOT\n\t\t\t\t\t: TYPE_FUNCTION\n\t\t\t\t: TYPE_ELEMENT;\n\n\t\tif (flags & TYPE_ELEMENT && type === 'svg') {\n\t\t\tflags |= MODE_SVG;\n\t\t} else if (\n\t\t\tparentInternal &&\n\t\t\tparentInternal._flags & MODE_SVG &&\n\t\t\tparentInternal.type === 'foreignObject'\n\t\t) {\n\t\t\tflags &= ~MODE_SVG;\n\t\t}\n\t}\n\n\t/** @type {import('./internal').Internal} */\n\tconst internal = {\n\t\ttype,\n\t\tprops,\n\t\tkey,\n\t\tref,\n\t\t_children: null,\n\t\t_parent: parentInternal,\n\t\t_vnodeId: vnodeId,\n\t\t_dom: null,\n\t\t_component: null,\n\t\t_flags: flags,\n\t\t_depth: parentInternal ? parentInternal._depth + 1 : 0\n\t};\n\n\tif (options._internal) options._internal(internal, vnode);\n\n\treturn internal;\n}\n\nconst shouldSearchComponent = internal =>\n\tinternal._flags & TYPE_COMPONENT &&\n\t(!(internal._flags & TYPE_ROOT) ||\n\t\tinternal.props._parentDom == getParentDom(internal._parent));\n\n/**\n * @param {import('./internal').Internal} internal\n * @param {number | null} [childIndex]\n * @returns {import('./internal').PreactNode}\n */\nexport function getDomSibling(internal, childIndex) {\n\tif (childIndex == null) {\n\t\t// Use childIndex==null as a signal to resume the search from the vnode's sibling\n\t\treturn getDomSibling(\n\t\t\tinternal._parent,\n\t\t\tinternal._parent._children.indexOf(internal) + 1\n\t\t);\n\t}\n\n\tlet childDom = getChildDom(internal, childIndex);\n\tif (childDom) {\n\t\treturn childDom;\n\t}\n\n\t// If we get here, we have not found a DOM node in this vnode's children. We\n\t// must resume from this vnode's sibling (in it's parent _children array).\n\t// Only climb up and search the parent if we aren't searching through a DOM\n\t// VNode (meaning we reached the DOM parent of the original vnode that began\n\t// the search). Note, the top of the tree has _parent == null so avoiding that\n\t// here.\n\treturn internal._parent && shouldSearchComponent(internal)\n\t\t? getDomSibling(internal)\n\t\t: null;\n}\n\n/**\n * @param {import('./internal').Internal} internal\n * @param {number} [i]\n * @returns {import('./internal').PreactElement}\n */\nexport function getChildDom(internal, i) {\n\tif (internal._children == null) {\n\t\treturn null;\n\t}\n\n\tfor (i = i || 0; i < internal._children.length; i++) {\n\t\tlet child = internal._children[i];\n\t\tif (child != null) {\n\t\t\tif (child._flags & TYPE_DOM) {\n\t\t\t\treturn child._dom;\n\t\t\t}\n\n\t\t\tif (shouldSearchComponent(child)) {\n\t\t\t\tlet childDom = getChildDom(child);\n\t\t\t\tif (childDom) {\n\t\t\t\t\treturn childDom;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn null;\n}\n\n/**\n * @param {import('./internal').Internal} internal\n * @returns {import('./internal').PreactElement}\n */\nexport function getParentDom(internal) {\n\tlet parentDom =\n\t\tinternal._flags & TYPE_ROOT ? internal.props._parentDom : null;\n\n\tlet parent = internal._parent;\n\twhile (parentDom == null && parent) {\n\t\tif (parent._flags & TYPE_ROOT) {\n\t\t\tparentDom = parent.props._parentDom;\n\t\t} else if (parent._flags & TYPE_ELEMENT) {\n\t\t\tparentDom = parent._dom;\n\t\t}\n\n\t\tparent = parent._parent;\n\t}\n\n\treturn parentDom;\n}\n","import { applyRef } from './refs';\nimport { normalizeToVNode } from '../create-element';\nimport {\n\tTYPE_COMPONENT,\n\tTYPE_TEXT,\n\tMODE_HYDRATE,\n\tMODE_SUSPENDED,\n\tEMPTY_ARR,\n\tTYPE_DOM,\n\tUNDEFINED\n} from '../constants';\nimport { mount } from './mount';\nimport { patch } from './patch';\nimport { unmount } from './unmount';\nimport { createInternal, getDomSibling, getChildDom } from '../tree';\n\n/**\n * Diff the children of a virtual node\n * @param {import('../internal').PreactElement} parentDom The DOM element whose\n * children are being diffed\n * @param {import('../internal').ComponentChildren[]} renderResult\n * @param {import('../internal').Internal} parentInternal The Internal node\n * whose children should be diff'ed against newParentVNode\n * @param {object} globalContext The current context object - modified by\n * getChildContext\n * @param {import('../internal').CommitQueue} commitQueue List of\n * components which have callbacks to invoke in commitRoot\n * @param {import('../internal').PreactElement} startDom The dom node\n * diffChildren should begin diffing with.\n */\nexport function diffChildren(\n\tparentDom,\n\trenderResult,\n\tparentInternal,\n\tglobalContext,\n\tcommitQueue,\n\tstartDom\n) {\n\tlet i, newDom, refs;\n\n\t/** @type {import('../internal').Internal} */\n\tlet childInternal;\n\n\t/** @type {import('../internal').VNode | string} */\n\tlet childVNode;\n\n\tlet oldChildren =\n\t\t(parentInternal._children && parentInternal._children.slice()) || EMPTY_ARR;\n\tlet oldChildrenLength = oldChildren.length;\n\n\tconst newChildren = [];\n\tfor (i = 0; i < renderResult.length; i++) {\n\t\tchildVNode = normalizeToVNode(renderResult[i]);\n\n\t\t// Terser removes the `continue` here and wraps the loop body\n\t\t// in a `if (childVNode) { ... } condition\n\t\tif (childVNode == null) {\n\t\t\tnewChildren[i] = null;\n\t\t\tcontinue;\n\t\t}\n\n\t\tchildInternal = findMatchingInternal(\n\t\t\tchildVNode,\n\t\t\toldChildren,\n\t\t\ti,\n\t\t\toldChildrenLength\n\t\t);\n\n\t\tlet oldVNodeRef;\n\t\tlet nextDomSibling;\n\t\tif (childInternal == null) {\n\t\t\tchildInternal = createInternal(childVNode, parentInternal);\n\n\t\t\t// We are mounting a new VNode\n\t\t\tnextDomSibling = mount(\n\t\t\t\tparentDom,\n\t\t\t\tchildVNode,\n\t\t\t\tchildInternal,\n\t\t\t\tglobalContext,\n\t\t\t\tcommitQueue,\n\t\t\t\tstartDom\n\t\t\t);\n\t\t}\n\t\t// If this node suspended during hydration, and no other flags are set:\n\t\t// @TODO: might be better to explicitly check for MODE_ERRORED here.\n\t\telse if (\n\t\t\t(childInternal._flags & (MODE_HYDRATE | MODE_SUSPENDED)) ===\n\t\t\t(MODE_HYDRATE | MODE_SUSPENDED)\n\t\t) {\n\t\t\t// We are resuming the hydration of a VNode\n\t\t\tstartDom = childInternal._dom;\n\t\t\toldVNodeRef = childInternal.ref;\n\n\t\t\tnextDomSibling = mount(\n\t\t\t\tparentDom,\n\t\t\t\tchildVNode,\n\t\t\t\tchildInternal,\n\t\t\t\tglobalContext,\n\t\t\t\tcommitQueue,\n\t\t\t\tstartDom\n\t\t\t);\n\t\t} else {\n\t\t\toldVNodeRef = childInternal.ref;\n\n\t\t\t// Morph the old element into the new one, but don't append it to the dom yet\n\t\t\tnextDomSibling = patch(\n\t\t\t\tparentDom,\n\t\t\t\tchildVNode,\n\t\t\t\tchildInternal,\n\t\t\t\tglobalContext,\n\t\t\t\tcommitQueue,\n\t\t\t\tstartDom\n\t\t\t);\n\t\t}\n\n\t\tnewDom = childInternal._dom;\n\n\t\tif (childVNode.ref) {\n\t\t\tif (!refs) refs = [];\n\t\t\trefs.push(\n\t\t\t\toldVNodeRef,\n\t\t\t\tchildVNode.ref,\n\t\t\t\tchildInternal._component || newDom,\n\t\t\t\tchildInternal\n\t\t\t);\n\t\t}\n\n\t\tif (childInternal._flags & TYPE_COMPONENT) {\n\t\t\tstartDom = nextDomSibling;\n\t\t} else if (newDom && newDom == startDom) {\n\t\t\t// If the newDom and the dom we are expecting to be there are the same, then\n\t\t\t// do nothing\n\t\t\tstartDom = nextDomSibling;\n\t\t} else if (newDom) {\n\t\t\tstartDom = placeChild(parentDom, oldChildrenLength, newDom, startDom);\n\t\t} else if (\n\t\t\tstartDom &&\n\t\t\tchildInternal != null &&\n\t\t\tstartDom.parentNode != parentDom\n\t\t) {\n\t\t\t// The above condition is to handle null placeholders. See test in placeholder.test.js:\n\t\t\t// `efficiently replace null placeholders in parent rerenders`\n\t\t\tstartDom = nextDomSibling;\n\t\t}\n\n\t\tnewChildren[i] = childInternal;\n\t}\n\n\tparentInternal._children = newChildren;\n\n\t// Remove remaining oldChildren if there are any.\n\tfor (i = oldChildrenLength; i--; ) {\n\t\tif (oldChildren[i] != null) {\n\t\t\tif (\n\t\t\t\tparentInternal._flags & TYPE_COMPONENT &&\n\t\t\t\tstartDom != null &&\n\t\t\t\t((oldChildren[i]._flags & TYPE_DOM &&\n\t\t\t\t\toldChildren[i]._dom == startDom) ||\n\t\t\t\t\tgetChildDom(oldChildren[i]) == startDom)\n\t\t\t) {\n\t\t\t\t// If the startDom points to a dom node that is about to be unmounted,\n\t\t\t\t// then get the next sibling of that vnode and set startDom to it\n\t\t\t\tstartDom = getDomSibling(parentInternal, i + 1);\n\t\t\t}\n\n\t\t\tunmount(oldChildren[i], oldChildren[i]);\n\t\t}\n\t}\n\n\t// Set refs only after unmount\n\tif (refs) {\n\t\tfor (i = 0; i < refs.length; i++) {\n\t\t\tapplyRef(refs[i], refs[++i], refs[++i], refs[++i]);\n\t\t}\n\t}\n\n\treturn startDom;\n}\n\n/**\n * @param {import('../internal').VNode | string} childVNode\n * @param {import('../internal').Internal[]} oldChildren\n * @param {number} i\n * @param {number} oldChildrenLength\n * @returns {import('../internal').Internal}\n */\nfunction findMatchingInternal(childVNode, oldChildren, i, oldChildrenLength) {\n\t// Check if we find a corresponding element in oldChildren.\n\t// If found, delete the array item by setting to `undefined`.\n\t// We use `undefined`, as `null` is reserved for empty placeholders\n\t// (holes).\n\tlet childInternal = oldChildren[i];\n\n\tif (typeof childVNode === 'string') {\n\t\t// We never move Text nodes, so we only check for an in-place match:\n\t\tif (childInternal && childInternal._flags & TYPE_TEXT) {\n\t\t\toldChildren[i] = UNDEFINED;\n\t\t} else {\n\t\t\t// We're looking for a Text node, but this wasn't one: ignore it\n\t\t\tchildInternal = UNDEFINED;\n\t\t}\n\t} else if (\n\t\tchildInternal === null ||\n\t\t(childInternal &&\n\t\t\tchildVNode.key == childInternal.key &&\n\t\t\tchildVNode.type === childInternal.type)\n\t) {\n\t\toldChildren[i] = UNDEFINED;\n\t} else {\n\t\t// Either oldVNode === undefined or oldChildrenLength > 0,\n\t\t// so after this loop oldVNode == null or oldVNode is a valid value.\n\t\tfor (let j = 0; j < oldChildrenLength; j++) {\n\t\t\tchildInternal = oldChildren[j];\n\t\t\t// If childVNode is unkeyed, we only match similarly unkeyed nodes, otherwise we match by key.\n\t\t\t// We always match by type (in either case).\n\t\t\tif (\n\t\t\t\tchildInternal &&\n\t\t\t\tchildVNode.key == childInternal.key &&\n\t\t\t\tchildVNode.type === childInternal.type\n\t\t\t) {\n\t\t\t\toldChildren[j] = UNDEFINED;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tchildInternal = null;\n\t\t}\n\t}\n\n\treturn childInternal;\n}\n\n/**\n * @param {import('../internal').Internal} internal\n * @param {import('../internal').PreactElement} startDom\n * @param {import('../internal').PreactElement} parentDom\n */\nexport function reorderChildren(internal, startDom, parentDom) {\n\tif (internal._children == null) {\n\t\treturn startDom;\n\t}\n\n\tfor (let tmp = 0; tmp < internal._children.length; tmp++) {\n\t\tlet childInternal = internal._children[tmp];\n\t\tif (childInternal) {\n\t\t\t// We typically enter this code path on sCU bailout, where we copy\n\t\t\t// oldVNode._children to newVNode._children. If that is the case, we need\n\t\t\t// to update the old children's _parent pointer to point to the newVNode\n\t\t\t// (childVNode here).\n\t\t\tchildInternal._parent = internal;\n\n\t\t\tif (childInternal._flags & TYPE_COMPONENT) {\n\t\t\t\tstartDom = reorderChildren(childInternal, startDom, parentDom);\n\t\t\t} else if (childInternal._dom == startDom) {\n\t\t\t\tstartDom = startDom.nextSibling;\n\t\t\t} else {\n\t\t\t\tstartDom = placeChild(\n\t\t\t\t\tparentDom,\n\t\t\t\t\tinternal._children.length,\n\t\t\t\t\tchildInternal._dom,\n\t\t\t\t\tstartDom\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn startDom;\n}\n\n/**\n * Flatten and loop through the children of a virtual node\n * @param {import('../index').ComponentChildren} children The unflattened\n * children of a virtual node\n * @returns {import('../internal').VNode[]}\n */\nexport function toChildArray(children, out) {\n\tout = out || [];\n\tif (children == null || typeof children == 'boolean') {\n\t} else if (Array.isArray(children)) {\n\t\tfor (children of children) {\n\t\t\ttoChildArray(children, out);\n\t\t}\n\t} else {\n\t\tout.push(children);\n\t}\n\n\treturn out;\n}\n\n/**\n * @param {import('../internal').PreactElement} parentDom\n * @param {number} oldChildrenLength\n * @param {import('../internal').PreactElement} newDom\n * @param {import('../internal').PreactElement} startDom\n * @returns {import('../internal').PreactElement}\n */\nfunction placeChild(parentDom, oldChildrenLength, newDom, startDom) {\n\tif (startDom == null || newDom.parentNode == null) {\n\t\t// \"startDom == null\": The diff has finished with existing DOM children and\n\t\t// we are appending new ones.\n\t\t//\n\t\t// newDom.parentNode == null: newDom is a brand new unconnected DOM node. Go\n\t\t// ahead and mount it here.\n\t\tparentDom.insertBefore(newDom, startDom);\n\t\treturn startDom;\n\t}\n\n\t// `j<oldChildrenLength; j+=2` is an alternative to `j++<oldChildrenLength/2`\n\tfor (\n\t\tlet sibDom = startDom, j = 0;\n\t\t(sibDom = sibDom.nextSibling) && j < oldChildrenLength;\n\t\tj += 2\n\t) {\n\t\tif (sibDom == newDom) {\n\t\t\treturn newDom.nextSibling;\n\t\t}\n\t}\n\tparentDom.insertBefore(newDom, startDom);\n\treturn startDom;\n}\n","import { diffChildren } from './children';\nimport { setProperty } from './props';\nimport options from '../options';\nimport { renderComponent } from './component';\nimport {\n\tRESET_MODE,\n\tTYPE_TEXT,\n\tTYPE_ELEMENT,\n\tMODE_SUSPENDED,\n\tMODE_ERRORED,\n\tTYPE_ROOT,\n\tMODE_SVG,\n\tUNDEFINED\n} from '../constants';\nimport { getChildDom, getDomSibling } from '../tree';\n\n/**\n * Diff two virtual nodes and apply proper changes to the DOM\n * @param {import('../internal').PreactElement} parentDom The parent of the DOM element\n * @param {import('../internal').VNode | string} newVNode The new virtual node\n * @param {import('../internal').Internal} internal The Internal node to patch\n * @param {object} globalContext The current context object. Modified by getChildContext\n * @param {import('../internal').CommitQueue} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {import('../internal').PreactNode} startDom\n */\nexport function patch(\n\tparentDom,\n\tnewVNode,\n\tinternal,\n\tglobalContext,\n\tcommitQueue,\n\tstartDom\n) {\n\tlet dom = internal._dom;\n\tlet flags = internal._flags;\n\n\tif (flags & TYPE_TEXT) {\n\t\tif (newVNode !== internal.props) {\n\t\t\tdom.data = newVNode;\n\t\t\tinternal.props = newVNode;\n\t\t}\n\n\t\treturn dom.nextSibling;\n\t}\n\n\t// When passing through createElement it assigns the object\n\t// constructor as undefined. This to prevent JSON-injection.\n\tif (newVNode.constructor !== UNDEFINED) return null;\n\n\tif (options._diff) options._diff(internal, newVNode);\n\n\tif (flags & TYPE_ELEMENT) {\n\t\tif (newVNode._vnodeId !== internal._vnodeId) {\n\t\t\t// @ts-ignore dom is a PreactElement here\n\t\t\tpatchDOMElement(dom, newVNode, internal, globalContext, commitQueue);\n\t\t\t// Once we have successfully rendered the new VNode, copy it's ID over\n\t\t\tinternal._vnodeId = newVNode._vnodeId;\n\t\t}\n\n\t\tif (options.diffed) options.diffed(internal);\n\n\t\t// We successfully rendered this VNode, unset any stored hydration/bailout state:\n\t\tinternal._flags &= RESET_MODE;\n\n\t\treturn dom.nextSibling;\n\t}\n\n\t/** @type {import('../internal').PreactNode} */\n\tlet nextDomSibling;\n\n\t// Root nodes signal that an attempt to render into a specific DOM node on\n\t// the page. Root nodes can occur anywhere in the tree and not just at the\n\t// top.\n\tlet prevStartDom = startDom;\n\tlet prevParentDom = parentDom;\n\tif (flags & TYPE_ROOT) {\n\t\tparentDom = newVNode.props._parentDom;\n\n\t\tif (parentDom !== prevParentDom) {\n\t\t\tstartDom = getChildDom(internal) || startDom;\n\n\t\t\t// The `startDom` variable might point to a node from another\n\t\t\t// tree from a previous render\n\t\t\tif (startDom != null && startDom.parentNode !== parentDom) {\n\t\t\t\tstartDom = null;\n\t\t\t}\n\t\t}\n\t}\n\n\ttry {\n\t\tnextDomSibling = renderComponent(\n\t\t\tparentDom,\n\t\t\t/** @type {import('../internal').VNode} */\n\t\t\t(newVNode),\n\t\t\tinternal,\n\t\t\tglobalContext,\n\t\t\tcommitQueue,\n\t\t\tstartDom\n\t\t);\n\t} catch (e) {\n\t\t// @TODO: assign a new VNode ID here? Or NaN?\n\t\t// newVNode._vnodeId = 0;\n\t\tinternal._flags |= e.then ? MODE_SUSPENDED : MODE_ERRORED;\n\t\toptions._catchError(e, internal);\n\n\t\treturn nextDomSibling;\n\t}\n\n\tif (prevParentDom !== parentDom) {\n\t\t// If this is a root node/Portal, and it changed the parentDom it's\n\t\t// children, then we need to determine which dom node the diff should\n\t\t// continue with.\n\t\tif (prevStartDom == null || prevStartDom.parentNode == prevParentDom) {\n\t\t\t// If prevStartDom == null, then we are diffing a root node that\n\t\t\t// didn't have a startDom to begin with, so we can just return null.\n\t\t\t//\n\t\t\t// Or, if the previous value for start dom still has the same parent\n\t\t\t// DOM has the root node's parent tree, then we can use it. This case\n\t\t\t// assumes the root node rendered its children into a new parent.\n\t\t\tnextDomSibling = prevStartDom;\n\t\t} else {\n\t\t\t// Here, if the parentDoms are different and prevStartDom has moved into\n\t\t\t// a new parentDom, we'll assume the root node moved prevStartDom under\n\t\t\t// the new parentDom. Because of this change, we need to search the\n\t\t\t// internal tree for the next DOM sibling the tree should begin with\n\t\t\tnextDomSibling = getDomSibling(internal);\n\t\t}\n\t}\n\n\tif (options.diffed) options.diffed(internal);\n\n\t// We successfully rendered this VNode, unset any stored hydration/bailout state:\n\tinternal._flags &= RESET_MODE;\n\t// Once we have successfully rendered the new VNode, copy it's ID over\n\tinternal._vnodeId = newVNode._vnodeId;\n\n\treturn nextDomSibling;\n}\n\n/**\n * Diff two virtual nodes representing DOM element\n * @param {import('../internal').PreactElement} dom The DOM element representing\n * the virtual nodes being diffed\n * @param {import('../internal').VNode} newVNode The new virtual node\n * @param {import('../internal').Internal} internal The Internal node to patch\n * @param {object} globalContext The current context object\n * @param {import('../internal').CommitQueue} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n */\nfunction patchDOMElement(dom, newVNode, internal, globalContext, commitQueue) {\n\tlet oldProps = internal.props,\n\t\tnewProps = (internal.props = newVNode.props),\n\t\tisSvg = internal._flags & MODE_SVG,\n\t\ti,\n\t\tvalue,\n\t\ttmp,\n\t\tnewHtml,\n\t\toldHtml,\n\t\tnewChildren;\n\n\tfor (i in oldProps) {\n\t\tvalue = oldProps[i];\n\t\tif (i === 'key') {\n\t\t} else if (i === 'children') {\n\t\t} else if (i === 'dangerouslySetInnerHTML') {\n\t\t\toldHtml = value;\n\t\t} else if (!(i in newProps)) {\n\t\t\tsetProperty(dom, i, null, value, isSvg);\n\t\t}\n\t}\n\n\tfor (i in newProps) {\n\t\tvalue = newProps[i];\n\t\tif (i === 'key') {\n\t\t} else if (i === 'children') {\n\t\t\tnewChildren = value;\n\t\t} else if (i === 'dangerouslySetInnerHTML') {\n\t\t\tnewHtml = value;\n\t\t} else if (\n\t\t\tvalue !== (tmp = oldProps[i]) ||\n\t\t\t((i === 'checked' || i === 'value') && value != null && value !== dom[i])\n\t\t) {\n\t\t\tsetProperty(dom, i, value, tmp, isSvg);\n\t\t}\n\t}\n\n\t// If the new vnode didn't have dangerouslySetInnerHTML, diff its children\n\tif (newHtml) {\n\t\tvalue = newHtml.__html;\n\t\t// Avoid re-applying the same '__html' if it did not changed between re-render\n\t\tif (!oldHtml || (value !== oldHtml.__html && value !== dom.innerHTML)) {\n\t\t\tdom.innerHTML = value;\n\t\t}\n\t\tinternal._children = null;\n\t} else {\n\t\tif (oldHtml) dom.innerHTML = '';\n\n\t\tdiffChildren(\n\t\t\tdom,\n\t\t\tnewChildren && Array.isArray(newChildren) ? newChildren : [newChildren],\n\t\t\tinternal,\n\t\t\tglobalContext,\n\t\t\tcommitQueue,\n\t\t\tdom.firstChild\n\t\t);\n\t}\n\n\tif (newProps.value != null && dom._isControlled) {\n\t\tdom._prevValue = newProps.value;\n\t} else if (newProps.checked != null && dom._isControlled) {\n\t\tdom._prevValue = newProps.checked;\n\t}\n}\n","import { addCommitCallback, commitRoot } from './diff/commit';\nimport options from './options';\nimport { createVNode, Fragment } from './create-element';\nimport { patch } from './diff/patch';\nimport {\n\tDIRTY_BIT,\n\tFORCE_UPDATE,\n\tMODE_HYDRATE,\n\tMODE_SUSPENDED,\n\tMODE_UNMOUNTING\n} from './constants';\nimport { getDomSibling, getParentDom } from './tree';\n\n/**\n * Base Component class. Provides `setState()` and `forceUpdate()`, which\n * trigger rendering\n * @param {object} props The initial component props\n * @param {object} context The initial context from parent components'\n * getChildContext\n */\nexport function Component(props, context) {\n\tthis.props = props;\n\tthis.context = context;\n}\n\n/**\n * Update component state and schedule a re-render.\n * @this {import('./internal').Component}\n * @param {object | ((s: object, p: object) => object)} update A hash of state\n * properties to update with new values or a function that given the current\n * state and props returns a new partial state\n * @param {() => void} [callback] A function to be called once component state is\n * updated\n */\nComponent.prototype.setState = function(update, callback) {\n\t// only clone state when copying to nextState the first time.\n\tlet s;\n\tif (this._nextState != null && this._nextState !== this.state) {\n\t\ts = this._nextState;\n\t} else {\n\t\ts = this._nextState = Object.assign({}, this.state);\n\t}\n\n\tif (typeof update == 'function') {\n\t\t// Some libraries like `immer` mark the current state as readonly,\n\t\t// preventing us from mutating it, so we need to clone it. See #2716\n\t\tupdate = update(Object.assign({}, s), this.props);\n\t}\n\n\tif (update) {\n\t\tObject.assign(s, update);\n\t}\n\n\t// Skip update if updater function returned null\n\tif (update == null) return;\n\n\tif (this._internal) {\n\t\tif (callback) addCommitCallback(this._internal, callback);\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Immediately perform a synchronous re-render of the component\n * @this {import('./internal').Component}\n * @param {() => void} [callback] A function to be called after component is\n * re-rendered\n */\nComponent.prototype.forceUpdate = function(callback) {\n\tif (this._internal) {\n\t\t// Set render mode so that we can differentiate where the render request\n\t\t// is coming from. We need this because forceUpdate should never call\n\t\t// shouldComponentUpdate\n\t\tthis._internal._flags |= FORCE_UPDATE;\n\t\tif (callback) addCommitCallback(this._internal, callback);\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Accepts `props` and `state`, and returns a new Virtual DOM tree to build.\n * Virtual DOM is generally constructed via [JSX](http://jasonformat.com/wtf-is-jsx).\n * @param {object} props Props (eg: JSX attributes) received from parent\n * element/component\n * @param {object} state The component's current state\n * @param {object} context Context object, as returned by the nearest\n * ancestor's `getChildContext()`\n * @returns {import('./index').ComponentChildren | void}\n */\nComponent.prototype.render = Fragment;\n\n/**\n * Trigger in-place re-rendering of a component.\n * @param {import('./internal').Component} component The component to rerender\n */\nfunction rerenderComponent(component) {\n\tlet internal = component._internal;\n\n\tif (~internal._flags & MODE_UNMOUNTING && internal._flags & DIRTY_BIT) {\n\t\tlet parentDom = getParentDom(internal);\n\t\tlet startDom =\n\t\t\t(internal._flags & (MODE_HYDRATE | MODE_SUSPENDED)) ===\n\t\t\t(MODE_HYDRATE | MODE_SUSPENDED)\n\t\t\t\t? internal._dom\n\t\t\t\t: getDomSibling(internal, 0);\n\n\t\tconst vnode = createVNode(\n\t\t\tinternal.type,\n\t\t\tinternal.props,\n\t\t\tinternal.key, // @TODO we shouldn't need to actually pass these\n\t\t\tinternal.ref, // since the mode flag should bypass key/ref handling\n\t\t\t0\n\t\t);\n\n\t\tconst commitQueue = [];\n\t\tpatch(\n\t\t\tparentDom,\n\t\t\tvnode,\n\t\t\tinternal,\n\t\t\tcomponent._globalContext,\n\t\t\tcommitQueue,\n\t\t\tstartDom\n\t\t);\n\t\tcommitRoot(commitQueue, internal);\n\t}\n}\n\n/**\n * The render queue\n * @type {Array<import('./internal').Component>}\n */\nlet rerenderQueue = [];\n\n/*\n * The value of `Component.debounce` must asynchronously invoke the passed in callback. It is\n * important that contributors to Preact can consistently reason about what calls to `setState`, etc.\n * do, and when their effects will be applied. See the links below for some further reading on designing\n * asynchronous APIs.\n * * [Designing APIs for Asynchrony](https://blog.izs.me/2013/08/designing-apis-for-asynchrony)\n * * [Callbacks synchronous and asynchronous](https://blog.ometer.com/2011/07/24/callbacks-synchronous-and-asynchronous/)\n */\n\nlet prevDebounce;\n\nconst defer = Promise.prototype.then.bind(Promise.resolve());\n\n/**\n * Enqueue a rerender of a component\n * @param {import('./internal').Component} c The component to rerender\n */\nexport function enqueueRender(c) {\n\tif (\n\t\t(!(c._internal._flags & DIRTY_BIT) &&\n\t\t\t(c._internal._flags |= DIRTY_BIT) &&\n\t\t\trerenderQueue.push(c) &&\n\t\t\t!process._rerenderCount++) ||\n\t\tprevDebounce !== options.debounceRendering\n\t) {\n\t\tprevDebounce = options.debounceRendering;\n\t\t(prevDebounce || defer)(process);\n\t}\n}\n\n/** Flush the render queue by rerendering all queued components */\nfunction process() {\n\twhile ((len = process._rerenderCount = rerenderQueue.length)) {\n\t\trerenderQueue.sort((a, b) => a._internal._depth - b._internal._depth);\n\t\twhile (len--) {\n\t\t\trerenderComponent(rerenderQueue.shift());\n\t\t}\n\t}\n}\nlet len = (process._rerenderCount = 0);\n","import { Fragment } from '../create-element';\nimport options from '../options';\nimport { Component } from '../component';\nimport { mountChildren } from './mount';\nimport { diffChildren, reorderChildren } from './children';\nimport {\n\tDIRTY_BIT,\n\tFORCE_UPDATE,\n\tMODE_PENDING_ERROR,\n\tMODE_RERENDERING_ERROR,\n\tTYPE_CLASS\n} from '../constants';\nimport { addCommitCallback } from './commit';\n\n/**\n * Diff two virtual nodes and apply proper changes to the DOM\n * @param {import('../internal').PreactElement} parentDom The parent of the DOM element\n * @param {import('../internal').VNode} newVNode The new virtual node\n * @param {import('../internal').Internal} internal The component's backing Internal node\n * @param {object} globalContext The current context object. Modified by getChildContext\n * @param {import('../internal').CommitQueue} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {import('../internal').PreactNode} startDom\n * @returns {import('../internal').PreactNode} pointer to the next DOM node (in order) to be rendered (or null)\n */\nexport function renderComponent(\n\tparentDom,\n\tnewVNode,\n\tinternal,\n\tglobalContext,\n\tcommitQueue,\n\tstartDom\n) {\n\t/** @type {import('../internal').Component} */\n\tlet c;\n\tlet isNew, oldProps, oldState, snapshot, tmp;\n\n\t/** @type {import('../internal').ComponentType} */\n\tlet type = (internal.type);\n\n\t// @TODO split update + mount?\n\tlet newProps = newVNode ? newVNode.props : internal.props;\n\n\tif (internal._flags & MODE_PENDING_ERROR) {\n\t\t// Toggle the MODE_PENDING_ERROR and MODE_RERENDERING_ERROR flags. In\n\t\t// actuality, this should turn off the MODE_PENDING_ERROR flag and turn on\n\t\t// the MODE_RERENDERING_ERROR flag.\n\t\tinternal._flags ^= MODE_PENDING_ERROR | MODE_RERENDERING_ERROR;\n\t}\n\n\t// Necessary for createContext api. Setting this property will pass\n\t// the context value as `this.context` just for this component.\n\ttmp = type.contextType;\n\tlet provider = tmp && globalContext[tmp._id];\n\tlet componentContext = tmp\n\t\t? provider\n\t\t\t? provider.props.value\n\t\t\t: tmp._defaultValue\n\t\t: globalContext;\n\n\tif (internal && internal._component) {\n\t\tc = internal._component;\n\t} else {\n\t\t// Instantiate the new component\n\t\tif (internal._flags & TYPE_CLASS) {\n\t\t\t// @ts-ignore The check above verifies that newType is suppose to be constructed\n\t\t\tinternal._component = c = new type(newProps, componentContext); // eslint-disable-line new-cap\n\t\t} else {\n\t\t\t// @ts-ignore Trust me, Component implements the interface we want\n\t\t\tinternal._component = c = new Component(newProps, componentContext);\n\t\t\tc.constructor = type;\n\t\t\tc.render = doRender;\n\t\t}\n\t\tif (provider) provider._subs.add(c);\n\n\t\tc.props = newProps;\n\t\tif (!c.state) c.state = {};\n\t\tc.context = componentContext;\n\t\tc._globalContext = globalContext;\n\t\tisNew = true;\n\t\tinternal._flags |= DIRTY_BIT;\n\t}\n\n\t// Invoke getDerivedStateFromProps\n\tif (c._nextState == null) {\n\t\tc._nextState = c.state;\n\t}\n\tif (type.getDerivedStateFromProps != null) {\n\t\tif (c._nextState == c.state) {\n\t\t\tc._nextState = Object.assign({}, c._nextState);\n\t\t}\n\n\t\tObject.assign(\n\t\t\tc._nextState,\n\t\t\ttype.getDerivedStateFromProps(newProps, c._nextState)\n\t\t);\n\t}\n\n\toldProps = c.props;\n\toldState = c.state;\n\tif (isNew) {\n\t\tif (type.getDerivedStateFromProps == null && c.componentWillMount != null) {\n\t\t\tc.componentWillMount();\n\t\t}\n\n\t\tif (c.componentDidMount != null) {\n\t\t\t// If the component was constructed, queue up componentDidMount so the\n\t\t\t// first time this internal commits (regardless of suspense or not) it\n\t\t\t// will be called\n\t\t\taddCommitCallback(internal, c.componentDidMount);\n\t\t}\n\t} else {\n\t\tif (\n\t\t\ttype.getDerivedStateFromProps == null &&\n\t\t\tnewProps !== oldProps &&\n\t\t\tc.componentWillReceiveProps != null\n\t\t) {\n\t\t\tc.componentWillReceiveProps(newProps, componentContext);\n\t\t}\n\n\t\tif (\n\t\t\t(!(internal._flags & FORCE_UPDATE) &&\n\t\t\t\tc.shouldComponentUpdate != null &&\n\t\t\t\tc.shouldComponentUpdate(newProps, c._nextState, componentContext) ===\n\t\t\t\t\tfalse) ||\n\t\t\t(newVNode && newVNode._vnodeId === internal._vnodeId)\n\t\t) {\n\t\t\tc.props = newProps;\n\t\t\tc.state = c._nextState;\n\t\t\tinternal.props = newProps;\n\t\t\t// More info about this here: https://gist.github.com/JoviDeCroock/bec5f2ce93544d2e6070ef8e0036e4e8\n\t\t\tif (newVNode && newVNode._vnodeId !== internal._vnodeId) {\n\t\t\t\tinternal._flags &= ~DIRTY_BIT;\n\t\t\t}\n\n\t\t\tc._internal = internal;\n\t\t\tif (\n\t\t\t\tinternal._commitCallbacks != null &&\n\t\t\t\tinternal._commitCallbacks.length\n\t\t\t) {\n\t\t\t\tcommitQueue.push(internal);\n\t\t\t}\n\n\t\t\t// TODO: Returning undefined here (i.e. return;) passes all tests. That seems\n\t\t\t// like a bug. Should validate that we have test coverage for sCU that\n\t\t\t// returns Fragments with multiple DOM children\n\t\t\treturn reorderChildren(internal, startDom, parentDom);\n\t\t}\n\n\t\tif (c.componentWillUpdate != null) {\n\t\t\tc.componentWillUpdate(newProps, c._nextState, componentContext);\n\t\t}\n\t}\n\n\tc.context = componentContext;\n\tc.props = newProps;\n\tc.state = c._nextState;\n\n\tinternal.props = newProps;\n\n\tif ((tmp = options._render)) tmp(internal);\n\n\tinternal._flags &= ~DIRTY_BIT;\n\tc._internal = internal;\n\n\ttmp = c.render(c.props, c.state, c.context);\n\n\t// Handle setState called in render, see #2553\n\tc.state = c._nextState;\n\n\tif (c.getChildContext != null) {\n\t\tglobalContext = Object.assign({}, globalContext, c.getChildContext());\n\t}\n\n\tif (!isNew) {\n\t\tif (c.getSnapshotBeforeUpdate != null) {\n\t\t\tsnapshot = c.getSnapshotBeforeUpdate(oldProps, oldState);\n\t\t}\n\n\t\t// Only schedule componentDidUpdate if the component successfully rendered\n\t\tif (c.componentDidUpdate != null) {\n\t\t\taddCommitCallback(internal, () => {\n\t\t\t\tc.componentDidUpdate(oldProps, oldState, snapshot);\n\t\t\t});\n\t\t}\n\t}\n\n\tlet isTopLevelFragment =\n\t\ttmp != null && tmp.type === Fragment && tmp.key == null;\n\tlet renderResult = isTopLevelFragment ? tmp.props.children : tmp;\n\n\tlet nextDomSibling;\n\n\tif (internal._children == null) {\n\t\tnextDomSibling = mountChildren(\n\t\t\tparentDom,\n\t\t\tArray.isArray(renderResult) ? renderResult : [renderResult],\n\t\t\tinternal,\n\t\t\tglobalContext,\n\t\t\tcommitQueue,\n\t\t\tstartDom\n\t\t);\n\t} else {\n\t\tnextDomSibling = diffChildren(\n\t\t\tparentDom,\n\t\t\tArray.isArray(renderResult) ? renderResult : [renderResult],\n\t\t\tinternal,\n\t\t\tglobalContext,\n\t\t\tcommitQueue,\n\t\t\tstartDom\n\t\t);\n\t}\n\n\tif (internal._commitCallbacks != null && internal._commitCallbacks.length) {\n\t\tcommitQueue.push(internal);\n\t}\n\n\treturn nextDomSibling;\n}\n\n/** The `.render()` method for a PFC backing instance. */\nfunction doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}\n","import { applyRef } from './refs';\nimport {\n\tTYPE_COMPONENT,\n\tTYPE_ELEMENT,\n\tMODE_HYDRATE,\n\tMODE_MUTATIVE_HYDRATE,\n\tMODE_SUSPENDED,\n\tRESET_MODE,\n\tTYPE_TEXT,\n\tMODE_ERRORED,\n\tTYPE_ROOT,\n\tMODE_SVG\n} from '../constants';\nimport { normalizeToVNode } from '../create-element';\nimport { setProperty } from './props';\nimport { renderComponent } from './component';\nimport { createInternal } from '../tree';\nimport options from '../options';\n\n/**\n * Diff two virtual nodes and apply proper changes to the DOM\n * @param {import('../internal').PreactElement} parentDom The parent of the DOM element\n * @param {import('../internal').VNode | string} newVNode The new virtual node\n * @param {import('../internal').Internal} internal The Internal node to mount\n * @param {object} globalContext The current context object. Modified by getChildContext\n * @param {import('../internal').CommitQueue} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {import('../internal').PreactElement} startDom\n * @returns {import('../internal').PreactElement | null} pointer to the next DOM node to be hydrated (or null)\n */\nexport function mount(\n\tparentDom,\n\tnewVNode,\n\tinternal,\n\tglobalContext,\n\tcommitQueue,\n\tstartDom\n) {\n\tif (options._diff) options._diff(internal, newVNode);\n\n\t/** @type {import('../internal').PreactElement} */\n\tlet nextDomSibling;\n\n\ttry {\n\t\tif (internal._flags & TYPE_COMPONENT) {\n\t\t\t// Root nodes signal that an attempt to render into a specific DOM node on\n\t\t\t// the page. Root nodes can occur anywhere in the tree and not just at the\n\t\t\t// top.\n\t\t\tlet prevStartDom = startDom;\n\t\t\tlet prevParentDom = parentDom;\n\t\t\tif (internal._flags & TYPE_ROOT) {\n\t\t\t\tparentDom = newVNode.props._parentDom;\n\n\t\t\t\tif (parentDom !== prevParentDom) {\n\t\t\t\t\tstartDom = null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tnextDomSibling = renderComponent(\n\t\t\t\tparentDom,\n\t\t\t\tnull,\n\t\t\t\tinternal,\n\t\t\t\tglobalContext,\n\t\t\t\tcommitQueue,\n\t\t\t\tstartDom\n\t\t\t);\n\n\t\t\tif (internal._flags & TYPE_ROOT && prevParentDom !== parentDom) {\n\t\t\t\t// If we just mounted a root node/Portal, and it changed the parentDom\n\t\t\t\t// of it's children, then we need to resume the diff from it's previous\n\t\t\t\t// startDom element, which could be null if we are mounting an entirely\n\t\t\t\t// new tree, or the portal's nextSibling if we are mounting a Portal in\n\t\t\t\t// an existing tree.\n\t\t\t\tnextDomSibling = prevStartDom;\n\t\t\t}\n\t\t} else {\n\t\t\tlet hydrateDom =\n\t\t\t\tinternal._flags & (MODE_HYDRATE | MODE_MUTATIVE_HYDRATE)\n\t\t\t\t\t? startDom\n\t\t\t\t\t: null;\n\n\t\t\tnextDomSibling = mountDOMElement(\n\t\t\t\thydrateDom,\n\t\t\t\tinternal,\n\t\t\t\tglobalContext,\n\t\t\t\tcommitQueue\n\t\t\t);\n\t\t}\n\n\t\tif (options.diffed) options.diffed(internal);\n\n\t\t// We successfully rendered this VNode, unset any stored hydration/bailout state:\n\t\tinternal._flags &= RESET_MODE;\n\t} catch (e) {\n\t\tinternal._vnodeId = 0;\n\t\tinternal._flags |= e.then ? MODE_SUSPENDED : MODE_ERRORED;\n\n\t\tif (internal._flags & MODE_HYDRATE) {\n\t\t\t// @ts-ignore Trust me TS, nextSibling is a PreactElement\n\t\t\tnextDomSibling = startDom && startDom.nextSibling;\n\t\t\tinternal._dom = startDom; // Save our current DOM position to resume later\n\t\t}\n\t\toptions._catchError(e, internal);\n\t}\n\n\treturn nextDomSibling;\n}\n\n/**\n * Diff two virtual nodes representing DOM element\n * @param {import('../internal').PreactElement} dom The DOM element representing\n * the virtual nodes being diffed\n * @param {import('../internal').Internal} internal The Internal node to mount\n * @param {object} globalContext The current context object\n * @param {import('../internal').CommitQueue} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @returns {import('../internal').PreactElement}\n */\nfunction mountDOMElement(dom, internal, globalContext, commitQueue) {\n\tlet newProps = internal.props;\n\tlet nodeType = internal.type;\n\t/** @type {any} */\n\tlet i, value;\n\n\tlet flags = internal._flags;\n\tlet isSvg = flags & MODE_SVG;\n\n\t// Are we *not* hydrating? (a top-level render() or mutative hydration):\n\tlet isFullRender = ~flags & MODE_HYDRATE;\n\n\t// if hydrating (hydrate() or render() with replaceNode), find the matching child:\n\tif (flags & (MODE_HYDRATE | MODE_MUTATIVE_HYDRATE)) {\n\t\twhile (\n\t\t\tdom &&\n\t\t\t(nodeType ? dom.localName !== nodeType : dom.nodeType !== 3)\n\t\t) {\n\t\t\tdom = dom.nextSibling;\n\t\t}\n\t}\n\n\tlet isNew = dom == null;\n\n\tif (flags & TYPE_TEXT) {\n\t\tif (isNew) {\n\t\t\t// @ts-ignore createTextNode returns Text, we expect PreactElement\n\t\t\tdom = document.createTextNode(newProps);\n\t\t} else if (dom.data !== newProps) {\n\t\t\tdom.data = newProps;\n\t\t}\n\n\t\tinternal._dom = dom;\n\t} else {\n\t\t// Tracks entering and exiting SVG namespace when descending through the tree.\n\t\t// if (nodeType === 'svg') internal._flags |= MODE_SVG;\n\n\t\tif (isNew) {\n\t\t\tif (isSvg) {\n\t\t\t\tdom = document.createElementNS(\n\t\t\t\t\t'http://www.w3.org/2000/svg',\n\t\t\t\t\t// @ts-ignore We know `newVNode.type` is a string\n\t\t\t\t\tnodeType\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tdom = document.createElement(\n\t\t\t\t\t// @ts-ignore We know `newVNode.type` is a string\n\t\t\t\t\tnodeType,\n\t\t\t\t\tnewProps.is && newProps\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// we are creating a new node, so we can assume this is a new subtree (in case we are hydrating), this deopts the hydrate\n\t\t\tinternal._flags = flags &= RESET_MODE;\n\t\t\tisFullRender = 1;\n\t\t}\n\n\t\t// @TODO: Consider removing and instructing users to instead set the desired\n\t\t// prop for removal to undefined/null. During hydration, props are not\n\t\t// diffed at all (including dangerouslySetInnerHTML)\n\t\tif (flags & MODE_MUTATIVE_HYDRATE) {\n\t\t\t// But, if we are in a situation where we are using existing DOM (e.g. replaceNode)\n\t\t\t// we should read the existing DOM attributes to diff them\n\t\t\tfor (i = 0; i < dom.attributes.length; i++) {\n\t\t\t\tvalue = dom.attributes[i].name;\n\t\t\t\tif (!(value in newProps)) {\n\t\t\t\t\tdom.removeAttribute(value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tlet newHtml, newValue, newChildren;\n\t\tif (\n\t\t\t(internal.type === 'input' ||\n\t\t\t\tinternal.type === 'textarea' ||\n\t\t\t\tinternal.type === 'select') &&\n\t\t\t(newProps.onInput || newProps.onChange)\n\t\t) {\n\t\t\tif (newProps.value != null) {\n\t\t\t\tdom._isControlled = true;\n\t\t\t\tdom._prevValue = newProps.value;\n\t\t\t} else if (newProps.checked != null) {\n\t\t\t\tdom._isControlled = true;\n\t\t\t\tdom._prevValue = newProps.checked;\n\t\t\t}\n\t\t}\n\n\t\tfor (i in newProps) {\n\t\t\tvalue = newProps[i];\n\t\t\tif (i === 'key') {\n\t\t\t} else if (i === 'children') {\n\t\t\t\tnewChildren = value;\n\t\t\t} else if (i === 'dangerouslySetInnerHTML') {\n\t\t\t\tnewHtml = value;\n\t\t\t} else if (i === 'value') {\n\t\t\t\tnewValue = value;\n\t\t\t} else if (\n\t\t\t\tvalue != null &&\n\t\t\t\t(isFullRender || typeof value === 'function')\n\t\t\t) {\n\t\t\t\tsetProperty(dom, i, value, null, isSvg);\n\t\t\t}\n\t\t}\n\n\t\tinternal._dom = dom;\n\n\t\t// If the new vnode didn't have dangerouslySetInnerHTML, diff its children\n\t\tif (newHtml) {\n\t\t\tif (isFullRender && newHtml.__html) {\n\t\t\t\tdom.innerHTML = newHtml.__html;\n\t\t\t}\n\t\t\tinternal._children = null;\n\t\t} else if (newChildren != null) {\n\t\t\tmountChildren(\n\t\t\t\tdom,\n\t\t\t\tnewChildren && Array.isArray(newChildren) ? newChildren : [newChildren],\n\t\t\t\tinternal,\n\t\t\t\tglobalContext,\n\t\t\t\tcommitQueue,\n\t\t\t\tisNew ? null : dom.firstChild\n\t\t\t);\n\t\t}\n\n\t\t// (as above, don't diff props during hydration)\n\t\tif (isFullRender && newValue != null) {\n\t\t\tsetProperty(dom, 'value', newValue, null, 0);\n\t\t}\n\t}\n\n\t// @ts-ignore\n\treturn isNew ? null : dom.nextSibling;\n}\n\n/**\n * Diff the children of a virtual node\n * @param {import('../internal').PreactElement} parentDom The DOM element whose\n * children are being diffed\n * @param {import('../internal').ComponentChildren[]} renderResult\n * @param {import('../internal').Internal} parentInternal The parent Internal of the given children\n * @param {object} globalContext The current context object - modified by getChildContext\n * @param {import('../internal').CommitQueue} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {import('../internal').PreactElement} startDom\n */\nexport function mountChildren(\n\tparentDom,\n\trenderResult,\n\tparentInternal,\n\tglobalContext,\n\tcommitQueue,\n\tstartDom\n) {\n\tlet internalChildren = (parentInternal._children = []),\n\t\ti,\n\t\tchildVNode,\n\t\tchildInternal,\n\t\tnewDom,\n\t\tmountedNextChild;\n\n\tfor (i = 0; i < renderResult.length; i++) {\n\t\tchildVNode = normalizeToVNode(renderResult[i]);\n\n\t\t// Terser removes the `continue` here and wraps the loop body\n\t\t// in a `if (childVNode) { ... } condition\n\t\tif (childVNode == null) {\n\t\t\tinternalChildren[i] = null;\n\t\t\tcontinue;\n\t\t}\n\n\t\tchildInternal = createInternal(childVNode, parentInternal);\n\t\tinternalChildren[i] = childInternal;\n\n\t\t// Morph the old element into the new one, but don't append it to the dom yet\n\t\tmountedNextChild = mount(\n\t\t\tparentDom,\n\t\t\tchildVNode,\n\t\t\tchildInternal,\n\t\t\tglobalContext,\n\t\t\tcommitQueue,\n\t\t\tstartDom\n\t\t);\n\n\t\tnewDom = childInternal._dom;\n\n\t\tif (childInternal._flags & TYPE_COMPONENT || newDom == startDom) {\n\t\t\t// If the child is a Fragment-like or if it is DOM VNode and its _dom\n\t\t\t// property matches the dom we are diffing (i.e. startDom), just\n\t\t\t// continue with the mountedNextChild\n\t\t\tstartDom = mountedNextChild;\n\t\t} else if (newDom != null) {\n\t\t\t// The DOM the diff should begin with is now startDom (since we inserted\n\t\t\t// newDom before startDom) so ignore mountedNextChild and continue with\n\t\t\t// startDom\n\t\t\tparentDom.insertBefore(newDom, startDom);\n\t\t}\n\n\t\tif (childInternal.ref) {\n\t\t\tapplyRef(\n\t\t\t\tnull,\n\t\t\t\tchildInternal.ref,\n\t\t\t\tchildInternal._component || newDom,\n\t\t\t\tchildInternal\n\t\t\t);\n\t\t}\n\t}\n\n\t// Remove children that are not part of any vnode.\n\tif (\n\t\tparentInternal._flags & (MODE_HYDRATE | MODE_MUTATIVE_HYDRATE) &&\n\t\tparentInternal._flags & TYPE_ELEMENT\n\t) {\n\t\t// TODO: Would it be simpler to just clear the pre-existing DOM in top-level\n\t\t// render if render is called with no oldVNode & existing children & no\n\t\t// replaceNode? Instead of patching the DOM to match the VNode tree? (remove\n\t\t// attributes & unused DOM)\n\t\twhile (startDom) {\n\t\t\ti = startDom;\n\t\t\tstartDom = startDom.nextSibling;\n\t\t\ti.remove();\n\t\t}\n\t}\n\n\treturn startDom;\n}\n","import {\n\tMODE_HYDRATE,\n\tMODE_MUTATIVE_HYDRATE,\n\tMODE_SVG,\n\tUNDEFINED\n} from './constants';\nimport { commitRoot } from './diff/commit';\nimport { createElement, Fragment } from './create-element';\nimport options from './options';\nimport { mount } from './diff/mount';\nimport { patch } from './diff/patch';\nimport { createInternal } from './tree';\n\n/**\n * Render a Preact virtual node into a DOM element\n * @param {import('./internal').ComponentChild} vnode The virtual node to render\n * @param {import('./internal').PreactElement} parentDom The DOM element to\n * render into\n */\nexport function render(vnode, parentDom) {\n\tif (options._root) options._root(vnode, parentDom);\n\n\t// List of effects that need to be called after diffing.\n\tconst commitQueue = [];\n\n\t// To be able to support calling `render()` multiple times on the same\n\t// DOM node, we need to obtain a reference to the previous tree. We do\n\t// this by assigning a new `_children` property to DOM nodes which points\n\t// to the last rendered tree. By default this property is not present, which\n\t// means that we are mounting a new tree for the first time.\n\tlet rootInternal = parentDom._children;\n\tvnode = createElement(Fragment, { _parentDom: parentDom }, [vnode]);\n\n\tif (rootInternal) {\n\t\tpatch(\n\t\t\tparentDom,\n\t\t\tvnode,\n\t\t\trootInternal,\n\t\t\t{},\n\t\t\tcommitQueue,\n\t\t\tparentDom.firstChild\n\t\t);\n\t} else {\n\t\t// Store the VDOM tree root on the DOM element in a (minified) property:\n\t\trootInternal = parentDom._children = createInternal(vnode, null);\n\n\t\tif (parentDom.ownerSVGElement !== UNDEFINED) {\n\t\t\trootInternal._flags |= MODE_SVG;\n\t\t}\n\n\t\t// Calling `render` on a container with existing DOM elements puts the diff into mutative hydrate mode:\n\t\tif (parentDom.firstChild) {\n\t\t\trootInternal._flags |= MODE_MUTATIVE_HYDRATE;\n\t\t}\n\n\t\tmount(\n\t\t\tparentDom,\n\t\t\tvnode,\n\t\t\trootInternal,\n\t\t\t{},\n\t\t\tcommitQueue,\n\t\t\t// Start the diff at the replaceNode or the parentDOM.firstChild if any.\n\t\t\t// Will be null if the parentDom is empty\n\t\t\tparentDom.firstChild\n\t\t);\n\t}\n\n\t// Flush all queued effects\n\tcommitRoot(commitQueue, rootInternal);\n}\n\n/**\n * Update an existing DOM element with data from a Preact virtual node\n * @param {import('./internal').ComponentChild} vnode The virtual node to render\n * @param {import('./internal').PreactElement} parentDom The DOM element to\n * update\n */\nexport function hydrate(vnode, parentDom) {\n\tif (options._root) options._root(vnode, parentDom);\n\n\tvnode = createElement(Fragment, { _parentDom: parentDom }, [vnode]);\n\tconst rootInternal = createInternal(vnode);\n\trootInternal._flags |= MODE_HYDRATE;\n\tparentDom._children = rootInternal;\n\n\tif (parentDom.ownerSVGElement !== UNDEFINED) {\n\t\trootInternal._flags |= MODE_SVG;\n\t}\n\n\tconst commitQueue = [];\n\tmount(parentDom, vnode, rootInternal, {}, commitQueue, parentDom.firstChild);\n\tcommitRoot(commitQueue, rootInternal);\n}\n","import {\n\tMODE_HYDRATE,\n\tMODE_MUTATIVE_HYDRATE,\n\tMODE_SVG,\n\tUNDEFINED\n} from './constants';\nimport { commitRoot } from './diff/commit';\nimport { createElement, Fragment } from './create-element';\nimport options from './options';\nimport { mount } from './diff/mount';\nimport { patch } from './diff/patch';\nimport { createInternal } from './tree';\n\n/**\n *\n * @param {import('./internal').PreactElement} parentDom The DOM element to\n */\nexport function createRoot(parentDom) {\n\tlet rootInternal = null;\n\n\tfunction render(vnode) {\n\t\tif (options._root) options._root(vnode, parentDom);\n\n\t\t// List of effects that need to be called after diffing.\n\t\tconst commitQueue = [];\n\n\t\tvnode = createElement(Fragment, { _parentDom: parentDom }, [vnode]);\n\n\t\tif (rootInternal) {\n\t\t\tpatch(\n\t\t\t\tparentDom,\n\t\t\t\tvnode,\n\t\t\t\trootInternal,\n\t\t\t\t{},\n\t\t\t\tcommitQueue,\n\t\t\t\tparentDom.firstChild\n\t\t\t);\n\t\t} else {\n\t\t\t// Store the VDOM tree root on the DOM element in a (minified) property:\n\t\t\trootInternal = parentDom._children = createInternal(vnode, null);\n\n\t\t\tif (parentDom.ownerSVGElement !== UNDEFINED) {\n\t\t\t\trootInternal._flags |= MODE_SVG;\n\t\t\t}\n\n\t\t\t// Calling `render` on a container with existing DOM elements puts the diff into mutative hydrate mode:\n\t\t\tif (parentDom.firstChild) {\n\t\t\t\trootInternal._flags |= MODE_MUTATIVE_HYDRATE;\n\t\t\t}\n\n\t\t\tmount(\n\t\t\t\tparentDom,\n\t\t\t\tvnode,\n\t\t\t\trootInternal,\n\t\t\t\t{},\n\t\t\t\tcommitQueue,\n\t\t\t\t// Start the diff at the replaceNode or the parentDOM.firstChild if any.\n\t\t\t\t// Will be null if the parentDom is empty\n\t\t\t\tparentDom.firstChild\n\t\t\t);\n\t\t}\n\n\t\t// Flush all queued effects\n\t\tcommitRoot(commitQueue, vnode);\n\t}\n\n\treturn {\n\t\thydrate(vnode) {\n\t\t\tif (options._root) options._root(vnode, parentDom);\n\n\t\t\tvnode = createElement(Fragment, { _parentDom: parentDom }, [vnode]);\n\t\t\trootInternal = createInternal(vnode);\n\t\t\trootInternal._flags |= MODE_HYDRATE;\n\t\t\tparentDom._children = rootInternal;\n\n\t\t\tif (parentDom.ownerSVGElement !== UNDEFINED) {\n\t\t\t\trootInternal._flags |= MODE_SVG;\n\t\t\t}\n\n\t\t\tconst commitQueue = [];\n\t\t\tmount(\n\t\t\t\tparentDom,\n\t\t\t\tvnode,\n\t\t\t\trootInternal,\n\t\t\t\t{},\n\t\t\t\tcommitQueue,\n\t\t\t\tparentDom.firstChild\n\t\t\t);\n\t\t\tcommitRoot(commitQueue, rootInternal);\n\t\t},\n\t\trender\n\t};\n}\n","import { createVNode } from './create-element';\n\n/**\n * Clones the given VNode, optionally adding attributes/props and replacing its children.\n * @param {import('./internal').VNode} vnode The virtual DOM element to clone\n * @param {object} props Attributes/props to add when cloning\n * @param {Array<import('./internal').ComponentChildren>} rest Any additional arguments will be used as replacement children.\n * @returns {import('./internal').VNode}\n */\nexport function cloneElement(vnode, props, children) {\n\tlet normalizedProps = Object.assign({}, vnode.props),\n\t\tkey,\n\t\tref,\n\t\ti;\n\n\tfor (i in props) {\n\t\tif (!(i === 'key' || (typeof vnode.type !== 'function' && i === 'ref'))) {\n\t\t\tnormalizedProps[i] = props[i];\n\t\t} else if (i === 'key') {\n\t\t\tkey = props[i];\n\t\t} else if (i === 'ref') {\n\t\t\tref = props[i];\n\t\t}\n\t}\n\n\tif (arguments.length > 3) {\n\t\tchildren = [children];\n\t\tfor (i = 3; i < arguments.length; i++) {\n\t\t\tchildren.push(arguments[i]);\n\t\t}\n\t}\n\tif (children != null) {\n\t\tnormalizedProps.children = children;\n\t}\n\n\treturn createVNode(\n\t\tvnode.type,\n\t\tnormalizedProps,\n\t\tkey || vnode.key,\n\t\tref || vnode.ref,\n\t\t0\n\t);\n}\n"],"names":["EMPTY_ARR","options","[object Object]","error","internal","TYPE_CLASS","type","getDerivedStateFromError","setState","componentDidCatch","e","addCommitCallback","callback","push","commitRoot","commitQueue","rootInternal","some","length","shift","call","vnodeId","createElement","props","children","key","ref","i","normalizedProps","arguments","defaultProps","undefined","createVNode","original","vnode","constructor","__v","normalizeToVNode","childVNode","Array","isArray","Fragment","createRef","current","isValidElement","applyRef","oldRef","value","setStyle","style","setProperty","dom","name","oldValue","isSvg","useCapture","o","cssText","replace","toLowerCase","slice","_listeners","addEventListener","eventProxyCapture","eventProxy","removeEventListener","setAttribute","removeAttribute","this","event","_isControlled","_prevValue","checked","nextContextId","providers","Set","createContext","defaultValue","contextId","context","__c","__","Consumer","contextValue","Provider","ctx","forEach","enqueueRender","getChildContext","contextType","unmount","parentInternal","skipRemove","r","delete","component","p","componentWillUnmount","TYPE_TEXT","remove","createInternal","flags","MODE_HYDRATE","NaN","prototype","__k","__e","__f","__b","shouldSearchComponent","getParentDom","getDomSibling","childIndex","indexOf","getChildDom","child","childDom","parentDom","parent","diffChildren","renderResult","globalContext","startDom","newDom","refs","childInternal","oldChildren","oldChildrenLength","newChildren","oldVNodeRef","nextDomSibling","findMatchingInternal","mount","patch","placeChild","parentNode","j","reorderChildren","tmp","nextSibling","toChildArray","out","insertBefore","sibDom","newVNode","data","patchDOMElement","diffed","prevStartDom","prevParentDom","renderComponent","then","newHtml","oldHtml","oldProps","newProps","innerHTML","firstChild","Component","rerenderComponent","update","s","state","Object","assign","forceUpdate","render","prevDebounce","rerenderQueue","defer","Promise","bind","resolve","c","process","debounceRendering","len","sort","a","b","isNew","oldState","snapshot","MODE_PENDING_ERROR","provider","componentContext","doRender","add","getDerivedStateFromProps","componentWillMount","componentDidMount","componentWillReceiveProps","shouldComponentUpdate","componentWillUpdate","getSnapshotBeforeUpdate","componentDidUpdate","mountChildren","mountDOMElement","nodeType","isFullRender","localName","document","createTextNode","createElementNS","is","attributes","newValue","onInput","onChange","mountedNextChild","internalChildren","__P","ownerSVGElement","hydrate","createRoot","cloneElement"],"mappings":"MA6DaA,EAAY,GClDnBC,EAAU,CACfC,ICE2BC,EAAOC,GAClC,KAAQA,EAAWA,MAClB,GFJ4BC,GEK3BD,OFoBmC,MEnBlCA,MAED,IAcC,GAbIA,EAASE,KAAKC,0BACjBH,MAAoBI,SACnBJ,EAASE,KAAKC,yBAAyBJ,IAIrCC,MAAoBK,mBACvBL,MAAoBK,kBAAkBN,GFkBlB,MEZjBC,MAEH,YADAA,OFL6B,KEQ7B,MAAOM,GACRP,EAAQO,EAKX,MAAMP,aCtCSQ,EAAkBP,EAAUQ,GACV,MAA7BR,QACHA,MAA4B,IAG7BA,MAA0BS,KAAKD,YAQhBE,EAAWC,EAAaC,GACnCf,OAAiBA,MAAgBe,EAAcD,GAEnDA,EAAYE,KAAKb,IAChB,IAIC,IAFAW,EAAcX,MAA0Bc,OAEjCH,KACNX,MAA0Be,QAAQC,KAAKhB,OAEvC,MAAOM,GACRT,MAAoBS,EAAGN,MC5B1B,IAAIiB,EAAU,WAUEC,EAAchB,EAAMiB,EAAOC,GAC1C,IACCC,EACAC,EACAC,EAHGC,EAAkB,GAItB,IAAKD,KAAKJ,EACG,QAANI,GAAgC,mBAATrB,GAA6B,QAANqB,EAErC,QAANA,EACRD,EAAMH,EAAMI,GACI,QAANA,IACVF,EAAMF,EAAMI,IAJZC,EAAgBD,GAAKJ,EAAMI,GAQ7B,GAAIE,UAAUX,OAAS,EAGtB,IAFAM,EAAW,CAACA,GAEPG,EAAI,EAAOE,UAAUX,OAAdS,EAAsBA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EAAarL,EAAOX,EAAOC,GAC1C,IACCC,EACAC,EACAC,EAHGC,EAAkBuI,OAAOC,OAAO,GAAIlI,EAAMX,OAK9C,IAAKI,KAAKJ,EACG,QAANI,GAAsC,mBAAfO,EAAM5B,MAA6B,QAANqB,EAEzC,QAANA,EACVF,EAAMF,EAAMI,GACI,QAANA,IACVD,EAAMH,EAAMI,IAJZC,EAAgBD,GAAKJ,EAAMI,GAQ7B,GAAIE,UAAUX,OAAS,EAEtB,IADAM,EAAW,CAACA,GACPG,EAAI,EAAOE,UAAUX,OAAdS,EAAsBA,IACjCH,EAASX,KAAKgB,UAAUF,IAO1B,OAJgB,MAAZH,IACHI,EAAgBJ,SAAWA,GAGrBQ,EACNE,EAAM5B,KACNsB,EACAH,GAAOS,EAAMT,IACbC,GAAOQ,EAAMR,IACb"}
1
+ {"version":3,"file":"preact.mjs","sources":["../src/constants.js","../src/options.js","../src/diff/catch-error.js","../src/diff/commit.js","../src/create-element.js","../src/diff/refs.js","../src/diff/props.js","../src/create-context.js","../src/diff/unmount.js","../src/tree.js","../src/diff/children.js","../src/diff/patch.js","../src/component.js","../src/diff/component.js","../src/diff/mount.js","../src/render.js","../src/create-root.js","../src/clone-element.js"],"sourcesContent":["// Internal._flags bitfield constants\nexport const TYPE_TEXT = 1 << 0;\nexport const TYPE_ELEMENT = 1 << 1;\nexport const TYPE_CLASS = 1 << 2;\nexport const TYPE_FUNCTION = 1 << 3;\n/** Signals this internal has a _parentDom prop that should change the parent\n * DOM node of it's children */\nexport const TYPE_ROOT = 1 << 4;\n\n/** Any type of internal representing DOM */\nexport const TYPE_DOM = TYPE_TEXT | TYPE_ELEMENT;\n/** Any type of component */\nexport const TYPE_COMPONENT = TYPE_CLASS | TYPE_FUNCTION | TYPE_ROOT;\n\n// Modes of rendering\n/** Normal hydration that attaches to a DOM tree but does not diff it. */\nexport const MODE_HYDRATE = 1 << 5;\n/** Top level render unspecified behaviour (old replaceNode parameter to render) */\nexport const MODE_MUTATIVE_HYDRATE = 1 << 6;\n/** Signifies this VNode suspended on the previous render */\nexport const MODE_SUSPENDED = 1 << 7;\n/** Signifies this VNode errored on the previous render */\nexport const MODE_ERRORED = 1 << 8;\n/** Signifies an error has been thrown and this component will be attempting to\n * handle & rerender the error on next render. In other words, on the next\n * render of this component, unset this mode and set the MODE_RERENDERING_ERROR.\n * This flag is distinct from MODE_RERENDERING_ERROR so that a component can\n * catch multiple errors thrown by its children in one render pass (see test\n * \"should handle double child throws\").\n */\nexport const MODE_PENDING_ERROR = 1 << 9;\n/** Signifies this Internal is attempting to \"handle\" an error and is\n * rerendering. This mode tracks that a component's last rerender was trying to\n * handle an error. As such, if another error is thrown while a component has\n * this flag set, it should not handle the newly thrown error since it failed to\n * successfully rerender the original error. This prevents error handling\n * infinite render loops */\nexport const MODE_RERENDERING_ERROR = 1 << 10;\n/** Signals this internal has been unmounted */\nexport const MODE_UNMOUNTING = 1 << 11;\n/** This Internal is rendered in an SVG tree */\nexport const MODE_SVG = 1 << 12;\n\n/** Signifies that bailout checks will be bypassed */\nexport const FORCE_UPDATE = 1 << 13;\n/** Signifies that a node needs to be updated */\nexport const DIRTY_BIT = 1 << 14;\n\n/** Reset all mode flags */\nexport const RESET_MODE = ~(\n\tMODE_HYDRATE |\n\tMODE_MUTATIVE_HYDRATE |\n\tMODE_SUSPENDED |\n\tMODE_ERRORED |\n\tMODE_RERENDERING_ERROR |\n\tFORCE_UPDATE\n);\n\n/** Modes a child internal inherits from their parent */\nexport const INHERITED_MODES = MODE_HYDRATE | MODE_MUTATIVE_HYDRATE | MODE_SVG;\n\nexport const EMPTY_ARR = [];\nexport const UNDEFINED = undefined;\n","import { _catchError } from './diff/catch-error';\n\n/**\n * The `option` object can potentially contain callback functions\n * that are called during various stages of our renderer. This is the\n * foundation on which all our addons like `preact/debug`, `preact/compat`,\n * and `preact/hooks` are based on. See the `Options` type in `internal.d.ts`\n * for a full list of available option hooks (most editors/IDEs allow you to\n * ctrl+click or cmd+click on mac the type definition below).\n * @type {import('./internal').Options}\n */\nconst options = {\n\t_catchError\n};\n\nexport default options;\n","import {\n\tDIRTY_BIT,\n\tMODE_RERENDERING_ERROR,\n\tMODE_PENDING_ERROR,\n\tTYPE_COMPONENT\n} from '../constants';\n\n/**\n * Find the closest error boundary to a thrown error and call it\n * @param {object} error The thrown value\n * @param {import('../internal').Internal} internal The Internal node that threw\n * the error that was caught (except for unmounting when this parameter\n * is the highest parent that was being unmounted)\n */\nexport function _catchError(error, internal) {\n\twhile ((internal = internal._parent)) {\n\t\tif (\n\t\t\tinternal._flags & TYPE_COMPONENT &&\n\t\t\t~internal._flags & MODE_RERENDERING_ERROR\n\t\t) {\n\t\t\ttry {\n\t\t\t\tif (internal.type.getDerivedStateFromError) {\n\t\t\t\t\tinternal._component.setState(\n\t\t\t\t\t\tinternal.type.getDerivedStateFromError(error)\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tif (internal._component.componentDidCatch) {\n\t\t\t\t\tinternal._component.componentDidCatch(error);\n\t\t\t\t}\n\n\t\t\t\t// NOTE: We're checking that any component in the stack got marked as dirty, even if it did so prior to this loop,\n\t\t\t\t// which is technically incorrect. However, there is no way for a component to mark itself as dirty during rendering.\n\t\t\t\t// The only way for a component to falsely intercept error bubbling would be to manually sets its internal dirty flag.\n\t\t\t\tif (internal._flags & DIRTY_BIT) {\n\t\t\t\t\tinternal._flags |= MODE_PENDING_ERROR;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\terror = e;\n\t\t\t}\n\t\t}\n\t}\n\n\tthrow error;\n}\n","import options from '../options';\n\n/**\n * @param {import('../internal').Internal} internal\n * @param {() => void} callback\n */\nexport function addCommitCallback(internal, callback) {\n\tif (internal._commitCallbacks == null) {\n\t\tinternal._commitCallbacks = [];\n\t}\n\n\tinternal._commitCallbacks.push(callback);\n}\n\n/**\n * @param {import('../internal').CommitQueue} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {import('../internal').Internal} rootInternal\n */\nexport function commitRoot(commitQueue, rootInternal) {\n\tif (options._commit) options._commit(rootInternal, commitQueue);\n\n\tcommitQueue.some(internal => {\n\t\ttry {\n\t\t\t// @ts-ignore Reuse the root variable here so the type changes\n\t\t\tcommitQueue = internal._commitCallbacks.length;\n\t\t\t// @ts-ignore See above ts-ignore comment\n\t\t\twhile (commitQueue--) {\n\t\t\t\tinternal._commitCallbacks.shift().call(internal._component);\n\t\t\t}\n\t\t} catch (e) {\n\t\t\toptions._catchError(e, internal);\n\t\t}\n\t});\n}\n","import { UNDEFINED } from './constants';\nimport options from './options';\n\nlet vnodeId = 0;\n\n/**\n * Create an virtual node (used for JSX)\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component\n * constructor for this virtual node\n * @param {object | null | undefined} [props] The properties of the virtual node\n * @param {Array<import('.').ComponentChildren>} [children] The children of the virtual node\n * @returns {import('./internal').VNode}\n */\nexport function createElement(type, props, children) {\n\tlet normalizedProps = {},\n\t\tkey,\n\t\tref,\n\t\ti;\n\tfor (i in props) {\n\t\tif (!(i === 'key' || (typeof type !== 'function' && i === 'ref')))\n\t\t\tnormalizedProps[i] = props[i];\n\t\telse if (i === 'ref') {\n\t\t\tref = props[i];\n\t\t} else if (i === 'key') {\n\t\t\tkey = props[i];\n\t\t}\n\t}\n\n\tif (arguments.length > 3) {\n\t\tchildren = [children];\n\t\t// https://github.com/preactjs/preact/issues/1916\n\t\tfor (i = 3; i < arguments.length; i++) {\n\t\t\tchildren.push(arguments[i]);\n\t\t}\n\t}\n\tif (children != null) {\n\t\tnormalizedProps.children = children;\n\t}\n\n\t// If a Component VNode, check for and apply defaultProps\n\t// Note: type may be undefined in development, must never error here.\n\tif (typeof type == 'function' && type.defaultProps != null) {\n\t\tfor (i in type.defaultProps) {\n\t\t\tif (normalizedProps[i] === UNDEFINED) {\n\t\t\t\tnormalizedProps[i] = type.defaultProps[i];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn createVNode(type, normalizedProps, key, ref, 0);\n}\n\n/**\n * Create a VNode (used internally by Preact)\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component\n * Constructor for this virtual node\n * @param {object | string | number | null} props The properties of this virtual node.\n * If this virtual node represents a text node, this is the text of the node (string or number).\n * @param {string | number | null} key The key for this virtual node, used when\n * diffing it against its children\n * @param {import('./internal').VNode[\"ref\"]} ref The ref property that will\n * receive a reference to its created child\n * @returns {import('./internal').VNode}\n */\nexport function createVNode(type, props, key, ref, original) {\n\t// V8 seems to be better at detecting type shapes if the object is allocated from the same call site\n\t// Do not inline into createElement and coerceToVNode!\n\tconst vnode = {\n\t\ttype,\n\t\tprops,\n\t\tkey,\n\t\tref,\n\t\tconstructor: undefined,\n\t\t_vnodeId: original || ++vnodeId\n\t};\n\n\tif (options.vnode != null) options.vnode(vnode);\n\n\treturn vnode;\n}\n\n/**\n * @param {import('./internal').ComponentChildren} childVNode\n * @returns {import('./internal').VNode | string | null}\n */\nexport function normalizeToVNode(childVNode) {\n\tif (childVNode == null || typeof childVNode == 'boolean') {\n\t\treturn null;\n\t}\n\t// If this newVNode is being reused (e.g. <div>{reuse}{reuse}</div>) in the same diff,\n\t// or we are rendering a component (e.g. setState) copy the oldVNodes so it can have\n\t// it's own DOM & etc. pointers\n\telse if (\n\t\ttypeof childVNode == 'number' ||\n\t\t// eslint-disable-next-line valid-typeof\n\t\ttypeof childVNode == 'bigint'\n\t) {\n\t\treturn childVNode + '';\n\t} else if (Array.isArray(childVNode)) {\n\t\treturn createVNode(Fragment, { children: childVNode }, null, null, 0);\n\t}\n\n\treturn childVNode;\n}\n\nexport function createRef() {\n\treturn { current: null };\n}\n\nexport function Fragment(props) {\n\treturn props.children;\n}\n\n/**\n * Check if a the argument is a valid Preact VNode.\n * @param {*} vnode\n * @returns {vnode is import('./internal').VNode}\n */\nexport const isValidElement = vnode =>\n\tvnode != null && vnode.constructor === UNDEFINED;\n","import options from '../options';\n\n/**\n * Invoke or update a ref, depending on whether it is a function or object ref.\n * @param {object|function} ref\n * @param {any} value\n * @param {import('../internal').Internal} internal\n */\nexport function applyRef(oldRef, ref, value, internal) {\n\tif (oldRef === ref) return;\n\n\tif (oldRef) applyRef(null, oldRef, null, internal);\n\ttry {\n\t\tif (typeof ref == 'function') ref(value);\n\t\telse ref.current = value;\n\t} catch (e) {\n\t\toptions._catchError(e, internal);\n\t}\n}\n","import options from '../options';\n\nfunction setStyle(dom, key, value) {\n\tif (key[0] === '-') {\n\t\tdom.style.setProperty(key, value);\n\t} else {\n\t\tdom.style[key] = value == null ? '' : value;\n\t}\n}\n\n/**\n * Set a property value on a DOM node\n * @param {import('../internal').PreactElement} dom The DOM node to modify\n * @param {string} name The name of the property to set\n * @param {*} value The value to set the property to\n * @param {*} oldValue The old value the property had\n * @param {number} isSvg 0 if not an SVG element, else it is an SVG element\n */\nexport function setProperty(dom, name, value, oldValue, isSvg) {\n\tlet useCapture;\n\n\to: if (name === 'style') {\n\t\tif (typeof value == 'string') {\n\t\t\tsetStyle(dom, 'cssText', value);\n\t\t} else {\n\t\t\tif (typeof oldValue == 'string') {\n\t\t\t\tsetStyle(dom, 'cssText', (oldValue = ''));\n\t\t\t}\n\n\t\t\tif (oldValue) {\n\t\t\t\tfor (name in oldValue) {\n\t\t\t\t\tif (!value || !(name in value)) {\n\t\t\t\t\t\tsetStyle(dom, name, '');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (name in value) {\n\t\t\t\tif (!oldValue || value[name] !== oldValue[name]) {\n\t\t\t\t\tsetStyle(dom, name, value[name]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// Benchmark for comparison: https://esbench.com/bench/574c954bdb965b9a00965ac6\n\telse if (name[0] === 'o' && name[1] === 'n') {\n\t\tuseCapture = name !== (name = name.replace(/Capture$/, ''));\n\n\t\t// Infer correct casing for DOM built-in events:\n\t\tif (name.toLowerCase() in dom) name = name.toLowerCase().slice(2);\n\t\telse name = name.slice(2);\n\n\t\tif (!dom._listeners) dom._listeners = {};\n\t\tdom._listeners[name + useCapture] = value;\n\n\t\tif (value) {\n\t\t\tif (!oldValue) {\n\t\t\t\tconst handler = useCapture ? eventProxyCapture : eventProxy;\n\t\t\t\tdom.addEventListener(name, handler, useCapture);\n\t\t\t}\n\t\t} else {\n\t\t\tconst handler = useCapture ? eventProxyCapture : eventProxy;\n\t\t\tdom.removeEventListener(name, handler, useCapture);\n\t\t}\n\t} else if (name !== 'dangerouslySetInnerHTML') {\n\t\tif (isSvg) {\n\t\t\t// Normalize incorrect prop usage for SVG:\n\t\t\t// - xlink:href / xlinkHref --> href (xlink:href was removed from SVG and isn't needed)\n\t\t\t// - className --> class\n\t\t\tname = name.replace(/xlink[H:h]/, 'h').replace(/sName$/, 's');\n\t\t} else if (\n\t\t\tname !== 'href' &&\n\t\t\tname !== 'list' &&\n\t\t\tname !== 'form' &&\n\t\t\t// Default value in browsers is `-1` and an empty string is\n\t\t\t// cast to `0` instead\n\t\t\tname !== 'tabIndex' &&\n\t\t\tname !== 'download' &&\n\t\t\tname in dom\n\t\t) {\n\t\t\ttry {\n\t\t\t\tdom[name] = value == null ? '' : value;\n\t\t\t\t// labelled break is 1b smaller here than a return statement (sorry)\n\t\t\t\tbreak o;\n\t\t\t} catch (e) {}\n\t\t}\n\n\t\t// ARIA-attributes have a different notion of boolean values.\n\t\t// The value `false` is different from the attribute not\n\t\t// existing on the DOM, so we can't remove it. For non-boolean\n\t\t// ARIA-attributes we could treat false as a removal, but the\n\t\t// amount of exceptions would cost us too many bytes. On top of\n\t\t// that other VDOM frameworks also always stringify `false`.\n\n\t\tif (typeof value === 'function') {\n\t\t\t// never serialize functions as attribute values\n\t\t} else if (\n\t\t\tvalue != null &&\n\t\t\t(value !== false || (name[0] === 'a' && name[1] === 'r'))\n\t\t) {\n\t\t\tdom.setAttribute(name, value);\n\t\t} else {\n\t\t\tdom.removeAttribute(name);\n\t\t}\n\t}\n}\n\n/**\n * Proxy an event to hooked event handlers\n * @param {Event} e The event object from the browser\n * @private\n */\nfunction eventProxy(e) {\n\tthis._listeners[e.type + false](options.event ? options.event(e) : e);\n\tif (this._isControlled) {\n\t\tif (this.value != null && (e.type === 'input' || e.type === 'change')) {\n\t\t\tthis.value = this._prevValue;\n\t\t}\n\t\tif (this.checked != null && e.type === 'change') {\n\t\t\tthis.checked = this._prevValue;\n\t\t}\n\t}\n}\n\nfunction eventProxyCapture(e) {\n\tthis._listeners[e.type + true](options.event ? options.event(e) : e);\n}\n","import { enqueueRender } from './component';\n\nexport let nextContextId = 0;\n\nconst providers = new Set();\n\nexport const unsubscribeFromContext = component => {\n\t// if this was a context provider, delete() returns true and we exit:\n\tif (providers.delete(component)) return;\n\t// ... otherwise, unsubscribe from any contexts:\n\tproviders.forEach(p => p._subs.delete(component));\n};\n\nexport const createContext = (defaultValue, contextId) => {\n\tcontextId = '__cC' + nextContextId++;\n\n\tconst context = {\n\t\t_id: contextId,\n\t\t_defaultValue: defaultValue,\n\t\t/** @type {import('./internal').FunctionComponent} */\n\t\tConsumer(props, contextValue) {\n\t\t\t// return props.children(\n\t\t\t// \tcontext[contextId] ? context[contextId].props.value : defaultValue\n\t\t\t// );\n\t\t\treturn props.children(contextValue);\n\t\t},\n\t\t/** @type {import('./internal').FunctionComponent} */\n\t\tProvider(props, ctx) {\n\t\t\t// initial setup:\n\t\t\tif (!this._subs) {\n\t\t\t\tthis._subs = new Set();\n\t\t\t\tctx = {};\n\t\t\t\tctx[contextId] = this;\n\t\t\t\tthis.getChildContext = () => ctx;\n\t\t\t}\n\t\t\t// re-render subscribers in response to value change\n\t\t\telse if (props.value !== this._prev) {\n\t\t\t\tthis._subs.forEach(enqueueRender);\n\t\t\t}\n\t\t\tthis._prev = props.value;\n\n\t\t\treturn props.children;\n\t\t}\n\t};\n\n\t// Devtools needs access to the context object when it\n\t// encounters a Provider. This is necessary to support\n\t// setting `displayName` on the context object instead\n\t// of on the component itself. See:\n\t// https://reactjs.org/docs/context.html#contextdisplayname\n\n\treturn (context.Provider._contextRef = context.Consumer.contextType = context);\n};\n","import { MODE_UNMOUNTING, TYPE_DOM, TYPE_ROOT } from '../constants';\nimport { unsubscribeFromContext } from '../create-context';\nimport options from '../options';\nimport { applyRef } from './refs';\n\n/**\n * Unmount a virtual node from the tree and apply DOM changes\n * @param {import('../internal').Internal} internal The virtual node to unmount\n * @param {import('../internal').Internal} parentInternal The parent of the VNode that\n * initiated the unmount\n * @param {number} [skipRemove] Flag that indicates that a parent node of the\n * current element is already detached from the DOM.\n */\nexport function unmount(internal, parentInternal, skipRemove) {\n\tlet r,\n\t\ti = 0;\n\tif (options.unmount) options.unmount(internal);\n\tinternal._flags |= MODE_UNMOUNTING;\n\n\tif ((r = internal.ref)) {\n\t\tif (!r.current || r.current === internal._dom)\n\t\t\tapplyRef(null, r, null, parentInternal);\n\t}\n\n\tif ((r = internal._component)) {\n\t\tunsubscribeFromContext(r);\n\n\t\tif (r.componentWillUnmount) {\n\t\t\ttry {\n\t\t\t\tr.componentWillUnmount();\n\t\t\t} catch (e) {\n\t\t\t\toptions._catchError(e, parentInternal);\n\t\t\t}\n\t\t}\n\t}\n\n\tif ((r = internal._children)) {\n\t\tfor (; i < r.length; i++) {\n\t\t\tif (r[i]) {\n\t\t\t\tunmount(\n\t\t\t\t\tr[i],\n\t\t\t\t\tparentInternal,\n\t\t\t\t\tskipRemove ? ~internal._flags & TYPE_ROOT : internal._flags & TYPE_DOM\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (!skipRemove && internal._flags & TYPE_DOM) {\n\t\tinternal._dom.remove();\n\t}\n\n\tinternal._dom = null;\n}\n","import options from './options';\nimport {\n\tTYPE_FUNCTION,\n\tTYPE_ELEMENT,\n\tTYPE_TEXT,\n\tTYPE_CLASS,\n\tTYPE_ROOT,\n\tINHERITED_MODES,\n\tTYPE_COMPONENT,\n\tTYPE_DOM,\n\tMODE_SVG,\n\tUNDEFINED\n} from './constants';\n\n/**\n * Create an internal tree node\n * @param {import('./internal').VNode | string} vnode\n * @param {import('./internal').Internal} [parentInternal]\n * @returns {import('./internal').Internal}\n */\nexport function createInternal(vnode, parentInternal) {\n\tlet type = null,\n\t\tprops,\n\t\tkey,\n\t\tref;\n\n\t/** @type {number} */\n\tlet flags = parentInternal ? parentInternal._flags & INHERITED_MODES : 0;\n\n\t// Text VNodes/Internals use NaN as an ID so that two are never equal.\n\tlet vnodeId = NaN;\n\n\tif (typeof vnode === 'string') {\n\t\t// type = null;\n\t\tflags |= TYPE_TEXT;\n\t\tprops = vnode;\n\t} else if (vnode.constructor !== UNDEFINED) {\n\t\tflags |= TYPE_TEXT;\n\t\tprops = '';\n\t} else {\n\t\ttype = vnode.type;\n\t\tprops = vnode.props || {};\n\t\tkey = vnode.key;\n\t\tref = vnode.ref;\n\t\tvnodeId = vnode._vnodeId;\n\n\t\t// @TODO re-enable this when we stop removing key+ref from VNode props\n\t\t// if (props) {\n\t\t// \tif ((key = props.key) != null) {\n\t\t// \t\tprops.key = UNDEFINED;\n\t\t// \t}\n\t\t// \tif (typeof type !== 'function' && (ref = props.ref) != null) {\n\t\t// \t\tprops.ref = UNDEFINED;\n\t\t// \t}\n\t\t// } else {\n\t\t// \tprops = {};\n\t\t// }\n\n\t\t// flags = typeof type === 'function' ? COMPONENT_NODE : ELEMENT_NODE;\n\t\tflags |=\n\t\t\ttypeof type === 'function'\n\t\t\t\t? type.prototype && 'render' in type.prototype\n\t\t\t\t\t? TYPE_CLASS\n\t\t\t\t\t: props._parentDom\n\t\t\t\t\t? TYPE_ROOT\n\t\t\t\t\t: TYPE_FUNCTION\n\t\t\t\t: TYPE_ELEMENT;\n\n\t\tif (flags & TYPE_ELEMENT && type === 'svg') {\n\t\t\tflags |= MODE_SVG;\n\t\t} else if (\n\t\t\tparentInternal &&\n\t\t\tparentInternal._flags & MODE_SVG &&\n\t\t\tparentInternal.type === 'foreignObject'\n\t\t) {\n\t\t\tflags &= ~MODE_SVG;\n\t\t}\n\t}\n\n\t/** @type {import('./internal').Internal} */\n\tconst internal = {\n\t\ttype,\n\t\tprops,\n\t\tkey,\n\t\tref,\n\t\t_children: null,\n\t\t_parent: parentInternal,\n\t\t_vnodeId: vnodeId,\n\t\t_dom: null,\n\t\t_component: null,\n\t\t_flags: flags,\n\t\t_depth: parentInternal ? parentInternal._depth + 1 : 0\n\t};\n\n\tif (options._internal) options._internal(internal, vnode);\n\n\treturn internal;\n}\n\nconst shouldSearchComponent = internal =>\n\tinternal._flags & TYPE_COMPONENT &&\n\t(!(internal._flags & TYPE_ROOT) ||\n\t\tinternal.props._parentDom == getParentDom(internal._parent));\n\n/**\n * @param {import('./internal').Internal} internal\n * @param {number | null} [childIndex]\n * @returns {import('./internal').PreactNode}\n */\nexport function getDomSibling(internal, childIndex) {\n\tif (childIndex == null) {\n\t\t// Use childIndex==null as a signal to resume the search from the vnode's sibling\n\t\treturn getDomSibling(\n\t\t\tinternal._parent,\n\t\t\tinternal._parent._children.indexOf(internal) + 1\n\t\t);\n\t}\n\n\tlet childDom = getChildDom(internal, childIndex);\n\tif (childDom) {\n\t\treturn childDom;\n\t}\n\n\t// If we get here, we have not found a DOM node in this vnode's children. We\n\t// must resume from this vnode's sibling (in it's parent _children array).\n\t// Only climb up and search the parent if we aren't searching through a DOM\n\t// VNode (meaning we reached the DOM parent of the original vnode that began\n\t// the search). Note, the top of the tree has _parent == null so avoiding that\n\t// here.\n\treturn internal._parent && shouldSearchComponent(internal)\n\t\t? getDomSibling(internal)\n\t\t: null;\n}\n\n/**\n * @param {import('./internal').Internal} internal\n * @param {number} [i]\n * @returns {import('./internal').PreactElement}\n */\nexport function getChildDom(internal, i) {\n\tif (internal._children == null) {\n\t\treturn null;\n\t}\n\n\tfor (i = i || 0; i < internal._children.length; i++) {\n\t\tlet child = internal._children[i];\n\t\tif (child != null) {\n\t\t\tif (child._flags & TYPE_DOM) {\n\t\t\t\treturn child._dom;\n\t\t\t}\n\n\t\t\tif (shouldSearchComponent(child)) {\n\t\t\t\tlet childDom = getChildDom(child);\n\t\t\t\tif (childDom) {\n\t\t\t\t\treturn childDom;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn null;\n}\n\n/**\n * @param {import('./internal').Internal} internal\n * @returns {import('./internal').PreactElement}\n */\nexport function getParentDom(internal) {\n\tlet parentDom =\n\t\tinternal._flags & TYPE_ROOT ? internal.props._parentDom : null;\n\n\tlet parent = internal._parent;\n\twhile (parentDom == null && parent) {\n\t\tif (parent._flags & TYPE_ROOT) {\n\t\t\tparentDom = parent.props._parentDom;\n\t\t} else if (parent._flags & TYPE_ELEMENT) {\n\t\t\tparentDom = parent._dom;\n\t\t}\n\n\t\tparent = parent._parent;\n\t}\n\n\treturn parentDom;\n}\n","import { applyRef } from './refs';\nimport { normalizeToVNode } from '../create-element';\nimport {\n\tTYPE_COMPONENT,\n\tTYPE_TEXT,\n\tMODE_HYDRATE,\n\tMODE_SUSPENDED,\n\tEMPTY_ARR,\n\tTYPE_DOM,\n\tUNDEFINED\n} from '../constants';\nimport { mount } from './mount';\nimport { patch } from './patch';\nimport { unmount } from './unmount';\nimport { createInternal, getDomSibling, getChildDom } from '../tree';\n\n/**\n * Diff the children of a virtual node\n * @param {import('../internal').PreactElement} parentDom The DOM element whose\n * children are being diffed\n * @param {import('../internal').ComponentChildren[]} renderResult\n * @param {import('../internal').Internal} parentInternal The Internal node\n * whose children should be diff'ed against newParentVNode\n * @param {object} globalContext The current context object - modified by\n * getChildContext\n * @param {import('../internal').CommitQueue} commitQueue List of\n * components which have callbacks to invoke in commitRoot\n * @param {import('../internal').PreactElement} startDom The dom node\n * diffChildren should begin diffing with.\n */\nexport function diffChildren(\n\tparentDom,\n\trenderResult,\n\tparentInternal,\n\tglobalContext,\n\tcommitQueue,\n\tstartDom\n) {\n\tlet i, newDom, refs;\n\n\t/** @type {import('../internal').Internal} */\n\tlet childInternal;\n\n\t/** @type {import('../internal').VNode | string} */\n\tlet childVNode;\n\n\tlet oldChildren =\n\t\t(parentInternal._children && parentInternal._children.slice()) || EMPTY_ARR;\n\tlet oldChildrenLength = oldChildren.length;\n\n\tconst newChildren = [];\n\tfor (i = 0; i < renderResult.length; i++) {\n\t\tchildVNode = normalizeToVNode(renderResult[i]);\n\n\t\t// Terser removes the `continue` here and wraps the loop body\n\t\t// in a `if (childVNode) { ... } condition\n\t\tif (childVNode == null) {\n\t\t\tnewChildren[i] = null;\n\t\t\tcontinue;\n\t\t}\n\n\t\tchildInternal = findMatchingInternal(\n\t\t\tchildVNode,\n\t\t\toldChildren,\n\t\t\ti,\n\t\t\toldChildrenLength\n\t\t);\n\n\t\tlet oldVNodeRef;\n\t\tlet nextDomSibling;\n\t\tif (childInternal == null) {\n\t\t\tchildInternal = createInternal(childVNode, parentInternal);\n\n\t\t\t// We are mounting a new VNode\n\t\t\tnextDomSibling = mount(\n\t\t\t\tparentDom,\n\t\t\t\tchildVNode,\n\t\t\t\tchildInternal,\n\t\t\t\tglobalContext,\n\t\t\t\tcommitQueue,\n\t\t\t\tstartDom\n\t\t\t);\n\t\t}\n\t\t// If this node suspended during hydration, and no other flags are set:\n\t\t// @TODO: might be better to explicitly check for MODE_ERRORED here.\n\t\telse if (\n\t\t\t(childInternal._flags & (MODE_HYDRATE | MODE_SUSPENDED)) ===\n\t\t\t(MODE_HYDRATE | MODE_SUSPENDED)\n\t\t) {\n\t\t\t// We are resuming the hydration of a VNode\n\t\t\tstartDom = childInternal._dom;\n\t\t\toldVNodeRef = childInternal.ref;\n\n\t\t\tnextDomSibling = mount(\n\t\t\t\tparentDom,\n\t\t\t\tchildVNode,\n\t\t\t\tchildInternal,\n\t\t\t\tglobalContext,\n\t\t\t\tcommitQueue,\n\t\t\t\tstartDom\n\t\t\t);\n\t\t} else {\n\t\t\toldVNodeRef = childInternal.ref;\n\n\t\t\t// Morph the old element into the new one, but don't append it to the dom yet\n\t\t\tnextDomSibling = patch(\n\t\t\t\tparentDom,\n\t\t\t\tchildVNode,\n\t\t\t\tchildInternal,\n\t\t\t\tglobalContext,\n\t\t\t\tcommitQueue,\n\t\t\t\tstartDom\n\t\t\t);\n\t\t}\n\n\t\tnewDom = childInternal._dom;\n\n\t\tif (childVNode.ref) {\n\t\t\tif (!refs) refs = [];\n\t\t\trefs.push(\n\t\t\t\toldVNodeRef,\n\t\t\t\tchildVNode.ref,\n\t\t\t\tchildInternal._component || newDom,\n\t\t\t\tchildInternal\n\t\t\t);\n\t\t}\n\n\t\tif (childInternal._flags & TYPE_COMPONENT) {\n\t\t\tstartDom = nextDomSibling;\n\t\t} else if (newDom && newDom == startDom) {\n\t\t\t// If the newDom and the dom we are expecting to be there are the same, then\n\t\t\t// do nothing\n\t\t\tstartDom = nextDomSibling;\n\t\t} else if (newDom) {\n\t\t\tstartDom = placeChild(parentDom, oldChildrenLength, newDom, startDom);\n\t\t} else if (\n\t\t\tstartDom &&\n\t\t\tchildInternal != null &&\n\t\t\tstartDom.parentNode != parentDom\n\t\t) {\n\t\t\t// The above condition is to handle null placeholders. See test in placeholder.test.js:\n\t\t\t// `efficiently replace null placeholders in parent rerenders`\n\t\t\tstartDom = nextDomSibling;\n\t\t}\n\n\t\tnewChildren[i] = childInternal;\n\t}\n\n\tparentInternal._children = newChildren;\n\n\t// Remove remaining oldChildren if there are any.\n\tfor (i = oldChildrenLength; i--; ) {\n\t\tif (oldChildren[i] != null) {\n\t\t\tif (\n\t\t\t\tparentInternal._flags & TYPE_COMPONENT &&\n\t\t\t\tstartDom != null &&\n\t\t\t\t((oldChildren[i]._flags & TYPE_DOM &&\n\t\t\t\t\toldChildren[i]._dom == startDom) ||\n\t\t\t\t\tgetChildDom(oldChildren[i]) == startDom)\n\t\t\t) {\n\t\t\t\t// If the startDom points to a dom node that is about to be unmounted,\n\t\t\t\t// then get the next sibling of that vnode and set startDom to it\n\t\t\t\tstartDom = getDomSibling(parentInternal, i + 1);\n\t\t\t}\n\n\t\t\tunmount(oldChildren[i], oldChildren[i]);\n\t\t}\n\t}\n\n\t// Set refs only after unmount\n\tif (refs) {\n\t\tfor (i = 0; i < refs.length; i++) {\n\t\t\tapplyRef(refs[i], refs[++i], refs[++i], refs[++i]);\n\t\t}\n\t}\n\n\treturn startDom;\n}\n\n/**\n * @param {import('../internal').VNode | string} childVNode\n * @param {import('../internal').Internal[]} oldChildren\n * @param {number} i\n * @param {number} oldChildrenLength\n * @returns {import('../internal').Internal}\n */\nfunction findMatchingInternal(childVNode, oldChildren, i, oldChildrenLength) {\n\t// Check if we find a corresponding element in oldChildren.\n\t// If found, delete the array item by setting to `undefined`.\n\t// We use `undefined`, as `null` is reserved for empty placeholders\n\t// (holes).\n\tlet childInternal = oldChildren[i];\n\n\tif (typeof childVNode === 'string') {\n\t\t// We never move Text nodes, so we only check for an in-place match:\n\t\tif (childInternal && childInternal._flags & TYPE_TEXT) {\n\t\t\toldChildren[i] = UNDEFINED;\n\t\t} else {\n\t\t\t// We're looking for a Text node, but this wasn't one: ignore it\n\t\t\tchildInternal = UNDEFINED;\n\t\t}\n\t} else if (\n\t\tchildInternal === null ||\n\t\t(childInternal &&\n\t\t\tchildVNode.key == childInternal.key &&\n\t\t\tchildVNode.type === childInternal.type)\n\t) {\n\t\toldChildren[i] = UNDEFINED;\n\t} else {\n\t\t// Either oldVNode === undefined or oldChildrenLength > 0,\n\t\t// so after this loop oldVNode == null or oldVNode is a valid value.\n\t\tfor (let j = 0; j < oldChildrenLength; j++) {\n\t\t\tchildInternal = oldChildren[j];\n\t\t\t// If childVNode is unkeyed, we only match similarly unkeyed nodes, otherwise we match by key.\n\t\t\t// We always match by type (in either case).\n\t\t\tif (\n\t\t\t\tchildInternal &&\n\t\t\t\tchildVNode.key == childInternal.key &&\n\t\t\t\tchildVNode.type === childInternal.type\n\t\t\t) {\n\t\t\t\toldChildren[j] = UNDEFINED;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tchildInternal = null;\n\t\t}\n\t}\n\n\treturn childInternal;\n}\n\n/**\n * @param {import('../internal').Internal} internal\n * @param {import('../internal').PreactElement} startDom\n * @param {import('../internal').PreactElement} parentDom\n */\nexport function reorderChildren(internal, startDom, parentDom) {\n\tif (internal._children == null) {\n\t\treturn startDom;\n\t}\n\n\tfor (let tmp = 0; tmp < internal._children.length; tmp++) {\n\t\tlet childInternal = internal._children[tmp];\n\t\tif (childInternal) {\n\t\t\t// We typically enter this code path on sCU bailout, where we copy\n\t\t\t// oldVNode._children to newVNode._children. If that is the case, we need\n\t\t\t// to update the old children's _parent pointer to point to the newVNode\n\t\t\t// (childVNode here).\n\t\t\tchildInternal._parent = internal;\n\n\t\t\tif (childInternal._flags & TYPE_COMPONENT) {\n\t\t\t\tstartDom = reorderChildren(childInternal, startDom, parentDom);\n\t\t\t} else if (childInternal._dom == startDom) {\n\t\t\t\tstartDom = startDom.nextSibling;\n\t\t\t} else {\n\t\t\t\tstartDom = placeChild(\n\t\t\t\t\tparentDom,\n\t\t\t\t\tinternal._children.length,\n\t\t\t\t\tchildInternal._dom,\n\t\t\t\t\tstartDom\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn startDom;\n}\n\n/**\n * Flatten and loop through the children of a virtual node\n * @param {import('../index').ComponentChildren} children The unflattened\n * children of a virtual node\n * @returns {import('../internal').VNode[]}\n */\nexport function toChildArray(children, out) {\n\tout = out || [];\n\tif (children == null || typeof children == 'boolean') {\n\t} else if (Array.isArray(children)) {\n\t\tfor (children of children) {\n\t\t\ttoChildArray(children, out);\n\t\t}\n\t} else {\n\t\tout.push(children);\n\t}\n\n\treturn out;\n}\n\n/**\n * @param {import('../internal').PreactElement} parentDom\n * @param {number} oldChildrenLength\n * @param {import('../internal').PreactElement} newDom\n * @param {import('../internal').PreactElement} startDom\n * @returns {import('../internal').PreactElement}\n */\nfunction placeChild(parentDom, oldChildrenLength, newDom, startDom) {\n\tif (startDom == null || newDom.parentNode == null) {\n\t\t// \"startDom == null\": The diff has finished with existing DOM children and\n\t\t// we are appending new ones.\n\t\t//\n\t\t// newDom.parentNode == null: newDom is a brand new unconnected DOM node. Go\n\t\t// ahead and mount it here.\n\t\tparentDom.insertBefore(newDom, startDom);\n\t\treturn startDom;\n\t}\n\n\t// `j<oldChildrenLength; j+=2` is an alternative to `j++<oldChildrenLength/2`\n\tfor (\n\t\tlet sibDom = startDom, j = 0;\n\t\t(sibDom = sibDom.nextSibling) && j < oldChildrenLength;\n\t\tj += 2\n\t) {\n\t\tif (sibDom == newDom) {\n\t\t\treturn newDom.nextSibling;\n\t\t}\n\t}\n\tparentDom.insertBefore(newDom, startDom);\n\treturn startDom;\n}\n","import { diffChildren } from './children';\nimport { setProperty } from './props';\nimport options from '../options';\nimport { renderComponent } from './component';\nimport {\n\tRESET_MODE,\n\tTYPE_TEXT,\n\tTYPE_ELEMENT,\n\tMODE_SUSPENDED,\n\tMODE_ERRORED,\n\tTYPE_ROOT,\n\tMODE_SVG,\n\tUNDEFINED\n} from '../constants';\nimport { getChildDom, getDomSibling } from '../tree';\n\n/**\n * Diff two virtual nodes and apply proper changes to the DOM\n * @param {import('../internal').PreactElement} parentDom The parent of the DOM element\n * @param {import('../internal').VNode | string} newVNode The new virtual node\n * @param {import('../internal').Internal} internal The Internal node to patch\n * @param {object} globalContext The current context object. Modified by getChildContext\n * @param {import('../internal').CommitQueue} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {import('../internal').PreactNode} startDom\n */\nexport function patch(\n\tparentDom,\n\tnewVNode,\n\tinternal,\n\tglobalContext,\n\tcommitQueue,\n\tstartDom\n) {\n\tlet dom = internal._dom;\n\tlet flags = internal._flags;\n\n\tif (flags & TYPE_TEXT) {\n\t\tif (newVNode !== internal.props) {\n\t\t\tdom.data = newVNode;\n\t\t\tinternal.props = newVNode;\n\t\t}\n\n\t\treturn dom.nextSibling;\n\t}\n\n\t// When passing through createElement it assigns the object\n\t// constructor as undefined. This to prevent JSON-injection.\n\tif (newVNode.constructor !== UNDEFINED) return null;\n\n\tif (options._diff) options._diff(internal, newVNode);\n\n\tif (flags & TYPE_ELEMENT) {\n\t\tif (newVNode._vnodeId !== internal._vnodeId) {\n\t\t\t// @ts-ignore dom is a PreactElement here\n\t\t\tpatchDOMElement(dom, newVNode, internal, globalContext, commitQueue);\n\t\t\t// Once we have successfully rendered the new VNode, copy it's ID over\n\t\t\tinternal._vnodeId = newVNode._vnodeId;\n\t\t}\n\n\t\tif (options.diffed) options.diffed(internal);\n\n\t\t// We successfully rendered this VNode, unset any stored hydration/bailout state:\n\t\tinternal._flags &= RESET_MODE;\n\n\t\treturn dom.nextSibling;\n\t}\n\n\t/** @type {import('../internal').PreactNode} */\n\tlet nextDomSibling;\n\n\t// Root nodes signal that an attempt to render into a specific DOM node on\n\t// the page. Root nodes can occur anywhere in the tree and not just at the\n\t// top.\n\tlet prevStartDom = startDom;\n\tlet prevParentDom = parentDom;\n\tif (flags & TYPE_ROOT) {\n\t\tparentDom = newVNode.props._parentDom;\n\n\t\tif (parentDom !== prevParentDom) {\n\t\t\tstartDom = getChildDom(internal) || startDom;\n\n\t\t\t// The `startDom` variable might point to a node from another\n\t\t\t// tree from a previous render\n\t\t\tif (startDom != null && startDom.parentNode !== parentDom) {\n\t\t\t\tstartDom = null;\n\t\t\t}\n\t\t}\n\t}\n\n\ttry {\n\t\tnextDomSibling = renderComponent(\n\t\t\tparentDom,\n\t\t\t/** @type {import('../internal').VNode} */\n\t\t\t(newVNode),\n\t\t\tinternal,\n\t\t\tglobalContext,\n\t\t\tcommitQueue,\n\t\t\tstartDom\n\t\t);\n\t} catch (e) {\n\t\t// @TODO: assign a new VNode ID here? Or NaN?\n\t\t// newVNode._vnodeId = 0;\n\t\tinternal._flags |= e.then ? MODE_SUSPENDED : MODE_ERRORED;\n\t\toptions._catchError(e, internal);\n\n\t\treturn nextDomSibling;\n\t}\n\n\tif (prevParentDom !== parentDom) {\n\t\t// If this is a root node/Portal, and it changed the parentDom it's\n\t\t// children, then we need to determine which dom node the diff should\n\t\t// continue with.\n\t\tif (prevStartDom == null || prevStartDom.parentNode == prevParentDom) {\n\t\t\t// If prevStartDom == null, then we are diffing a root node that\n\t\t\t// didn't have a startDom to begin with, so we can just return null.\n\t\t\t//\n\t\t\t// Or, if the previous value for start dom still has the same parent\n\t\t\t// DOM has the root node's parent tree, then we can use it. This case\n\t\t\t// assumes the root node rendered its children into a new parent.\n\t\t\tnextDomSibling = prevStartDom;\n\t\t} else {\n\t\t\t// Here, if the parentDoms are different and prevStartDom has moved into\n\t\t\t// a new parentDom, we'll assume the root node moved prevStartDom under\n\t\t\t// the new parentDom. Because of this change, we need to search the\n\t\t\t// internal tree for the next DOM sibling the tree should begin with\n\t\t\tnextDomSibling = getDomSibling(internal);\n\t\t}\n\t}\n\n\tif (options.diffed) options.diffed(internal);\n\n\t// We successfully rendered this VNode, unset any stored hydration/bailout state:\n\tinternal._flags &= RESET_MODE;\n\t// Once we have successfully rendered the new VNode, copy it's ID over\n\tinternal._vnodeId = newVNode._vnodeId;\n\n\treturn nextDomSibling;\n}\n\n/**\n * Diff two virtual nodes representing DOM element\n * @param {import('../internal').PreactElement} dom The DOM element representing\n * the virtual nodes being diffed\n * @param {import('../internal').VNode} newVNode The new virtual node\n * @param {import('../internal').Internal} internal The Internal node to patch\n * @param {object} globalContext The current context object\n * @param {import('../internal').CommitQueue} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n */\nfunction patchDOMElement(dom, newVNode, internal, globalContext, commitQueue) {\n\tlet oldProps = internal.props,\n\t\tnewProps = (internal.props = newVNode.props),\n\t\tisSvg = internal._flags & MODE_SVG,\n\t\ti,\n\t\tvalue,\n\t\ttmp,\n\t\tnewHtml,\n\t\toldHtml,\n\t\tnewChildren;\n\n\tfor (i in oldProps) {\n\t\tvalue = oldProps[i];\n\t\tif (i === 'key') {\n\t\t} else if (i === 'children') {\n\t\t} else if (i === 'dangerouslySetInnerHTML') {\n\t\t\toldHtml = value;\n\t\t} else if (!(i in newProps)) {\n\t\t\tsetProperty(dom, i, null, value, isSvg);\n\t\t}\n\t}\n\n\tfor (i in newProps) {\n\t\tvalue = newProps[i];\n\t\tif (i === 'key') {\n\t\t} else if (i === 'children') {\n\t\t\tnewChildren = value;\n\t\t} else if (i === 'dangerouslySetInnerHTML') {\n\t\t\tnewHtml = value;\n\t\t} else if (\n\t\t\tvalue !== (tmp = oldProps[i]) ||\n\t\t\t((i === 'checked' || i === 'value') && value != null && value !== dom[i])\n\t\t) {\n\t\t\tsetProperty(dom, i, value, tmp, isSvg);\n\t\t}\n\t}\n\n\t// If the new vnode didn't have dangerouslySetInnerHTML, diff its children\n\tif (newHtml) {\n\t\tvalue = newHtml.__html;\n\t\t// Avoid re-applying the same '__html' if it did not changed between re-render\n\t\tif (!oldHtml || (value !== oldHtml.__html && value !== dom.innerHTML)) {\n\t\t\tdom.innerHTML = value;\n\t\t}\n\t\tinternal._children = null;\n\t} else {\n\t\tif (oldHtml) dom.innerHTML = '';\n\n\t\tdiffChildren(\n\t\t\tdom,\n\t\t\tnewChildren && Array.isArray(newChildren) ? newChildren : [newChildren],\n\t\t\tinternal,\n\t\t\tglobalContext,\n\t\t\tcommitQueue,\n\t\t\tdom.firstChild\n\t\t);\n\t}\n\n\tif (newProps.value != null && dom._isControlled) {\n\t\tdom._prevValue = newProps.value;\n\t} else if (newProps.checked != null && dom._isControlled) {\n\t\tdom._prevValue = newProps.checked;\n\t}\n}\n","import { addCommitCallback, commitRoot } from './diff/commit';\nimport options from './options';\nimport { createVNode, Fragment } from './create-element';\nimport { patch } from './diff/patch';\nimport {\n\tDIRTY_BIT,\n\tFORCE_UPDATE,\n\tMODE_HYDRATE,\n\tMODE_SUSPENDED,\n\tMODE_UNMOUNTING\n} from './constants';\nimport { getDomSibling, getParentDom } from './tree';\n\n/**\n * Base Component class. Provides `setState()` and `forceUpdate()`, which\n * trigger rendering\n * @param {object} props The initial component props\n * @param {object} context The initial context from parent components'\n * getChildContext\n */\nexport function Component(props, context) {\n\tthis.props = props;\n\tthis.context = context;\n}\n\n/**\n * Update component state and schedule a re-render.\n * @this {import('./internal').Component}\n * @param {object | ((s: object, p: object) => object)} update A hash of state\n * properties to update with new values or a function that given the current\n * state and props returns a new partial state\n * @param {() => void} [callback] A function to be called once component state is\n * updated\n */\nComponent.prototype.setState = function(update, callback) {\n\t// only clone state when copying to nextState the first time.\n\tlet s;\n\tif (this._nextState != null && this._nextState !== this.state) {\n\t\ts = this._nextState;\n\t} else {\n\t\ts = this._nextState = Object.assign({}, this.state);\n\t}\n\n\tif (typeof update == 'function') {\n\t\t// Some libraries like `immer` mark the current state as readonly,\n\t\t// preventing us from mutating it, so we need to clone it. See #2716\n\t\tupdate = update(Object.assign({}, s), this.props);\n\t}\n\n\tif (update) {\n\t\tObject.assign(s, update);\n\t}\n\n\t// Skip update if updater function returned null\n\tif (update == null) return;\n\n\tif (this._internal) {\n\t\tif (callback) addCommitCallback(this._internal, callback);\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Immediately perform a synchronous re-render of the component\n * @this {import('./internal').Component}\n * @param {() => void} [callback] A function to be called after component is\n * re-rendered\n */\nComponent.prototype.forceUpdate = function(callback) {\n\tif (this._internal) {\n\t\t// Set render mode so that we can differentiate where the render request\n\t\t// is coming from. We need this because forceUpdate should never call\n\t\t// shouldComponentUpdate\n\t\tthis._internal._flags |= FORCE_UPDATE;\n\t\tif (callback) addCommitCallback(this._internal, callback);\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Accepts `props` and `state`, and returns a new Virtual DOM tree to build.\n * Virtual DOM is generally constructed via [JSX](http://jasonformat.com/wtf-is-jsx).\n * @param {object} props Props (eg: JSX attributes) received from parent\n * element/component\n * @param {object} state The component's current state\n * @param {object} context Context object, as returned by the nearest\n * ancestor's `getChildContext()`\n * @returns {import('./index').ComponentChildren | void}\n */\nComponent.prototype.render = Fragment;\n\n/**\n * Trigger in-place re-rendering of a component.\n * @param {import('./internal').Component} component The component to rerender\n */\nfunction rerenderComponent(component) {\n\tlet internal = component._internal;\n\n\tif (~internal._flags & MODE_UNMOUNTING && internal._flags & DIRTY_BIT) {\n\t\tlet parentDom = getParentDom(internal);\n\t\tlet startDom =\n\t\t\t(internal._flags & (MODE_HYDRATE | MODE_SUSPENDED)) ===\n\t\t\t(MODE_HYDRATE | MODE_SUSPENDED)\n\t\t\t\t? internal._dom\n\t\t\t\t: getDomSibling(internal, 0);\n\n\t\tconst vnode = createVNode(\n\t\t\tinternal.type,\n\t\t\tinternal.props,\n\t\t\tinternal.key, // @TODO we shouldn't need to actually pass these\n\t\t\tinternal.ref, // since the mode flag should bypass key/ref handling\n\t\t\t0\n\t\t);\n\n\t\tconst commitQueue = [];\n\t\tpatch(\n\t\t\tparentDom,\n\t\t\tvnode,\n\t\t\tinternal,\n\t\t\tcomponent._globalContext,\n\t\t\tcommitQueue,\n\t\t\tstartDom\n\t\t);\n\t\tcommitRoot(commitQueue, internal);\n\t}\n}\n\n/**\n * The render queue\n * @type {Array<import('./internal').Component>}\n */\nlet rerenderQueue = [];\n\n/*\n * The value of `Component.debounce` must asynchronously invoke the passed in callback. It is\n * important that contributors to Preact can consistently reason about what calls to `setState`, etc.\n * do, and when their effects will be applied. See the links below for some further reading on designing\n * asynchronous APIs.\n * * [Designing APIs for Asynchrony](https://blog.izs.me/2013/08/designing-apis-for-asynchrony)\n * * [Callbacks synchronous and asynchronous](https://blog.ometer.com/2011/07/24/callbacks-synchronous-and-asynchronous/)\n */\n\nlet prevDebounce;\n\nconst defer = Promise.prototype.then.bind(Promise.resolve());\n\n/**\n * Enqueue a rerender of a component\n * @param {import('./internal').Component} c The component to rerender\n */\nexport function enqueueRender(c) {\n\tif (\n\t\t(!(c._internal._flags & DIRTY_BIT) &&\n\t\t\t(c._internal._flags |= DIRTY_BIT) &&\n\t\t\trerenderQueue.push(c) &&\n\t\t\t!process._rerenderCount++) ||\n\t\tprevDebounce !== options.debounceRendering\n\t) {\n\t\tprevDebounce = options.debounceRendering;\n\t\t(prevDebounce || defer)(process);\n\t}\n}\n\n/** Flush the render queue by rerendering all queued components */\nfunction process() {\n\twhile ((len = process._rerenderCount = rerenderQueue.length)) {\n\t\trerenderQueue.sort((a, b) => a._internal._depth - b._internal._depth);\n\t\twhile (len--) {\n\t\t\trerenderComponent(rerenderQueue.shift());\n\t\t}\n\t}\n}\nlet len = (process._rerenderCount = 0);\n","import { Fragment } from '../create-element';\nimport options from '../options';\nimport { Component } from '../component';\nimport { mountChildren } from './mount';\nimport { diffChildren, reorderChildren } from './children';\nimport {\n\tDIRTY_BIT,\n\tFORCE_UPDATE,\n\tMODE_PENDING_ERROR,\n\tMODE_RERENDERING_ERROR,\n\tTYPE_CLASS\n} from '../constants';\nimport { addCommitCallback } from './commit';\n\n/**\n * Diff two virtual nodes and apply proper changes to the DOM\n * @param {import('../internal').PreactElement} parentDom The parent of the DOM element\n * @param {import('../internal').VNode} newVNode The new virtual node\n * @param {import('../internal').Internal} internal The component's backing Internal node\n * @param {object} globalContext The current context object. Modified by getChildContext\n * @param {import('../internal').CommitQueue} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {import('../internal').PreactNode} startDom\n * @returns {import('../internal').PreactNode} pointer to the next DOM node (in order) to be rendered (or null)\n */\nexport function renderComponent(\n\tparentDom,\n\tnewVNode,\n\tinternal,\n\tglobalContext,\n\tcommitQueue,\n\tstartDom\n) {\n\t/** @type {import('../internal').Component} */\n\tlet c;\n\tlet isNew, oldProps, oldState, snapshot, tmp;\n\n\t/** @type {import('../internal').ComponentType} */\n\tlet type = (internal.type);\n\n\t// @TODO split update + mount?\n\tlet newProps = newVNode ? newVNode.props : internal.props;\n\n\tif (internal._flags & MODE_PENDING_ERROR) {\n\t\t// Toggle the MODE_PENDING_ERROR and MODE_RERENDERING_ERROR flags. In\n\t\t// actuality, this should turn off the MODE_PENDING_ERROR flag and turn on\n\t\t// the MODE_RERENDERING_ERROR flag.\n\t\tinternal._flags ^= MODE_PENDING_ERROR | MODE_RERENDERING_ERROR;\n\t}\n\n\t// Necessary for createContext api. Setting this property will pass\n\t// the context value as `this.context` just for this component.\n\ttmp = type.contextType;\n\tlet provider = tmp && globalContext[tmp._id];\n\tlet componentContext = tmp\n\t\t? provider\n\t\t\t? provider.props.value\n\t\t\t: tmp._defaultValue\n\t\t: globalContext;\n\n\tif (internal && internal._component) {\n\t\tc = internal._component;\n\t} else {\n\t\t// Instantiate the new component\n\t\tif (internal._flags & TYPE_CLASS) {\n\t\t\t// @ts-ignore The check above verifies that newType is suppose to be constructed\n\t\t\tinternal._component = c = new type(newProps, componentContext); // eslint-disable-line new-cap\n\t\t} else {\n\t\t\t// @ts-ignore Trust me, Component implements the interface we want\n\t\t\tinternal._component = c = new Component(newProps, componentContext);\n\t\t\tc.constructor = type;\n\t\t\tc.render = doRender;\n\t\t}\n\t\tif (provider) provider._subs.add(c);\n\n\t\tc.props = newProps;\n\t\tif (!c.state) c.state = {};\n\t\tc.context = componentContext;\n\t\tc._globalContext = globalContext;\n\t\tisNew = true;\n\t\tinternal._flags |= DIRTY_BIT;\n\t}\n\n\t// Invoke getDerivedStateFromProps\n\tif (c._nextState == null) {\n\t\tc._nextState = c.state;\n\t}\n\tif (type.getDerivedStateFromProps != null) {\n\t\tif (c._nextState == c.state) {\n\t\t\tc._nextState = Object.assign({}, c._nextState);\n\t\t}\n\n\t\tObject.assign(\n\t\t\tc._nextState,\n\t\t\ttype.getDerivedStateFromProps(newProps, c._nextState)\n\t\t);\n\t}\n\n\toldProps = c.props;\n\toldState = c.state;\n\tif (isNew) {\n\t\tif (type.getDerivedStateFromProps == null && c.componentWillMount != null) {\n\t\t\tc.componentWillMount();\n\t\t}\n\n\t\tif (c.componentDidMount != null) {\n\t\t\t// If the component was constructed, queue up componentDidMount so the\n\t\t\t// first time this internal commits (regardless of suspense or not) it\n\t\t\t// will be called\n\t\t\taddCommitCallback(internal, c.componentDidMount);\n\t\t}\n\t} else {\n\t\tif (\n\t\t\ttype.getDerivedStateFromProps == null &&\n\t\t\tnewProps !== oldProps &&\n\t\t\tc.componentWillReceiveProps != null\n\t\t) {\n\t\t\tc.componentWillReceiveProps(newProps, componentContext);\n\t\t}\n\n\t\tif (\n\t\t\t(!(internal._flags & FORCE_UPDATE) &&\n\t\t\t\tc.shouldComponentUpdate != null &&\n\t\t\t\tc.shouldComponentUpdate(newProps, c._nextState, componentContext) ===\n\t\t\t\t\tfalse) ||\n\t\t\t(newVNode && newVNode._vnodeId === internal._vnodeId)\n\t\t) {\n\t\t\tc.props = newProps;\n\t\t\tc.state = c._nextState;\n\t\t\tinternal.props = newProps;\n\t\t\t// More info about this here: https://gist.github.com/JoviDeCroock/bec5f2ce93544d2e6070ef8e0036e4e8\n\t\t\tif (newVNode && newVNode._vnodeId !== internal._vnodeId) {\n\t\t\t\tinternal._flags &= ~DIRTY_BIT;\n\t\t\t}\n\n\t\t\tc._internal = internal;\n\t\t\tif (\n\t\t\t\tinternal._commitCallbacks != null &&\n\t\t\t\tinternal._commitCallbacks.length\n\t\t\t) {\n\t\t\t\tcommitQueue.push(internal);\n\t\t\t}\n\n\t\t\t// TODO: Returning undefined here (i.e. return;) passes all tests. That seems\n\t\t\t// like a bug. Should validate that we have test coverage for sCU that\n\t\t\t// returns Fragments with multiple DOM children\n\t\t\treturn reorderChildren(internal, startDom, parentDom);\n\t\t}\n\n\t\tif (c.componentWillUpdate != null) {\n\t\t\tc.componentWillUpdate(newProps, c._nextState, componentContext);\n\t\t}\n\t}\n\n\tc.context = componentContext;\n\tc.props = newProps;\n\tc.state = c._nextState;\n\n\tinternal.props = newProps;\n\n\tif ((tmp = options._render)) tmp(internal);\n\n\tinternal._flags &= ~DIRTY_BIT;\n\tc._internal = internal;\n\n\ttmp = c.render(c.props, c.state, c.context);\n\n\t// Handle setState called in render, see #2553\n\tc.state = c._nextState;\n\n\tif (c.getChildContext != null) {\n\t\tglobalContext = Object.assign({}, globalContext, c.getChildContext());\n\t}\n\n\tif (!isNew) {\n\t\tif (c.getSnapshotBeforeUpdate != null) {\n\t\t\tsnapshot = c.getSnapshotBeforeUpdate(oldProps, oldState);\n\t\t}\n\n\t\t// Only schedule componentDidUpdate if the component successfully rendered\n\t\tif (c.componentDidUpdate != null) {\n\t\t\taddCommitCallback(internal, () => {\n\t\t\t\tc.componentDidUpdate(oldProps, oldState, snapshot);\n\t\t\t});\n\t\t}\n\t}\n\n\tlet isTopLevelFragment =\n\t\ttmp != null && tmp.type === Fragment && tmp.key == null;\n\tlet renderResult = isTopLevelFragment ? tmp.props.children : tmp;\n\n\tlet nextDomSibling;\n\n\tif (internal._children == null) {\n\t\tnextDomSibling = mountChildren(\n\t\t\tparentDom,\n\t\t\tArray.isArray(renderResult) ? renderResult : [renderResult],\n\t\t\tinternal,\n\t\t\tglobalContext,\n\t\t\tcommitQueue,\n\t\t\tstartDom\n\t\t);\n\t} else {\n\t\tnextDomSibling = diffChildren(\n\t\t\tparentDom,\n\t\t\tArray.isArray(renderResult) ? renderResult : [renderResult],\n\t\t\tinternal,\n\t\t\tglobalContext,\n\t\t\tcommitQueue,\n\t\t\tstartDom\n\t\t);\n\t}\n\n\tif (internal._commitCallbacks != null && internal._commitCallbacks.length) {\n\t\tcommitQueue.push(internal);\n\t}\n\n\treturn nextDomSibling;\n}\n\n/** The `.render()` method for a PFC backing instance. */\nfunction doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}\n","import { applyRef } from './refs';\nimport {\n\tTYPE_COMPONENT,\n\tTYPE_ELEMENT,\n\tMODE_HYDRATE,\n\tMODE_MUTATIVE_HYDRATE,\n\tMODE_SUSPENDED,\n\tRESET_MODE,\n\tTYPE_TEXT,\n\tMODE_ERRORED,\n\tTYPE_ROOT,\n\tMODE_SVG\n} from '../constants';\nimport { normalizeToVNode } from '../create-element';\nimport { setProperty } from './props';\nimport { renderComponent } from './component';\nimport { createInternal } from '../tree';\nimport options from '../options';\n\n/**\n * Diff two virtual nodes and apply proper changes to the DOM\n * @param {import('../internal').PreactElement} parentDom The parent of the DOM element\n * @param {import('../internal').VNode | string} newVNode The new virtual node\n * @param {import('../internal').Internal} internal The Internal node to mount\n * @param {object} globalContext The current context object. Modified by getChildContext\n * @param {import('../internal').CommitQueue} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {import('../internal').PreactElement} startDom\n * @returns {import('../internal').PreactElement | null} pointer to the next DOM node to be hydrated (or null)\n */\nexport function mount(\n\tparentDom,\n\tnewVNode,\n\tinternal,\n\tglobalContext,\n\tcommitQueue,\n\tstartDom\n) {\n\tif (options._diff) options._diff(internal, newVNode);\n\n\t/** @type {import('../internal').PreactElement} */\n\tlet nextDomSibling;\n\n\ttry {\n\t\tif (internal._flags & TYPE_COMPONENT) {\n\t\t\t// Root nodes signal that an attempt to render into a specific DOM node on\n\t\t\t// the page. Root nodes can occur anywhere in the tree and not just at the\n\t\t\t// top.\n\t\t\tlet prevStartDom = startDom;\n\t\t\tlet prevParentDom = parentDom;\n\t\t\tif (internal._flags & TYPE_ROOT) {\n\t\t\t\tparentDom = newVNode.props._parentDom;\n\n\t\t\t\tif (parentDom !== prevParentDom) {\n\t\t\t\t\tstartDom = null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tnextDomSibling = renderComponent(\n\t\t\t\tparentDom,\n\t\t\t\tnull,\n\t\t\t\tinternal,\n\t\t\t\tglobalContext,\n\t\t\t\tcommitQueue,\n\t\t\t\tstartDom\n\t\t\t);\n\n\t\t\tif (internal._flags & TYPE_ROOT && prevParentDom !== parentDom) {\n\t\t\t\t// If we just mounted a root node/Portal, and it changed the parentDom\n\t\t\t\t// of it's children, then we need to resume the diff from it's previous\n\t\t\t\t// startDom element, which could be null if we are mounting an entirely\n\t\t\t\t// new tree, or the portal's nextSibling if we are mounting a Portal in\n\t\t\t\t// an existing tree.\n\t\t\t\tnextDomSibling = prevStartDom;\n\t\t\t}\n\t\t} else {\n\t\t\tlet hydrateDom =\n\t\t\t\tinternal._flags & (MODE_HYDRATE | MODE_MUTATIVE_HYDRATE)\n\t\t\t\t\t? startDom\n\t\t\t\t\t: null;\n\n\t\t\tnextDomSibling = mountDOMElement(\n\t\t\t\thydrateDom,\n\t\t\t\tinternal,\n\t\t\t\tglobalContext,\n\t\t\t\tcommitQueue\n\t\t\t);\n\t\t}\n\n\t\tif (options.diffed) options.diffed(internal);\n\n\t\t// We successfully rendered this VNode, unset any stored hydration/bailout state:\n\t\tinternal._flags &= RESET_MODE;\n\t} catch (e) {\n\t\tinternal._vnodeId = 0;\n\t\tinternal._flags |= e.then ? MODE_SUSPENDED : MODE_ERRORED;\n\n\t\tif (internal._flags & MODE_HYDRATE) {\n\t\t\t// @ts-ignore Trust me TS, nextSibling is a PreactElement\n\t\t\tnextDomSibling = startDom && startDom.nextSibling;\n\t\t\tinternal._dom = startDom; // Save our current DOM position to resume later\n\t\t}\n\t\toptions._catchError(e, internal);\n\t}\n\n\treturn nextDomSibling;\n}\n\n/**\n * Diff two virtual nodes representing DOM element\n * @param {import('../internal').PreactElement} dom The DOM element representing\n * the virtual nodes being diffed\n * @param {import('../internal').Internal} internal The Internal node to mount\n * @param {object} globalContext The current context object\n * @param {import('../internal').CommitQueue} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @returns {import('../internal').PreactElement}\n */\nfunction mountDOMElement(dom, internal, globalContext, commitQueue) {\n\tlet newProps = internal.props;\n\tlet nodeType = internal.type;\n\t/** @type {any} */\n\tlet i, value;\n\n\tlet flags = internal._flags;\n\tlet isSvg = flags & MODE_SVG;\n\n\t// Are we *not* hydrating? (a top-level render() or mutative hydration):\n\tlet isFullRender = ~flags & MODE_HYDRATE;\n\n\t// if hydrating (hydrate() or render() with replaceNode), find the matching child:\n\tif (flags & (MODE_HYDRATE | MODE_MUTATIVE_HYDRATE)) {\n\t\twhile (\n\t\t\tdom &&\n\t\t\t(nodeType ? dom.localName !== nodeType : dom.nodeType !== 3)\n\t\t) {\n\t\t\tdom = dom.nextSibling;\n\t\t}\n\t}\n\n\tlet isNew = dom == null;\n\n\tif (flags & TYPE_TEXT) {\n\t\tif (isNew) {\n\t\t\t// @ts-ignore createTextNode returns Text, we expect PreactElement\n\t\t\tdom = document.createTextNode(newProps);\n\t\t} else if (dom.data !== newProps) {\n\t\t\tdom.data = newProps;\n\t\t}\n\n\t\tinternal._dom = dom;\n\t} else {\n\t\t// Tracks entering and exiting SVG namespace when descending through the tree.\n\t\t// if (nodeType === 'svg') internal._flags |= MODE_SVG;\n\n\t\tif (isNew) {\n\t\t\tif (isSvg) {\n\t\t\t\tdom = document.createElementNS(\n\t\t\t\t\t'http://www.w3.org/2000/svg',\n\t\t\t\t\t// @ts-ignore We know `newVNode.type` is a string\n\t\t\t\t\tnodeType\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tdom = document.createElement(\n\t\t\t\t\t// @ts-ignore We know `newVNode.type` is a string\n\t\t\t\t\tnodeType,\n\t\t\t\t\tnewProps.is && newProps\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// we are creating a new node, so we can assume this is a new subtree (in case we are hydrating), this deopts the hydrate\n\t\t\tinternal._flags = flags &= RESET_MODE;\n\t\t\tisFullRender = 1;\n\t\t}\n\n\t\t// @TODO: Consider removing and instructing users to instead set the desired\n\t\t// prop for removal to undefined/null. During hydration, props are not\n\t\t// diffed at all (including dangerouslySetInnerHTML)\n\t\tif (flags & MODE_MUTATIVE_HYDRATE) {\n\t\t\t// But, if we are in a situation where we are using existing DOM (e.g. replaceNode)\n\t\t\t// we should read the existing DOM attributes to diff them\n\t\t\tfor (i = 0; i < dom.attributes.length; i++) {\n\t\t\t\tvalue = dom.attributes[i].name;\n\t\t\t\tif (!(value in newProps)) {\n\t\t\t\t\tdom.removeAttribute(value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tlet newHtml, newValue, newChildren;\n\t\tif (\n\t\t\t(internal.type === 'input' ||\n\t\t\t\tinternal.type === 'textarea' ||\n\t\t\t\tinternal.type === 'select') &&\n\t\t\t(newProps.onInput || newProps.onChange)\n\t\t) {\n\t\t\tif (newProps.value != null) {\n\t\t\t\tdom._isControlled = true;\n\t\t\t\tdom._prevValue = newProps.value;\n\t\t\t} else if (newProps.checked != null) {\n\t\t\t\tdom._isControlled = true;\n\t\t\t\tdom._prevValue = newProps.checked;\n\t\t\t}\n\t\t}\n\n\t\tfor (i in newProps) {\n\t\t\tvalue = newProps[i];\n\t\t\tif (i === 'key') {\n\t\t\t} else if (i === 'children') {\n\t\t\t\tnewChildren = value;\n\t\t\t} else if (i === 'dangerouslySetInnerHTML') {\n\t\t\t\tnewHtml = value;\n\t\t\t} else if (i === 'value') {\n\t\t\t\tnewValue = value;\n\t\t\t} else if (\n\t\t\t\tvalue != null &&\n\t\t\t\t(isFullRender || typeof value === 'function')\n\t\t\t) {\n\t\t\t\tsetProperty(dom, i, value, null, isSvg);\n\t\t\t}\n\t\t}\n\n\t\tinternal._dom = dom;\n\n\t\t// If the new vnode didn't have dangerouslySetInnerHTML, diff its children\n\t\tif (newHtml) {\n\t\t\tif (isFullRender && newHtml.__html) {\n\t\t\t\tdom.innerHTML = newHtml.__html;\n\t\t\t}\n\t\t\tinternal._children = null;\n\t\t} else if (newChildren != null) {\n\t\t\tmountChildren(\n\t\t\t\tdom,\n\t\t\t\tnewChildren && Array.isArray(newChildren) ? newChildren : [newChildren],\n\t\t\t\tinternal,\n\t\t\t\tglobalContext,\n\t\t\t\tcommitQueue,\n\t\t\t\tisNew ? null : dom.firstChild\n\t\t\t);\n\t\t}\n\n\t\t// (as above, don't diff props during hydration)\n\t\tif (isFullRender && newValue != null) {\n\t\t\tsetProperty(dom, 'value', newValue, null, 0);\n\t\t}\n\t}\n\n\t// @ts-ignore\n\treturn isNew ? null : dom.nextSibling;\n}\n\n/**\n * Diff the children of a virtual node\n * @param {import('../internal').PreactElement} parentDom The DOM element whose\n * children are being diffed\n * @param {import('../internal').ComponentChildren[]} renderResult\n * @param {import('../internal').Internal} parentInternal The parent Internal of the given children\n * @param {object} globalContext The current context object - modified by getChildContext\n * @param {import('../internal').CommitQueue} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {import('../internal').PreactElement} startDom\n */\nexport function mountChildren(\n\tparentDom,\n\trenderResult,\n\tparentInternal,\n\tglobalContext,\n\tcommitQueue,\n\tstartDom\n) {\n\tlet internalChildren = (parentInternal._children = []),\n\t\ti,\n\t\tchildVNode,\n\t\tchildInternal,\n\t\tnewDom,\n\t\tmountedNextChild;\n\n\tfor (i = 0; i < renderResult.length; i++) {\n\t\tchildVNode = normalizeToVNode(renderResult[i]);\n\n\t\t// Terser removes the `continue` here and wraps the loop body\n\t\t// in a `if (childVNode) { ... } condition\n\t\tif (childVNode == null) {\n\t\t\tinternalChildren[i] = null;\n\t\t\tcontinue;\n\t\t}\n\n\t\tchildInternal = createInternal(childVNode, parentInternal);\n\t\tinternalChildren[i] = childInternal;\n\n\t\t// Morph the old element into the new one, but don't append it to the dom yet\n\t\tmountedNextChild = mount(\n\t\t\tparentDom,\n\t\t\tchildVNode,\n\t\t\tchildInternal,\n\t\t\tglobalContext,\n\t\t\tcommitQueue,\n\t\t\tstartDom\n\t\t);\n\n\t\tnewDom = childInternal._dom;\n\n\t\tif (childInternal._flags & TYPE_COMPONENT || newDom == startDom) {\n\t\t\t// If the child is a Fragment-like or if it is DOM VNode and its _dom\n\t\t\t// property matches the dom we are diffing (i.e. startDom), just\n\t\t\t// continue with the mountedNextChild\n\t\t\tstartDom = mountedNextChild;\n\t\t} else if (newDom != null) {\n\t\t\t// The DOM the diff should begin with is now startDom (since we inserted\n\t\t\t// newDom before startDom) so ignore mountedNextChild and continue with\n\t\t\t// startDom\n\t\t\tparentDom.insertBefore(newDom, startDom);\n\t\t}\n\n\t\tif (childInternal.ref) {\n\t\t\tapplyRef(\n\t\t\t\tnull,\n\t\t\t\tchildInternal.ref,\n\t\t\t\tchildInternal._component || newDom,\n\t\t\t\tchildInternal\n\t\t\t);\n\t\t}\n\t}\n\n\t// Remove children that are not part of any vnode.\n\tif (\n\t\tparentInternal._flags & (MODE_HYDRATE | MODE_MUTATIVE_HYDRATE) &&\n\t\tparentInternal._flags & TYPE_ELEMENT\n\t) {\n\t\t// TODO: Would it be simpler to just clear the pre-existing DOM in top-level\n\t\t// render if render is called with no oldVNode & existing children & no\n\t\t// replaceNode? Instead of patching the DOM to match the VNode tree? (remove\n\t\t// attributes & unused DOM)\n\t\twhile (startDom) {\n\t\t\ti = startDom;\n\t\t\tstartDom = startDom.nextSibling;\n\t\t\ti.remove();\n\t\t}\n\t}\n\n\treturn startDom;\n}\n","import {\n\tMODE_HYDRATE,\n\tMODE_MUTATIVE_HYDRATE,\n\tMODE_SVG,\n\tUNDEFINED\n} from './constants';\nimport { commitRoot } from './diff/commit';\nimport { createElement, Fragment } from './create-element';\nimport options from './options';\nimport { mount } from './diff/mount';\nimport { patch } from './diff/patch';\nimport { createInternal } from './tree';\n\n/**\n * Render a Preact virtual node into a DOM element\n * @param {import('./internal').ComponentChild} vnode The virtual node to render\n * @param {import('./internal').PreactElement} parentDom The DOM element to\n * render into\n */\nexport function render(vnode, parentDom) {\n\tif (options._root) options._root(vnode, parentDom);\n\n\t// List of effects that need to be called after diffing.\n\tconst commitQueue = [];\n\n\t// To be able to support calling `render()` multiple times on the same\n\t// DOM node, we need to obtain a reference to the previous tree. We do\n\t// this by assigning a new `_children` property to DOM nodes which points\n\t// to the last rendered tree. By default this property is not present, which\n\t// means that we are mounting a new tree for the first time.\n\tlet rootInternal = parentDom._children;\n\tvnode = createElement(Fragment, { _parentDom: parentDom }, [vnode]);\n\n\tif (rootInternal) {\n\t\tpatch(\n\t\t\tparentDom,\n\t\t\tvnode,\n\t\t\trootInternal,\n\t\t\t{},\n\t\t\tcommitQueue,\n\t\t\tparentDom.firstChild\n\t\t);\n\t} else {\n\t\t// Store the VDOM tree root on the DOM element in a (minified) property:\n\t\trootInternal = parentDom._children = createInternal(vnode, null);\n\n\t\tif (parentDom.ownerSVGElement !== UNDEFINED) {\n\t\t\trootInternal._flags |= MODE_SVG;\n\t\t}\n\n\t\t// Calling `render` on a container with existing DOM elements puts the diff into mutative hydrate mode:\n\t\tif (parentDom.firstChild) {\n\t\t\trootInternal._flags |= MODE_MUTATIVE_HYDRATE;\n\t\t}\n\n\t\tmount(\n\t\t\tparentDom,\n\t\t\tvnode,\n\t\t\trootInternal,\n\t\t\t{},\n\t\t\tcommitQueue,\n\t\t\t// Start the diff at the replaceNode or the parentDOM.firstChild if any.\n\t\t\t// Will be null if the parentDom is empty\n\t\t\tparentDom.firstChild\n\t\t);\n\t}\n\n\t// Flush all queued effects\n\tcommitRoot(commitQueue, rootInternal);\n}\n\n/**\n * Update an existing DOM element with data from a Preact virtual node\n * @param {import('./internal').ComponentChild} vnode The virtual node to render\n * @param {import('./internal').PreactElement} parentDom The DOM element to\n * update\n */\nexport function hydrate(vnode, parentDom) {\n\tif (options._root) options._root(vnode, parentDom);\n\n\tvnode = createElement(Fragment, { _parentDom: parentDom }, [vnode]);\n\tconst rootInternal = createInternal(vnode);\n\trootInternal._flags |= MODE_HYDRATE;\n\tparentDom._children = rootInternal;\n\n\tif (parentDom.ownerSVGElement !== UNDEFINED) {\n\t\trootInternal._flags |= MODE_SVG;\n\t}\n\n\tconst commitQueue = [];\n\tmount(parentDom, vnode, rootInternal, {}, commitQueue, parentDom.firstChild);\n\tcommitRoot(commitQueue, rootInternal);\n}\n","import {\n\tMODE_HYDRATE,\n\tMODE_MUTATIVE_HYDRATE,\n\tMODE_SVG,\n\tUNDEFINED\n} from './constants';\nimport { commitRoot } from './diff/commit';\nimport { createElement, Fragment } from './create-element';\nimport options from './options';\nimport { mount } from './diff/mount';\nimport { patch } from './diff/patch';\nimport { createInternal } from './tree';\n\n/**\n *\n * @param {import('./internal').PreactElement} parentDom The DOM element to\n */\nexport function createRoot(parentDom) {\n\tlet rootInternal = null;\n\n\tfunction render(vnode) {\n\t\tif (options._root) options._root(vnode, parentDom);\n\n\t\t// List of effects that need to be called after diffing.\n\t\tconst commitQueue = [];\n\n\t\tvnode = createElement(Fragment, { _parentDom: parentDom }, [vnode]);\n\n\t\tif (rootInternal) {\n\t\t\tpatch(\n\t\t\t\tparentDom,\n\t\t\t\tvnode,\n\t\t\t\trootInternal,\n\t\t\t\t{},\n\t\t\t\tcommitQueue,\n\t\t\t\tparentDom.firstChild\n\t\t\t);\n\t\t} else {\n\t\t\t// Store the VDOM tree root on the DOM element in a (minified) property:\n\t\t\trootInternal = parentDom._children = createInternal(vnode, null);\n\n\t\t\tif (parentDom.ownerSVGElement !== UNDEFINED) {\n\t\t\t\trootInternal._flags |= MODE_SVG;\n\t\t\t}\n\n\t\t\t// Calling `render` on a container with existing DOM elements puts the diff into mutative hydrate mode:\n\t\t\tif (parentDom.firstChild) {\n\t\t\t\trootInternal._flags |= MODE_MUTATIVE_HYDRATE;\n\t\t\t}\n\n\t\t\tmount(\n\t\t\t\tparentDom,\n\t\t\t\tvnode,\n\t\t\t\trootInternal,\n\t\t\t\t{},\n\t\t\t\tcommitQueue,\n\t\t\t\t// Start the diff at the replaceNode or the parentDOM.firstChild if any.\n\t\t\t\t// Will be null if the parentDom is empty\n\t\t\t\tparentDom.firstChild\n\t\t\t);\n\t\t}\n\n\t\t// Flush all queued effects\n\t\tcommitRoot(commitQueue, vnode);\n\t}\n\n\treturn {\n\t\thydrate(vnode) {\n\t\t\tif (options._root) options._root(vnode, parentDom);\n\n\t\t\tvnode = createElement(Fragment, { _parentDom: parentDom }, [vnode]);\n\t\t\trootInternal = createInternal(vnode);\n\t\t\trootInternal._flags |= MODE_HYDRATE;\n\t\t\tparentDom._children = rootInternal;\n\n\t\t\tif (parentDom.ownerSVGElement !== UNDEFINED) {\n\t\t\t\trootInternal._flags |= MODE_SVG;\n\t\t\t}\n\n\t\t\tconst commitQueue = [];\n\t\t\tmount(\n\t\t\t\tparentDom,\n\t\t\t\tvnode,\n\t\t\t\trootInternal,\n\t\t\t\t{},\n\t\t\t\tcommitQueue,\n\t\t\t\tparentDom.firstChild\n\t\t\t);\n\t\t\tcommitRoot(commitQueue, rootInternal);\n\t\t},\n\t\trender\n\t};\n}\n","import { createVNode } from './create-element';\n\n/**\n * Clones the given VNode, optionally adding attributes/props and replacing its children.\n * @param {import('./internal').VNode} vnode The virtual DOM element to clone\n * @param {object} props Attributes/props to add when cloning\n * @param {Array<import('./internal').ComponentChildren>} rest Any additional arguments will be used as replacement children.\n * @returns {import('./internal').VNode}\n */\nexport function cloneElement(vnode, props, children) {\n\tlet normalizedProps = Object.assign({}, vnode.props),\n\t\tkey,\n\t\tref,\n\t\ti;\n\tfor (i in props) {\n\t\tif (!(i === 'key' || (typeof vnode.type !== 'function' && i === 'ref'))) {\n\t\t\tnormalizedProps[i] = props[i];\n\t\t} else if (i === 'key') {\n\t\t\tkey = props[i];\n\t\t} else if (i === 'ref') {\n\t\t\tref = props[i];\n\t\t}\n\t}\n\n\tif (arguments.length > 3) {\n\t\tchildren = [children];\n\t\tfor (i = 3; i < arguments.length; i++) {\n\t\t\tchildren.push(arguments[i]);\n\t\t}\n\t}\n\tif (children != null) {\n\t\tnormalizedProps.children = children;\n\t}\n\n\treturn createVNode(\n\t\tvnode.type,\n\t\tnormalizedProps,\n\t\tkey || vnode.key,\n\t\tref || vnode.ref,\n\t\t0\n\t);\n}\n"],"names":["EMPTY_ARR","options","[object Object]","error","internal","TYPE_CLASS","type","getDerivedStateFromError","setState","componentDidCatch","e","addCommitCallback","callback","push","commitRoot","commitQueue","rootInternal","some","length","shift","call","vnodeId","createElement","props","children","key","ref","i","normalizedProps","arguments","defaultProps","undefined","createVNode","original","vnode","constructor","__v","normalizeToVNode","childVNode","Array","isArray","Fragment","createRef","current","isValidElement","applyRef","oldRef","value","setStyle","dom","style","setProperty","name","oldValue","isSvg","useCapture","o","replace","toLowerCase","slice","_listeners","addEventListener","eventProxyCapture","eventProxy","removeEventListener","setAttribute","removeAttribute","this","event","_isControlled","_prevValue","checked","nextContextId","providers","Set","createContext","defaultValue","contextId","context","__c","__","Consumer","contextValue","Provider","ctx","forEach","enqueueRender","getChildContext","contextType","unmount","parentInternal","skipRemove","r","delete","component","p","componentWillUnmount","TYPE_TEXT","remove","createInternal","flags","MODE_HYDRATE","NaN","prototype","__k","__e","__f","__b","shouldSearchComponent","getParentDom","getDomSibling","childIndex","indexOf","getChildDom","child","childDom","parentDom","parent","diffChildren","renderResult","globalContext","startDom","newDom","refs","childInternal","oldChildren","oldChildrenLength","newChildren","oldVNodeRef","nextDomSibling","findMatchingInternal","mount","patch","placeChild","parentNode","j","reorderChildren","tmp","nextSibling","toChildArray","out","insertBefore","sibDom","newVNode","data","patchDOMElement","diffed","prevStartDom","prevParentDom","renderComponent","then","newHtml","oldHtml","oldProps","newProps","innerHTML","firstChild","Component","rerenderComponent","update","s","state","Object","assign","forceUpdate","render","prevDebounce","rerenderQueue","defer","Promise","bind","resolve","c","process","debounceRendering","len","sort","a","b","isNew","oldState","snapshot","MODE_PENDING_ERROR","provider","componentContext","doRender","add","getDerivedStateFromProps","componentWillMount","componentDidMount","componentWillReceiveProps","shouldComponentUpdate","componentWillUpdate","getSnapshotBeforeUpdate","componentDidUpdate","mountChildren","mountDOMElement","nodeType","isFullRender","localName","document","createTextNode","createElementNS","is","attributes","newValue","onInput","onChange","mountedNextChild","internalChildren","__P","ownerSVGElement","hydrate","createRoot","cloneElement"],"mappings":"MA6DaA,EAAY,GClDnBC,EAAU,CACfC,ICE2BC,EAAOC,GAClC,KAAQA,EAAWA,MAClB,GFJ4BC,GEK3BD,OFoBmC,MEnBlCA,MAED,IAcC,GAbIA,EAASE,KAAKC,0BACjBH,MAAoBI,SACnBJ,EAASE,KAAKC,yBAAyBJ,IAIrCC,MAAoBK,mBACvBL,MAAoBK,kBAAkBN,GFkBlB,MEZjBC,MAEH,YADAA,OFL6B,KEQ7B,MAAOM,GACRP,EAAQO,EAKX,MAAMP,aCtCSQ,EAAkBP,EAAUQ,GACV,MAA7BR,QACHA,MAA4B,IAG7BA,MAA0BS,KAAKD,YAQhBE,EAAWC,EAAaC,GACnCf,OAAiBA,MAAgBe,EAAcD,GAEnDA,EAAYE,KAAKb,IAChB,IAIC,IAFAW,EAAcX,MAA0Bc,OAEjCH,KACNX,MAA0Be,QAAQC,KAAKhB,OAEvC,MAAOM,GACRT,MAAoBS,EAAGN,MC5B1B,IAAIiB,EAAU,W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CAAEyK,IAAY9F,GAAa,CAAClF,IAExDlB,EACHoH,EACChB,EACAlF,EACAlB,EACA,GACAD,EACAqG,EAAUwC,aAIX5I,EAAeoG,MAAsBjB,EAAejE,EAAO,WhBuBrCH,IgBrBlBqF,EAAU+F,kBACbnM,OhBDoB,MgBKjBoG,EAAUwC,aACb5I,OhB7BiC,IgBgClCmH,EACCf,EACAlF,EACAlB,EACA,GACAD,EAGAqG,EAAUwC,aAKZ9I,EAAWC,EAAamB,cCtDVoL,EAAapL,EAAOX,EAAOC,GAC1C,IACCC,EACAC,EACAC,EAHGC,EAAkBsI,OAAOC,OAAO,GAAIjI,EAAMX,OAI9C,IAAKI,KAAKJ,EACG,QAANI,GAAsC,mBAAfO,EAAM5B,MAA6B,QAANqB,EAEzC,QAANA,EACVF,EAAMF,EAAMI,GACI,QAANA,IACVD,EAAMH,EAAMI,IAJZC,EAAgBD,GAAKJ,EAAMI,GAQ7B,GAAIE,UAAUX,OAAS,EAEtB,IADAM,EAAW,CAACA,GACPG,EAAI,EAAOE,UAAUX,OAAdS,EAAsBA,IACjCH,EAASX,KAAKgB,UAAUF,IAO1B,OAJgB,MAAZH,IACHI,EAAgBJ,SAAWA,GAGrBQ,EACNE,EAAM5B,KACNsB,EACAH,GAAOS,EAAMT,IACbC,GAAOQ,EAAMR,IACb"}
@@ -1,2 +1,2 @@
1
- var n,l,u,i,t,r,o,f,e={},c=[],s=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function a(n,l){for(var u in l)n[u]=l[u];return n}function h(n){var l=n.parentNode;l&&l.removeChild(n)}function v(l,u,i){var t,r,o,f={};for(o in u)"key"==o?t=u[o]:"ref"==o?r=u[o]:f[o]=u[o];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):i),"function"==typeof l&&null!=l.defaultProps)for(o in l.defaultProps)void 0===f[o]&&(f[o]=l.defaultProps[o]);return y(l,f,t,r,null)}function y(n,i,t,r,o){var f={type:n,props:i,key:t,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==o?++u:o};return null==o&&null!=l.vnode&&l.vnode(f),f}function p(){return{current:null}}function d(n){return n.children}function _(n,l){this.props=n,this.context=l}function k(n,l){if(null==l)return n.__?k(n.__,n.__.__k.indexOf(n)+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return"function"==typeof n.type?k(n):null}function b(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return b(n)}}function m(n){(!n.__d&&(n.__d=!0)&&t.push(n)&&!g.__r++||o!==l.debounceRendering)&&((o=l.debounceRendering)||r)(g)}function g(){for(var n;g.__r=t.length;)n=t.sort(function(n,l){return n.__v.__b-l.__v.__b}),t=[],n.some(function(n){var l,u,i,t,r,o;n.__d&&(r=(t=(l=n).__v).__e,(o=l.__P)&&(u=[],(i=a({},t)).__v=t.__v+1,j(o,t,i,l.__n,void 0!==o.ownerSVGElement,null!=t.__h?[r]:null,u,null==r?k(t):r,t.__h),z(u,t),t.__e!=r&&b(t)))})}function w(n,l,u,i,t,r,o,f,s,a){var h,v,p,_,b,m,g,w=i&&i.__k||c,A=w.length;for(u.__k=[],h=0;h<l.length;h++)if(null!=(_=u.__k[h]=null==(_=l[h])||"boolean"==typeof _?null:"string"==typeof _||"number"==typeof _||"bigint"==typeof _?y(null,_,null,null,_):Array.isArray(_)?y(d,{children:_},null,null,null):_.__b>0?y(_.type,_.props,_.key,null,_.__v):_)){if(_.__=u,_.__b=u.__b+1,null===(p=w[h])||p&&_.key==p.key&&_.type===p.type)w[h]=void 0;else for(v=0;v<A;v++){if((p=w[v])&&_.key==p.key&&_.type===p.type){w[v]=void 0;break}p=null}j(n,_,p=p||e,t,r,o,f,s,a),b=_.__e,(v=_.ref)&&p.ref!=v&&(g||(g=[]),p.ref&&g.push(p.ref,null,_),g.push(v,_.__c||b,_)),null!=b?(null==m&&(m=b),"function"==typeof _.type&&_.__k===p.__k?_.__d=s=x(_,s,n):s=P(n,_,p,w,b,s),"function"==typeof u.type&&(u.__d=s)):s&&p.__e==s&&s.parentNode!=n&&(s=k(p))}for(u.__e=m,h=A;h--;)null!=w[h]&&("function"==typeof u.type&&null!=w[h].__e&&w[h].__e==u.__d&&(u.__d=k(i,h+1)),N(w[h],w[h]));if(g)for(h=0;h<g.length;h++)M(g[h],g[++h],g[++h])}function x(n,l,u){for(var i,t=n.__k,r=0;t&&r<t.length;r++)(i=t[r])&&(i.__=n,l="function"==typeof i.type?x(i,l,u):P(u,i,i,t,i.__e,l));return l}function A(n,l){return l=l||[],null==n||"boolean"==typeof n||(Array.isArray(n)?n.some(function(n){A(n,l)}):l.push(n)),l}function P(n,l,u,i,t,r){var o,f,e;if(void 0!==l.__d)o=l.__d,l.__d=void 0;else if(null==u||t!=r||null==t.parentNode)n:if(null==r||r.parentNode!==n)n.appendChild(t),o=null;else{for(f=r,e=0;(f=f.nextSibling)&&e<i.length;e+=2)if(f==t)break n;n.insertBefore(t,r),o=r}return void 0!==o?o:t.nextSibling}function C(n,l,u,i,t){var r;for(r in u)"children"===r||"key"===r||r in l||H(n,r,null,u[r],i);for(r in l)t&&"function"!=typeof l[r]||"children"===r||"key"===r||"value"===r||"checked"===r||u[r]===l[r]||H(n,r,l[r],u[r],i)}function $(n,l,u){"-"===l[0]?n.setProperty(l,u):n[l]=null==u?"":"number"!=typeof u||s.test(l)?u:u+"px"}function H(n,l,u,i,t){var r;n:if("style"===l)if("string"==typeof u)n.style.cssText=u;else{if("string"==typeof i&&(n.style.cssText=i=""),i)for(l in i)u&&l in u||$(n.style,l,"");if(u)for(l in u)i&&u[l]===i[l]||$(n.style,l,u[l])}else if("o"===l[0]&&"n"===l[1])r=l!==(l=l.replace(/Capture$/,"")),l=l.toLowerCase()in n?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+r]=u,u?i||n.addEventListener(l,r?T:I,r):n.removeEventListener(l,r?T:I,r);else if("dangerouslySetInnerHTML"!==l){if(t)l=l.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if("href"!==l&&"list"!==l&&"form"!==l&&"tabIndex"!==l&&"download"!==l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null!=u&&(!1!==u||"a"===l[0]&&"r"===l[1])?n.setAttribute(l,u):n.removeAttribute(l))}}function I(n){this.l[n.type+!1](l.event?l.event(n):n)}function T(n){this.l[n.type+!0](l.event?l.event(n):n)}function j(n,u,i,t,r,o,f,e,c){var s,h,v,y,p,k,b,m,g,x,A,P=u.type;if(void 0!==u.constructor)return null;null!=i.__h&&(c=i.__h,e=u.__e=i.__e,u.__h=null,o=[e]),(s=l.__b)&&s(u);try{n:if("function"==typeof P){if(m=u.props,g=(s=P.contextType)&&t[s.__c],x=s?g?g.props.value:s.__:t,i.__c?b=(h=u.__c=i.__c).__=h.__E:("prototype"in P&&P.prototype.render?u.__c=h=new P(m,x):(u.__c=h=new _(m,x),h.constructor=P,h.render=O),g&&g.sub(h),h.props=m,h.state||(h.state={}),h.context=x,h.__n=t,v=h.__d=!0,h.__h=[]),null==h.__s&&(h.__s=h.state),null!=P.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=a({},h.__s)),a(h.__s,P.getDerivedStateFromProps(m,h.__s))),y=h.props,p=h.state,v)null==P.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(null==P.getDerivedStateFromProps&&m!==y&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(m,x),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(m,h.__s,x)||u.__v===i.__v){h.props=m,h.state=h.__s,u.__v!==i.__v&&(h.__d=!1),h.__v=u,u.__e=i.__e,u.__k=i.__k,u.__k.forEach(function(n){n&&(n.__=u)}),h.__h.length&&f.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(m,h.__s,x),null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(y,p,k)})}h.context=x,h.props=m,h.state=h.__s,(s=l.__r)&&s(u),h.__d=!1,h.__v=u,h.__P=n,s=h.render(h.props,h.state,h.context),h.state=h.__s,null!=h.getChildContext&&(t=a(a({},t),h.getChildContext())),v||null==h.getSnapshotBeforeUpdate||(k=h.getSnapshotBeforeUpdate(y,p)),A=null!=s&&s.type===d&&null==s.key?s.props.children:s,w(n,Array.isArray(A)?A:[A],u,i,t,r,o,f,e,c),h.base=u.__e,u.__h=null,h.__h.length&&f.push(h),b&&(h.__E=h.__=null),h.__e=!1}else null==o&&u.__v===i.__v?(u.__k=i.__k,u.__e=i.__e):u.__e=L(i.__e,u,i,t,r,o,f,c);(s=l.diffed)&&s(u)}catch(n){u.__v=null,(c||null!=o)&&(u.__e=e,u.__h=!!c,o[o.indexOf(e)]=null),l.__e(n,u,i)}}function z(n,u){l.__c&&l.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u)})}catch(n){l.__e(n,u.__v)}})}function L(l,u,i,t,r,o,f,c){var s,a,v,y=i.props,p=u.props,d=u.type,_=0;if("svg"===d&&(r=!0),null!=o)for(;_<o.length;_++)if((s=o[_])&&(s===l||(d?s.localName==d:3==s.nodeType))){l=s,o[_]=null;break}if(null==l){if(null===d)return document.createTextNode(p);l=r?document.createElementNS("http://www.w3.org/2000/svg",d):document.createElement(d,p.is&&p),o=null,c=!1}if(null===d)y===p||c&&l.data===p||(l.data=p);else{if(o=o&&n.call(l.childNodes),a=(y=i.props||e).dangerouslySetInnerHTML,v=p.dangerouslySetInnerHTML,!c){if(null!=o)for(y={},_=0;_<l.attributes.length;_++)y[l.attributes[_].name]=l.attributes[_].value;(v||a)&&(v&&(a&&v.__html==a.__html||v.__html===l.innerHTML)||(l.innerHTML=v&&v.__html||""))}if(C(l,p,y,r,c),v)u.__k=[];else if(_=u.props.children,w(l,Array.isArray(_)?_:[_],u,i,t,r&&"foreignObject"!==d,o,f,o?o[0]:i.__k&&k(i,0),c),null!=o)for(_=o.length;_--;)null!=o[_]&&h(o[_]);c||("value"in p&&void 0!==(_=p.value)&&(_!==l.value||"progress"===d&&!_)&&H(l,"value",_,y.value,!1),"checked"in p&&void 0!==(_=p.checked)&&_!==l.checked&&H(l,"checked",_,y.checked,!1))}return l}function M(n,u,i){try{"function"==typeof n?n(u):n.current=u}catch(n){l.__e(n,i)}}function N(n,u,i){var t,r;if(l.unmount&&l.unmount(n),(t=n.ref)&&(t.current&&t.current!==n.__e||M(t,null,u)),null!=(t=n.__c)){if(t.componentWillUnmount)try{t.componentWillUnmount()}catch(n){l.__e(n,u)}t.base=t.__P=null}if(t=n.__k)for(r=0;r<t.length;r++)t[r]&&N(t[r],u,"function"!=typeof n.type);i||null==n.__e||h(n.__e),n.__e=n.__d=void 0}function O(n,l,u){return this.constructor(n,u)}function S(u,i,t){var r,o,f;l.__&&l.__(u,i),o=(r="function"==typeof t)?null:t&&t.__k||i.__k,f=[],j(i,u=(!r&&t||i).__k=v(d,null,[u]),o||e,e,void 0!==i.ownerSVGElement,!r&&t?[t]:o?null:i.firstChild?n.call(i.childNodes):null,f,!r&&t?t:o?o.__e:i.firstChild,r),z(f,u)}function q(n,l){S(n,l,q)}function B(l,u,i){var t,r,o,f=a({},l.props);for(o in u)"key"==o?t=u[o]:"ref"==o?r=u[o]:f[o]=u[o];return arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):i),y(l.type,f,t||l.key,r||l.ref,null)}function D(n,l){var u={__c:l="__cC"+f++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var u,i;return this.getChildContext||(u=[],(i={})[l]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.some(m)},this.sub=function(n){u.push(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u.splice(u.indexOf(n),1),l&&l.call(n)}}),n.children}};return u.Provider.__=u.Consumer.contextType=u}n=c.slice,l={__e:function(n,l){for(var u,i,t;l=l.__;)if((u=l.__c)&&!u.__)try{if((i=u.constructor)&&null!=i.getDerivedStateFromError&&(u.setState(i.getDerivedStateFromError(n)),t=u.__d),null!=u.componentDidCatch&&(u.componentDidCatch(n),t=u.__d),t)return u.__E=u}catch(l){n=l}throw n}},u=0,i=function(n){return null!=n&&void 0===n.constructor},_.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=a({},this.state),"function"==typeof n&&(n=n(a({},u),this.props)),n&&a(u,n),null!=n&&this.__v&&(l&&this.__h.push(l),m(this))},_.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),m(this))},_.prototype.render=d,t=[],r="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,g.__r=0,f=0;export{S as render,q as hydrate,v as createElement,v as h,d as Fragment,p as createRef,i as isValidElement,_ as Component,B as cloneElement,D as createContext,A as toChildArray,l as options};
1
+ var n,l,u,i,t,o,r,f,e={},c=[],s=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function a(n,l){for(var u in l)n[u]=l[u];return n}function h(n){var l=n.parentNode;l&&l.removeChild(n)}function v(l,u,i){var t,o,r,f={};for(r in u)"key"==r?t=u[r]:"ref"==r?o=u[r]:f[r]=u[r];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):i),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===f[r]&&(f[r]=l.defaultProps[r]);return y(l,f,t,o,null)}function y(n,i,t,o,r){var f={type:n,props:i,key:t,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++u:r};return null==r&&null!=l.vnode&&l.vnode(f),f}function p(){return{current:null}}function d(n){return n.children}function _(n,l){this.props=n,this.context=l}function k(n,l){if(null==l)return n.__?k(n.__,n.__.__k.indexOf(n)+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return"function"==typeof n.type?k(n):null}function b(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return b(n)}}function m(n){(!n.__d&&(n.__d=!0)&&t.push(n)&&!g.__r++||r!==l.debounceRendering)&&((r=l.debounceRendering)||o)(g)}function g(){for(var n;g.__r=t.length;)n=t.sort(function(n,l){return n.__v.__b-l.__v.__b}),t=[],n.some(function(n){var l,u,i,t,o,r;n.__d&&(o=(t=(l=n).__v).__e,(r=l.__P)&&(u=[],(i=a({},t)).__v=t.__v+1,T(r,t,i,l.__n,void 0!==r.ownerSVGElement,null!=t.__h?[o]:null,u,null==o?k(t):o,t.__h),j(u,t),t.__e!=o&&b(t)))})}function w(n,l,u,i,t,o,r,f,s,a){var h,v,p,_,b,m,g,w=i&&i.__k||c,A=w.length;for(u.__k=[],h=0;h<l.length;h++)if(null!=(_=u.__k[h]=null==(_=l[h])||"boolean"==typeof _?null:"string"==typeof _||"number"==typeof _||"bigint"==typeof _?y(null,_,null,null,_):Array.isArray(_)?y(d,{children:_},null,null,null):_.__b>0?y(_.type,_.props,_.key,null,_.__v):_)){if(_.__=u,_.__b=u.__b+1,null===(p=w[h])||p&&_.key==p.key&&_.type===p.type)w[h]=void 0;else for(v=0;v<A;v++){if((p=w[v])&&_.key==p.key&&_.type===p.type){w[v]=void 0;break}p=null}T(n,_,p=p||e,t,o,r,f,s,a),b=_.__e,(v=_.ref)&&p.ref!=v&&(g||(g=[]),p.ref&&g.push(p.ref,null,_),g.push(v,_.__c||b,_)),null!=b?(null==m&&(m=b),"function"==typeof _.type&&_.__k===p.__k?_.__d=s=x(_,s,n):s=P(n,_,p,w,b,s),"function"==typeof u.type&&(u.__d=s)):s&&p.__e==s&&s.parentNode!=n&&(s=k(p))}for(u.__e=m,h=A;h--;)null!=w[h]&&("function"==typeof u.type&&null!=w[h].__e&&w[h].__e==u.__d&&(u.__d=k(i,h+1)),M(w[h],w[h]));if(g)for(h=0;h<g.length;h++)L(g[h],g[++h],g[++h])}function x(n,l,u){for(var i,t=n.__k,o=0;t&&o<t.length;o++)(i=t[o])&&(i.__=n,l="function"==typeof i.type?x(i,l,u):P(u,i,i,t,i.__e,l));return l}function A(n,l){return l=l||[],null==n||"boolean"==typeof n||(Array.isArray(n)?n.some(function(n){A(n,l)}):l.push(n)),l}function P(n,l,u,i,t,o){var r,f,e;if(void 0!==l.__d)r=l.__d,l.__d=void 0;else if(null==u||t!=o||null==t.parentNode)n:if(null==o||o.parentNode!==n)n.appendChild(t),r=null;else{for(f=o,e=0;(f=f.nextSibling)&&e<i.length;e+=2)if(f==t)break n;n.insertBefore(t,o),r=o}return void 0!==r?r:t.nextSibling}function C(n,l,u,i,t){var o;for(o in u)"children"===o||"key"===o||o in l||H(n,o,null,u[o],i);for(o in l)t&&"function"!=typeof l[o]||"children"===o||"key"===o||"value"===o||"checked"===o||u[o]===l[o]||H(n,o,l[o],u[o],i)}function $(n,l,u){"-"===l[0]?n.setProperty(l,u):n[l]=null==u?"":"number"!=typeof u||s.test(l)?u:u+"px"}function H(n,l,u,i,t){var o;n:if("style"===l)if("string"==typeof u)n.style.cssText=u;else{if("string"==typeof i&&(n.style.cssText=i=""),i)for(l in i)u&&l in u||$(n.style,l,"");if(u)for(l in u)i&&u[l]===i[l]||$(n.style,l,u[l])}else if("o"===l[0]&&"n"===l[1])o=l!==(l=l.replace(/Capture$/,"")),l=l.toLowerCase()in n?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=u,u?i||n.addEventListener(l,o?N:I,o):n.removeEventListener(l,o?N:I,o);else if("dangerouslySetInnerHTML"!==l){if(t)l=l.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if("href"!==l&&"list"!==l&&"form"!==l&&"tabIndex"!==l&&"download"!==l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null!=u&&(!1!==u||"a"===l[0]&&"r"===l[1])?n.setAttribute(l,u):n.removeAttribute(l))}}function I(n){this.l[n.type+!1](l.event?l.event(n):n)}function N(n){this.l[n.type+!0](l.event?l.event(n):n)}function T(n,u,i,t,o,r,f,e,c){var s,h,v,y,p,k,b,m,g,x,A,P=u.type;if(void 0!==u.constructor)return null;null!=i.__h&&(c=i.__h,e=u.__e=i.__e,u.__h=null,r=[e]),(s=l.__b)&&s(u);try{n:if("function"==typeof P){if(m=u.props,g=(s=P.contextType)&&t[s.__c],x=s?g?g.props.value:s.__:t,i.__c?b=(h=u.__c=i.__c).__=h.__E:("prototype"in P&&P.prototype.render?u.__c=h=new P(m,x):(u.__c=h=new _(m,x),h.constructor=P,h.render=O),g&&g.sub(h),h.props=m,h.state||(h.state={}),h.context=x,h.__n=t,v=h.__d=!0,h.__h=[]),null==h.__s&&(h.__s=h.state),null!=P.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=a({},h.__s)),a(h.__s,P.getDerivedStateFromProps(m,h.__s))),y=h.props,p=h.state,v)null==P.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(null==P.getDerivedStateFromProps&&m!==y&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(m,x),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(m,h.__s,x)||u.__v===i.__v){h.props=m,h.state=h.__s,u.__v!==i.__v&&(h.__d=!1),h.__v=u,u.__e=i.__e,u.__k=i.__k,u.__k.forEach(function(n){n&&(n.__=u)}),h.__h.length&&f.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(m,h.__s,x),null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(y,p,k)})}h.context=x,h.props=m,h.state=h.__s,(s=l.__r)&&s(u),h.__d=!1,h.__v=u,h.__P=n,s=h.render(h.props,h.state,h.context),h.state=h.__s,null!=h.getChildContext&&(t=a(a({},t),h.getChildContext())),v||null==h.getSnapshotBeforeUpdate||(k=h.getSnapshotBeforeUpdate(y,p)),A=null!=s&&s.type===d&&null==s.key?s.props.children:s,w(n,Array.isArray(A)?A:[A],u,i,t,o,r,f,e,c),h.base=u.__e,u.__h=null,h.__h.length&&f.push(h),b&&(h.__E=h.__=null),h.__e=!1}else null==r&&u.__v===i.__v?(u.__k=i.__k,u.__e=i.__e):u.__e=z(i.__e,u,i,t,o,r,f,c);(s=l.diffed)&&s(u)}catch(n){u.__v=null,(c||null!=r)&&(u.__e=e,u.__h=!!c,r[r.indexOf(e)]=null),l.__e(n,u,i)}}function j(n,u){l.__c&&l.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u)})}catch(n){l.__e(n,u.__v)}})}function z(l,u,i,t,o,r,f,c){var s,a,v,y=i.props,p=u.props,d=u.type,_=0;if("svg"===d&&(o=!0),null!=r)for(;_<r.length;_++)if((s=r[_])&&"localName"in s==!!d&&(d?s.localName===d:3===s.nodeType)){l=s,r[_]=null;break}if(null==l){if(null===d)return document.createTextNode(p);l=o?document.createElementNS("http://www.w3.org/2000/svg",d):document.createElement(d,p.is&&p),r=null,c=!1}if(null===d)y===p||c&&l.data===p||(l.data=p);else{if(r=r&&n.call(l.childNodes),a=(y=i.props||e).dangerouslySetInnerHTML,v=p.dangerouslySetInnerHTML,!c){if(null!=r)for(y={},_=0;_<l.attributes.length;_++)y[l.attributes[_].name]=l.attributes[_].value;(v||a)&&(v&&(a&&v.__html==a.__html||v.__html===l.innerHTML)||(l.innerHTML=v&&v.__html||""))}if(C(l,p,y,o,c),v)u.__k=[];else if(_=u.props.children,w(l,Array.isArray(_)?_:[_],u,i,t,o&&"foreignObject"!==d,r,f,r?r[0]:i.__k&&k(i,0),c),null!=r)for(_=r.length;_--;)null!=r[_]&&h(r[_]);c||("value"in p&&void 0!==(_=p.value)&&(_!==y.value||_!==l.value||"progress"===d&&!_)&&H(l,"value",_,y.value,!1),"checked"in p&&void 0!==(_=p.checked)&&_!==l.checked&&H(l,"checked",_,y.checked,!1))}return l}function L(n,u,i){try{"function"==typeof n?n(u):n.current=u}catch(n){l.__e(n,i)}}function M(n,u,i){var t,o;if(l.unmount&&l.unmount(n),(t=n.ref)&&(t.current&&t.current!==n.__e||L(t,null,u)),null!=(t=n.__c)){if(t.componentWillUnmount)try{t.componentWillUnmount()}catch(n){l.__e(n,u)}t.base=t.__P=null}if(t=n.__k)for(o=0;o<t.length;o++)t[o]&&M(t[o],u,"function"!=typeof n.type);i||null==n.__e||h(n.__e),n.__e=n.__d=void 0}function O(n,l,u){return this.constructor(n,u)}function S(u,i,t){var o,r,f;l.__&&l.__(u,i),r=(o="function"==typeof t)?null:t&&t.__k||i.__k,f=[],T(i,u=(!o&&t||i).__k=v(d,null,[u]),r||e,e,void 0!==i.ownerSVGElement,!o&&t?[t]:r?null:i.firstChild?n.call(i.childNodes):null,f,!o&&t?t:r?r.__e:i.firstChild,o),j(f,u)}function q(n,l){S(n,l,q)}function B(l,u,i){var t,o,r,f=a({},l.props);for(r in u)"key"==r?t=u[r]:"ref"==r?o=u[r]:f[r]=u[r];return arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):i),y(l.type,f,t||l.key,o||l.ref,null)}function D(n,l){var u={__c:l="__cC"+f++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var u,i;return this.getChildContext||(u=[],(i={})[l]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.some(m)},this.sub=function(n){u.push(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u.splice(u.indexOf(n),1),l&&l.call(n)}}),n.children}};return u.Provider.__=u.Consumer.contextType=u}n=c.slice,l={__e:function(n,l){for(var u,i,t;l=l.__;)if((u=l.__c)&&!u.__)try{if((i=u.constructor)&&null!=i.getDerivedStateFromError&&(u.setState(i.getDerivedStateFromError(n)),t=u.__d),null!=u.componentDidCatch&&(u.componentDidCatch(n),t=u.__d),t)return u.__E=u}catch(l){n=l}throw n}},u=0,i=function(n){return null!=n&&void 0===n.constructor},_.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=a({},this.state),"function"==typeof n&&(n=n(a({},u),this.props)),n&&a(u,n),null!=n&&this.__v&&(l&&this.__h.push(l),m(this))},_.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),m(this))},_.prototype.render=d,t=[],o="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,g.__r=0,f=0;export{S as render,q as hydrate,v as createElement,v as h,d as Fragment,p as createRef,i as isValidElement,_ as Component,B as cloneElement,D as createContext,A as toChildArray,l as options};
2
2
  //# sourceMappingURL=preact.module.js.map