{"version":3,"file":"compat.mjs","sources":["../src/Children.js","../src/util.js","../src/PureComponent.js","../src/forwardRef.js","../src/hooks.js","../src/memo.js","../src/portals.js","../src/render.js","../src/suspense.js","../../src/constants.js","../src/index.js"],"sourcesContent":["import { toChildArray } from 'preact';\n\nconst mapFn = (children, fn, context) => {\n\tif (children == null) return null;\n\treturn toChildArray(toChildArray(children).map(fn.bind(context)));\n};\n\n// This API is completely unnecessary for Preact, so it's basically passthrough.\nexport const Children = {\n\tmap: mapFn,\n\tforEach: mapFn,\n\tcount(children) {\n\t\treturn children ? toChildArray(children).length : 0;\n\t},\n\tonly(children) {\n\t\tconst normalized = toChildArray(children);\n\t\tif (normalized.length != 1) throw 'Children.only';\n\t\treturn normalized[0];\n\t},\n\ttoArray: toChildArray\n};\n","export const assign = Object.assign;\n\n/**\n * Check if two objects have a different shape\n * @param {object} a\n * @param {object} b\n * @returns {boolean}\n */\nexport function shallowDiffers(a, b) {\n\tfor (let i in a) if (i != '__source' && a[i] !== b[i]) return true;\n\tfor (let i in b) if (i != '__source' && !(i in a)) return true;\n\treturn false;\n}\n\nexport const IS_NON_DIMENSIONAL =\n\t/^(-|f[lo].*[^se]$|g.{5,}[^ps]$|z|o[pr]|(W.{5})?[lL]i.*(t|mp)$|an|(bo|s).{4}Im|sca|m.{6}[ds]|ta|c.*[st]$|wido|ini)/;\n","import { Component } from 'preact';\nimport { shallowDiffers } from './util';\n\n// Built in a factory so bundlers can drop it when unused\nfunction createPureComponent() {\n\t/**\n\t * Component class with a predefined `shouldComponentUpdate` implementation\n\t */\n\tfunction PureComponent(p, c) {\n\t\tthis.props = p;\n\t\tthis.context = c;\n\t}\n\tPureComponent.prototype = new Component();\n\t// Some third-party libraries check if this property is present\n\tPureComponent.prototype.isPureReactComponent = true;\n\tPureComponent.prototype.shouldComponentUpdate = function (props, state) {\n\t\treturn (\n\t\t\tshallowDiffers(this.props, props) || shallowDiffers(this.state, state)\n\t\t);\n\t};\n\treturn PureComponent;\n}\n\nexport const PureComponent = /* @__PURE__ */ createPureComponent();\n","import { assign } from './util';\n\nexport const REACT_FORWARD_SYMBOL = Symbol.for('react.forward_ref');\n\n/**\n * Pass ref down to a child. This is mainly used in libraries with HOCs that\n * wrap components. Using `forwardRef` there is an easy way to get a reference\n * of the wrapped component instead of one of the wrapper itself.\n * @param {import('./index').ForwardRefRenderFunction} fn\n * @returns {import('./internal').FunctionComponent}\n */\nexport function forwardRef(fn) {\n\tfunction Forwarded(props) {\n\t\tlet clone = assign({}, props);\n\t\tdelete clone.ref;\n\t\treturn fn(clone, props.ref || null);\n\t}\n\n\t// mobx-react checks for this being present\n\tForwarded.$$typeof = REACT_FORWARD_SYMBOL;\n\t// mobx-react heavily relies on implementation details.\n\t// It expects an object here with a `render` property,\n\t// and prototype.render will fail. Without this\n\t// mobx-react throws.\n\tForwarded.render = fn;\n\n\tForwarded.prototype.isReactComponent = true;\n\tForwarded.displayName = 'ForwardRef(' + (fn.displayName || fn.name) + ')';\n\n\treturn Forwarded;\n}\n","import { useLayoutEffect, useRef } from 'preact/hooks';\n\nexport function startTransition(cb) {\n\tcb();\n}\n\nexport function useDeferredValue(val) {\n\treturn val;\n}\n\nexport function useTransition() {\n\treturn [false, startTransition];\n}\n\n// TODO: in theory this should be done after a VNode is diffed as we want to insert\n// styles/... before it attaches\nexport const useInsertionEffect = useLayoutEffect;\n\n/**\n * @template {Function} T\n * @param {T} callback\n * @returns {T}\n */\nexport function useEffectEvent(callback) {\n\tconst ref = useRef(callback);\n\tref.current = callback;\n\n\treturn /** @type {T} */ (\n\t\tfunction () {\n\t\t\treturn ref.current.apply(undefined, arguments);\n\t\t}\n\t);\n}\n","import { createElement } from 'preact';\nimport { shallowDiffers } from './util';\n\n/**\n * Memoize a component, so that it only updates when the props actually have\n * changed. This was previously known as `React.pure`.\n * @param {import('./internal').FunctionComponent} c functional component\n * @param {(prev: object, next: object) => boolean} [comparer] Custom equality function\n * @returns {import('./internal').FunctionComponent}\n */\nexport function memo(c, comparer) {\n\tfunction shouldUpdate(nextProps) {\n\t\tconst ref = this.props.ref;\n\t\tif (ref != nextProps.ref && ref) {\n\t\t\ttypeof ref == 'function' ? ref(null) : (ref.current = null);\n\t\t}\n\n\t\treturn comparer\n\t\t\t? !comparer(this.props, nextProps) || ref != nextProps.ref\n\t\t\t: shallowDiffers(this.props, nextProps);\n\t}\n\n\tfunction Memoed(props) {\n\t\tthis.shouldComponentUpdate = shouldUpdate;\n\t\treturn createElement(c, props);\n\t}\n\tMemoed.displayName = 'Memo(' + (c.displayName || c.name) + ')';\n\tMemoed.prototype.isReactComponent = true;\n\tMemoed.type = c;\n\treturn Memoed;\n}\n","import { createPortal as corePortal } from 'preact';\n\n/**\n * Create a `Portal` to continue rendering the vnode tree at a different DOM node\n * @param {import('./internal').VNode} 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\tconst el = corePortal(vnode, container);\n\tel.containerInfo = container;\n\treturn el;\n}\n","import {\n\trender as preactRender,\n\thydrate as preactHydrate,\n\toptions,\n\ttoChildArray,\n\tComponent\n} from 'preact';\nimport {\n\tuseCallback,\n\tuseContext,\n\tuseDebugValue,\n\tuseEffect,\n\tuseId,\n\tuseImperativeHandle,\n\tuseLayoutEffect,\n\tuseMemo,\n\tuseReducer,\n\tuseRef,\n\tuseState\n} from 'preact/hooks';\nimport { useDeferredValue, useInsertionEffect, useTransition } from './index';\nimport { assign, IS_NON_DIMENSIONAL } from './util';\n\nexport const REACT_ELEMENT_TYPE = Symbol.for('react.element');\n\nconst MODE_HYDRATE = 1 << 5;\nlet currentComponent, hydrationRoot, renderTrackingInitialized;\n\nconst CAMEL_PROPS =\n\t/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(?!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/;\nconst CAMEL_REPLACE = /[A-Z0-9]/g;\nconst IS_DOM = typeof document < 'u';\n\n/**\n * This is taken from https://github.com/facebook/react/blob/main/packages/use-sync-external-store/src/useSyncExternalStoreShimClient.js#L84\n * on a high level this cuts out the warnings, ... and attempts a smaller implementation\n * @typedef {{ _value: any; _getSnapshot: () => any }} Store\n */\nexport const useSyncExternalStore = /* @__PURE__ */ initRenderTracking(\n\tfunction useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {\n\t\tconst serverRendering = options._skipEffects || hydrationRoot;\n\t\tconst value = serverRendering\n\t\t\t? (getServerSnapshot || getSnapshot)()\n\t\t\t: getSnapshot();\n\n\t\t/**\n\t\t * @typedef {{ _instance: Store }} StoreRef\n\t\t * @type {[StoreRef, (store: StoreRef) => void]}\n\t\t */\n\t\tconst [{ _instance }, forceUpdate] = useState({\n\t\t\t_instance: { _value: value, _getSnapshot: getSnapshot }\n\t\t});\n\n\t\tuseLayoutEffect(() => {\n\t\t\t_instance._value = value;\n\t\t\t_instance._getSnapshot = getSnapshot;\n\n\t\t\tif (didSnapshotChange(_instance)) {\n\t\t\t\tforceUpdate({ _instance });\n\t\t\t}\n\t\t}, [subscribe, value, getSnapshot]);\n\n\t\tuseEffect(() => {\n\t\t\tif (didSnapshotChange(_instance)) {\n\t\t\t\tforceUpdate({ _instance });\n\t\t\t}\n\n\t\t\treturn subscribe(() => {\n\t\t\t\tif (didSnapshotChange(_instance)) {\n\t\t\t\t\tforceUpdate({ _instance });\n\t\t\t\t}\n\t\t\t});\n\t\t}, [subscribe]);\n\n\t\treturn value;\n\t}\n);\n\n/** @type {(inst: Store) => boolean} */\nfunction didSnapshotChange(inst) {\n\ttry {\n\t\treturn !Object.is(inst._value, inst._getSnapshot());\n\t} catch (error) {\n\t\treturn true;\n\t}\n}\n\n// Input types for which onchange should not be converted to oninput.\nconst onChangeInputType = type => /fil|che|rad/.test(type);\n\n// Some libraries like `react-virtualized` explicitly check for this.\nComponent.prototype.isReactComponent = true;\n\n// `UNSAFE_*` lifecycle hooks\n// Preact only ever invokes the unprefixed methods.\n// Here we provide a base \"fallback\" implementation that calls any defined UNSAFE_ prefixed method.\n// - If a component defines its own `componentDidMount()` (including via defineProperty), use that.\n// - If a component defines `UNSAFE_componentDidMount()`, `componentDidMount` is the alias getter/setter.\n// - If anything assigns to an `UNSAFE_*` property, the assignment is forwarded to the unprefixed property.\n// See https://github.com/preactjs/preact/issues/1941\n[\n\t'componentWillMount',\n\t'componentWillReceiveProps',\n\t'componentWillUpdate'\n].forEach(key => {\n\tObject.defineProperty(Component.prototype, key, {\n\t\tconfigurable: true,\n\t\tget() {\n\t\t\treturn this['UNSAFE_' + key];\n\t\t},\n\t\tset(v) {\n\t\t\tObject.defineProperty(this, key, {\n\t\t\t\tconfigurable: true,\n\t\t\t\twritable: true,\n\t\t\t\tvalue: v\n\t\t\t});\n\t\t}\n\t});\n});\n\n/**\n * Proxy render() since React returns a Component reference.\n * @param {import('./internal').VNode} vnode VNode tree to render\n * @param {import('./internal').PreactElement} parent DOM node to render vnode tree into\n * @param {() => void} [callback] Optional callback that will be called after rendering\n * @returns {import('./internal').Component | null} The root component reference or null\n */\nexport function render(vnode, parent, callback) {\n\t// React destroys any existing DOM nodes, see #1727\n\t// ...but only on the first render, see #1828\n\tif (parent._children == null) {\n\t\tparent.textContent = '';\n\t}\n\n\tpreactRender(vnode, parent);\n\tif (typeof callback == 'function') callback();\n\n\treturn vnode ? vnode._component : null;\n}\n\nexport function hydrate(vnode, parent, callback) {\n\tpreactHydrate(vnode, parent);\n\tif (typeof callback == 'function') callback();\n\n\treturn vnode ? vnode._component : null;\n}\n\nlet oldEventHook = options.event;\noptions.event = e => {\n\tif (oldEventHook) e = oldEventHook(e);\n\n\te.persist = () => {};\n\te.isPropagationStopped = function isPropagationStopped() {\n\t\treturn this.cancelBubble;\n\t};\n\te.isDefaultPrevented = function isDefaultPrevented() {\n\t\treturn this.defaultPrevented;\n\t};\n\treturn (e.nativeEvent = e);\n};\n\nconst classNameDescriptorNonEnumberable = {\n\tconfigurable: true,\n\tget() {\n\t\treturn this.class;\n\t}\n};\n\nfunction handleDomVNode(vnode) {\n\tlet props = vnode.props,\n\t\ttype = vnode.type,\n\t\tnormalizedProps = {},\n\t\tisNonDashedType = type.indexOf('-') == -1;\n\n\tfor (let i in props) {\n\t\tlet value = props[i];\n\n\t\tif (\n\t\t\t(i == 'value' && 'defaultValue' in props && value == null) ||\n\t\t\t// Emulate React's behavior of not rendering the contents of noscript tags on the client.\n\t\t\t(IS_DOM && i == 'children' && type == 'noscript') ||\n\t\t\ti == 'class' ||\n\t\t\ti == 'className'\n\t\t) {\n\t\t\t// Skip applying value if it is null/undefined and we already set\n\t\t\t// a default value\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (i == 'style' && typeof value == 'object') {\n\t\t\tlet cloned;\n\t\t\tfor (let key in value) {\n\t\t\t\tif (typeof value[key] == 'number' && !IS_NON_DIMENSIONAL.test(key)) {\n\t\t\t\t\tif (!cloned) {\n\t\t\t\t\t\tcloned = value = assign({}, value);\n\t\t\t\t\t}\n\t\t\t\t\tvalue[key] += 'px';\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (i == 'defaultValue' && 'value' in props && props.value == null) {\n\t\t\t// `defaultValue` is treated as a fallback `value` when a value prop is present but null/undefined.\n\t\t\t// `defaultValue` for Elements with no value prop is the same as the DOM defaultValue property.\n\t\t\ti = 'value';\n\t\t} else if (i == 'download' && value === true) {\n\t\t\t// Calling `setAttribute` with a truthy value will lead to it being\n\t\t\t// passed as a stringified value, e.g. `download=\"true\"`. React\n\t\t\t// converts it to an empty string instead, otherwise the attribute\n\t\t\t// value will be used as the file name and the file will be called\n\t\t\t// \"true\" upon downloading it.\n\t\t\tvalue = '';\n\t\t} else if (i == 'translate' && value === 'no') {\n\t\t\tvalue = false;\n\t\t} else if (i[0] == 'o' && i[1] == 'n') {\n\t\t\tlet lowerCased = i.toLowerCase();\n\t\t\tif (lowerCased == 'ondoubleclick') {\n\t\t\t\ti = 'ondblclick';\n\t\t\t} else if (\n\t\t\t\tlowerCased == 'onchange' &&\n\t\t\t\t(type == 'input' || type == 'textarea') &&\n\t\t\t\t!onChangeInputType(props.type)\n\t\t\t) {\n\t\t\t\tlowerCased = i = 'oninput';\n\t\t\t} else if (lowerCased == 'onfocus') {\n\t\t\t\ti = 'onfocusin';\n\t\t\t} else if (lowerCased == 'onblur') {\n\t\t\t\ti = 'onfocusout';\n\t\t\t}\n\n\t\t\t// Add support for onInput and onChange, see #3561\n\t\t\t// if we have an oninput prop already change it to oninputCapture\n\t\t\tif (lowerCased == 'oninput') {\n\t\t\t\ti = lowerCased;\n\t\t\t\tif (normalizedProps[i]) {\n\t\t\t\t\ti = 'oninputCapture';\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (isNonDashedType && CAMEL_PROPS.test(i)) {\n\t\t\ti = i.replace(CAMEL_REPLACE, '-$&').toLowerCase();\n\t\t} else if (value === null) {\n\t\t\tvalue = undefined;\n\t\t}\n\n\t\tnormalizedProps[i] = value;\n\t}\n\n\tif (type == 'select') {\n\t\t// Add support for array select values: <select multiple value={[]} />\n\t\tif (normalizedProps.multiple && Array.isArray(normalizedProps.value)) {\n\t\t\t// forEach() always returns undefined, which we abuse here to unset the value prop.\n\t\t\tnormalizedProps.value = toChildArray(props.children).forEach(child => {\n\t\t\t\tchild.props.selected =\n\t\t\t\t\tnormalizedProps.value.indexOf(child.props.value) != -1;\n\t\t\t});\n\t\t}\n\n\t\t// Adding support for defaultValue in select tag\n\t\tif (normalizedProps.defaultValue != null) {\n\t\t\tnormalizedProps.value = toChildArray(props.children).forEach(child => {\n\t\t\t\tif (normalizedProps.multiple) {\n\t\t\t\t\tchild.props.selected =\n\t\t\t\t\t\tnormalizedProps.defaultValue.indexOf(child.props.value) != -1;\n\t\t\t\t} else {\n\t\t\t\t\tchild.props.selected =\n\t\t\t\t\t\tnormalizedProps.defaultValue == child.props.value;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tif (props.class && !props.className) {\n\t\tnormalizedProps.class = props.class;\n\t\tObject.defineProperty(\n\t\t\tnormalizedProps,\n\t\t\t'className',\n\t\t\tclassNameDescriptorNonEnumberable\n\t\t);\n\t} else if (props.className) {\n\t\tnormalizedProps.class = normalizedProps.className = props.className;\n\t}\n\n\tvnode.props = normalizedProps;\n}\n\nlet oldVNodeHook = options.vnode;\noptions.vnode = vnode => {\n\t// only normalize props on Element nodes\n\tif (typeof vnode.type == 'string') {\n\t\thandleDomVNode(vnode);\n\t} else if (typeof vnode.type == 'function') {\n\t\tconst shouldApplyRef =\n\t\t\t'prototype' in vnode.type && vnode.type.prototype.render;\n\t\tif ('ref' in vnode.props && shouldApplyRef) {\n\t\t\tvnode.ref = vnode.props.ref;\n\t\t\tdelete vnode.props.ref;\n\t\t}\n\n\t\tif (vnode.type.defaultProps) {\n\t\t\tlet normalizedProps = assign({}, vnode.props);\n\t\t\tfor (let i in vnode.type.defaultProps) {\n\t\t\t\tif (normalizedProps[i] === undefined) {\n\t\t\t\t\tnormalizedProps[i] = vnode.type.defaultProps[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\tvnode.props = normalizedProps;\n\t\t}\n\t}\n\n\t// React 19 keeps `ref` in element.props for every element type, and that's\n\t// where libraries detecting React 19 read it (e.g. MUI's getReactElementRef).\n\t// DOM and class vnodes keep theirs on vnode.ref.\n\tif (vnode.ref && !('ref' in vnode.props)) {\n\t\tObject.defineProperty(vnode.props, 'ref', {\n\t\t\tvalue: vnode.ref,\n\t\t\tconfigurable: true,\n\t\t\twritable: true\n\t\t});\n\t}\n\tvnode.$$typeof = REACT_ELEMENT_TYPE;\n\n\tif (oldVNodeHook) oldVNodeHook(vnode);\n};\n\n// Only needed for react-relay and useSyncExternalStore hydration.\nfunction initRenderTracking(value) {\n\tif (!renderTrackingInitialized) {\n\t\trenderTrackingInitialized = true;\n\n\t\tconst oldBeforeRender = options._render;\n\t\toptions._render = vnode => {\n\t\t\tif (oldBeforeRender) oldBeforeRender(vnode);\n\t\t\tif (vnode._flags & MODE_HYDRATE) hydrationRoot = vnode;\n\t\t\tcurrentComponent = vnode._component;\n\t\t};\n\n\t\tconst oldDiffed = options.diffed;\n\t\toptions.diffed = vnode => {\n\t\t\tif (oldDiffed) oldDiffed(vnode);\n\t\t\tcurrentComponent = null;\n\t\t\tif (hydrationRoot == vnode) hydrationRoot = null;\n\t\t};\n\t}\n\n\treturn value;\n}\n\n/**\n * Read the value of a Promise (suspending while pending) or a Context.\n * Unlike other hooks, `use` may be called conditionally.\n * @template T\n * @param {(Promise<T> & { status?: string, value?: T, reason?: any }) | import('../../src/internal').PreactContext} resource\n * @returns {T}\n */\nexport const use = /* @__PURE__ */ initRenderTracking(function use(resource) {\n\t// A Context is a function without a `then`, a thenable has one.\n\tif (resource.then) {\n\t\tif (resource.status == 'fulfilled') return resource.value;\n\t\tif (resource.status == 'rejected') throw resource.reason;\n\t\tif (!resource.status) {\n\t\t\tresource.status = 'pending';\n\t\t\tresource.then(\n\t\t\t\tvalue => {\n\t\t\t\t\tresource.status = 'fulfilled';\n\t\t\t\t\tresource.value = value;\n\t\t\t\t},\n\t\t\t\treason => {\n\t\t\t\t\tresource.status = 'rejected';\n\t\t\t\t\tresource.reason = reason;\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t\tthrow resource;\n\t}\n\n\tconst id = resource._id;\n\tconst provider = currentComponent._globalContext[id];\n\tif (!provider) return resource._defaultValue;\n\t// `use` runs on every render without hook state, while `provider.sub`\n\t// wraps `componentWillUnmount` on each call — mark the component so we\n\t// only subscribe it once.\n\tif (!currentComponent[id]) {\n\t\tcurrentComponent[id] = true;\n\t\tprovider.sub(currentComponent);\n\t}\n\treturn provider.props.value;\n});\n\n// This is a very very private internal function for React it\n// is used to sort-of do runtime dependency injection.\nexport const __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {\n\tReactCurrentDispatcher: {\n\t\tcurrent: {\n\t\t\treadContext: use,\n\t\t\tuseCallback,\n\t\t\tuseContext,\n\t\t\tuseDebugValue,\n\t\t\tuseDeferredValue,\n\t\t\tuseEffect,\n\t\t\tuseId,\n\t\t\tuseImperativeHandle,\n\t\t\tuseInsertionEffect,\n\t\t\tuseLayoutEffect,\n\t\t\tuseMemo,\n\t\t\t// useMutableSource, // experimental-only and replaced by uSES, likely not worth supporting\n\t\t\tuseReducer,\n\t\t\tuseRef,\n\t\t\tuseState,\n\t\t\tuseSyncExternalStore,\n\t\t\tuseTransition\n\t\t}\n\t}\n};\n","import { Component, Fragment, createElement, options } from 'preact';\nimport {\n\tCOMPONENT_FORCE,\n\tFORCE_PROPS_REVALIDATE,\n\tMODE_HYDRATE,\n\tREF_DETACHED,\n\tUNDEFINED\n} from '../../src/constants';\nimport { assign } from './util';\n\nfunction initSuspenseHooks() {\n\tconst oldCatchError = options._catchError;\n\toptions._catchError = (error, newVNode, oldVNode, errorInfo) => {\n\t\tif (error.then) {\n\t\t\t/** @type {import('./internal').Component} */\n\t\t\tlet component;\n\t\t\tlet vnode = newVNode;\n\n\t\t\twhile ((vnode = vnode._parent)) {\n\t\t\t\tif ((component = vnode._component) && component._childDidSuspend) {\n\t\t\t\t\t// A component that suspends before ever committing has no state\n\t\t\t\t\t// worth keeping; mounted ones keep their hooks while parked.\n\t\t\t\t\tif (oldVNode && !oldVNode._component)\n\t\t\t\t\t\tnewVNode._component.__hooks = UNDEFINED;\n\t\t\t\t\t// Don't call oldCatchError if we found a Suspense\n\t\t\t\t\treturn component._childDidSuspend(error, newVNode);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\toldCatchError(error, newVNode, oldVNode, errorInfo);\n\t};\n\n\tconst oldUnmount = options.unmount;\n\toptions.unmount = vnode => {\n\t\t/** @type {import('./internal').Component} */\n\t\tconst component = vnode._component;\n\t\tif (component && component._onResolve) {\n\t\t\tcomponent._onResolve();\n\t\t}\n\n\t\tif (oldUnmount) oldUnmount(vnode);\n\t};\n}\n\nfunction detachedClone(vnode, detachedParent, parentDom) {\n\tif (vnode) {\n\t\tconst hooks = vnode._component && vnode._component.__hooks;\n\t\tif (hooks) {\n\t\t\thooks._list.forEach(effect => {\n\t\t\t\t// Only effects carry `_passive`; clearing `_args` makes them run\n\t\t\t\t// again when the tree is revealed, memo/ref state stays intact.\n\t\t\t\tif (effect._passive != null) {\n\t\t\t\t\tif (typeof effect._cleanup == 'function') effect._cleanup();\n\t\t\t\t\teffect._cleanup = effect._args = UNDEFINED;\n\t\t\t\t}\n\t\t\t});\n\t\t\t// Drop effects queued by the aborted render; `options._render` swaps in\n\t\t\t// a fresh `_pendingEffects` array before anything is pushed again, so\n\t\t\t// sharing one empty array here is safe.\n\t\t\thooks._pendingEffects = vnode._component._renderCallbacks = [];\n\t\t}\n\n\t\t// Unmounting the clone detaches DOM refs; flag the original so the\n\t\t// reveal attaches them again.\n\t\tif (typeof vnode.type == 'string') vnode._flags |= REF_DETACHED;\n\n\t\tvnode = assign({ constructor: UNDEFINED }, vnode);\n\t\tif (vnode._component != null) {\n\t\t\tif (vnode._component._parentDom == parentDom) {\n\t\t\t\tvnode._component._parentDom = detachedParent;\n\t\t\t}\n\n\t\t\tvnode._component._bits |= COMPONENT_FORCE;\n\n\t\t\tvnode._component = null;\n\t\t}\n\n\t\tvnode._children =\n\t\t\tvnode._children &&\n\t\t\tvnode._children.map(child =>\n\t\t\t\tdetachedClone(child, detachedParent, parentDom)\n\t\t\t);\n\t}\n\n\treturn vnode;\n}\n\nfunction removeOriginal(vnode, detachedParent, originalParent) {\n\tif (vnode && originalParent) {\n\t\tif (typeof vnode.type == 'string') {\n\t\t\tvnode._flags |= FORCE_PROPS_REVALIDATE;\n\t\t}\n\n\t\tvnode._original = null;\n\t\tvnode._children =\n\t\t\tvnode._children &&\n\t\t\tvnode._children.map(child =>\n\t\t\t\tremoveOriginal(child, detachedParent, originalParent)\n\t\t\t);\n\n\t\tif (vnode._component) {\n\t\t\tif (vnode._component._parentDom == detachedParent) {\n\t\t\t\tif (vnode._dom) {\n\t\t\t\t\toriginalParent.appendChild(vnode._dom);\n\t\t\t\t}\n\t\t\t\tvnode._component._bits |= COMPONENT_FORCE;\n\t\t\t\tvnode._component._parentDom = originalParent;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn vnode;\n}\n\n// having custom inheritance instead of a class here saves a lot of bytes\nfunction createSuspense() {\n\tinitSuspenseHooks();\n\n\tfunction Suspense() {\n\t\t// we do not call super here to golf some bytes...\n\t\tthis._pendingSuspensionCount = 0;\n\t\tthis._suspenders = null;\n\t\tthis._detachOnNextRender = null;\n\t}\n\n\t// Things we do here to save some bytes but are not proper JS inheritance:\n\t// - call `new Component()` as the prototype\n\t// - do not set `Suspense.prototype.constructor` to `Suspense`\n\tSuspense.prototype = new Component();\n\n\t/**\n\t * @this {import('./internal').SuspenseComponent}\n\t * @param {Promise} promise The thrown promise\n\t * @param {import('./internal').VNode<any, any>} suspendingVNode The suspending component\n\t */\n\tSuspense.prototype._childDidSuspend = function (promise, suspendingVNode) {\n\t\tconst suspendingComponent = suspendingVNode._component;\n\n\t\tif (this._suspenders == null) {\n\t\t\tthis._suspenders = [];\n\t\t}\n\t\tthis._suspenders.push(suspendingComponent);\n\n\t\tlet resolved = false;\n\t\tconst onResolved = () => {\n\t\t\t// Core nulls `_parentDom` when the boundary unmounts.\n\t\t\tif (resolved || !this._parentDom) return;\n\n\t\t\tresolved = true;\n\t\t\tsuspendingComponent._onResolve = null;\n\n\t\t\tonSuspensionComplete();\n\t\t};\n\n\t\tsuspendingComponent._onResolve = onResolved;\n\n\t\t// Store and null _parentDom to prevent setState/forceUpdate from\n\t\t// scheduling renders while suspended. Render would be a no-op anyway\n\t\t// since renderComponent checks _parentDom, but this avoids queue churn.\n\t\tconst originalParentDom = suspendingComponent._parentDom;\n\t\tsuspendingComponent._parentDom = null;\n\n\t\tconst onSuspensionComplete = () => {\n\t\t\tif (!--this._pendingSuspensionCount) {\n\t\t\t\t// If the suspension was during hydration we don't need to restore the\n\t\t\t\t// suspended children into the _children array\n\t\t\t\tif (this.state._suspended) {\n\t\t\t\t\tconst suspendedVNode = this.state._suspended;\n\t\t\t\t\tthis._vnode._children[0] = removeOriginal(\n\t\t\t\t\t\tsuspendedVNode,\n\t\t\t\t\t\tsuspendedVNode._component._parentDom,\n\t\t\t\t\t\tsuspendedVNode._component._originalParentDom\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tthis.setState({ _suspended: (this._detachOnNextRender = null) });\n\n\t\t\t\tlet suspended;\n\t\t\t\twhile ((suspended = this._suspenders.pop())) {\n\t\t\t\t\t// Restore _parentDom before forceUpdate so render can proceed\n\t\t\t\t\tsuspended._parentDom = originalParentDom;\n\t\t\t\t\tsuspended.forceUpdate();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t/**\n\t\t * We do not set `suspended: true` during hydration because we want the actual markup\n\t\t * to remain on screen and hydrate it when the suspense actually gets resolved.\n\t\t * While in non-hydration cases the usual fallback -> component flow would occour.\n\t\t */\n\t\tif (\n\t\t\t!this._pendingSuspensionCount++ &&\n\t\t\t!(suspendingVNode._flags & MODE_HYDRATE)\n\t\t) {\n\t\t\tthis.setState({\n\t\t\t\t_suspended: (this._detachOnNextRender = this._vnode._children[0])\n\t\t\t});\n\t\t}\n\t\tpromise.then(onResolved, onResolved);\n\t};\n\n\tSuspense.prototype.componentWillUnmount = function () {\n\t\tthis._suspenders = [];\n\t};\n\n\t/**\n\t * @this {import('./internal').SuspenseComponent}\n\t * @param {import('./internal').SuspenseComponent[\"props\"]} props\n\t * @param {import('./internal').SuspenseState} state\n\t */\n\tSuspense.prototype.render = function (props, state) {\n\t\tif (this._detachOnNextRender) {\n\t\t\t// When the Suspense's _vnode was created by a call to createVNode\n\t\t\t// (i.e. due to a setState further up in the tree)\n\t\t\t// it's _children prop is null, in this case we \"forget\" about the parked vnodes to detach\n\t\t\tif (this._vnode._children) {\n\t\t\t\tconst detachedParent = document.createElement('div');\n\t\t\t\tconst detachedComponent = this._vnode._children[0]._component;\n\t\t\t\tthis._vnode._children[0] = detachedClone(\n\t\t\t\t\tthis._detachOnNextRender,\n\t\t\t\t\tdetachedParent,\n\t\t\t\t\t(detachedComponent._originalParentDom = detachedComponent._parentDom)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tthis._detachOnNextRender = null;\n\t\t}\n\n\t\treturn [\n\t\t\tcreateElement(Fragment, null, state._suspended ? null : props.children),\n\t\t\tstate._suspended && createElement(Fragment, null, props.fallback)\n\t\t];\n\t};\n\n\treturn Suspense;\n}\n\nexport const Suspense = /* @__PURE__ */ createSuspense();\n\nexport function lazy(loader) {\n\tlet prom;\n\tlet component = null;\n\tlet error;\n\tlet resolved;\n\n\tfunction Lazy(props) {\n\t\tif (!prom) {\n\t\t\tprom = loader();\n\t\t\tprom.then(\n\t\t\t\texports => {\n\t\t\t\t\tif (exports) {\n\t\t\t\t\t\tcomponent = exports.default || exports;\n\t\t\t\t\t}\n\t\t\t\t\tresolved = true;\n\t\t\t\t},\n\t\t\t\te => {\n\t\t\t\t\terror = e;\n\t\t\t\t\tresolved = true;\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\tif (error) {\n\t\t\tthrow error;\n\t\t}\n\n\t\tif (!resolved) {\n\t\t\tthrow prom;\n\t\t}\n\n\t\treturn component ? createElement(component, props) : null;\n\t}\n\n\tLazy.displayName = 'Lazy';\n\treturn Lazy;\n}\n","// Vnode._flags\n/** Normal hydration that attaches to a DOM tree but does not diff it. */\nexport const MODE_HYDRATE = 1 << 5;\n/** Signifies this VNode suspended on the previous render */\nexport const MODE_SUSPENDED = 1 << 7;\n/** Indicates that this node needs to be inserted while patching children */\nexport const INSERT_VNODE = 1 << 2;\n/** Indicates a VNode has been matched with another VNode in the diff */\nexport const MATCHED = 1 << 1;\n/** Indicates that this vnode has been unmounted before indicating the loss of event listeners */\nexport const FORCE_PROPS_REVALIDATE = 1 << 0;\n/** The vnode's ref was detached while its subtree was parked by Suspense */\nexport const REF_DETACHED = 1 << 3;\n\n// component._bits\n/** Component is processing an exception */\nexport const COMPONENT_PROCESSING_EXCEPTION = 1 << 0;\n/** Component has a pending error */\nexport const COMPONENT_PENDING_ERROR = 1 << 1;\n/** Component should force update (skip shouldComponentUpdate) */\nexport const COMPONENT_FORCE = 1 << 2;\n/** Component is queued for update */\nexport const COMPONENT_DIRTY = 1 << 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 EMPTY_OBJ = /** @type {any} */ ({});\nexport const EMPTY_ARR = [];\n\nexport const MATHML_TOKEN_ELEMENTS = /^m(i|n|o|s|text|space)$/;\n","import {\n\tComponent,\n\tFragment,\n\tcreateContext,\n\tcreateElement,\n\tcreateRef,\n\toptions,\n\tcloneElement as preactCloneElement,\n\trender as preactRender\n} from 'preact';\nimport {\n\tuseCallback,\n\tuseContext,\n\tuseDebugValue,\n\tuseEffect,\n\tuseId,\n\tuseImperativeHandle,\n\tuseLayoutEffect,\n\tuseMemo,\n\tuseReducer,\n\tuseRef,\n\tuseState\n} from 'preact/hooks';\nimport { Children } from './Children';\nimport { PureComponent } from './PureComponent';\nimport { forwardRef } from './forwardRef';\nimport {\n\tstartTransition,\n\tuseDeferredValue,\n\tuseEffectEvent,\n\tuseInsertionEffect,\n\tuseTransition\n} from './hooks';\nimport { memo } from './memo';\nimport { createPortal } from './portals';\nimport {\n\tREACT_ELEMENT_TYPE,\n\t__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,\n\thydrate,\n\trender,\n\tuse,\n\tuseSyncExternalStore\n} from './render';\nimport { Suspense, lazy } from './suspense';\n\nconst version = '19.0.0'; // trick libraries to think we are react\n\n/**\n * Legacy version of createElement.\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component constructor\n */\nfunction createFactory(type) {\n\treturn createElement.bind(null, type);\n}\n\n/**\n * Check if the passed element is a valid (p)react node.\n * @param {*} element The element to check\n * @returns {boolean}\n */\nfunction isValidElement(element) {\n\treturn !!element && element.$$typeof === REACT_ELEMENT_TYPE;\n}\n\n/**\n * Check if the passed element is a Fragment node.\n * @param {*} element The element to check\n * @returns {boolean}\n */\nfunction isFragment(element) {\n\treturn isValidElement(element) && element.type == Fragment;\n}\n\n/**\n * Check if the passed element is a Memo node.\n * @param {*} element The element to check\n * @returns {boolean}\n */\nfunction isMemo(element) {\n\treturn (\n\t\t!!element &&\n\t\ttypeof element.displayName == 'string' &&\n\t\telement.displayName.indexOf('Memo(') == 0\n\t);\n}\n\n/**\n * Wrap `cloneElement` to abort if the passed element is not a valid element and apply\n * all vnode normalizations.\n * @param {import('./internal').VNode} element The vnode to clone\n * @param {object} props Props to add when cloning\n * @param {Array<import('./internal').ComponentChildren>} rest Optional component children\n */\nfunction cloneElement(element) {\n\tif (!isValidElement(element)) return element;\n\treturn preactCloneElement.apply(null, arguments);\n}\n\n/**\n * Remove a component tree from the DOM, including state and event handlers.\n * @param {import('./internal').PreactElement} container\n * @returns {boolean}\n */\nfunction unmountComponentAtNode(container) {\n\tif (container._children) {\n\t\tpreactRender(null, container);\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n/**\n * Get the matching DOM node for a component\n * @param {import('./internal').Component} component\n * @returns {import('./internal').PreactElement | null}\n */\nfunction findDOMNode(component) {\n\treturn (\n\t\t(component &&\n\t\t\t((component._vnode && component._vnode._dom) ||\n\t\t\t\t(component.nodeType == 1 && component))) ||\n\t\tnull\n\t);\n}\n\n/**\n * In React, `flushSync` flushes the entire tree and forces a rerender.\n * @template Arg\n * @template Result\n * @param {(arg: Arg) => Result} callback function that runs before the flush\n * @param {Arg} [arg] Optional argument that can be passed to the callback\n * @returns\n */\nconst flushSync = (callback, arg) => {\n\tconst prevDebounce = options.debounceRendering;\n\n\t// Capture the scheduled render callback so that all updates performed\n\t// inside the user callback are batched into a single synchronous commit\n\t// instead of every state setter rendering independently.\n\tlet flush;\n\toptions.debounceRendering = cb => {\n\t\tflush = cb;\n\t};\n\ttry {\n\t\tconst res = callback(arg);\n\t\tif (flush) flush();\n\t\treturn res;\n\t} finally {\n\t\toptions.debounceRendering = prevDebounce;\n\t}\n};\n\n/**\n * In React, `unstable_batchedUpdates` is a legacy feature that was made a no-op\n * outside of legacy mode in React 18 and a no-op across the board in React 19.\n * @template Arg\n * @template Result\n * @param {(arg: Arg) => Result} callback\n * @param {Arg} [arg]\n * @returns {Result}\n */\nfunction unstable_batchedUpdates(callback, arg) {\n\treturn callback(arg);\n}\n\nexport * from 'preact/hooks';\nexport {\n\tversion,\n\tChildren,\n\trender,\n\thydrate,\n\tunmountComponentAtNode,\n\tcreatePortal,\n\tcreateElement,\n\tcreateContext,\n\tcreateFactory,\n\tcloneElement,\n\tcreateRef,\n\tFragment,\n\tisValidElement,\n\t// compat to react-is\n\tisValidElement as isElement,\n\tisFragment,\n\tisMemo,\n\tfindDOMNode,\n\tComponent,\n\tPureComponent,\n\tmemo,\n\tforwardRef,\n\tflushSync,\n\tunstable_batchedUpdates,\n\tuseInsertionEffect,\n\tstartTransition,\n\tuseDeferredValue,\n\tuseSyncExternalStore,\n\tuseTransition,\n\tuseEffectEvent,\n\tuse,\n\tFragment as StrictMode,\n\tSuspense,\n\tlazy,\n\t__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED\n};\n\n// React copies the named exports to the default one.\nexport default {\n\tuseState,\n\tuseId,\n\tuseReducer,\n\tuseEffect,\n\tuseLayoutEffect,\n\tuseInsertionEffect,\n\tuseTransition,\n\tuseDeferredValue,\n\tuseSyncExternalStore,\n\tuseEffectEvent,\n\tstartTransition,\n\tuseRef,\n\tuseImperativeHandle,\n\tuseMemo,\n\tuseCallback,\n\tuseContext,\n\tuse,\n\tuseDebugValue,\n\tversion,\n\tChildren,\n\trender,\n\thydrate,\n\tunmountComponentAtNode,\n\tcreatePortal,\n\tcreateElement,\n\tcreateContext,\n\tcreateFactory,\n\tcloneElement,\n\tcreateRef,\n\tFragment,\n\tisValidElement,\n\tisElement: isValidElement,\n\tisFragment,\n\tisMemo,\n\tfindDOMNode,\n\tComponent,\n\tPureComponent,\n\tmemo,\n\tforwardRef,\n\tflushSync,\n\tunstable_batchedUpdates,\n\tStrictMode: Fragment,\n\tSuspense,\n\tlazy,\n\t__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED\n};\n"],"names":["mapFn","children","fn","context","toChildArray","map","bind","Children","forEach","count","length","only","normalized","toArray","assign","Object","shallowDiffers","a","b","i","IS_NON_DIMENSIONAL","createPureComponent","PureComponent","p","c","this","props","prototype","Component","isPureReactComponent","shouldComponentUpdate","state","REACT_FORWARD_SYMBOL","Symbol","for","forwardRef","Forwarded","clone","ref","$$typeof","render","isReactComponent","displayName","name","startTransition","cb","useDeferredValue","val","useTransition","useInsertionEffect","useLayoutEffect","useEffectEvent","callback","useRef","current","apply","undefined","arguments","memo","comparer","shouldUpdate","nextProps","Memoed","createElement","type","createPortal","vnode","container","el","corePortal","containerInfo","currentComponent","hydrationRoot","renderTrackingInitialized","REACT_ELEMENT_TYPE","CAMEL_PROPS","CAMEL_REPLACE","IS_DOM","document","useSyncExternalStore","initRenderTracking","subscribe","getSnapshot","getServerSnapshot","value","options","__s","_useState","useState","_instance","__","_getSnapshot","forceUpdate","didSnapshotChange","useEffect","inst","is","error","onChangeInputType","test","parent","__k","textContent","preactRender","__c","hydrate","preactHydrate","key","defineProperty","configurable","get","set","v","writable","oldEventHook","event","e","persist","isPropagationStopped","cancelBubble","isDefaultPrevented","defaultPrevented","nativeEvent","classNameDescriptorNonEnumberable","class","oldVNodeHook","oldBeforeRender","__r","__u","oldDiffed","diffed","normalizedProps","isNonDashedType","indexOf","cloned","lowerCased","toLowerCase","replace","multiple","Array","isArray","child","selected","defaultValue","className","handleDomVNode","defaultProps","use","resource","then","status","reason","id","provider","__n","sub","__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED","ReactCurrentDispatcher","readContext","useCallback","useContext","useDebugValue","useId","useImperativeHandle","useMemo","useReducer","detachedClone","detachedParent","parentDom","hooks","__H","effect","__P","__h","constructor","__g","removeOriginal","originalParent","__v","__e","appendChild","createSuspense","Suspense","_suspenders","__b","oldCatchError","newVNode","oldVNode","errorInfo","component","oldUnmount","unmount","__R","initSuspenseHooks","promise","suspendingVNode","_this","suspendingComponent","push","resolved","onResolved","onSuspensionComplete","originalParentDom","__a","suspendedVNode","__O","suspended","setState","pop","componentWillUnmount","detachedComponent","Fragment","fallback","lazy","loader","prom","Lazy","exports","default","version","createFactory","isValidElement","element","isFragment","isMemo","cloneElement","preactCloneElement","unmountComponentAtNode","findDOMNode","nodeType","flushSync","arg","flush","prevDebounce","debounceRendering","res","unstable_batchedUpdates","index","createContext","createRef","isElement","StrictMode"],"mappings":"6gBAEA,IAAMA,EAAQ,SAACC,EAAUC,EAAIC,GAC5B,OAAgB,MAAZF,EAAyB,KACtBG,EAAaA,EAAaH,GAAUI,IAAIH,EAAGI,KAAKH,IACxD,EAGaI,EAAW,CACvBF,IAAKL,EACLQ,QAASR,EACTS,MAAK,SAACR,GACL,OAAOA,EAAWG,EAAaH,GAAUS,OAAS,CACnD,EACAC,KAAI,SAACV,GACJ,IAAMW,EAAaR,EAAaH,GAChC,GAAyB,GAArBW,EAAWF,OAAa,KAAM,gBAClC,OAAOE,EAAW,EACnB,EACAC,QAAST,GCnBGU,EAASC,OAAOD,OAQtB,SAASE,EAAeC,EAAGC,GACjC,IAAK,IAAIC,KAAKF,EAAG,GAAS,YAALE,GAAmBF,EAAEE,KAAOD,EAAEC,GAAI,OAAO,EAC9D,IAAK,IAAIA,KAAKD,EAAG,GAAS,YAALC,KAAqBA,KAAKF,GAAI,OAAO,EAC1D,OAAO,CACR,CAEO,IAAMG,EACZ,oHC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