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KsH,QACnB8E,EAAIpM,KAAIwH,IAAc1J,EAAO,CAAA,EAAIkC,KAAKsH,KAAAA,GAGlB,OAAV4E,GAAU,aAGpBA,EAASA,EAAOpO,EAAO,CAAA,EAAIsO,CAAAA,EAAIpM,KAAK1B,KAAAA,GAGjC4N,IACHpO,EAAOsO,EAAGF,CAAAA,EAKPlM,KAAIR,MACH2M,GACHnM,KAAId,IAAiBqC,KAAK4K,CAAAA,EAE3B9K,EAAcrB,IAAAA,GAEhB,EAQAF,EAAcmH,UAAUoF,YAAc,SAAUF,EAAAA,CAC3CnM,KAAIR,MAIPQ,KAAIC,KHtDyB,EGuDzBkM,GAAUnM,KAAIuH,IAAkBhG,KAAK4K,CAAAA,EACzC9K,EAAcrB,IAAAA,EAEhB,EAYAF,EAAcmH,UAAUC,OAASrH,EA6F3BjD,EAAgB,CAAA,EAYrBE,EAAgB,EA2BXC,GAAY,SAACuP,EAAGC,EAAAA,CAAC,OAAKD,EAAC9M,IAAAJ,IAAiBmN,EAAC/M,IAAAJ,GAAc,ECtNzDpC,EAAmBM,OAAAA,EAWjBL,GAAgB,8BAalBC,EAAa,EAgJXC,EAAe,CAAA,EC3KVC,GAAI","names":["options","vnodeId","isValidElement","rerenderQueue","prevDebounce","rerenderCount","depthSort","EVENT_DISPATCHED","CAPTURE_REGEX","eventClock","eventProxies","i","VNODE_MARKER","Symbol","for","EMPTY_OBJ","EMPTY_ARR","MATHML_TOKEN_ELEMENTS","isArray","Array","slice","assign","Object","removeNode","node","parentNode","remove","createElement","type","props","children","key","ref","normalizedProps","length","arguments","call","createVNode","cloneElement","vnode","original","__k","__","__b","__e","__c","constructor","__v","__i","__u","createRef","current","Fragment","BaseComponent","context","this","__g","getDomSibling","childIndex","sibling","__P","renderComponent","component","newVNode","oldVNode","oldDom","commitQueue","refQueue","parentDom","diff","__n","namespaceURI","commitRoot","updateParentDomPointers","some","child","enqueueRender","c","push","debounceRendering","queueMicrotask","process","l","sort","shift","diffChildren","renderResult","newParentVNode","oldParentVNode","globalContext","namespace","excessDomChildren","isHydrating","childVNode","newDom","firstChildDom","result","oldChildren","newChildrenLength","constructNewChildrenArray","applyRef","insert","nextSibling","skewedIndex","matchingIndex","tails","lisLengths","hi","mid","oldChildrenLength","remainingOldChildren","skew","moved","newChildren","String","findMatchingIndex","unmount","parentVNode","isMounting","dom","next","nodeType","moveBefore","insertBefore","data","startsWith","toChildArray","out","x","matched","setStyle","style","value","setProperty","name","oldValue","useCapture","proxy","cssText","createEventProxy","__a","replace","toLowerCase","addEventListener","removeEventListener","e","removeAttribute","setAttribute","eventHandler","event","tmp","resumed","oldCommitQueueLength","oldProps","oldState","snapshot","newProps","isClassComponent","provider","componentContext","renderHook","count","startMarker","end","newType","__z","rangeEnd","outer","prototype","render","contextType","doRender","sub","state","__h","__s","getDerivedStateFromProps","componentWillReceiveProps","shouldComponentUpdate","apply","componentWillUpdate","componentDidUpdate","componentWillMount","componentDidMount","__r","getChildContext","getSnapshotBeforeUpdate","then","indexOf","undefined","markAsForce","diffElementNodes","diffed","start","nodes","depth","root","cb","newHtml","oldHtml","inputValue","checked","doc","localName","ownerDocument","document","createTextNode","createElementNS","is","__m","content","defaultValue","childNodes","attributes","__html","innerHTML","textContent","test","owner","__x","skipRemove","r","componentWillUnmount","documentElement","firstChild","hydrate","createContext","Context","subs","ctx","Set","_props","forEach","add","old","delete","Provider","Consumer","contextValue","Portal","createPortal","container","error","errorInfo","ctor","handled","getDerivedStateFromError","setState","componentDidCatch","update","callback","s","forceUpdate","a","b"],"sources":["../esm/npm/preact@11.2.0/node_modules/preact/src/constants.js","../esm/npm/preact@11.2.0/node_modules/preact/src/options.js","../esm/npm/preact@11.2.0/node_modules/preact/src/create-element.js","../esm/npm/preact@11.2.0/node_modules/preact/src/component.js","../esm/npm/preact@11.2.0/node_modules/preact/src/diff/props.js","../esm/npm/preact@11.2.0/node_modules/preact/src/create-context.js","../esm/npm/preact@11.2.0/node_modules/preact/src/util.js","../esm/npm/preact@11.2.0/node_modules/preact/src/diff/children.js","../esm/npm/preact@11.2.0/node_modules/preact/src/diff/index.js","../esm/npm/preact@11.2.0/node_modules/preact/src/render.js","../esm/npm/preact@11.2.0/node_modules/preact/src/create-portal.js","../esm/npm/preact@11.2.0/node_modules/preact/src/diff/catch-error.js"],"sourcesContent":["// Vnode._flags\n/** Normal hydration that attaches to a DOM tree but does not diff it. */\nexport const MODE_HYDRATE = 1 \u003c\u003c 5;\n/** Signifies this VNode suspended on the previous render */\nexport const MODE_SUSPENDED = 1 \u003c\u003c 7;\n/** Indicates that this node needs to be inserted while patching children */\nexport const INSERT_VNODE = 1 \u003c\u003c 2;\n/** Indicates a VNode has been matched with another VNode in the diff */\nexport const MATCHED = 1 \u003c\u003c 1;\n/** The vnode's ref was detached while its subtree was parked by Suspense */\nexport const REF_DETACHED = 1 \u003c\u003c 3;\n\n// component._bits\n/** Component is processing an exception */\nexport const COMPONENT_PROCESSING_EXCEPTION = 1 \u003c\u003c 0;\n/** Component has a pending error */\nexport const COMPONENT_PENDING_ERROR = 1 \u003c\u003c 1;\n/** Component should force update (skip shouldComponentUpdate) */\nexport const COMPONENT_FORCE = 1 \u003c\u003c 2;\n/** Component is queued for update */\nexport const COMPONENT_DIRTY = 1 \u003c\u003c 3;\n\n/** Reset all mode flags */\nexport const RESET_MODE = ~(MODE_HYDRATE | MODE_SUSPENDED);\n\nexport const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\nexport const XHTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\nexport const MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n\nexport const NULL = null;\nexport const UNDEFINED = undefined;\nexport const VNODE_MARKER = Symbol.for('pv');\nexport const EMPTY_OBJ = /** @type {any} */ ({});\nexport const EMPTY_ARR = [];\n\nexport const MATHML_TOKEN_ELEMENTS = /^m(i|n|o|s|text|space)$/;\n\n/** Matched new vnode eligible for the longest increasing subsequence. */\nexport const LIS_CANDIDATE = 1 \u003c\u003c 4;\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 { assign, slice } from './util';\nimport options from './options';\nimport { NULL, UNDEFINED, VNODE_MARKER } from './constants';\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 constructor for this\n * virtual node\n * @param {object | null | undefined} [props] The properties of the virtual node\n * @param {Array\u003cimport('.').ComponentChildren\u003e} [children] The children of the\n * 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\t\tlength = arguments.length;\n\tfor (i in props) {\n\t\tif (i == 'key') key = props[i];\n\t\telse if (i == 'ref' \u0026\u0026 typeof type != 'function') ref = props[i];\n\t\telse normalizedProps[i] = props[i];\n\t}\n\n\tif (length \u003e 2) {\n\t\tnormalizedProps.children = length \u003e 3 ? slice.call(arguments, 2) : children;\n\t}\n\n\treturn createVNode(type, normalizedProps, key, ref, NULL);\n}\n\n/**\n * Clones the given VNode, optionally adding attributes/props and replacing its\n * 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\u003cimport('./internal').ComponentChildren\u003e} children Any additional arguments will be used\n * as replacement children.\n * @returns {import('./internal').VNode}\n */\nexport function cloneElement(vnode, props, children) {\n\tlet normalizedProps = assign({}, vnode.props),\n\t\tkey,\n\t\tref,\n\t\ti,\n\t\tlength = arguments.length;\n\n\tfor (i in props) {\n\t\tif (i == 'key') key = props[i];\n\t\telse if (i == 'ref' \u0026\u0026 typeof vnode.type != 'function') ref = props[i];\n\t\telse normalizedProps[i] = props[i];\n\t}\n\n\tif (length \u003e 2) {\n\t\tnormalizedProps.children = length \u003e 3 ? slice.call(arguments, 2) : children;\n\t}\n\n\treturn createVNode(\n\t\tvnode.type,\n\t\tnormalizedProps,\n\t\tkey !== UNDEFINED ? key : vnode.key,\n\t\tref !== UNDEFINED ? ref : vnode.ref,\n\t\tNULL\n\t);\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\t/** @type {import('./internal').VNode} */\n\tconst vnode = {\n\t\ttype,\n\t\tprops,\n\t\tkey,\n\t\tref,\n\t\t_children: NULL,\n\t\t_parent: NULL,\n\t\t_depth: 0,\n\t\t_dom: NULL,\n\t\t_component: NULL,\n\t\tconstructor: VNODE_MARKER,\n\t\t_original: original || ++vnodeId,\n\t\t_index: -1,\n\t\t_flags: 0\n\t};\n\n\t// Only invoke the vnode hook if this was *not* a direct copy:\n\tif (!original \u0026\u0026 options.vnode) options.vnode(vnode);\n\n\treturn vnode;\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 VNode}\n */\nexport const isValidElement = vnode =\u003e\n\tvnode != NULL \u0026\u0026 vnode.constructor === VNODE_MARKER;\n","import {\n\tCOMPONENT_DIRTY,\n\tCOMPONENT_FORCE,\n\tMODE_HYDRATE,\n\tNULL,\n\tVNODE_MARKER\n} from './constants';\nimport { Fragment } from './create-element';\nimport { commitRoot, diff } from './diff/index';\nimport options from './options';\nimport { assign } from './util';\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 BaseComponent(props, context) {\n\tthis.props = props;\n\tthis.context = context;\n\tthis._bits = 0;\n}\n\n/**\n * Update component state and schedule a re-render.\n * @this {import('./internal').Component}\n * @param {object | ((s: object, p: object) =\u003e 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 {() =\u003e void} [callback] A function to be called once component state is\n * updated\n */\nBaseComponent.prototype.setState = function (update, callback) {\n\t// only clone state when copying to nextState the first time.\n\tlet s = this._nextState;\n\tif (!s || s == this.state) {\n\t\ts = this._nextState = 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(assign({}, s), this.props);\n\t}\n\n\tif (update) {\n\t\tassign(s, update);\n\t} else {\n\t\treturn;\n\t}\n\n\tif (this._vnode) {\n\t\tif (callback) {\n\t\t\tthis._stateCallbacks.push(callback);\n\t\t}\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 {() =\u003e void} [callback] A function to be called after component is\n * re-rendered\n */\nBaseComponent.prototype.forceUpdate = function (callback) {\n\tif (this._vnode) {\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._bits |= COMPONENT_FORCE;\n\t\tif (callback) this._renderCallbacks.push(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](https://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 {ComponentChildren | void}\n */\nBaseComponent.prototype.render = Fragment;\n\n/**\n * @param {import('./internal').VNode} vnode\n * @param {number | null} [childIndex]\n */\nexport function getDomSibling(vnode, 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 vnode._parent \u0026\u0026 getDomSibling(vnode._parent, vnode._index + 1);\n\t}\n\n\tlet sibling;\n\tfor (; childIndex \u003c vnode._children.length; childIndex++) {\n\t\tsibling = vnode._children[childIndex];\n\n\t\tif (sibling \u0026\u0026 sibling._dom) {\n\t\t\t// Since updateParentDomPointers keeps _dom pointer correct,\n\t\t\t// we can rely on _dom to tell us if this subtree contains a\n\t\t\t// rendered DOM node, and what the first rendered DOM node is\n\t\t\treturn sibling._dom;\n\t\t}\n\t}\n\n\t// If we get here, we have not found a DOM node in this vnode's children.\n\t// We 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). New roots (_parentDom) are a DOM boundary too.\n\treturn typeof vnode.type == 'function' \u0026\u0026 !vnode.props._parentDom\n\t\t? getDomSibling(vnode)\n\t\t: NULL;\n}\n\n/**\n * Trigger in-place re-rendering of a component.\n * @param {import('./internal').Component} component The component to rerender\n */\nfunction renderComponent(component) {\n\tconst oldVNode = component._vnode,\n\t\toldDom = oldVNode._dom,\n\t\tcommitQueue = [],\n\t\trefQueue = [];\n\n\tconst parentDom = component._parentDom;\n\tif (parentDom) {\n\t\tconst newVNode = assign({ constructor: VNODE_MARKER }, oldVNode);\n\t\tnewVNode._original = oldVNode._original + 1;\n\t\tif (options.vnode) options.vnode(newVNode);\n\n\t\tdiff(\n\t\t\tparentDom,\n\t\t\tnewVNode,\n\t\t\toldVNode,\n\t\t\tcomponent._globalContext,\n\t\t\tparentDom.namespaceURI,\n\t\t\toldVNode._flags \u0026 MODE_HYDRATE ? [oldDom] : NULL,\n\t\t\tcommitQueue,\n\t\t\toldDom || getDomSibling(oldVNode),\n\t\t\toldVNode._flags \u0026 MODE_HYDRATE,\n\t\t\trefQueue\n\t\t);\n\n\t\tnewVNode._original = oldVNode._original;\n\t\tnewVNode._parent._children[newVNode._index] = newVNode;\n\t\tcommitRoot(commitQueue, newVNode, refQueue);\n\t\toldVNode._parent = oldVNode._dom = NULL;\n\n\t\tif (newVNode._dom != oldDom) {\n\t\t\tupdateParentDomPointers(newVNode);\n\t\t}\n\t}\n}\n\n/**\n * @param {import('./internal').VNode} vnode\n */\nfunction updateParentDomPointers(vnode) {\n\t// Stop at root boundaries (_parentDom)\n\tif ((vnode = vnode._parent) \u0026\u0026 vnode._component \u0026\u0026 !vnode.props._parentDom) {\n\t\t// _dom starts nulled, so re-assigning a null child._dom is a no-op and\n\t\t// the first truthy _dom stops the walk.\n\t\tvnode._dom = NULL;\n\t\tvnode._children.some(child =\u003e child \u0026\u0026 (vnode._dom = child._dom));\n\n\t\treturn updateParentDomPointers(vnode);\n\t}\n}\n\n/**\n * The render queue\n * @type {Array\u003cimport('./internal').Component\u003e}\n */\nconst 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\trerenderCount = 0;\n\nexport function resetRenderCount() {\n\trerenderCount = 0;\n}\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._bits \u0026 COMPONENT_DIRTY) \u0026\u0026\n\t\t\t((c._bits |= COMPONENT_DIRTY),\n\t\t\trerenderQueue.push(c),\n\t\t\t!rerenderCount++)) ||\n\t\tprevDebounce != options.debounceRendering\n\t) {\n\t\tprevDebounce = options.debounceRendering;\n\t\t(prevDebounce || queueMicrotask)(process);\n\t}\n}\n\n/**\n * @param {import('./internal').Component} a\n * @param {import('./internal').Component} b\n */\nconst depthSort = (a, b) =\u003e a._vnode._depth - b._vnode._depth;\n\n/** Flush the render queue by rerendering all queued components */\nfunction process() {\n\ttry {\n\t\tlet c,\n\t\t\tl = 1;\n\n\t\t// Don't update `renderCount` yet. Keep its value non-zero to prevent unnecessary\n\t\t// process() calls from getting scheduled while `queue` is still being consumed.\n\t\twhile (rerenderQueue.length) {\n\t\t\t// Keep the rerender queue sorted by (depth, insertion order). The queue\n\t\t\t// will initially be sorted on the first iteration only if it has more than 1 item.\n\t\t\t//\n\t\t\t// New items can be added to the queue e.g. when rerendering a provider, so we want to\n\t\t\t// keep the order from top to bottom with those new items so we can handle them in a\n\t\t\t// single pass\n\t\t\tif (rerenderQueue.length \u003e l) {\n\t\t\t\trerenderQueue.sort(depthSort);\n\t\t\t}\n\n\t\t\tc = rerenderQueue.shift();\n\t\t\tl = rerenderQueue.length;\n\n\t\t\tif (c._bits \u0026 COMPONENT_DIRTY) {\n\t\t\t\trenderComponent(c);\n\t\t\t}\n\t\t}\n\t} finally {\n\t\tif ((rerenderCount = rerenderQueue.length)) {\n\t\t\t(prevDebounce || queueMicrotask)(process);\n\t\t}\n\t}\n}\n","import { NULL, SVG_NAMESPACE } from '../constants';\nimport options from '../options';\n\n// Per-instance unique key for the event clock stamp. Each Preact copy on the\n// page gets its own Symbol so that stamps on shared event objects can never\n// collide across instances.\nlet EVENT_DISPATCHED = Symbol();\n\nfunction setStyle(style, key, value) {\n\tif (value == NULL) value = '';\n\tif (key[0] == '-') {\n\t\tstyle.setProperty(key, value);\n\t} else {\n\t\tstyle[key] = value;\n\t}\n}\n\nconst CAPTURE_REGEX = /(PointerCapture)$|Capture$/i;\n\n// A logical clock to solve issues like https://github.com/preactjs/preact/issues/3927.\n// When the DOM performs an event it leaves micro-ticks in between bubbling up which means that\n// an event can trigger on a newly reated DOM-node while the event bubbles up.\n//\n// Originally inspired by Vue\n// (https://github.com/vuejs/core/blob/caeb8a68811a1b0f79/packages/runtime-dom/src/modules/events.ts#L90-L101),\n// but modified to use a logical clock instead of Date.now() in case event handlers get attached\n// and events get dispatched during the same millisecond.\n//\n// The clock is incremented after each new event dispatch. This allows 1 000 000 new events\n// per second for over 280 years before the value reaches Number.MAX_SAFE_INTEGER (2**53 - 1).\nlet eventClock = 0;\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 {string} namespace Whether or not this DOM node is an SVG node or not\n */\nexport function setProperty(dom, name, value, oldValue, namespace) {\n\tlet useCapture;\n\n\tif (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 \u0026\u0026 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' \u0026\u0026 name[1] == 'n') {\n\t\tif (typeof value != 'function') value = NULL;\n\t\tif (typeof oldValue != 'function') oldValue = NULL;\n\n\t\t// Handlers are keyed by prop name and every prop name gets its own proxy,\n\t\t// so swapping one (e.g. an inline arrow function on every render) is a\n\t\t// single store. The event name is only derived to attach or remove it.\n\t\t(dom._listeners || (dom._listeners = {}))[name] = value;\n\n\t\tif (!value || !oldValue) {\n\t\t\tconst proxy =\n\t\t\t\teventProxies[name] || (eventProxies[name] = createEventProxy(name));\n\t\t\t// The attach time belongs to the listener, not to the handler: one\n\t\t\t// function can back several listeners that were attached at different\n\t\t\t// times.\n\t\t\t(dom._attached || (dom._attached = {}))[name] = eventClock;\n\t\t\tuseCapture = name != (name = name.replace(CAPTURE_REGEX, '$1'));\n\n\t\t\t// Infer correct casing for DOM built-in events: `onClick` -\u003e `click`.\n\t\t\t// Only names starting with an uppercase letter are lowercased, so\n\t\t\t// camelCase custom events keep their casing: `onionChange` -\u003e `ionChange`.\n\t\t\tname = name.slice(2);\n\t\t\tif (name[0] \u003c 'a') name = name.toLowerCase();\n\n\t\t\tif (value) {\n\t\t\t\tdom.addEventListener(name, proxy, useCapture);\n\t\t\t} else {\n\t\t\t\tdom.removeEventListener(name, proxy, useCapture);\n\t\t\t}\n\t\t}\n\t} else {\n\t\tif (namespace == SVG_NAMESPACE) {\n\t\t\t// Normalize incorrect prop usage for SVG:\n\t\t\t// - xlink:href / xlinkHref --\u003e href (xlink:href was removed from SVG and isn't needed)\n\t\t\t// - className --\u003e class\n\t\t\tname = name.replace(/xlink(H|:h)/, 'h').replace(/sName$/, 's');\n\t\t} else if (\n\t\t\tname != 'width' \u0026\u0026\n\t\t\tname != 'height' \u0026\u0026\n\t\t\tname != 'href' \u0026\u0026\n\t\t\tname != 'list' \u0026\u0026\n\t\t\tname != 'form' \u0026\u0026\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' \u0026\u0026\n\t\t\tname != 'download' \u0026\u0026\n\t\t\tname != 'rowSpan' \u0026\u0026\n\t\t\tname != 'colSpan' \u0026\u0026\n\t\t\tname != 'role' \u0026\u0026\n\t\t\tname != 'popover' \u0026\u0026\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\treturn;\n\t\t\t} catch (e) {}\n\t\t}\n\n\t\t// aria- and data- attributes have no boolean representation.\n\t\t// A `false` value is different from the attribute not being\n\t\t// present, so we can't remove it. For non-boolean aria\n\t\t// attributes we could treat false as a removal, but the\n\t\t// amount of exceptions would cost too many bytes. On top of\n\t\t// that other frameworks generally stringify `false`.\n\n\t\t// Never serialize functions as attribute values.\n\t\tif (typeof value == 'function') return;\n\t\tif (value != NULL \u0026\u0026 (value !== false || name[4] == '-')) {\n\t\t\tdom.setAttribute(name, name == 'popover' \u0026\u0026 value == true ? '' : value);\n\t\t} else {\n\t\t\tdom.removeAttribute(name);\n\t\t}\n\t}\n}\n\n/**\n * Create an event proxy function.\n * @param {string} name The prop name the handler is stored under.\n * @private\n */\nfunction createEventProxy(name) {\n\t/**\n\t * Proxy an event to hooked event handlers\n\t * @param {import('../internal').PreactEvent} e The event object from the browser\n\t * @private\n\t */\n\treturn function (e) {\n\t\tlet eventHandler = this._listeners;\n\t\tif (eventHandler) {\n\t\t\teventHandler = eventHandler[name];\n\t\t\tif (e[EVENT_DISPATCHED] == NULL) {\n\t\t\t\te[EVENT_DISPATCHED] = eventClock++;\n\n\t\t\t\t// When `e[EVENT_DISPATCHED]` is smaller than the time when the targeted event\n\t\t\t\t// listener was attached we know we have bubbled up to an element that was added\n\t\t\t\t// during patching the DOM.\n\t\t\t} else if (e[EVENT_DISPATCHED] \u003c this._attached[name]) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treturn eventHandler(options.event ? options.event(e) : e);\n\t\t}\n\t};\n}\n\n/** @type {Record\u003cstring, (e: Event) =\u003e any\u003e} */\nconst eventProxies = {};\n","import { enqueueRender } from './component';\nimport { COMPONENT_FORCE } from './constants';\n\nexport let i = 0;\n\nexport function createContext(defaultValue) {\n\tfunction Context(props) {\n\t\tif (!this.getChildContext) {\n\t\t\t/** @type {Set\u003cimport('./internal').Component\u003e | null} */\n\t\t\tlet subs = new Set();\n\t\t\tlet ctx = {};\n\t\t\tctx[Context._id] = this;\n\n\t\t\tthis.getChildContext = () =\u003e ctx;\n\n\t\t\tthis.shouldComponentUpdate = function (_props) {\n\t\t\t\t// @ts-expect-error even\n\t\t\t\tif (this.props.value != _props.value) {\n\t\t\t\t\tsubs.forEach(c =\u003e {\n\t\t\t\t\t\tc._bits |= COMPONENT_FORCE;\n\t\t\t\t\t\tenqueueRender(c);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.sub = c =\u003e {\n\t\t\t\tsubs.add(c);\n\t\t\t\tlet old = c.componentWillUnmount;\n\t\t\t\tc.componentWillUnmount = () =\u003e {\n\t\t\t\t\tsubs.delete(c);\n\t\t\t\t\tif (old) old.call(c);\n\t\t\t\t};\n\t\t\t};\n\t\t}\n\n\t\treturn props.children;\n\t}\n\n\tContext._id = '__cC' + i++;\n\tContext._defaultValue = defaultValue;\n\n\t/** @type {import('./internal').FunctionComponent} */\n\tContext.Consumer = (props, contextValue) =\u003e {\n\t\treturn props.children(contextValue);\n\t};\n\n\tContext.Provider = Context.Consumer.contextType = Context;\n\n\treturn Context;\n}\n","import { EMPTY_ARR } from './constants';\n\nexport const isArray = Array.isArray;\nexport const slice = EMPTY_ARR.slice;\nexport const assign = Object.assign;\n\n/**\n * Remove a child node from its parent if attached.\n * @param {import('./internal').PreactElement | null} node The node to remove\n */\nexport function removeNode(node) {\n\tif (node \u0026\u0026 node.parentNode) node.remove();\n}\n","import { diff, unmount, applyRef } from './index';\nimport { createVNode, Fragment } from '../create-element';\nimport {\n\tEMPTY_OBJ,\n\tEMPTY_ARR,\n\tINSERT_VNODE,\n\tMATCHED,\n\tLIS_CANDIDATE,\n\tREF_DETACHED,\n\tUNDEFINED,\n\tVNODE_MARKER,\n\tNULL\n} from '../constants';\nimport { isArray } from '../util';\nimport { getDomSibling } from '../component';\n\n/**\n * @typedef {import('../internal').ComponentChildren} ComponentChildren\n * @typedef {import('../internal').Component} Component\n * @typedef {import('../internal').PreactElement} PreactElement\n * @typedef {import('../internal').VNode} VNode\n */\n\n/**\n * Diff the children of a virtual node\n * @param {PreactElement} parentDom The DOM element whose children are being\n * diffed\n * @param {ComponentChildren[]} renderResult\n * @param {VNode} newParentVNode The new virtual node whose children should be\n * diff'ed against oldParentVNode\n * @param {VNode} oldParentVNode The old virtual node whose children should be\n * diff'ed against newParentVNode\n * @param {object} globalContext The current context object - modified by\n * getChildContext\n * @param {string} namespace Current namespace of the DOM node (HTML, SVG, or MathML)\n * @param {Array\u003cPreactElement\u003e} excessDomChildren\n * @param {Array\u003cComponent\u003e} commitQueue List of components which have callbacks\n * to invoke in commitRoot\n * @param {PreactElement} oldDom The current attached DOM element any new dom\n * elements should be placed around. Likely `null` on first render (except when\n * hydrating). Can be a sibling DOM element when diffing Fragments that have\n * siblings. In most cases, it starts out as `oldChildren[0]._dom`.\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @param {any[]} refQueue an array of elements needed to invoke refs\n * @returns {PreactElement} The next sibling DOM element to insert new elements\n */\nexport function diffChildren(\n\tparentDom,\n\trenderResult,\n\tnewParentVNode,\n\toldParentVNode,\n\tglobalContext,\n\tnamespace,\n\texcessDomChildren,\n\tcommitQueue,\n\toldDom,\n\tisHydrating,\n\trefQueue\n) {\n\tlet i,\n\t\t/** @type {VNode} */\n\t\toldVNode,\n\t\t/** @type {VNode} */\n\t\tchildVNode,\n\t\t/** @type {PreactElement} */\n\t\tnewDom,\n\t\t/** @type {PreactElement} */\n\t\tfirstChildDom;\n\n\t// This is a compression of oldParentVNode != EMPTY_OBJ \u0026\u0026 oldParentVNode._children || EMPTY_ARR\n\t// as EMPTY_OBJ._children should be `undefined`. Callers always pass at\n\t// least EMPTY_OBJ, so a null check isn't needed.\n\t/** @type {VNode[]} */\n\tlet oldChildren = oldParentVNode._children || EMPTY_ARR;\n\n\tlet newChildrenLength = renderResult.length;\n\n\toldDom = constructNewChildrenArray(\n\t\tnewParentVNode,\n\t\trenderResult,\n\t\toldChildren,\n\t\toldDom,\n\t\tnewChildrenLength\n\t);\n\n\tfor (i = 0; i \u003c newChildrenLength; i++) {\n\t\tchildVNode = newParentVNode._children[i];\n\t\tif (childVNode == NULL) continue;\n\n\t\t// At this point, constructNewChildrenArray has assigned _index to be the\n\t\t// matchingIndex for this VNode's oldVNode (or -1 if there is no oldVNode).\n\t\t// ~_index guards the -1 case: a negative array index is a named property\n\t\t// access which V8 can't serve from the fast elements path.\n\t\toldVNode =\n\t\t\t(~childVNode._index \u0026\u0026 oldChildren[childVNode._index]) || EMPTY_OBJ;\n\n\t\t// Update childVNode._index to its final index\n\t\tchildVNode._index = i;\n\n\t\t// Morph the old element into the new one, but don't append it to the dom yet\n\t\tlet result = diff(\n\t\t\tparentDom,\n\t\t\tchildVNode,\n\t\t\toldVNode,\n\t\t\tglobalContext,\n\t\t\tnamespace,\n\t\t\texcessDomChildren,\n\t\t\tcommitQueue,\n\t\t\toldDom,\n\t\t\tisHydrating,\n\t\t\trefQueue\n\t\t);\n\n\t\t// Adjust DOM nodes\n\t\tnewDom = childVNode._dom;\n\t\t// A ref detached while its subtree was parked by Suspense is attached\n\t\t// again on reveal.\n\t\tif (oldVNode.ref != childVNode.ref || oldVNode._flags \u0026 REF_DETACHED) {\n\t\t\tif (oldVNode.ref) applyRef(oldVNode.ref, NULL, childVNode, oldVNode);\n\t\t\tif (childVNode.ref) {\n\t\t\t\trefQueue.push(\n\t\t\t\t\tchildVNode.ref,\n\t\t\t\t\tchildVNode._component || newDom,\n\t\t\t\t\tchildVNode\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tfirstChildDom = firstChildDom || newDom;\n\n\t\tif (childVNode._flags \u0026 INSERT_VNODE) {\n\t\t\toldDom = insert(childVNode, oldDom, parentDom, !oldVNode._original);\n\n\t\t\t// When a matched VNode is physically moved via INSERT_VNODE, its old\n\t\t\t// _dom pointer becomes a stale positional reference. Clear it so that\n\t\t\t// getDomSibling (called from nested diffs) won't return this stale\n\t\t\t// reference and mis-place subsequent DOM nodes. See #5065.\n\t\t\tif (oldVNode._dom) {\n\t\t\t\toldVNode._dom = NULL;\n\t\t\t}\n\t\t} else if (typeof childVNode.type == 'function' \u0026\u0026 result !== UNDEFINED) {\n\t\t\toldDom = result;\n\t\t} else if (newDom) {\n\t\t\toldDom = newDom.nextSibling;\n\t\t}\n\n\t\t// Clear placement and LIS flags; MATCHED only belongs to old vnodes.\n\t\tchildVNode._flags \u0026= ~(INSERT_VNODE | LIS_CANDIDATE);\n\t}\n\n\tnewParentVNode._dom = firstChildDom;\n\n\treturn oldDom;\n}\n\n/**\n * @param {VNode} newParentVNode\n * @param {ComponentChildren[]} renderResult\n * @param {VNode[]} oldChildren\n */\nfunction constructNewChildrenArray(\n\tnewParentVNode,\n\trenderResult,\n\toldChildren,\n\toldDom,\n\tnewChildrenLength\n) {\n\t/** @type {number} */\n\tlet i;\n\t/** @type {VNode} */\n\tlet childVNode;\n\t/** @type {VNode} */\n\tlet oldVNode;\n\n\tlet oldChildrenLength = oldChildren.length,\n\t\tremainingOldChildren = oldChildrenLength;\n\n\tlet skew = 0;\n\n\t/** Whether any matched child was found far from its skewed index, i.e. a\n\t * real reorder happened and we need to compute the minimal set of moves. */\n\tlet moved = 0;\n\n\t// Hoisted: every normalization branch below writes through this array, so\n\t// reading `_children` off the vnode each time is a wasted property load.\n\t/** @type {VNode[]} */\n\tlet newChildren = (newParentVNode._children = Array(newChildrenLength));\n\tfor (i = 0; i \u003c newChildrenLength; i++) {\n\t\t// @ts-expect-error We are reusing the childVNode variable to hold both the\n\t\t// pre and post normalized childVNode\n\t\tchildVNode = renderResult[i];\n\n\t\tif (\n\t\t\tchildVNode == NULL ||\n\t\t\ttypeof childVNode == 'boolean' ||\n\t\t\ttypeof childVNode == 'function'\n\t\t) {\n\t\t\tnewChildren[i] = NULL;\n\t\t\tcontinue;\n\t\t}\n\t\t// If this newVNode is being reused (e.g. \u003cdiv\u003e{reuse}{reuse}\u003c/div\u003e) in the same diff,\n\t\t// or we are rendering a component (e.g. setState) copy the oldVNodes so it can have\n\t\t// it's own DOM \u0026 etc. pointers\n\t\t// Anything that isn't an object at this point is a string, number or\n\t\t// bigint (null, booleans and functions are handled above), String\n\t\t// objects are the lone object type rendered as text.\n\t\telse if (\n\t\t\ttypeof childVNode != 'object' ||\n\t\t\tchildVNode.constructor === String\n\t\t) {\n\t\t\tchildVNode = newChildren[i] = createVNode(NULL, childVNode);\n\t\t} else if (isArray(childVNode)) {\n\t\t\tchildVNode = newChildren[i] = createVNode(Fragment, {\n\t\t\t\tchildren: childVNode\n\t\t\t});\n\t\t} else if (childVNode.constructor === VNODE_MARKER \u0026\u0026 childVNode._depth) {\n\t\t\t// VNode is already in use, clone it. This can happen in the following\n\t\t\t// scenario:\n\t\t\t//   const reuse = \u003cdiv /\u003e\n\t\t\t//   \u003cdiv\u003e{reuse}\u003cspan /\u003e{reuse}\u003c/div\u003e\n\t\t\tchildVNode = newChildren[i] = createVNode(\n\t\t\t\tchildVNode.type,\n\t\t\t\tchildVNode.props,\n\t\t\t\tchildVNode.key,\n\t\t\t\tchildVNode.ref,\n\t\t\t\tchildVNode._original\n\t\t\t);\n\t\t} else {\n\t\t\tnewChildren[i] = childVNode;\n\t\t}\n\n\t\tconst skewedIndex = i + skew;\n\t\tchildVNode._parent = newParentVNode;\n\t\tchildVNode._depth = newParentVNode._depth + 1;\n\n\t\t// Temporarily store the matchingIndex on the _index property so we can pull\n\t\t// out the oldVNode in diffChildren. We'll override this to the VNode's\n\t\t// final index after using this property to get the oldVNode\n\t\tconst matchingIndex = (childVNode._index = findMatchingIndex(\n\t\t\tchildVNode,\n\t\t\toldChildren,\n\t\t\tskewedIndex,\n\t\t\tremainingOldChildren\n\t\t));\n\n\t\toldVNode = NULL;\n\t\t// ~matchingIndex is only falsy for -1, i.e. when no match was found\n\t\tif (~matchingIndex) {\n\t\t\toldVNode = oldChildren[matchingIndex];\n\t\t\tremainingOldChildren--;\n\t\t\tif (oldVNode) {\n\t\t\t\toldVNode._flags |= MATCHED;\n\t\t\t}\n\t\t}\n\n\t\t// Here, we define isMounting for the purposes of the skew diffing\n\t\t// algorithm. Nodes that are unsuspending are considered mounting and we detect\n\t\t// this by checking if oldVNode._original == null\n\t\tif (!oldVNode || !oldVNode._original) {\n\t\t\tif (!~matchingIndex) {\n\t\t\t\t// When the array of children is growing we need to decrease the skew\n\t\t\t\t// as we are adding a new element to the array.\n\t\t\t\t// Example:\n\t\t\t\t// [1, 2, 3] --\u003e [0, 1, 2, 3]\n\t\t\t\t// oldChildren   newChildren\n\t\t\t\t//\n\t\t\t\t// The new element is at index 0, so our skew is 0,\n\t\t\t\t// we need to decrease the skew as we are adding a new element.\n\t\t\t\t// The decrease will cause us to compare the element at position 1\n\t\t\t\t// with value 1 with the element at position 0 with value 0.\n\t\t\t\t//\n\t\t\t\t// A linear concept is applied when the array is shrinking,\n\t\t\t\t// if the length is unchanged we can assume that no skew\n\t\t\t\t// changes are needed.\n\t\t\t\tif (newChildrenLength \u003e oldChildrenLength) {\n\t\t\t\t\tskew--;\n\t\t\t\t} else if (newChildrenLength \u003c oldChildrenLength) {\n\t\t\t\t\tskew++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If we are mounting a DOM VNode, mark it for insertion\n\t\t\tif (typeof childVNode.type != 'function') {\n\t\t\t\tchildVNode._flags |= INSERT_VNODE;\n\t\t\t}\n\t\t} else {\n\t\t\t// Keep LIS eligibility separate from MATCHED on old vnodes: if a child\n\t\t\t// throws, uncleared new-vnode flags must not prevent the next match.\n\t\t\tchildVNode._flags |= LIS_CANDIDATE;\n\n\t\t\t// Center the next search for shifts. Only matches farther than one\n\t\t\t// position away require the minimal-move pass.\n\t\t\tif (matchingIndex == skewedIndex - 1) {\n\t\t\t\tskew--;\n\t\t\t} else if (matchingIndex == skewedIndex + 1) {\n\t\t\t\tskew++;\n\t\t\t} else if (matchingIndex != skewedIndex) {\n\t\t\t\tif (matchingIndex \u003e skewedIndex) {\n\t\t\t\t\tskew--;\n\t\t\t\t} else {\n\t\t\t\t\tskew++;\n\t\t\t\t}\n\n\t\t\t\tmoved = 1;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (moved) {\n\t\t// Children were reordered: mark the minimal set of matched (LIS_CANDIDATE flag)\n\t\t// children for insertion by finding the longest increasing subsequence of\n\t\t// old indices (patience sorting). Children on the subsequence stay in\n\t\t// place, all others get INSERT_VNODE. `_index` still holds the\n\t\t// matchingIndex here.\n\t\t/** @type {number[]} tails[x] is the smallest old index ending an increasing subsequence of length x+1 */\n\t\tlet tails = [];\n\t\t/** @type {number[]} length of the longest increasing subsequence ending at child i */\n\t\tlet lisLengths = [];\n\t\tfor (i = 0; i \u003c newChildrenLength; i++) {\n\t\t\tchildVNode = newChildren[i];\n\t\t\tif (childVNode \u0026\u0026 childVNode._flags \u0026 LIS_CANDIDATE) {\n\t\t\t\t// Binary search for the insertion point, keeping the pass at\n\t\t\t\t// O(n log n) even for pathological reorders.\n\t\t\t\tskew = 0;\n\t\t\t\tlet hi = tails.length;\n\t\t\t\twhile (skew \u003c hi) {\n\t\t\t\t\tconst mid = (skew + hi) \u003e\u003e 1;\n\t\t\t\t\tif (tails[mid] \u003c childVNode._index) {\n\t\t\t\t\t\tskew = mid + 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\thi = mid;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttails[skew] = childVNode._index;\n\t\t\t\tlisLengths[i] = skew + 1;\n\t\t\t}\n\t\t}\n\n\t\t// `skew` is dead after the main loop; reuse it as the remaining\n\t\t// subsequence length while walking backwards. Likewise `i` is left at\n\t\t// newChildrenLength by the loop above.\n\t\tskew = tails.length;\n\t\twhile (i--) {\n\t\t\tif (lisLengths[i]) {\n\t\t\t\tif (lisLengths[i] == skew) {\n\t\t\t\t\tskew--;\n\t\t\t\t} else {\n\t\t\t\t\tnewChildren[i]._flags |= INSERT_VNODE;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Remove remaining oldChildren if there are any. Loop forwards so that as we\n\t// unmount DOM from the beginning of the oldChildren, we can adjust oldDom to\n\t// point to the next child, which needs to be the first DOM node that won't be\n\t// unmounted. Keep this a plain loop: an arrow function here would capture\n\t// `oldDom`, forcing V8 to context-allocate it on every call to this function.\n\tif (remainingOldChildren) {\n\t\tfor (i = 0; i \u003c oldChildrenLength; i++) {\n\t\t\toldVNode = oldChildren[i];\n\t\t\tif (oldVNode \u0026\u0026 !(oldVNode._flags \u0026 MATCHED)) {\n\t\t\t\tif (oldVNode._dom == oldDom) {\n\t\t\t\t\toldDom = getDomSibling(oldVNode);\n\t\t\t\t}\n\n\t\t\t\tunmount(oldVNode, oldVNode);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn oldDom;\n}\n\n/**\n * @param {VNode} parentVNode\n * @param {PreactElement} oldDom\n * @param {PreactElement} parentDom\n * @param {boolean} isMounting\n * @returns {PreactElement}\n */\nfunction insert(parentVNode, oldDom, parentDom, isMounting) {\n\t// Note: VNodes in nested suspended trees may be missing _children.\n\tif (typeof parentVNode.type == 'function') {\n\t\t// Root children live in another container, they never move with the\n\t\t// host tree and contribute nothing to the host insertion cursor.\n\t\tif (parentVNode.props._parentDom) return oldDom;\n\t\tlet children = parentVNode._children;\n\t\tif (children) {\n\t\t\tfor (let i = 0; i \u003c children.length; i++) {\n\t\t\t\tif (children[i]) {\n\t\t\t\t\t// If we enter this code path on sCU bailout, where we copy\n\t\t\t\t\t// oldVNode._children to newVNode._children, we need to update the old\n\t\t\t\t\t// children's _parent pointer to point to the newVNode (parentVNode\n\t\t\t\t\t// here).\n\t\t\t\t\tchildren[i]._parent = parentVNode;\n\t\t\t\t\toldDom = insert(children[i], oldDom, parentDom, false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn oldDom;\n\t} else {\n\t\t// A cursor a parked Suspense subtree detached can't be a reference node:\n\t\t// retry from the vnode tree, then give up and append.\n\t\tif (oldDom \u0026\u0026 !oldDom.parentNode) {\n\t\t\toldDom = getDomSibling(parentVNode);\n\t\t\tif (oldDom \u0026\u0026 !oldDom.parentNode) oldDom = NULL;\n\t\t}\n\n\t\t// Comments (e.g. server `$s` markers) are never ours: a node right after\n\t\t// them is already in place.\n\t\tlet dom = parentVNode._dom;\n\t\tlet next = oldDom;\n\t\twhile (next \u0026\u0026 next.nodeType == 8) next = next.nextSibling;\n\n\t\tif (dom != next) {\n\t\t\t// Containers that aren't DOM nodes may not implement moveBefore()\n\t\t\tif (!isMounting \u0026\u0026 parentDom.moveBefore \u0026\u0026 dom.parentNode) {\n\t\t\t\t// @ts-expect-error This isn't added to TypeScript lib.d.ts yet\n\t\t\t\tparentDom.moveBefore(dom, oldDom);\n\t\t\t} else {\n\t\t\t\tparentDom.insertBefore(dom, oldDom || NULL);\n\t\t\t}\n\t\t}\n\t\toldDom = dom;\n\t}\n\n\twhile (\n\t\t(oldDom = oldDom \u0026\u0026 oldDom.nextSibling) \u0026\u0026\n\t\toldDom.nodeType == 8 \u0026\u0026\n\t\t!oldDom.data.startsWith('$s')\n\t);\n\n\treturn oldDom;\n}\n\n/**\n * Flatten and loop through the children of a virtual node\n * @param {ComponentChildren} children The unflattened children of a virtual\n * node\n * @returns {VNode[]}\n */\nexport function toChildArray(children, out) {\n\tout = out || [];\n\tif (children != NULL \u0026\u0026 typeof children != 'boolean') {\n\t\tif (isArray(children)) {\n\t\t\tchildren.some(child =\u003e {\n\t\t\t\ttoChildArray(child, out);\n\t\t\t});\n\t\t} else {\n\t\t\tout.push(children);\n\t\t}\n\t}\n\treturn out;\n}\n\n/**\n * @param {VNode} childVNode\n * @param {VNode[]} oldChildren\n * @param {number} skewedIndex\n * @param {number} remainingOldChildren\n * @returns {number}\n */\nfunction findMatchingIndex(\n\tchildVNode,\n\toldChildren,\n\tskewedIndex,\n\tremainingOldChildren\n) {\n\tconst key = childVNode.key;\n\tconst type = childVNode.type;\n\tlet oldVNode = oldChildren[skewedIndex];\n\tconst matched = oldVNode \u0026\u0026 !(oldVNode._flags \u0026 MATCHED);\n\n\t// We only need to perform a search if there are more children\n\t// (remainingOldChildren) to search. However, if the oldVNode we just looked\n\t// at skewedIndex was not already used in this diff, then there must be at\n\t// least 1 other (so greater than 1) remainingOldChildren to attempt to match\n\t// against. So the following condition checks that ensuring\n\t// remainingOldChildren \u003e 1 if the oldVNode is not already used/matched. Else\n\t// if the oldVNode was null or matched, then there could needs to be at least\n\t// 1 (aka `remainingOldChildren \u003e 0`) children to find and compare against.\n\t//\n\t// If there is an unkeyed functional VNode, that isn't a built-in like our Fragment,\n\t// we should not search as we risk re-using state of an unrelated VNode. (reverted for now)\n\tlet shouldSearch =\n\t\t// (typeof type != 'function' || type === Fragment || key) \u0026\u0026\n\t\t// The ternary keeps this a Smi comparison; `\u003e matched` would compare\n\t\t// number to boolean which V8 can't serve from the fast path.\n\t\tremainingOldChildren \u003e (matched ? 1 : 0);\n\n\tif (\n\t\t(oldVNode === NULL \u0026\u0026 key == NULL) ||\n\t\t(matched \u0026\u0026 key == oldVNode.key \u0026\u0026 type == oldVNode.type)\n\t) {\n\t\treturn skewedIndex;\n\t} else if (shouldSearch) {\n\t\tlet x;\n\t\tfor (x = skewedIndex - 1; x \u003e= 0; x--) {\n\t\t\toldVNode = oldChildren[x];\n\t\t\tif (\n\t\t\t\toldVNode \u0026\u0026\n\t\t\t\t!(oldVNode._flags \u0026 MATCHED) \u0026\u0026\n\t\t\t\tkey == oldVNode.key \u0026\u0026\n\t\t\t\ttype == oldVNode.type\n\t\t\t)\n\t\t\t\treturn x;\n\t\t}\n\t\tfor (x = skewedIndex + 1; x \u003c oldChildren.length; x++) {\n\t\t\toldVNode = oldChildren[x];\n\t\t\tif (\n\t\t\t\toldVNode \u0026\u0026\n\t\t\t\t!(oldVNode._flags \u0026 MATCHED) \u0026\u0026\n\t\t\t\tkey == oldVNode.key \u0026\u0026\n\t\t\t\ttype == oldVNode.type\n\t\t\t)\n\t\t\t\treturn x;\n\t\t}\n\t}\n\n\treturn -1;\n}\n","import { BaseComponent, getDomSibling } from '../component';\nimport {\n\tCOMPONENT_DIRTY,\n\tCOMPONENT_FORCE,\n\tCOMPONENT_PENDING_ERROR,\n\tCOMPONENT_PROCESSING_EXCEPTION,\n\tEMPTY_ARR,\n\tEMPTY_OBJ,\n\tMATHML_TOKEN_ELEMENTS,\n\tMATH_NAMESPACE,\n\tMODE_HYDRATE,\n\tMODE_SUSPENDED,\n\tNULL,\n\tRESET_MODE,\n\tSVG_NAMESPACE,\n\tUNDEFINED,\n\tVNODE_MARKER,\n\tXHTML_NAMESPACE\n} from '../constants';\nimport { Fragment } from '../create-element';\nimport options from '../options';\nimport { assign, isArray, removeNode, slice } from '../util';\nimport { diffChildren } from './children';\nimport { setProperty } from './props';\n\n/**\n * @typedef {import('../internal').ComponentType} ComponentType\n * @typedef {import('../internal').ComponentChildren} ComponentChildren\n * @typedef {import('../internal').Component} Component\n * @typedef {import('../internal').PreactElement} PreactElement\n * @typedef {import('../internal').VNode} VNode\n */\n\n/**\n * @template {any} T\n * @typedef {import('../internal').Ref\u003cT\u003e} Ref\u003cT\u003e\n */\n\n/**\n * Diff two virtual nodes and apply proper changes to the DOM\n * @param {PreactElement} parentDom The parent of the DOM element\n * @param {VNode} newVNode The new virtual node\n * @param {VNode} oldVNode The old virtual node\n * @param {object} globalContext The current context object. Modified by\n * getChildContext\n * @param {string} namespace Current namespace of the DOM node (HTML, SVG, or MathML)\n * @param {Array\u003cPreactElement\u003e} excessDomChildren\n * @param {Array\u003cComponent\u003e} commitQueue List of components which have callbacks\n * to invoke in commitRoot\n * @param {PreactElement} oldDom The current attached DOM element any new dom\n * elements should be placed around. Likely `null` on first render (except when\n * hydrating). Can be a sibling DOM element when diffing Fragments that have\n * siblings. In most cases, it starts out as `oldChildren[0]._dom`.\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @param {any[]} refQueue an array of elements needed to invoke refs\n */\nexport function diff(\n\tparentDom,\n\tnewVNode,\n\toldVNode,\n\tglobalContext,\n\tnamespace,\n\texcessDomChildren,\n\tcommitQueue,\n\toldDom,\n\tisHydrating,\n\trefQueue\n) {\n\t/** @type {any} */\n\tlet tmp,\n\t\tresumed,\n\t\tnewType = newVNode.type;\n\n\t// Only diff VNodes created by Preact.\n\tif (newVNode.constructor !== VNODE_MARKER) return NULL;\n\n\t// If the previous diff bailed out, resume creating/hydrating into the DOM\n\t// that was kept while suspended (server-rendered, or already in the\n\t// container we rendered into). `tmp` holds the stored excess node until the\n\t// options._diff call below.\n\tif (\n\t\toldVNode._flags \u0026 MODE_SUSPENDED \u0026\u0026\n\t\t// @ts-expect-error This is MODE_HYDRATE or 0\n\t\t((isHydrating = oldVNode._flags \u0026 MODE_HYDRATE),\n\t\t(tmp = oldVNode._component._excess))\n\t) {\n\t\tnewVNode._flags |= isHydrating;\n\t\tresumed = excessDomChildren = [];\n\t\tif (tmp.nodeType == 8) {\n\t\t\t// Re-scan DOM from stored start marker for streamed hydration.\n\t\t\toldDom = rangeEnd(tmp, excessDomChildren);\n\t\t} else {\n\t\t\texcessDomChildren.push(tmp);\n\t\t}\n\t\toldDom = excessDomChildren[0] || oldDom;\n\t}\n\n\tif ((tmp = options._diff)) tmp(newVNode);\n\n\touter: if (typeof newType == 'function') {\n\t\tlet oldCommitQueueLength = commitQueue.length;\n\t\ttry {\n\t\t\tlet c,\n\t\t\t\toldProps,\n\t\t\t\toldState,\n\t\t\t\tsnapshot,\n\t\t\t\tnewProps = newVNode.props;\n\t\t\tconst isClassComponent = (tmp = newType.prototype) \u0026\u0026 tmp.render;\n\n\t\t\t// Necessary for createContext api. Setting this property will pass\n\t\t\t// the context value as `this.context` just for this component.\n\t\t\ttmp = newType.contextType;\n\t\t\tconst provider = tmp \u0026\u0026 globalContext[tmp._id];\n\t\t\tconst componentContext = tmp\n\t\t\t\t? provider\n\t\t\t\t\t? provider.props.value\n\t\t\t\t\t: tmp._defaultValue\n\t\t\t\t: globalContext;\n\n\t\t\t// Get component and set it to `c`\n\t\t\tif ((c = oldVNode._component)) {\n\t\t\t\tnewVNode._component = c;\n\t\t\t\tif (c._bits \u0026 COMPONENT_PENDING_ERROR) {\n\t\t\t\t\tc._bits |= COMPONENT_PROCESSING_EXCEPTION;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Instantiate the new component\n\t\t\t\tif (isClassComponent) {\n\t\t\t\t\t// @ts-expect-error Trust me, Component implements the interface we want\n\t\t\t\t\tnewVNode._component = c = new newType(newProps, componentContext); // eslint-disable-line new-cap\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-expect-error Trust me, Component implements the interface we want\n\t\t\t\t\tnewVNode._component = c = new BaseComponent(\n\t\t\t\t\t\tnewProps,\n\t\t\t\t\t\tcomponentContext\n\t\t\t\t\t);\n\n\t\t\t\t\tc.constructor = newType;\n\t\t\t\t\tc.render = doRender;\n\t\t\t\t}\n\t\t\t\tif (provider) provider.sub(c);\n\n\t\t\t\tif (!c.state) c.state = {};\n\t\t\t\tc._globalContext = globalContext;\n\t\t\t\tc._bits |= COMPONENT_DIRTY;\n\t\t\t\tc._renderCallbacks = [];\n\t\t\t\tc._stateCallbacks = [];\n\t\t\t}\n\n\t\t\tif (isClassComponent) {\n\t\t\t\tif (!c._nextState) c._nextState = c.state;\n\n\t\t\t\t// Invoke getDerivedStateFromProps\n\t\t\t\tif (newType.getDerivedStateFromProps) {\n\t\t\t\t\tif (c._nextState == c.state) {\n\t\t\t\t\t\tc._nextState = assign({}, c._nextState);\n\t\t\t\t\t}\n\n\t\t\t\t\tassign(\n\t\t\t\t\t\tc._nextState,\n\t\t\t\t\t\tnewType.getDerivedStateFromProps(newProps, c._nextState)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\toldProps = c.props;\n\t\t\toldState = c.state;\n\t\t\tc._vnode = newVNode;\n\n\t\t\t// Invoke pre-render lifecycle methods\n\t\t\tif (!oldVNode._component) {\n\t\t\t\tif (\n\t\t\t\t\tisClassComponent \u0026\u0026\n\t\t\t\t\t!newType.getDerivedStateFromProps \u0026\u0026\n\t\t\t\t\tc.componentWillMount\n\t\t\t\t) {\n\t\t\t\t\tc.componentWillMount();\n\t\t\t\t}\n\n\t\t\t\tif (isClassComponent \u0026\u0026 c.componentDidMount) {\n\t\t\t\t\tc._renderCallbacks.push(c.componentDidMount);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (\n\t\t\t\t\tnewProps !== oldProps \u0026\u0026\n\t\t\t\t\tisClassComponent \u0026\u0026\n\t\t\t\t\t!newType.getDerivedStateFromProps \u0026\u0026\n\t\t\t\t\tc.componentWillReceiveProps\n\t\t\t\t) {\n\t\t\t\t\tc.componentWillReceiveProps(newProps, componentContext);\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\t(newVNode._original == oldVNode._original \u0026\u0026\n\t\t\t\t\t\t!(c._bits \u0026 COMPONENT_DIRTY)) ||\n\t\t\t\t\t(!(c._bits \u0026 COMPONENT_FORCE) \u0026\u0026\n\t\t\t\t\t\tc.shouldComponentUpdate \u0026\u0026\n\t\t\t\t\t\tc.shouldComponentUpdate(\n\t\t\t\t\t\t\tnewProps,\n\t\t\t\t\t\t\tc._nextState,\n\t\t\t\t\t\t\tcomponentContext\n\t\t\t\t\t\t) === false)\n\t\t\t\t) {\n\t\t\t\t\t// More info about this here: https://gist.github.com/JoviDeCroock/bec5f2ce93544d2e6070ef8e0036e4e8\n\t\t\t\t\tif (newVNode._original != oldVNode._original) {\n\t\t\t\t\t\t// When we are dealing with a bail because of sCU we have to update\n\t\t\t\t\t\t// the props, state and dirty-state.\n\t\t\t\t\t\t// when we are dealing with strict-equality we don't as the child could still\n\t\t\t\t\t\t// be dirtied see #3883\n\t\t\t\t\t\tc.props = newProps;\n\t\t\t\t\t\tc.state = c._nextState;\n\t\t\t\t\t\tc._bits \u0026= ~COMPONENT_DIRTY;\n\t\t\t\t\t}\n\n\t\t\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t\t\t\tnewVNode._children = oldVNode._children;\n\t\t\t\t\tnewVNode._children.some(vnode =\u003e {\n\t\t\t\t\t\tif (vnode) vnode._parent = newVNode;\n\t\t\t\t\t});\n\n\t\t\t\t\tEMPTY_ARR.push.apply(c._renderCallbacks, c._stateCallbacks);\n\t\t\t\t\tc._stateCallbacks = [];\n\n\t\t\t\t\tif (c._renderCallbacks.length) {\n\t\t\t\t\t\tcommitQueue.push(c);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Skip over the retained subtree without traversing it; the\n\t\t\t\t\t// `result` branch in diffChildren picks this up as the next\n\t\t\t\t\t// oldDom.\n\t\t\t\t\toldDom = getDomSibling(oldVNode);\n\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\n\t\t\t\tif (c.componentWillUpdate) {\n\t\t\t\t\tc.componentWillUpdate(newProps, c._nextState, componentContext);\n\t\t\t\t}\n\n\t\t\t\tif (isClassComponent \u0026\u0026 c.componentDidUpdate) {\n\t\t\t\t\tc._renderCallbacks.push(() =\u003e {\n\t\t\t\t\t\tc.componentDidUpdate(oldProps, oldState, snapshot);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tc.context = componentContext;\n\t\t\tc.props = newProps;\n\t\t\tc._parentDom = parentDom;\n\t\t\tc._bits \u0026= ~COMPONENT_FORCE;\n\n\t\t\t// Function components re-render until they stop calling setState\n\t\t\t// during render (see #2553), class components render exactly once.\n\t\t\tlet renderHook = options._render,\n\t\t\t\tcount = isClassComponent ? 25 : 0;\n\t\t\tdo {\n\t\t\t\tc._bits \u0026= ~COMPONENT_DIRTY;\n\t\t\t\tif (renderHook) renderHook(newVNode);\n\t\t\t\ttmp = c.render(c.props, (c.state = c._nextState), c.context);\n\t\t\t} while (c._bits \u0026 COMPONENT_DIRTY \u0026\u0026 ++count \u003c 25);\n\n\t\t\tif (isClassComponent) {\n\t\t\t\tEMPTY_ARR.push.apply(c._renderCallbacks, c._stateCallbacks);\n\t\t\t\tc._stateCallbacks = [];\n\t\t\t}\n\n\t\t\t// Handle setState called in render, see #2553\n\t\t\tc.state = c._nextState;\n\n\t\t\tif (c.getChildContext) {\n\t\t\t\tglobalContext = assign({}, globalContext, c.getChildContext());\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tisClassComponent \u0026\u0026\n\t\t\t\toldVNode._component \u0026\u0026\n\t\t\t\tc.getSnapshotBeforeUpdate\n\t\t\t) {\n\t\t\t\tsnapshot = c.getSnapshotBeforeUpdate(oldProps, oldState);\n\t\t\t}\n\n\t\t\tconst renderResult =\n\t\t\t\ttmp \u0026\u0026 tmp.type === Fragment \u0026\u0026 tmp.key == NULL\n\t\t\t\t\t? tmp.props.children\n\t\t\t\t\t: tmp;\n\n\t\t\t// A vnode carrying a `_parentDom` prop, considered a new root,\n\t\t\t// continues rendering into that container. The subtree must stay\n\t\t\t// invisible to the host tree's DOM bookkeeping: the portal vnode\n\t\t\t// keeps a `null` `_dom` and the host insertion cursor (`oldDom`)\n\t\t\t// passes through unchanged.\n\t\t\t// `tmp` (the raw render result, already unwrapped into renderResult)\n\t\t\t// doubles as the saved host insertion cursor while we render into\n\t\t\t// the portal's container.\n\t\t\tif (newProps._parentDom) {\n\t\t\t\ttmp = oldDom;\n\t\t\t\tparentDom = newProps._parentDom;\n\t\t\t\t// If we portal into a math or svg element we need\n\t\t\t\t// to swap the namespace (chart libraries often do this).\n\t\t\t\t// The document follows the container too (e.g. iframes) as\n\t\t\t\t// diffElementNodes derives it from its parentDom.\n\t\t\t\tnamespace = parentDom.namespaceURI;\n\t\t\t\t// Portals are never server-rendered: hydration must not claim the\n\t\t\t\t// host parent's excess nodes for the container's children.\n\t\t\t\tisHydrating = excessDomChildren = NULL;\n\n\t\t\t\t// Changing the container remounts the children into the new one\n\t\t\t\tif (oldVNode.props \u0026\u0026 oldVNode.props._parentDom != parentDom) {\n\t\t\t\t\t/** @type {VNode[]} */ (oldVNode._children).some(child =\u003e {\n\t\t\t\t\t\tif (child) unmount(child, child);\n\t\t\t\t\t});\n\t\t\t\t\toldVNode._children = NULL;\n\t\t\t\t}\n\n\t\t\t\toldDom = oldVNode._children ? getDomSibling(oldVNode, 0) : NULL;\n\t\t\t}\n\n\t\t\toldDom = diffChildren(\n\t\t\t\tparentDom,\n\t\t\t\tisArray(renderResult) ? renderResult : [renderResult],\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tnamespace,\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\toldDom,\n\t\t\t\tisHydrating,\n\t\t\t\trefQueue\n\t\t\t);\n\n\t\t\t// When we exit a portal we\n\t\t\t// change up the oldDom\n\t\t\tif (newProps._parentDom) {\n\t\t\t\tnewVNode._dom = NULL;\n\t\t\t\toldDom = tmp;\n\t\t\t}\n\n\t\t\t// Keep `_excess` so unmount can remove the range markers.\n\t\t\tnewVNode._flags \u0026= RESET_MODE;\n\n\t\t\t// Remove the kept DOM this resumed render didn't claim\n\t\t\tif (resumed) resumed.some(removeNode);\n\n\t\t\tif (c._renderCallbacks.length) {\n\t\t\t\tcommitQueue.push(c);\n\t\t\t}\n\n\t\t\t// Only clear when this render was the retry; PENDING_ERROR set by a\n\t\t\t// descendant during this render must survive until then.\n\t\t\tif (c._bits \u0026 COMPONENT_PROCESSING_EXCEPTION) {\n\t\t\t\tc._bits \u0026= ~(COMPONENT_PROCESSING_EXCEPTION | COMPONENT_PENDING_ERROR);\n\t\t\t}\n\t\t} catch (e) {\n\t\t\t// We remove any componentDidMount, ...\n\t\t\t// that have been invalidated by us\n\t\t\t// intercepting the error.\n\t\t\tcommitQueue.length = oldCommitQueueLength;\n\t\t\tnewVNode._original = NULL;\n\t\t\t// if hydrating or creating initial tree, bailout preserves DOM:\n\t\t\tif (isHydrating || excessDomChildren) {\n\t\t\t\tif (e \u0026\u0026 e.then) {\n\t\t\t\t\tlet startMarker, end;\n\n\t\t\t\t\t// isHydrating is MODE_HYDRATE or falsy\n\t\t\t\t\tnewVNode._flags |= MODE_SUSPENDED | isHydrating;\n\n\t\t\t\t\tif (excessDomChildren) {\n\t\t\t\t\t\tlet i = excessDomChildren.indexOf(oldDom || UNDEFINED),\n\t\t\t\t\t\t\tchild;\n\t\t\t\t\t\tif (!~i) i = excessDomChildren.length;\n\n\t\t\t\t\t\t// The cursor skips comments: step back to this component's markers.\n\t\t\t\t\t\twhile ((child = excessDomChildren[i - 1]) \u0026\u0026 child.nodeType == 8) {\n\t\t\t\t\t\t\ti--;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Keep what this component would have claimed: its whole\n\t\t\t\t\t\t// streamed range (all of it when unclosed), or else the first\n\t\t\t\t\t\t// node that isn't a comment.\n\t\t\t\t\t\tfor (; i \u003c excessDomChildren.length; i++) {\n\t\t\t\t\t\t\tif ((child = excessDomChildren[i])) {\n\t\t\t\t\t\t\t\texcessDomChildren[i] = NULL;\n\t\t\t\t\t\t\t\tif (startMarker) {\n\t\t\t\t\t\t\t\t\tif (child == end) break;\n\t\t\t\t\t\t\t\t} else if (child.nodeType != 8) {\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t} else if (child.data.startsWith('$s')) {\n\t\t\t\t\t\t\t\t\tend = rangeEnd((startMarker = child));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!startMarker) {\n\t\t\t\t\t\twhile (oldDom \u0026\u0026 oldDom.nodeType == 8 \u0026\u0026 oldDom.nextSibling) {\n\t\t\t\t\t\t\toldDom = oldDom.nextSibling;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstartMarker = oldDom;\n\t\t\t\t\t}\n\t\t\t\t\t// Preserve the original range when re-suspending.\n\t\t\t\t\tstartMarker =\n\t\t\t\t\t\tnewVNode._component._excess ||\n\t\t\t\t\t\t(newVNode._component._excess = startMarker);\n\t\t\t\t\t// Insert before the range; continue diffing after it.\n\t\t\t\t\tif ((tmp = rangeEnd(startMarker))) {\n\t\t\t\t\t\tnewVNode._dom = startMarker;\n\t\t\t\t\t\toldDom = tmp;\n\t\t\t\t\t} else newVNode._dom = oldDom;\n\t\t\t\t\toldDom = oldDom \u0026\u0026 oldDom.nextSibling;\n\t\t\t\t} else if (excessDomChildren) {\n\t\t\t\t\texcessDomChildren.some(removeNode);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t\t}\n\n\t\t\tif (!newVNode._children) {\n\t\t\t\tnewVNode._children = oldVNode._children || [];\n\t\t\t}\n\n\t\t\tif (!(e \u0026\u0026 e.then)) markAsForce(newVNode);\n\t\t\toptions._catchError(e, newVNode, oldVNode);\n\t\t}\n\t} else {\n\t\toldDom = newVNode._dom = diffElementNodes(\n\t\t\toldVNode._dom,\n\t\t\tnewVNode,\n\t\t\toldVNode,\n\t\t\tglobalContext,\n\t\t\tnamespace,\n\t\t\texcessDomChildren,\n\t\t\tcommitQueue,\n\t\t\tisHydrating,\n\t\t\trefQueue,\n\t\t\tparentDom\n\t\t);\n\t}\n\n\tif ((tmp = options.diffed)) tmp(newVNode);\n\n\treturn oldDom;\n}\n\n/**\n * Find the closing marker of a streamed range.\n * @param {PreactElement} start A `$s` marker opening a range\n * @param {PreactElement[]} [nodes] Collects the nodes inside the range\n * @returns {PreactElement} The closing marker, or undefined when `start` doesn't\n * open a range or the range is unclosed\n */\nfunction rangeEnd(start, nodes) {\n\tif (start \u0026\u0026 start.nodeType == 8 \u0026\u0026 start.data.startsWith('$s')) {\n\t\tfor (let depth = 1; (start = start.nextSibling); ) {\n\t\t\tif (start.nodeType == 8) {\n\t\t\t\tif (start.data.startsWith('$s')) depth++;\n\t\t\t\telse if (start.data.startsWith('/$s') \u0026\u0026 !--depth) return start;\n\t\t\t}\n\t\t\tif (nodes) nodes.push(start);\n\t\t}\n\t}\n}\n\nfunction markAsForce(vnode) {\n\tif (vnode) {\n\t\tif (vnode._component) vnode._component._bits |= COMPONENT_FORCE;\n\t\tif (vnode._children) vnode._children.some(markAsForce);\n\t}\n}\n\n/**\n * @param {Array\u003cComponent\u003e} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {VNode} root\n */\nexport function commitRoot(commitQueue, root, refQueue) {\n\tfor (let i = 0; i \u003c refQueue.length; ) {\n\t\tapplyRef(refQueue[i++], refQueue[i++], refQueue[i++]);\n\t}\n\n\tif (options._commit) options._commit(root, commitQueue);\n\n\tcommitQueue.some(c =\u003e {\n\t\ttry {\n\t\t\t// @ts-expect-error Reuse the commitQueue variable here so the type changes\n\t\t\tcommitQueue = c._renderCallbacks;\n\t\t\tc._renderCallbacks = [];\n\t\t\tcommitQueue.some(cb =\u003e {\n\t\t\t\t// @ts-expect-error See above comment on commitQueue\n\t\t\t\tcb.call(c);\n\t\t\t});\n\t\t} catch (e) {\n\t\t\toptions._catchError(e, c._vnode);\n\t\t}\n\t});\n}\n\n/**\n * Diff two virtual nodes representing DOM element\n * @param {PreactElement} dom The DOM element representing the virtual nodes\n * being diffed\n * @param {VNode} newVNode The new virtual node\n * @param {VNode} oldVNode The old virtual node\n * @param {object} globalContext The current context object\n * @param {string} namespace Current namespace of the DOM node (HTML, SVG, or MathML)\n * @param {Array\u003cPreactElement\u003e} excessDomChildren\n * @param {Array\u003cComponent\u003e} commitQueue List of components which have callbacks\n * to invoke in commitRoot\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @param {any[]} refQueue an array of elements needed to invoke refs\n * @param {PreactElement} parentDom The parent this element will be inserted\n * into; new nodes are created from its ownerDocument (e.g. iframes), or from\n * the global document for containers that don't have one\n * @returns {PreactElement}\n */\nfunction diffElementNodes(\n\tdom,\n\tnewVNode,\n\toldVNode,\n\tglobalContext,\n\tnamespace,\n\texcessDomChildren,\n\tcommitQueue,\n\tisHydrating,\n\trefQueue,\n\tparentDom\n) {\n\tlet oldProps = oldVNode.props || EMPTY_OBJ;\n\tconst newProps = newVNode.props;\n\tconst nodeType = /** @type {string} */ (newVNode.type);\n\t/** @type {any} */\n\tlet i;\n\t/** @type {{ __html?: string }} */\n\tlet newHtml;\n\t/** @type {{ __html?: string }} */\n\tlet oldHtml;\n\t/** @type {ComponentChildren} */\n\tlet newChildren;\n\tlet value;\n\tlet inputValue;\n\tlet checked;\n\n\t// Tracks entering and exiting namespaces when descending through the tree.\n\tif (nodeType == 'svg') namespace = SVG_NAMESPACE;\n\telse if (nodeType == 'math') namespace = MATH_NAMESPACE;\n\telse if (!namespace) namespace = XHTML_NAMESPACE;\n\n\tif (excessDomChildren) {\n\t\tfor (i = 0; i \u003c excessDomChildren.length; i++) {\n\t\t\tvalue = excessDomChildren[i];\n\n\t\t\t// if newVNode matches an element in excessDomChildren or the `dom`\n\t\t\t// argument matches an element in excessDomChildren, remove it from\n\t\t\t// excessDomChildren so it isn't later removed in diffChildren.\n\t\t\t// `localName` is only present on elements, so it doubles as the\n\t\t\t// element check for the non-text branch.\n\t\t\tif (\n\t\t\t\tvalue \u0026\u0026\n\t\t\t\t(nodeType ? value.localName == nodeType : value.nodeType == 3)\n\t\t\t) {\n\t\t\t\tdom = value;\n\t\t\t\texcessDomChildren[i] = NULL;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (!dom) {\n\t\tconst doc = parentDom.ownerDocument || document;\n\t\tif (!nodeType) {\n\t\t\treturn doc.createTextNode(newProps);\n\t\t}\n\n\t\t// Without `is`, the parent doubles as the creation options so its\n\t\t// `customElementRegistry` (scoped registries on shadow roots/elements) is\n\t\t// inherited. The spec throws when `is` and a registry are both passed.\n\t\tdom = doc.createElementNS(\n\t\t\tnamespace,\n\t\t\tnodeType,\n\t\t\tnewProps.is ? newProps : parentDom\n\t\t);\n\n\t\t// we are creating a new node, so we can assume this is a new subtree (in\n\t\t// case we are hydrating), this deopts the hydrate\n\t\tif (isHydrating) {\n\t\t\tif (options._hydrationMismatch)\n\t\t\t\toptions._hydrationMismatch(newVNode, excessDomChildren);\n\t\t\tisHydrating = false;\n\t\t}\n\t\t// we created a new parent, so none of the previously attached children can be reused:\n\t\texcessDomChildren = NULL;\n\t}\n\n\tif (!nodeType) {\n\t\t// During hydration, we still have to split merged text from SSR'd HTML.\n\t\tif (oldProps !== newProps \u0026\u0026 (!isHydrating || dom.data != newProps)) {\n\t\t\tdom.data = newProps;\n\t\t}\n\t} else {\n\t\t// A \u003ctemplate\u003e holds its children in a separate document-fragment, both\n\t\t// when reading existing DOM and when inserting new nodes. `parentDom` is\n\t\t// unused from here on, so we reuse it as the container for our children.\n\t\t// @ts-expect-error\n\t\tparentDom = (nodeType == 'template' \u0026\u0026 dom.content) || dom;\n\n\t\t// If excessDomChildren was not null, repopulate it with the current element's children:\n\t\texcessDomChildren =\n\t\t\tnodeType == 'textarea' \u0026\u0026 newProps.defaultValue != NULL\n\t\t\t\t? NULL\n\t\t\t\t: excessDomChildren \u0026\u0026 slice.call(parentDom.childNodes);\n\n\t\t// If we are in a situation where we are not hydrating but are using\n\t\t// existing DOM (e.g. replaceNode) we should read the existing DOM\n\t\t// attributes to diff them\n\t\tif (!isHydrating \u0026\u0026 excessDomChildren) {\n\t\t\t// Keep this a plain loop: an arrow function here would capture\n\t\t\t// `oldProps`, forcing V8 to context-allocate it and slowing down the\n\t\t\t// hot `for (i in oldProps)` loop below for every element we diff.\n\t\t\toldProps = {};\n\t\t\tfor (i = 0; i \u003c dom.attributes.length; i++) {\n\t\t\t\tvalue = dom.attributes[i];\n\t\t\t\toldProps[value.name] = value.value;\n\t\t\t}\n\t\t}\n\n\t\tfor (i in oldProps) {\n\t\t\tvalue = oldProps[i];\n\t\t\tif (i == 'dangerouslySetInnerHTML') {\n\t\t\t\toldHtml = value;\n\t\t\t} else if (\n\t\t\t\ti != 'children' \u0026\u0026\n\t\t\t\t!(i in newProps) \u0026\u0026\n\t\t\t\t!(i == 'value' \u0026\u0026 'defaultValue' in newProps) \u0026\u0026\n\t\t\t\t!(i == 'checked' \u0026\u0026 'defaultChecked' in newProps)\n\t\t\t) {\n\t\t\t\tsetProperty(dom, i, NULL, value, namespace);\n\t\t\t}\n\t\t}\n\n\t\t// During hydration, props are not diffed at all (including dangerouslySetInnerHTML)\n\t\t// @TODO we should warn in debug mode when props don't match here.\n\t\tfor (i in newProps) {\n\t\t\tvalue = newProps[i];\n\t\t\tif (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\tinputValue = value;\n\t\t\t} else if (i == 'checked') {\n\t\t\t\tchecked = value;\n\t\t\t} else if (\n\t\t\t\t(!isHydrating || typeof value == 'function') \u0026\u0026\n\t\t\t\toldProps[i] !== value\n\t\t\t) {\n\t\t\t\tsetProperty(dom, i, value, oldProps[i], namespace);\n\t\t\t}\n\t\t}\n\n\t\t// If the new vnode didn't have dangerouslySetInnerHTML, diff its children\n\t\tif (newHtml) {\n\t\t\t// Avoid re-applying the same '__html' if it did not changed between re-render\n\t\t\tif (\n\t\t\t\t!isHydrating \u0026\u0026\n\t\t\t\t(!oldHtml ||\n\t\t\t\t\t(newHtml.__html != oldHtml.__html \u0026\u0026 newHtml.__html != dom.innerHTML))\n\t\t\t) {\n\t\t\t\tdom.innerHTML = newHtml.__html;\n\t\t\t}\n\n\t\t\tnewVNode._children = [];\n\t\t} else {\n\t\t\tif (oldHtml) dom.textContent = '';\n\n\t\t\tif (\n\t\t\t\tnodeType == 'foreignObject' ||\n\t\t\t\t(namespace == MATH_NAMESPACE \u0026\u0026 MATHML_TOKEN_ELEMENTS.test(nodeType))\n\t\t\t) {\n\t\t\t\tnamespace = XHTML_NAMESPACE;\n\t\t\t}\n\n\t\t\tdiffChildren(\n\t\t\t\tparentDom,\n\t\t\t\tisArray(newChildren) ? newChildren : [newChildren],\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tnamespace,\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\texcessDomChildren\n\t\t\t\t\t? excessDomChildren[0]\n\t\t\t\t\t: oldVNode._children \u0026\u0026 getDomSibling(oldVNode, 0),\n\t\t\t\tisHydrating,\n\t\t\t\trefQueue\n\t\t\t);\n\n\t\t\t// Remove children that are not part of any vnode.\n\t\t\tif (excessDomChildren) excessDomChildren.some(removeNode);\n\t\t}\n\n\t\t// As above, don't diff props during hydration\n\t\tif (!isHydrating || nodeType == 'textarea') {\n\t\t\ti = 'value';\n\t\t\tif (nodeType == 'progress' \u0026\u0026 inputValue == NULL) {\n\t\t\t\tdom.removeAttribute(i);\n\t\t\t} else if (\n\t\t\t\tinputValue != UNDEFINED \u0026\u0026\n\t\t\t\t// #2756 For the \u003cprogress\u003e-element the initial value is 0,\n\t\t\t\t// despite the attribute not being present. When the attribute\n\t\t\t\t// is missing the progress bar is treated as indeterminate.\n\t\t\t\t// To fix that we'll always update it when it is 0 for progress elements\n\t\t\t\t(inputValue !== dom[i] || (nodeType == 'progress' \u0026\u0026 !inputValue))\n\t\t\t) {\n\t\t\t\tsetProperty(dom, i, inputValue, oldProps[i], namespace);\n\t\t\t}\n\n\t\t\ti = 'checked';\n\t\t\tif (checked != UNDEFINED \u0026\u0026 checked != dom[i]) {\n\t\t\t\tsetProperty(dom, i, checked, oldProps[i], namespace);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn dom;\n}\n\n/**\n * Invoke or update a ref, depending on whether it is a function or object ref.\n * @param {Ref\u003cany\u003e} ref\n * @param {any} value The element or component to attach, or `null` to detach\n * @param {VNode} vnode\n * @param {any} [owner] The vnode the ref is detached from\n */\nexport function applyRef(ref, value, vnode, owner) {\n\ttry {\n\t\tif (typeof ref == 'function') {\n\t\t\t// Store the cleanup on the element or component rather than on the\n\t\t\t// ref function, which can be shared between several of them. The\n\t\t\t// slot is cleared on detach, so detaching twice is a no-op.\n\t\t\tif (value) value._refCleanup = ref(value) || 1;\n\t\t\telse if (\n\t\t\t\towner \u0026\u0026\n\t\t\t\t(owner = owner._component || owner._dom) \u0026\u0026\n\t\t\t\t(value = owner._refCleanup)\n\t\t\t) {\n\t\t\t\towner._refCleanup = NULL;\n\t\t\t\tif (typeof value == 'function') value();\n\t\t\t\telse ref(NULL);\n\t\t\t}\n\t\t} else ref.current = value;\n\t} catch (e) {\n\t\toptions._catchError(e, vnode);\n\t}\n}\n\n/**\n * Unmount a virtual node from the tree and apply DOM changes\n * @param {VNode} vnode The virtual node to unmount\n * @param {VNode} parentVNode The parent of the VNode that initiated the unmount\n * @param {boolean} [skipRemove] Flag that indicates that a parent node of the\n * current element is already detached from the DOM.\n */\nexport function unmount(vnode, parentVNode, skipRemove) {\n\tlet r, end, nodes;\n\tif (options.unmount) options.unmount(vnode);\n\n\tif ((r = vnode.ref) \u0026\u0026 (!r.current || r.current == vnode._dom)) {\n\t\tapplyRef(r, NULL, parentVNode, vnode);\n\t}\n\n\tif ((r = vnode._component)) {\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, parentVNode);\n\t\t\t}\n\t\t}\n\n\t\tr._parentDom = r._globalContext = NULL;\n\t}\n\n\tif ((r = vnode._children)) {\n\t\tfor (let i = 0; i \u003c 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\tparentVNode,\n\t\t\t\t\t// A portal's children live in another container, so a removed\n\t\t\t\t\t// host ancestor doesn't detach them; always remove them.\n\t\t\t\t\ttypeof vnode.type == 'function'\n\t\t\t\t\t\t? skipRemove \u0026\u0026 !vnode.props._parentDom\n\t\t\t\t\t\t: true\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\t// A component that suspended while hydrating owns its range's markers,\n\t// and its content too while still pending.\n\tif (\n\t\t!skipRemove \u0026\u0026\n\t\t(r = vnode._component) \u0026\u0026\n\t\t(r = r._excess) \u0026\u0026\n\t\t(end = rangeEnd(r, (nodes = [])))\n\t) {\n\t\tif (r == vnode._dom) nodes.some(removeNode);\n\t\tremoveNode(end);\n\t\tremoveNode(r);\n\t}\n\n\tif (!skipRemove) removeNode(vnode._dom);\n\n\tvnode._dom = vnode._component = vnode._parent = NULL;\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 { EMPTY_OBJ, MODE_HYDRATE, NULL } from './constants';\nimport { commitRoot, diff } from './diff/index';\nimport { createVNode, Fragment } from './create-element';\nimport options from './options';\nimport { slice } from './util';\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 render into\n */\nexport function render(vnode, parentDom) {\n\tif (options._root) options._root(vnode, parentDom);\n\n\t// https://github.com/preactjs/preact/issues/3794\n\t// https://github.com/preactjs/preact/issues/5118\n\tif (parentDom.nodeType == 9) {\n\t\tparentDom = parentDom.documentElement;\n\t}\n\n\t// @ts-expect-error\n\tlet isHydrating = vnode \u0026\u0026 vnode._flags \u0026 MODE_HYDRATE;\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 oldVNode = isHydrating ? NULL : parentDom._children;\n\n\tparentDom._children = createVNode(Fragment, { children: [vnode] });\n\n\t// List of effects that need to be called after diffing.\n\tlet commitQueue = [],\n\t\trefQueue = [];\n\n\tdiff(\n\t\tparentDom,\n\t\t// Determine the new vnode tree and store it on the DOM element on\n\t\t// our custom `_children` property.\n\t\tparentDom._children,\n\t\toldVNode || EMPTY_OBJ,\n\t\tEMPTY_OBJ,\n\t\tparentDom.namespaceURI,\n\t\toldVNode\n\t\t\t? NULL\n\t\t\t: parentDom.firstChild\n\t\t\t\t? slice.call(parentDom.childNodes)\n\t\t\t\t: NULL,\n\t\tcommitQueue,\n\t\toldVNode ? oldVNode._dom : parentDom.firstChild,\n\t\t// @ts-expect-error we are doing a bit-wise operation so it's either 0 or true\n\t\tisHydrating,\n\t\trefQueue\n\t);\n\n\t// Flush all queued effects\n\tcommitRoot(commitQueue, parentDom._children, refQueue);\n\n\t// The live children are tracked on _children after diffing.\n\tparentDom._children.props.children = NULL;\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 update\n */\nexport function hydrate(vnode, parentDom) {\n\t// Only objects can carry the flag. Primitives (null, strings, numbers,\n\t// booleans) render into the existing DOM the same way hydrating would.\n\tif (vnode \u0026\u0026 typeof vnode == 'object') {\n\t\t// @ts-expect-error\n\t\tvnode._flags |= MODE_HYDRATE;\n\t}\n\trender(vnode, parentDom);\n}\n","import { createVNode } from './create-element';\n\n/**\n * Portal component. A unique type is used instead of Fragment so that a\n * portal returned directly from a component isn't collapsed into the\n * component's children array by the Fragment unwrapping in `diff()`.\n * @param {object} props\n */\nfunction Portal(props) {\n\treturn props.children;\n}\n\n/**\n * Create a `Portal` to continue rendering the vnode tree at a different DOM node\n * @param {import('./internal').ComponentChildren} vnode The vnode to render\n * @param {import('./internal').PreactElement} container The DOM node to continue rendering in to\n */\nexport function createPortal(vnode, container) {\n\treturn createVNode(Portal, { _parentDom: container, children: vnode });\n}\n","import { resetRenderCount } from '../component';\nimport {\n\tCOMPONENT_DIRTY,\n\tCOMPONENT_PENDING_ERROR,\n\tCOMPONENT_PROCESSING_EXCEPTION,\n\tCOMPONENT_FORCE\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').VNode} vnode The vnode that threw the error that was caught (except\n * for unmounting when this parameter is the highest parent that was being\n * unmounted)\n * @param {import('../internal').VNode} [oldVNode]\n * @param {import('../internal').ErrorInfo} [errorInfo]\n */\nexport function _catchError(error, vnode, oldVNode, errorInfo) {\n\t/** @type {import('../internal').Component} */\n\tlet component,\n\t\t/** @type {import('../internal').ComponentType} */\n\t\tctor,\n\t\t/** @type {number} */\n\t\thandled;\n\n\tfor (; (vnode = vnode._parent); ) {\n\t\tif (\n\t\t\t(component = vnode._component) \u0026\u0026\n\t\t\t!(component._bits \u0026 COMPONENT_PROCESSING_EXCEPTION)\n\t\t) {\n\t\t\tcomponent._bits |= COMPONENT_FORCE;\n\t\t\ttry {\n\t\t\t\tctor = component.constructor;\n\n\t\t\t\t// `handled` is reassigned before any read on every boundary\n\t\t\t\t// candidate, so nothing carries over to the next ancestor.\n\t\t\t\tif ((handled = ctor \u0026\u0026 ctor.getDerivedStateFromError)) {\n\t\t\t\t\tcomponent.setState(ctor.getDerivedStateFromError(error));\n\t\t\t\t}\n\n\t\t\t\tif (component.componentDidCatch) {\n\t\t\t\t\tcomponent.componentDidCatch(error, errorInfo || {});\n\t\t\t\t\thandled = 1;\n\t\t\t\t}\n\n\t\t\t\t// This is an error boundary. Mark it as having bailed out, and whether it was mid-hydration.\n\t\t\t\tif (handled \u0026\u0026 component._bits \u0026 COMPONENT_DIRTY) {\n\t\t\t\t\tcomponent._bits |= COMPONENT_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\t// Reset rerender count to 0, so that the next render will not be skipped\n\t// when we leverage prefresh\n\tresetRenderCount();\n\tthrow error;\n}\n"],"version":3}
