@tanstack/redact 0.0.15 → 0.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ export declare function attributeName(name: string, isSvg?: boolean): string;
@@ -0,0 +1,19 @@
1
+ // packages/redact/src/core/attributes.ts
2
+ function attributeName(name, isSvg = false) {
3
+ if (isSvg && name !== "viewBox" && SVG_KEBAB_PREFIX.test(name)) {
4
+ return name.replace(/[A-Z]/g, (m) => "-" + m.toLowerCase());
5
+ }
6
+ if (name === "className") return "class";
7
+ if (name === "htmlFor") return "for";
8
+ if (name === "httpEquiv") return "http-equiv";
9
+ if (name === "acceptCharset") return "accept-charset";
10
+ if (name === "crossOrigin") return "crossorigin";
11
+ if (name === "noModule") return "nomodule";
12
+ if (name === "viewBox") return "viewBox";
13
+ return name.startsWith("aria-") || name.startsWith("data-") ? name : name.toLowerCase();
14
+ }
15
+ var SVG_KEBAB_PREFIX = /^(?:clip|fill|stroke)/;
16
+ export {
17
+ attributeName
18
+ };
19
+ //# sourceMappingURL=attributes.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/core/attributes.ts"],
4
+ "sourcesContent": ["export function attributeName(name: string, isSvg = false): string {\n if (isSvg && name !== 'viewBox' && SVG_KEBAB_PREFIX.test(name)) {\n return name.replace(/[A-Z]/g, (m) => '-' + m.toLowerCase())\n }\n if (name === 'className') return 'class'\n if (name === 'htmlFor') return 'for'\n if (name === 'httpEquiv') return 'http-equiv'\n if (name === 'acceptCharset') return 'accept-charset'\n if (name === 'crossOrigin') return 'crossorigin'\n if (name === 'noModule') return 'nomodule'\n if (name === 'viewBox') return 'viewBox'\n return name.startsWith('aria-') || name.startsWith('data-')\n ? name\n : name.toLowerCase()\n}\n\nconst SVG_KEBAB_PREFIX = /^(?:clip|fill|stroke)/\n"],
5
+ "mappings": ";AAAO,SAAS,cAAc,MAAc,QAAQ,OAAe;AACjE,MAAI,SAAS,SAAS,aAAa,iBAAiB,KAAK,IAAI,GAAG;AAC9D,WAAO,KAAK,QAAQ,UAAU,CAAC,MAAM,MAAM,EAAE,YAAY,CAAC;AAAA,EAC5D;AACA,MAAI,SAAS,YAAa,QAAO;AACjC,MAAI,SAAS,UAAW,QAAO;AAC/B,MAAI,SAAS,YAAa,QAAO;AACjC,MAAI,SAAS,gBAAiB,QAAO;AACrC,MAAI,SAAS,cAAe,QAAO;AACnC,MAAI,SAAS,WAAY,QAAO;AAChC,MAAI,SAAS,UAAW,QAAO;AAC/B,SAAO,KAAK,WAAW,OAAO,KAAK,KAAK,WAAW,OAAO,IACtD,OACA,KAAK,YAAY;AACvB;AAEA,IAAM,mBAAmB;",
6
+ "names": []
7
+ }
@@ -53,6 +53,7 @@ export interface FiberRoot {
53
53
  ce?: ((err: unknown) => void) | undefined;
54
54
  ue?: ((err: unknown) => void) | undefined;
55
55
  i: string;
56
+ ic: number;
56
57
  h: boolean;
57
58
  }
58
59
  export declare function createFiber(tag: FiberTag, type: any, key: string | null): Fiber;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/core/internal.ts"],
4
- "sourcesContent": ["import type { ReactElement, ReactNode, Ref } from './types'\n\nexport const enum FiberTag {\n Host = 0,\n Text = 1,\n Function = 2,\n Class = 3,\n Fragment = 4,\n Portal = 5,\n Provider = 6,\n Consumer = 7,\n ForwardRef = 8,\n Memo = 9,\n Lazy = 10,\n Suspense = 11,\n Root = 12,\n}\n\nexport interface Hook {\n s: any\n q: any\n d: any\n c: any\n n: Hook | null\n}\n\nexport interface Effect {\n t: 0 | 1\n c: () => any\n}\n\nexport interface Fiber {\n tag: FiberTag\n type: any\n key: string | null\n ref: Ref<any> | null\n pp: any\n mp: any\n ms: any\n sn: any\n dom: Node | null\n parent: Fiber | null\n child: Fiber | null\n sibling: Fiber | null\n hooks: Hook | null\n cu: Array<() => void> | null\n dy: boolean\n um: boolean\n root: FiberRoot | null\n}\n\nexport interface FiberRoot {\n c: Element | DocumentFragment\n r: Fiber\n p: Set<Fiber>\n s: boolean\n re?: ((err: unknown) => void) | undefined\n ce?: ((err: unknown) => void) | undefined\n ue?: ((err: unknown) => void) | undefined\n i: string\n h: boolean\n}\n\nexport function createFiber(tag: FiberTag, type: any, key: string | null): Fiber {\n return {\n tag,\n type,\n key,\n ref: null,\n pp: null,\n mp: null,\n ms: null,\n sn: null,\n dom: null,\n parent: null,\n child: null,\n sibling: null,\n hooks: null,\n cu: null,\n dy: false,\n um: false,\n root: null,\n }\n}\n\nexport type ChildNode = ReactElement | string | number | boolean | null | undefined | ChildNode[]\nexport type { ReactElement, ReactNode }\n"],
5
- "mappings": ";AAEO,IAAW,WAAX,kBAAWA,cAAX;AACL,EAAAA,oBAAA,UAAO,KAAP;AACA,EAAAA,oBAAA,UAAO,KAAP;AACA,EAAAA,oBAAA,cAAW,KAAX;AACA,EAAAA,oBAAA,WAAQ,KAAR;AACA,EAAAA,oBAAA,cAAW,KAAX;AACA,EAAAA,oBAAA,YAAS,KAAT;AACA,EAAAA,oBAAA,cAAW,KAAX;AACA,EAAAA,oBAAA,cAAW,KAAX;AACA,EAAAA,oBAAA,gBAAa,KAAb;AACA,EAAAA,oBAAA,UAAO,KAAP;AACA,EAAAA,oBAAA,UAAO,MAAP;AACA,EAAAA,oBAAA,cAAW,MAAX;AACA,EAAAA,oBAAA,UAAO,MAAP;AAbgB,SAAAA;AAAA,GAAA;AA6DX,SAAS,YAAY,KAAe,MAAW,KAA2B;AAC/E,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA,KAAK;AAAA,IACL,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,KAAK;AAAA,IACL,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,SAAS;AAAA,IACT,OAAO;AAAA,IACP,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,MAAM;AAAA,EACR;AACF;",
4
+ "sourcesContent": ["import type { ReactElement, ReactNode, Ref } from './types'\n\nexport const enum FiberTag {\n Host = 0,\n Text = 1,\n Function = 2,\n Class = 3,\n Fragment = 4,\n Portal = 5,\n Provider = 6,\n Consumer = 7,\n ForwardRef = 8,\n Memo = 9,\n Lazy = 10,\n Suspense = 11,\n Root = 12,\n}\n\nexport interface Hook {\n s: any\n q: any\n d: any\n c: any\n n: Hook | null\n}\n\nexport interface Effect {\n t: 0 | 1\n c: () => any\n}\n\nexport interface Fiber {\n tag: FiberTag\n type: any\n key: string | null\n ref: Ref<any> | null\n pp: any\n mp: any\n ms: any\n sn: any\n dom: Node | null\n parent: Fiber | null\n child: Fiber | null\n sibling: Fiber | null\n hooks: Hook | null\n cu: Array<() => void> | null\n dy: boolean\n um: boolean\n root: FiberRoot | null\n}\n\nexport interface FiberRoot {\n c: Element | DocumentFragment\n r: Fiber\n p: Set<Fiber>\n s: boolean\n re?: ((err: unknown) => void) | undefined\n ce?: ((err: unknown) => void) | undefined\n ue?: ((err: unknown) => void) | undefined\n i: string\n ic: number\n h: boolean\n}\n\nexport function createFiber(tag: FiberTag, type: any, key: string | null): Fiber {\n return {\n tag,\n type,\n key,\n ref: null,\n pp: null,\n mp: null,\n ms: null,\n sn: null,\n dom: null,\n parent: null,\n child: null,\n sibling: null,\n hooks: null,\n cu: null,\n dy: false,\n um: false,\n root: null,\n }\n}\n\nexport type ChildNode = ReactElement | string | number | boolean | null | undefined | ChildNode[]\nexport type { ReactElement, ReactNode }\n"],
5
+ "mappings": ";AAEO,IAAW,WAAX,kBAAWA,cAAX;AACL,EAAAA,oBAAA,UAAO,KAAP;AACA,EAAAA,oBAAA,UAAO,KAAP;AACA,EAAAA,oBAAA,cAAW,KAAX;AACA,EAAAA,oBAAA,WAAQ,KAAR;AACA,EAAAA,oBAAA,cAAW,KAAX;AACA,EAAAA,oBAAA,YAAS,KAAT;AACA,EAAAA,oBAAA,cAAW,KAAX;AACA,EAAAA,oBAAA,cAAW,KAAX;AACA,EAAAA,oBAAA,gBAAa,KAAb;AACA,EAAAA,oBAAA,UAAO,KAAP;AACA,EAAAA,oBAAA,UAAO,MAAP;AACA,EAAAA,oBAAA,cAAW,MAAX;AACA,EAAAA,oBAAA,UAAO,MAAP;AAbgB,SAAAA;AAAA,GAAA;AA8DX,SAAS,YAAY,KAAe,MAAW,KAA2B;AAC/E,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA,KAAK;AAAA,IACL,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,KAAK;AAAA,IACL,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,SAAS;AAAA,IACT,OAAO;AAAA,IACP,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,MAAM;AAAA,EACR;AACF;",
6
6
  "names": ["FiberTag"]
7
7
  }
@@ -173,7 +173,7 @@ function makeDispatcherImpl() {
173
173
  if (hook.s === void 0) {
174
174
  const fiber = getCurrentFiber();
175
175
  const root = findRootFromFiber(fiber);
176
- hook.s = (root?.i ?? ":r") + (idCounter++).toString(36);
176
+ hook.s = root ? root.i + (root.ic++).toString(36) : ":r" + (idCounter++).toString(36);
177
177
  }
178
178
  return hook.s;
179
179
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/dom/dispatcher.ts"],
4
- "sourcesContent": ["import type { Hook, Fiber, FiberRoot, Effect } from '../core'\nimport { ReactSharedInternals, REACT_CONTEXT_TYPE } from '../react'\nimport { scheduleUpdate, enqueueEffect, readContext } from './reconcile'\n\nfunction getCurrentFiber(): Fiber {\n const f = ReactSharedInternals.F\n if (!f) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('Hook called outside a function component render.')\n }\n throw new Error()\n }\n return f\n}\n\nfunction nextHook(): Hook {\n const fiber = getCurrentFiber()\n const idx = ReactSharedInternals.I++\n\n let prev = ReactSharedInternals.K\n\n if (idx === 0) {\n if (fiber.hooks) {\n ReactSharedInternals.K = fiber.hooks\n return fiber.hooks\n }\n const h: Hook = { s: undefined, q: undefined, d: undefined, c: undefined, n: null }\n fiber.hooks = h\n ReactSharedInternals.K = h\n return h\n }\n\n if (prev && prev.n) {\n ReactSharedInternals.K = prev.n\n return prev.n\n }\n\n const h: Hook = { s: undefined, q: undefined, d: undefined, c: undefined, n: null }\n if (prev) prev.n = h\n else fiber.hooks = h\n ReactSharedInternals.K = h\n return h\n}\n\nfunction depsEqual(\n a: ReadonlyArray<unknown> | undefined,\n b: ReadonlyArray<unknown> | undefined,\n): boolean {\n if (a === b) return true\n if (!a || !b) return false\n if (a.length !== b.length) return false\n for (let i = 0; i < a.length; i++) {\n if (!Object.is(a[i], b[i])) return false\n }\n return true\n}\n\ntype BasicStateAction<S> = S | ((p: S) => S)\n\n// Singleton \u2014 every method reads render context via ReactSharedInternals,\n// and per-hook closures live on the hook itself, so nothing is render-local\n// to capture. Allocating a fresh wrapper + 17 method closures per function-\n// component render was pure GC pressure.\nconst DISPATCHER = makeDispatcherImpl()\n\nexport function makeDispatcher() {\n return DISPATCHER\n}\n\nfunction makeDispatcherImpl() {\n return {\n useState<S>(initial: S | (() => S)): [S, (a: BasicStateAction<S>) => void] {\n return this.useReducer(\n basicReducer as (state: S, action: BasicStateAction<S>) => S,\n typeof initial == 'function' ? (initial as () => S)() : initial,\n )\n },\n\n useReducer<S, A>(reducer: (s: S, a: A) => S, initialArg: any, init?: (a: any) => S) {\n const hook = nextHook()\n const fiber = getCurrentFiber()\n if (hook.q === undefined) {\n hook.s = init ? init(initialArg) : initialArg\n const queue: any = { r: reducer }\n const dispatch = (action: A) => {\n const currentState = hook.s as S\n const next = queue.r(currentState, action)\n if (!Object.is(next, currentState)) {\n hook.s = next\n scheduleUpdate(fiber)\n }\n }\n queue.d = dispatch\n hook.q = queue\n } else {\n hook.q.r = reducer\n }\n return [hook.s, hook.q.d] as [S, (a: A) => void]\n },\n\n useEffect(create: () => any, deps?: ReadonlyArray<unknown>) {\n const hook = nextHook()\n const fiber = getCurrentFiber()\n const prevDeps = hook.d\n if (prevDeps !== undefined && depsEqual(prevDeps, deps)) return\n hook.d = deps\n const effect: Effect = {\n t: 0,\n c: () => {\n // Run the prior cleanup INSIDE the effect run, not during the\n // dispatch/render phase. If render A \u2192 B \u2192 C all happen back-to-\n // back before the passive microtask drains, dispatch-time cleanup\n // only fires once (between A\u2192B) and fx B + C both run fresh,\n // leaving two side-fx (e.g. two plot SVGs) in the DOM. Doing\n // it here, at effect-run time, means every new create first tears\n // down whatever cleanup is currently live on the hook.\n if (hook.c) {\n try { hook.c() } catch {}\n // The prior cleanup was also pushed onto fiber.cu; remove\n // it so unmount doesn't double-call it.\n if (fiber.cu) {\n const i = fiber.cu.indexOf(hook.c)\n if (i >= 0) fiber.cu.splice(i, 1)\n }\n hook.c = null\n }\n const c = create()\n hook.c = typeof c == 'function' ? c : null\n return hook.c\n },\n }\n enqueueEffect(fiber, effect)\n },\n\n useLayoutEffect(create: () => any, deps?: ReadonlyArray<unknown>) {\n const hook = nextHook()\n const fiber = getCurrentFiber()\n const prevDeps = hook.d\n if (prevDeps !== undefined && depsEqual(prevDeps, deps)) return\n hook.d = deps\n const effect: Effect = {\n t: 1,\n c: () => {\n // Mirror useEffect: tear down the prior cleanup at run time so\n // coalesced renders don't leak side-fx.\n if (hook.c) {\n try { hook.c() } catch {}\n if (fiber.cu) {\n const i = fiber.cu.indexOf(hook.c)\n if (i >= 0) fiber.cu.splice(i, 1)\n }\n hook.c = null\n }\n const c = create()\n hook.c = typeof c == 'function' ? c : null\n return hook.c\n },\n }\n enqueueEffect(fiber, effect)\n },\n\n useInsertionEffect(create: () => any, deps?: ReadonlyArray<unknown>) {\n return this.useLayoutEffect(create, deps)\n },\n\n useRef<T>(initial: T) {\n const hook = nextHook()\n if (hook.s === undefined) hook.s = { current: initial }\n return hook.s as { current: T }\n },\n\n useMemo<T>(factory: () => T, deps?: ReadonlyArray<unknown>) {\n const hook = nextHook()\n if (hook.d !== undefined && depsEqual(hook.d, deps)) {\n return hook.s as T\n }\n const value = factory()\n hook.s = value\n hook.d = deps\n return value\n },\n\n useCallback<T extends Function>(fn: T, deps?: ReadonlyArray<unknown>): T {\n return this.useMemo(() => fn, deps) as T\n },\n\n useContext<T>(ctx: any): T {\n const fiber = getCurrentFiber()\n return readContext(fiber, ctx)\n },\n\n useImperativeHandle<T>(ref: any, factory: () => T, deps?: ReadonlyArray<unknown>) {\n const hook = nextHook()\n if (hook.d !== undefined && depsEqual(hook.d, deps)) return\n hook.d = deps\n const value = factory()\n if (ref) {\n if (typeof ref == 'function') ref(value)\n else ref.current = value\n }\n },\n\n useDebugValue<T>(_value: T, _formatter?: (v: T) => any): void {\n // noop\n },\n\n useId(): string {\n const hook = nextHook()\n if (hook.s === undefined) {\n const fiber = getCurrentFiber()\n const root = findRootFromFiber(fiber)\n hook.s = (root?.i ?? ':r') + (idCounter++).toString(36)\n }\n return hook.s as string\n },\n\n useTransition(): [boolean, (fn: () => void) => void] {\n return [false, (fn: () => void) => fn()]\n },\n\n useDeferredValue<T>(v: T): T {\n return v\n },\n\n useSyncExternalStore<T>(\n subscribe: (cb: () => void) => () => void,\n getSnapshot: () => T,\n getServerSnapshot?: () => T,\n ): T {\n const fiber = getCurrentFiber()\n const hook = nextHook()\n const store: {\n g: () => T\n s: (() => T) | undefined\n } = hook.q ?? {\n g: getSnapshot,\n s: getServerSnapshot,\n }\n hook.q = store\n store.g = getSnapshot\n store.s = getServerSnapshot\n\n // During hydration, use the server snapshot (if provided) so the tree\n // matches the SSR output. Components like TanStack Router's ClientOnly\n // rely on this: they render `false` on server, `true` on client \u2014 and\n // if we return `true` during hydration, client and server diverge and\n // the tree mounts fresh next to the SSR fallback DOM.\n const root = fiber.root ?? findRootFromFiber(fiber)\n const isHydrating = Boolean(root?.h)\n const value =\n isHydrating && getServerSnapshot ? getServerSnapshot() : getSnapshot()\n hook.s = value\n\n const deps = [subscribe]\n if (hook.d === undefined || !depsEqual(hook.d, deps)) {\n hook.d = deps\n const effect: Effect = {\n t: 1,\n c: () => {\n if (hook.c) {\n try {\n hook.c()\n } catch {\n // ignore cleanup failures\n }\n if (fiber.cu) {\n const i = fiber.cu.indexOf(hook.c)\n if (i >= 0) fiber.cu.splice(i, 1)\n }\n hook.c = null\n }\n\n let unsubscribed = false\n const cleanup = () => {\n unsubscribed = true\n if (typeof unsubscribe == 'function') {\n unsubscribe()\n }\n }\n const forceUpdate = () => {\n if (unsubscribed || fiber.um) {\n return\n }\n\n let next: T\n try {\n next = store.g()\n } catch {\n scheduleUpdate(fiber)\n return\n }\n\n if (!Object.is(hook.s, next)) {\n hook.s = next\n scheduleUpdate(fiber)\n }\n }\n const unsubscribe = subscribe(forceUpdate)\n\n // If we served the server snapshot, run a post-hydration check so\n // components like `useHydrated()` flip from false \u2192 true after the\n // initial render commits. Queued late so hydration finishes first.\n if (isHydrating && store.s) {\n queueMicrotask(() => queueMicrotask(forceUpdate))\n }\n\n forceUpdate()\n hook.c = cleanup\n return cleanup\n },\n }\n enqueueEffect(fiber, effect)\n }\n return value\n },\n\n use<T>(resource: any): T {\n if (resource == null) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('use() received null or undefined')\n }\n throw new Error()\n }\n if (resource.$$typeof === REACT_CONTEXT_TYPE) {\n return readContext(getCurrentFiber(), resource)\n }\n if (typeof resource.then == 'function') {\n const thenable = resource\n switch (thenable.status) {\n case 'fulfilled':\n return thenable.value\n case 'rejected':\n throw thenable.reason\n default: {\n if (thenable.status === undefined) {\n thenable.status = 'pending'\n thenable.then(\n (v: any) => {\n if (thenable.status === 'pending') {\n thenable.status = 'fulfilled'\n thenable.value = v\n }\n },\n (e: any) => {\n if (thenable.status === 'pending') {\n thenable.status = 'rejected'\n thenable.reason = e\n }\n },\n )\n }\n throw thenable\n }\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('use() expected a Promise or Context')\n }\n throw new Error()\n },\n }\n}\n\nfunction basicReducer<S>(state: S, action: BasicStateAction<S>): S {\n return typeof action == 'function' ? (action as (p: S) => S)(state) : action\n}\n\nlet idCounter = 0\n\nfunction findRootFromFiber(fiber: Fiber): FiberRoot | null {\n let f: Fiber | null = fiber\n while (f) {\n if (f.root) return f.root\n f = f.parent\n }\n return null\n}\n"],
5
- "mappings": ";AACA,SAAS,sBAAsB,0BAA0B;AACzD,SAAS,gBAAgB,eAAe,mBAAmB;AAE3D,SAAS,kBAAyB;AAChC,QAAM,IAAI,qBAAqB;AAC/B,MAAI,CAAC,GAAG;AACN,QAAI,MAAuC;AACzC,YAAM,IAAI,MAAM,kDAAkD;AAAA,IACpE;AACA,UAAM,IAAI,MAAM;AAAA,EAClB;AACA,SAAO;AACT;AAEA,SAAS,WAAiB;AACxB,QAAM,QAAQ,gBAAgB;AAC9B,QAAM,MAAM,qBAAqB;AAEjC,MAAI,OAAO,qBAAqB;AAEhC,MAAI,QAAQ,GAAG;AACb,QAAI,MAAM,OAAO;AACf,2BAAqB,IAAI,MAAM;AAC/B,aAAO,MAAM;AAAA,IACf;AACA,UAAMA,KAAU,EAAE,GAAG,QAAW,GAAG,QAAW,GAAG,QAAW,GAAG,QAAW,GAAG,KAAK;AAClF,UAAM,QAAQA;AACd,yBAAqB,IAAIA;AACzB,WAAOA;AAAA,EACT;AAEA,MAAI,QAAQ,KAAK,GAAG;AAClB,yBAAqB,IAAI,KAAK;AAC9B,WAAO,KAAK;AAAA,EACd;AAEA,QAAM,IAAU,EAAE,GAAG,QAAW,GAAG,QAAW,GAAG,QAAW,GAAG,QAAW,GAAG,KAAK;AAClF,MAAI,KAAM,MAAK,IAAI;AAAA,MACd,OAAM,QAAQ;AACnB,uBAAqB,IAAI;AACzB,SAAO;AACT;AAEA,SAAS,UACP,GACA,GACS;AACT,MAAI,MAAM,EAAG,QAAO;AACpB,MAAI,CAAC,KAAK,CAAC,EAAG,QAAO;AACrB,MAAI,EAAE,WAAW,EAAE,OAAQ,Q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ot, Effect } from '../core'\nimport { ReactSharedInternals, REACT_CONTEXT_TYPE } from '../react'\nimport { scheduleUpdate, enqueueEffect, readContext } from './reconcile'\n\nfunction getCurrentFiber(): Fiber {\n const f = ReactSharedInternals.F\n if (!f) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('Hook called outside a function component render.')\n }\n throw new Error()\n }\n return f\n}\n\nfunction nextHook(): Hook {\n const fiber = getCurrentFiber()\n const idx = ReactSharedInternals.I++\n\n let prev = ReactSharedInternals.K\n\n if (idx === 0) {\n if (fiber.hooks) {\n ReactSharedInternals.K = fiber.hooks\n return fiber.hooks\n }\n const h: Hook = { s: undefined, q: undefined, d: undefined, c: undefined, n: null }\n fiber.hooks = h\n ReactSharedInternals.K = h\n return h\n }\n\n if (prev && prev.n) {\n ReactSharedInternals.K = prev.n\n return prev.n\n }\n\n const h: Hook = { s: undefined, q: undefined, d: undefined, c: undefined, n: null }\n if (prev) prev.n = h\n else fiber.hooks = h\n ReactSharedInternals.K = h\n return h\n}\n\nfunction depsEqual(\n a: ReadonlyArray<unknown> | undefined,\n b: ReadonlyArray<unknown> | undefined,\n): boolean {\n if (a === b) return true\n if (!a || !b) return false\n if (a.length !== b.length) return false\n for (let i = 0; i < a.length; i++) {\n if (!Object.is(a[i], b[i])) return false\n }\n return true\n}\n\ntype BasicStateAction<S> = S | ((p: S) => S)\n\n// Singleton \u2014 every method reads render context via ReactSharedInternals,\n// and per-hook closures live on the hook itself, so nothing is render-local\n// to capture. Allocating a fresh wrapper + 17 method closures per function-\n// component render was pure GC pressure.\nconst DISPATCHER = makeDispatcherImpl()\n\nexport function makeDispatcher() {\n return DISPATCHER\n}\n\nfunction makeDispatcherImpl() {\n return {\n useState<S>(initial: S | (() => S)): [S, (a: BasicStateAction<S>) => void] {\n return this.useReducer(\n basicReducer as (state: S, action: BasicStateAction<S>) => S,\n typeof initial == 'function' ? (initial as () => S)() : initial,\n )\n },\n\n useReducer<S, A>(reducer: (s: S, a: A) => S, initialArg: any, init?: (a: any) => S) {\n const hook = nextHook()\n const fiber = getCurrentFiber()\n if (hook.q === undefined) {\n hook.s = init ? init(initialArg) : initialArg\n const queue: any = { r: reducer }\n const dispatch = (action: A) => {\n const currentState = hook.s as S\n const next = queue.r(currentState, action)\n if (!Object.is(next, currentState)) {\n hook.s = next\n scheduleUpdate(fiber)\n }\n }\n queue.d = dispatch\n hook.q = queue\n } else {\n hook.q.r = reducer\n }\n return [hook.s, hook.q.d] as [S, (a: A) => void]\n },\n\n useEffect(create: () => any, deps?: ReadonlyArray<unknown>) {\n const hook = nextHook()\n const fiber = getCurrentFiber()\n const prevDeps = hook.d\n if (prevDeps !== undefined && depsEqual(prevDeps, deps)) return\n hook.d = deps\n const effect: Effect = {\n t: 0,\n c: () => {\n // Run the prior cleanup INSIDE the effect run, not during the\n // dispatch/render phase. If render A \u2192 B \u2192 C all happen back-to-\n // back before the passive microtask drains, dispatch-time cleanup\n // only fires once (between A\u2192B) and fx B + C both run fresh,\n // leaving two side-fx (e.g. two plot SVGs) in the DOM. Doing\n // it here, at effect-run time, means every new create first tears\n // down whatever cleanup is currently live on the hook.\n if (hook.c) {\n try { hook.c() } catch {}\n // The prior cleanup was also pushed onto fiber.cu; remove\n // it so unmount doesn't double-call it.\n if (fiber.cu) {\n const i = fiber.cu.indexOf(hook.c)\n if (i >= 0) fiber.cu.splice(i, 1)\n }\n hook.c = null\n }\n const c = create()\n hook.c = typeof c == 'function' ? c : null\n return hook.c\n },\n }\n enqueueEffect(fiber, effect)\n },\n\n useLayoutEffect(create: () => any, deps?: ReadonlyArray<unknown>) {\n const hook = nextHook()\n const fiber = getCurrentFiber()\n const prevDeps = hook.d\n if (prevDeps !== undefined && depsEqual(prevDeps, deps)) return\n hook.d = deps\n const effect: Effect = {\n t: 1,\n c: () => {\n // Mirror useEffect: tear down the prior cleanup at run time so\n // coalesced renders don't leak side-fx.\n if (hook.c) {\n try { hook.c() } catch {}\n if (fiber.cu) {\n const i = fiber.cu.indexOf(hook.c)\n if (i >= 0) fiber.cu.splice(i, 1)\n }\n hook.c = null\n }\n const c = create()\n hook.c = typeof c == 'function' ? c : null\n return hook.c\n },\n }\n enqueueEffect(fiber, effect)\n },\n\n useInsertionEffect(create: () => any, deps?: ReadonlyArray<unknown>) {\n return this.useLayoutEffect(create, deps)\n },\n\n useRef<T>(initial: T) {\n const hook = nextHook()\n if (hook.s === undefined) hook.s = { current: initial }\n return hook.s as { current: T }\n },\n\n useMemo<T>(factory: () => T, deps?: ReadonlyArray<unknown>) {\n const hook = nextHook()\n if (hook.d !== undefined && depsEqual(hook.d, deps)) {\n return hook.s as T\n }\n const value = factory()\n hook.s = value\n hook.d = deps\n return value\n },\n\n useCallback<T extends Function>(fn: T, deps?: ReadonlyArray<unknown>): T {\n return this.useMemo(() => fn, deps) as T\n },\n\n useContext<T>(ctx: any): T {\n const fiber = getCurrentFiber()\n return readContext(fiber, ctx)\n },\n\n useImperativeHandle<T>(ref: any, factory: () => T, deps?: ReadonlyArray<unknown>) {\n const hook = nextHook()\n if (hook.d !== undefined && depsEqual(hook.d, deps)) return\n hook.d = deps\n const value = factory()\n if (ref) {\n if (typeof ref == 'function') ref(value)\n else ref.current = value\n }\n },\n\n useDebugValue<T>(_value: T, _formatter?: (v: T) => any): void {\n // noop\n },\n\n useId(): string {\n const hook = nextHook()\n if (hook.s === undefined) {\n const fiber = getCurrentFiber()\n const root = findRootFromFiber(fiber)\n hook.s = root\n ? root.i + (root.ic++).toString(36)\n : ':r' + (idCounter++).toString(36)\n }\n return hook.s as string\n },\n\n useTransition(): [boolean, (fn: () => void) => void] {\n return [false, (fn: () => void) => fn()]\n },\n\n useDeferredValue<T>(v: T): T {\n return v\n },\n\n useSyncExternalStore<T>(\n subscribe: (cb: () => void) => () => void,\n getSnapshot: () => T,\n getServerSnapshot?: () => T,\n ): T {\n const fiber = getCurrentFiber()\n const hook = nextHook()\n const store: {\n g: () => T\n s: (() => T) | undefined\n } = hook.q ?? {\n g: getSnapshot,\n s: getServerSnapshot,\n }\n hook.q = store\n store.g = getSnapshot\n store.s = getServerSnapshot\n\n // During hydration, use the server snapshot (if provided) so the tree\n // matches the SSR output. Components like TanStack Router's ClientOnly\n // rely on this: they render `false` on server, `true` on client \u2014 and\n // if we return `true` during hydration, client and server diverge and\n // the tree mounts fresh next to the SSR fallback DOM.\n const root = fiber.root ?? findRootFromFiber(fiber)\n const isHydrating = Boolean(root?.h)\n const value =\n isHydrating && getServerSnapshot ? getServerSnapshot() : getSnapshot()\n hook.s = value\n\n const deps = [subscribe]\n if (hook.d === undefined || !depsEqual(hook.d, deps)) {\n hook.d = deps\n const effect: Effect = {\n t: 1,\n c: () => {\n if (hook.c) {\n try {\n hook.c()\n } catch {\n // ignore cleanup failures\n }\n if (fiber.cu) {\n const i = fiber.cu.indexOf(hook.c)\n if (i >= 0) fiber.cu.splice(i, 1)\n }\n hook.c = null\n }\n\n let unsubscribed = false\n const cleanup = () => {\n unsubscribed = true\n if (typeof unsubscribe == 'function') {\n unsubscribe()\n }\n }\n const forceUpdate = () => {\n if (unsubscribed || fiber.um) {\n return\n }\n\n let next: T\n try {\n next = store.g()\n } catch {\n scheduleUpdate(fiber)\n return\n }\n\n if (!Object.is(hook.s, next)) {\n hook.s = next\n scheduleUpdate(fiber)\n }\n }\n const unsubscribe = subscribe(forceUpdate)\n\n // If we served the server snapshot, run a post-hydration check so\n // components like `useHydrated()` flip from false \u2192 true after the\n // initial render commits. Queued late so hydration finishes first.\n if (isHydrating && store.s) {\n queueMicrotask(() => queueMicrotask(forceUpdate))\n }\n\n forceUpdate()\n hook.c = cleanup\n return cleanup\n },\n }\n enqueueEffect(fiber, effect)\n }\n return value\n },\n\n use<T>(resource: any): T {\n if (resource == null) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('use() received null or undefined')\n }\n throw new Error()\n }\n if (resource.$$typeof === REACT_CONTEXT_TYPE) {\n return readContext(getCurrentFiber(), resource)\n }\n if (typeof resource.then == 'function') {\n const thenable = resource\n switch (thenable.status) {\n case 'fulfilled':\n return thenable.value\n case 'rejected':\n throw thenable.reason\n default: {\n if (thenable.status === undefined) {\n thenable.status = 'pending'\n thenable.then(\n (v: any) => {\n if (thenable.status === 'pending') {\n thenable.status = 'fulfilled'\n thenable.value = v\n }\n },\n (e: any) => {\n if (thenable.status === 'pending') {\n thenable.status = 'rejected'\n thenable.reason = e\n }\n },\n )\n }\n throw thenable\n }\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('use() expected a Promise or Context')\n }\n throw new Error()\n },\n }\n}\n\nfunction basicReducer<S>(state: S, action: BasicStateAction<S>): S {\n return typeof action == 'function' ? (action as (p: S) => S)(state) : action\n}\n\nlet idCounter = 0\n\nfunction findRootFromFiber(fiber: Fiber): FiberRoot | null {\n let f: Fiber | null = fiber\n while (f) {\n if (f.root) return f.root\n f = f.parent\n }\n return null\n}\n"],
5
+ "mappings": ";AACA,SAAS,sBAAsB,0BAA0B;AACzD,SAAS,gBAAgB,eAAe,mBAAmB;AAE3D,SAAS,kBAAyB;AAChC,QAAM,IAAI,qBAAqB;AAC/B,MAAI,CAAC,GAAG;AACN,QAAI,MAAuC;AACzC,YAAM,IAAI,MAAM,kDAAkD;AAAA,IACpE;AACA,UAAM,IAAI,MAAM;AAAA,EAClB;AACA,SAAO;AACT;AAEA,SAAS,WAAiB;AACxB,QAAM,QAAQ,gBAAgB;AAC9B,QAAM,MAAM,qBAAqB;AAEjC,MAAI,OAAO,qBAAqB;AAEhC,MAAI,QAAQ,GAAG;AACb,QAAI,MAAM,OAAO;AACf,2BAAqB,IAAI,MAAM;AAC/B,aAAO,MAAM;AAAA,IACf;AACA,UAAMA,KAAU,EAAE,GAAG,QAAW,GAAG,QAAW,GAAG,QAAW,GAAG,QAAW,GAAG,KAAK;AAClF,UAAM,QAAQA;AACd,yBAAqB,IAAIA;AACzB,WAAOA;AAAA,EACT;AAEA,MAAI,QAAQ,KAAK,GAAG;AAClB,yBAAqB,IAAI,KAAK;AAC9B,WAAO,KAAK;A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qC;AAAA,MACvD;AACA,YAAM,IAAI,MAAM;AAAA,IAClB;AAAA,EACF;AACF;AAEA,SAAS,aAAgB,OAAU,QAAgC;AACjE,SAAO,OAAO,UAAU,aAAc,OAAuB,KAAK,IAAI;AACxE;AAEA,IAAI,YAAY;AAEhB,SAAS,kBAAkB,OAAgC;AACzD,MAAI,IAAkB;AACtB,SAAO,GAAG;AACR,QAAI,EAAE,KAAM,QAAO,EAAE;AACrB,QAAI,EAAE;AAAA,EACR;AACA,SAAO;AACT;",
6
6
  "names": ["h"]
7
7
  }
package/dist/dom/dom.js CHANGED
@@ -1,4 +1,5 @@
1
1
  // packages/redact/src/dom/dom.ts
2
+ import { attributeName } from "../core/attributes";
2
3
  var SVG_NS = "http://www.w3.org/2000/svg";
3
4
  var BOOLEAN_ATTRS = /* @__PURE__ */ new Set([
4
5
  "allowfullscreen",
@@ -50,6 +51,7 @@ function isSvgElement(el) {
50
51
  }
51
52
  function setProp(el, name, next, prev, isSvg) {
52
53
  if (name === "children" || name === "key" || name === "ref") return;
54
+ const attr = attributeName(name, isSvg);
53
55
  if (name === "defaultValue" || name === "defaultChecked") {
54
56
  if (prev === void 0 && next != null) {
55
57
  try {
@@ -103,26 +105,26 @@ function setProp(el, name, next, prev, isSvg) {
103
105
  }
104
106
  }
105
107
  if (BOOLEAN_ATTRS.has(name.toLowerCase())) {
106
- if (next) el.setAttribute(name, "");
107
- else el.removeAttribute(name);
108
+ if (next) el.setAttribute(attr, "");
109
+ else el.removeAttribute(attr);
108
110
  return;
109
111
  }
110
112
  if (name.length > 5 && (name.charCodeAt(0) === 97 || name.charCodeAt(0) === 100)) {
111
113
  if (name.startsWith("aria-") || name.startsWith("data-")) {
112
114
  if (next == null) {
113
- el.removeAttribute(name);
115
+ el.removeAttribute(attr);
114
116
  } else {
115
- el.setAttribute(name, "" + next);
117
+ el.setAttribute(attr, "" + next);
116
118
  }
117
119
  return;
118
120
  }
119
121
  }
120
122
  if (next == null || next === false) {
121
- el.removeAttribute(name);
123
+ el.removeAttribute(attr);
122
124
  } else if (next === true) {
123
- el.setAttribute(name, "");
125
+ el.setAttribute(attr, "");
124
126
  } else {
125
- el.setAttribute(name, "" + next);
127
+ el.setAttribute(attr, "" + next);
126
128
  }
127
129
  }
128
130
  function setStyle(el, next, prev) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/dom/dom.ts"],
4
- "sourcesContent": ["const SVG_NS = 'http://www.w3.org/2000/svg'\n\nconst BOOLEAN_ATTRS = new Set([\n 'allowfullscreen',\n 'async',\n 'autofocus',\n 'autoplay',\n 'checked',\n 'controls',\n 'default',\n 'defer',\n 'disabled',\n 'formnovalidate',\n 'hidden',\n 'inert',\n 'ismap',\n 'itemscope',\n 'loop',\n 'multiple',\n 'muted',\n 'nomodule',\n 'novalidate',\n 'open',\n 'playsinline',\n 'readonly',\n 'required',\n 'reversed',\n 'selected',\n])\n\nconst IDL_ATTRS = new Set([\n 'value',\n 'checked',\n 'selected',\n 'disabled',\n 'multiple',\n 'muted',\n 'readonly',\n 'contentEditable',\n 'spellcheck',\n 'draggable',\n])\n\nexport function createHostNode(type: string, isSvg: boolean): Element {\n if (isSvg || type === 'svg') {\n return document.createElementNS(SVG_NS, type)\n }\n return document.createElement(type)\n}\n\nexport function isSvgElement(el: Element): boolean {\n return (el as any).ownerSVGElement !== undefined || el.tagName === 'svg'\n}\n\nexport function setProp(\n el: Element,\n name: string,\n next: any,\n prev: any,\n isSvg: boolean,\n): void {\n if (name === 'children' || name === 'key' || name === 'ref') return\n\n // defaultValue / defaultChecked are IDL-property-only \u2014 they seed the\n // initial value/checked of a form control on first mount and must NOT be\n // emitted as HTML attributes (which would leak as `defaultValue=\"...\"`).\n // Setting `el.defaultValue` on a fresh control also sets the initial\n // `el.value`, which is what consumers expect. Skip on hydrated DOM so we\n // don't clobber a live user-typed value.\n if (name === 'defaultValue' || name === 'defaultChecked') {\n if (prev === undefined && next != null) {\n try {\n ;(el as any)[name] = next\n } catch {}\n }\n return\n }\n\n if (name === 'className') {\n if (isSvg) {\n if (next == null) el.removeAttribute('class')\n else el.setAttribute('class', '' + next)\n } else {\n ;(el as HTMLElement).className = next == null ? '' : '' + next\n }\n return\n }\n\n if (name === 'class') {\n if (next == null) el.removeAttribute('class')\n else el.setAttribute('class', '' + next)\n return\n }\n\n if (name === 'style') {\n setStyle(el as HTMLElement, next, prev)\n return\n }\n\n if (name === 'dangerouslySetInnerHTML') {\n const nextHtml = next?.__html ?? ''\n const prevHtml = prev?.__html ?? ''\n if (nextHtml !== prevHtml) (el as HTMLElement).innerHTML = nextHtml\n return\n }\n\n if (name[0] === 'o' && name[1] === 'n') {\n setEventHandler(el, name, next, prev)\n return\n }\n\n if (name === 'htmlFor') {\n if (next == null) el.removeAttribute('for')\n else el.setAttribute('for', '' + next)\n return\n }\n\n if (!isSvg && IDL_ATTRS.has(name) && name in el) {\n try {\n ;(el as any)[name] = next == null ? '' : next\n return\n } catch {}\n }\n\n if (BOOLEAN_ATTRS.has(name.toLowerCase())) {\n if (next) el.setAttribute(name, '')\n else el.removeAttribute(name)\n return\n }\n\n // aria-* and data-* attributes stringify booleans to `\"true\"`/`\"false\"`\n // rather than using the HTML boolean-attribute presence/absence semantics.\n // This matches React and the ARIA spec (aria-hidden=\"false\" is meaningful).\n if (name.length > 5 && (name.charCodeAt(0) === 97 /* a */ || name.charCodeAt(0) === 100 /* d */)) {\n if (name.startsWith('aria-') || name.startsWith('data-')) {\n if (next == null) {\n el.removeAttribute(name)\n } else {\n el.setAttribute(name, '' + next)\n }\n return\n }\n }\n\n if (next == null || next === false) {\n el.removeAttribute(name)\n } else if (next === true) {\n el.setAttribute(name, '')\n } else {\n el.setAttribute(name, '' + next)\n }\n}\n\nfunction setStyle(el: HTMLElement, next: any, prev: any): void {\n const style = el.style\n if (typeof next === 'string') {\n style.cssText = next\n return\n }\n if (typeof prev === 'string') style.cssText = ''\n if (prev && typeof prev === 'object') {\n for (const k in prev) {\n if (!next || !(k in next)) setStyleProperty(style, k, '')\n }\n }\n if (next && typeof next === 'object') {\n for (const k in next) {\n if (!prev || prev[k] !== next[k]) setStyleProperty(style, k, next[k])\n }\n }\n}\n\nfunction setStyleProperty(style: CSSStyleDeclaration, key: string, value: any): void {\n if (key[0] === '-') {\n style.setProperty(key, value == null ? '' : '' + value)\n } else if (value == null || value === '') {\n ;(style as any)[key] = ''\n } else if (typeof value === 'number' && !UNITLESS_STYLE.has(key)) {\n ;(style as any)[key] = value + 'px'\n } else {\n ;(style as any)[key] = '' + value\n }\n}\n\nconst UNITLESS_STYLE = new Set([\n 'animationIterationCount',\n 'borderImageOutset',\n 'borderImageSlice',\n 'borderImageWidth',\n 'boxFlex',\n 'boxFlexGroup',\n 'boxOrdinalGroup',\n 'columnCount',\n 'columns',\n 'flex',\n 'flexGrow',\n 'flexPositive',\n 'flexShrink',\n 'flexNegative',\n 'flexOrder',\n 'gridArea',\n 'gridRow',\n 'gridRowEnd',\n 'gridRowSpan',\n 'gridRowStart',\n 'gridColumn',\n 'gridColumnEnd',\n 'gridColumnSpan',\n 'gridColumnStart',\n 'fontWeight',\n 'lineClamp',\n 'lineHeight',\n 'opacity',\n 'order',\n 'orphans',\n 'tabSize',\n 'widows',\n 'zIndex',\n 'zoom',\n 'fillOpacity',\n 'floodOpacity',\n 'stopOpacity',\n 'strokeDasharray',\n 'strokeDashoffset',\n 'strokeMiterlimit',\n 'strokeOpacity',\n 'strokeWidth',\n])\n\nexport interface SyntheticEvent extends Event {\n nativeEvent: Event\n isDefaultPrevented(): boolean\n isPropagationStopped(): boolean\n persist(): void\n currentTarget: EventTarget & Element\n}\n\nfunction setEventHandler(el: Element, name: string, next: any, prev: any): void {\n // Only function handlers are accepted. Reject strings/objects/etc \u2014 the\n // legacy `onclick=\"...\"` HTML attribute (string handler) is a known XSS\n // vector if a parent spreads untrusted props onto a host element. React\n // also ignores non-function handlers.\n if (next != null && typeof next != 'function') next = null\n\n const capture = name.endsWith('Capture')\n const reactEventName = name.slice(2, capture ? -7 : undefined)\n const eventName = domEventFor(reactEventName, el)\n\n // Key by the React prop name (not DOM event name) so `onChange` and\n // `onInput` on the same text input \u2014 which both dispatch from the native\n // `input` event \u2014 can coexist without clobbering each other's handlers.\n const handlers = ((el as any).__handlers ||= Object.create(null))\n const key = name\n\n const existing = handlers[key]\n\n if (existing && !next) {\n el.removeEventListener(existing.event, existing.listener, existing.capture)\n handlers[key] = null\n return\n }\n\n if (!existing && next) {\n const entry = {\n current: next as Function,\n listener: null as any,\n event: eventName,\n capture,\n }\n entry.listener = (e: Event) => {\n // React hands handlers a SyntheticEvent that carries `.nativeEvent`.\n // Many libraries check `event.nativeEvent.isComposing` (react-instantsearch)\n // or `event.nativeEvent.shiftKey` (UI kits) \u2014 without the alias they throw\n // on `undefined.foo`. Aliasing the native event to itself is the cheapest\n // way to satisfy the shape without building a full synthetic layer.\n if ((e as any).nativeEvent === undefined) (e as any).nativeEvent = e\n entry.current(e)\n }\n handlers[key] = entry\n el.addEventListener(eventName, entry.listener, capture)\n return\n }\n\n if (existing) {\n // Re-bind if the effective DOM event changed (e.g. <input> whose `type`\n // flipped from \"text\" to \"checkbox\" \u2014 onChange should now follow `change`\n // instead of `input`). This is rare but keeps semantics correct.\n if (existing.event !== eventName || existing.capture !== capture) {\n el.removeEventListener(existing.event, existing.listener, existing.capture)\n existing.event = eventName\n existing.capture = capture\n el.addEventListener(eventName, existing.listener, capture)\n }\n existing.current = next\n }\n}\n\nfunction domEventFor(reactEventName: string, el: Element): string {\n const lower = reactEventName.toLowerCase()\n // React's `onChange` on text-like <input> and <textarea> maps to the\n // native `input` event so handlers fire on every keystroke. On checkbox,\n // radio, file inputs, and <select>, React's `onChange` maps to the\n // native `change` event (which fires on click / option select).\n if (lower === 'change') {\n const tag = el.tagName\n if (tag === 'TEXTAREA') return 'input'\n if (tag === 'INPUT') {\n const type = ((el as HTMLInputElement).type || 'text').toLowerCase()\n if (type !== 'checkbox' && type !== 'radio' && type !== 'file') {\n return 'input'\n }\n }\n }\n if (lower === 'doubleclick') return 'dblclick'\n return lower\n}\n"],
5
- "mappings": ";AAAA,IAAM,SAAS;AAEf,IAAM,gBAAgB,oBAAI,IAAI;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAED,IAAM,YAAY,oBAAI,IAAI;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAEM,SAAS,eAAe,MAAc,OAAyB;AACpE,MAAI,SAAS,SAAS,OAAO;AAC3B,WAAO,SAAS,gBAAgB,QAAQ,IAAI;AAAA,EAC9C;AACA,SAAO,SAAS,cAAc,IAAI;AACpC;AAEO,SAAS,aAAa,IAAsB;AACjD,SAAQ,GAAW,oBAAoB,UAAa,GAAG,YAAY;AACrE;AAEO,SAAS,QACd,IACA,MACA,MACA,MACA,OACM;AACN,MAAI,SAAS,cAAc,SAAS,SAAS,SAAS,MAAO;AAQ7D,MAAI,SAAS,kBAAkB,SAAS,kBAAkB;AACxD,QAAI,SAAS,UAAa,QAAQ,MAAM;AACtC,UAAI;AACF;AAAC,QAAC,GAAW,IAAI,IAAI;AAAA,MACvB,QAAQ;AAAA,MAAC;AAAA,IACX;AACA;AAAA,EACF;AAEA,MAAI,SAAS,aAAa;AACxB,QAAI,OAAO;AACT,UAAI,QAAQ,KAAM,IAAG,gBAAgB,OAAO;AAAA,UACvC,IAAG,aAAa,SAAS,KAAK,IAAI;AAAA,IACzC,OAAO;AACL;AAAC,MAAC,GAAmB,YAAY,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AAU,aAAa,SAAS,YAAY,SAAS;AAChE,SAAG,oBAAoB,SAAS,OAAO,SAAS,UAAU,SAAS,OAAO;AAC1E,eAAS,QAAQ;AACjB,eAAS,UAAU;AACnB,SAAG,iBAAiB,WAAW,SAAS,UAAU,OAAO;AAAA,IAC3D;AACA,aAAS,UAAU;AAAA,EACrB;AACF;AAEA,SAAS,YAAY,gBAAwB,IAAqB;AAChE,QAAM,QAAQ,eAAe,YAAY;AAKzC,MAAI,UAAU,UAAU;AACtB,UAAM,MAAM,GAAG;AACf,QAAI,QAAQ,WAAY,QAAO;AAC/B,QAAI,QAAQ,SAAS;AACnB,YAAM,QAAS,GAAwB,QAAQ,QAAQ,YAAY;AACnE,UAAI,SAAS,cAAc,SAAS,WAAW,SAAS,QAAQ;AAC9D,eAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AACA,MAAI,UAAU,cAAe,QAAO;AACpC,SAAO;AACT;",
4
+ "sourcesContent": ["import { attributeName } from '../core/attributes'\n\nconst SVG_NS = 'http://www.w3.org/2000/svg'\n\nconst BOOLEAN_ATTRS = new Set([\n 'allowfullscreen',\n 'async',\n 'autofocus',\n 'autoplay',\n 'checked',\n 'controls',\n 'default',\n 'defer',\n 'disabled',\n 'formnovalidate',\n 'hidden',\n 'inert',\n 'ismap',\n 'itemscope',\n 'loop',\n 'multiple',\n 'muted',\n 'nomodule',\n 'novalidate',\n 'open',\n 'playsinline',\n 'readonly',\n 'required',\n 'reversed',\n 'selected',\n])\n\nconst IDL_ATTRS = new Set([\n 'value',\n 'checked',\n 'selected',\n 'disabled',\n 'multiple',\n 'muted',\n 'readonly',\n 'contentEditable',\n 'spellcheck',\n 'draggable',\n])\n\nexport function createHostNode(type: string, isSvg: boolean): Element {\n if (isSvg || type === 'svg') {\n return document.createElementNS(SVG_NS, type)\n }\n return document.createElement(type)\n}\n\nexport function isSvgElement(el: Element): boolean {\n return (el as any).ownerSVGElement !== undefined || el.tagName === 'svg'\n}\n\nexport function setProp(\n el: Element,\n name: string,\n next: any,\n prev: any,\n isSvg: boolean,\n): void {\n if (name === 'children' || name === 'key' || name === 'ref') return\n const attr = attributeName(name, isSvg)\n\n // defaultValue / defaultChecked are IDL-property-only \u2014 they seed the\n // initial value/checked of a form control on first mount and must NOT be\n // emitted as HTML attributes (which would leak as `defaultValue=\"...\"`).\n // Setting `el.defaultValue` on a fresh control also sets the initial\n // `el.value`, which is what consumers expect. Skip on hydrated DOM so we\n // don't clobber a live user-typed value.\n if (name === 'defaultValue' || name === 'defaultChecked') {\n if (prev === undefined && next != null) {\n try {\n ;(el as any)[name] = next\n } catch {}\n }\n return\n }\n\n if (name === 'className') {\n if (isSvg) {\n if (next == null) el.removeAttribute('class')\n else el.setAttribute('class', '' + next)\n } else {\n ;(el as HTMLElement).className = next == null ? '' : '' + next\n }\n return\n }\n\n if (name === 'class') {\n if (next == null) el.removeAttribute('class')\n else el.setAttribute('class', '' + next)\n return\n }\n\n if (name === 'style') {\n setStyle(el as HTMLElement, next, prev)\n return\n }\n\n if (name === 'dangerouslySetInnerHTML') {\n const nextHtml = next?.__html ?? ''\n const prevHtml = prev?.__html ?? ''\n if (nextHtml !== prevHtml) (el as HTMLElement).innerHTML = nextHtml\n return\n }\n\n if (name[0] === 'o' && name[1] === 'n') {\n setEventHandler(el, name, next, prev)\n return\n }\n\n if (name === 'htmlFor') {\n if (next == null) el.removeAttribute('for')\n else el.setAttribute('for', '' + next)\n return\n }\n\n if (!isSvg && IDL_ATTRS.has(name) && name in el) {\n try {\n ;(el as any)[name] = next == null ? '' : next\n return\n } catch {}\n }\n\n if (BOOLEAN_ATTRS.has(name.toLowerCase())) {\n if (next) el.setAttribute(attr, '')\n else el.removeAttribute(attr)\n return\n }\n\n // aria-* and data-* attributes stringify booleans to `\"true\"`/`\"false\"`\n // rather than using the HTML boolean-attribute presence/absence semantics.\n // This matches React and the ARIA spec (aria-hidden=\"false\" is meaningful).\n if (name.length > 5 && (name.charCodeAt(0) === 97 /* a */ || name.charCodeAt(0) === 100 /* d */)) {\n if (name.startsWith('aria-') || name.startsWith('data-')) {\n if (next == null) {\n el.removeAttribute(attr)\n } else {\n el.setAttribute(attr, '' + next)\n }\n return\n }\n }\n\n if (next == null || next === false) {\n el.removeAttribute(attr)\n } else if (next === true) {\n el.setAttribute(attr, '')\n } else {\n el.setAttribute(attr, '' + next)\n }\n}\n\nfunction setStyle(el: HTMLElement, next: any, prev: any): void {\n const style = el.style\n if (typeof next === 'string') {\n style.cssText = next\n return\n }\n if (typeof prev === 'string') style.cssText = ''\n if (prev && typeof prev === 'object') {\n for (const k in prev) {\n if (!next || !(k in next)) setStyleProperty(style, k, '')\n }\n }\n if (next && typeof next === 'object') {\n for (const k in next) {\n if (!prev || prev[k] !== next[k]) setStyleProperty(style, k, next[k])\n }\n }\n}\n\nfunction setStyleProperty(style: CSSStyleDeclaration, key: string, value: any): void {\n if (key[0] === '-') {\n style.setProperty(key, value == null ? '' : '' + value)\n } else if (value == null || value === '') {\n ;(style as any)[key] = ''\n } else if (typeof value === 'number' && !UNITLESS_STYLE.has(key)) {\n ;(style as any)[key] = value + 'px'\n } else {\n ;(style as any)[key] = '' + value\n }\n}\n\nconst UNITLESS_STYLE = new Set([\n 'animationIterationCount',\n 'borderImageOutset',\n 'borderImageSlice',\n 'borderImageWidth',\n 'boxFlex',\n 'boxFlexGroup',\n 'boxOrdinalGroup',\n 'columnCount',\n 'columns',\n 'flex',\n 'flexGrow',\n 'flexPositive',\n 'flexShrink',\n 'flexNegative',\n 'flexOrder',\n 'gridArea',\n 'gridRow',\n 'gridRowEnd',\n 'gridRowSpan',\n 'gridRowStart',\n 'gridColumn',\n 'gridColumnEnd',\n 'gridColumnSpan',\n 'gridColumnStart',\n 'fontWeight',\n 'lineClamp',\n 'lineHeight',\n 'opacity',\n 'order',\n 'orphans',\n 'tabSize',\n 'widows',\n 'zIndex',\n 'zoom',\n 'fillOpacity',\n 'floodOpacity',\n 'stopOpacity',\n 'strokeDasharray',\n 'strokeDashoffset',\n 'strokeMiterlimit',\n 'strokeOpacity',\n 'strokeWidth',\n])\n\nexport interface SyntheticEvent extends Event {\n nativeEvent: Event\n isDefaultPrevented(): boolean\n isPropagationStopped(): boolean\n persist(): void\n currentTarget: EventTarget & Element\n}\n\nfunction setEventHandler(el: Element, name: string, next: any, prev: any): void {\n // Only function handlers are accepted. Reject strings/objects/etc \u2014 the\n // legacy `onclick=\"...\"` HTML attribute (string handler) is a known XSS\n // vector if a parent spreads untrusted props onto a host element. React\n // also ignores non-function handlers.\n if (next != null && typeof next != 'function') next = null\n\n const capture = name.endsWith('Capture')\n const reactEventName = name.slice(2, capture ? -7 : undefined)\n const eventName = domEventFor(reactEventName, el)\n\n // Key by the React prop name (not DOM event name) so `onChange` and\n // `onInput` on the same text input \u2014 which both dispatch from the native\n // `input` event \u2014 can coexist without clobbering each other's handlers.\n const handlers = ((el as any).__handlers ||= Object.create(null))\n const key = name\n\n const existing = handlers[key]\n\n if (existing && !next) {\n el.removeEventListener(existing.event, existing.listener, existing.capture)\n handlers[key] = null\n return\n }\n\n if (!existing && next) {\n const entry = {\n current: next as Function,\n listener: null as any,\n event: eventName,\n capture,\n }\n entry.listener = (e: Event) => {\n // React hands handlers a SyntheticEvent that carries `.nativeEvent`.\n // Many libraries check `event.nativeEvent.isComposing` (react-instantsearch)\n // or `event.nativeEvent.shiftKey` (UI kits) \u2014 without the alias they throw\n // on `undefined.foo`. Aliasing the native event to itself is the cheapest\n // way to satisfy the shape without building a full synthetic layer.\n if ((e as any).nativeEvent === undefined) (e as any).nativeEvent = e\n entry.current(e)\n }\n handlers[key] = entry\n el.addEventListener(eventName, entry.listener, capture)\n return\n }\n\n if (existing) {\n // Re-bind if the effective DOM event changed (e.g. <input> whose `type`\n // flipped from \"text\" to \"checkbox\" \u2014 onChange should now follow `change`\n // instead of `input`). This is rare but keeps semantics correct.\n if (existing.event !== eventName || existing.capture !== capture) {\n el.removeEventListener(existing.event, existing.listener, existing.capture)\n existing.event = eventName\n existing.capture = capture\n el.addEventListener(eventName, existing.listener, capture)\n }\n existing.current = next\n }\n}\n\nfunction domEventFor(reactEventName: string, el: Element): string {\n const lower = reactEventName.toLowerCase()\n // React's `onChange` on text-like <input> and <textarea> maps to the\n // native `input` event so handlers fire on every keystroke. On checkbox,\n // radio, file inputs, and <select>, React's `onChange` maps to the\n // native `change` event (which fires on click / option select).\n if (lower === 'change') {\n const tag = el.tagName\n if (tag === 'TEXTAREA') return 'input'\n if (tag === 'INPUT') {\n const type = ((el as HTMLInputElement).type || 'text').toLowerCase()\n if (type !== 'checkbox' && type !== 'radio' && type !== 'file') {\n return 'input'\n }\n }\n }\n if (lower === 'doubleclick') return 'dblclick'\n return lower\n}\n"],
5
+ "mappings": ";AAAA,SAAS,qBAAqB;AAE9B,IAAM,SAAS;AAEf,IAAM,gBAAgB,oBAAI,IAAI;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAED,IAAM,YAAY,oBAAI,IAAI;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAEM,SAAS,eAAe,MAAc,OAAyB;AACpE,MAAI,SAAS,SAAS,OAAO;AAC3B,WAAO,SAAS,gBAAgB,QAAQ,IAAI;AAAA,EAC9C;AACA,SAAO,SAAS,cAAc,IAAI;AACpC;AAEO,SAAS,aAAa,IAAsB;AACjD,SAAQ,GAAW,oBAAoB,UAAa,GAAG,YAAY;AACrE;AAEO,SAAS,QACd,IACA,MACA,MACA,MACA,OACM;AACN,MAAI,S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AO,SAAS,UAAU,SAAS,OAAO;AAC1E,aAAS,GAAG,IAAI;AAChB;AAAA,EACF;AAEA,MAAI,CAAC,YAAY,MAAM;AACrB,UAAM,QAAQ;AAAA,MACZ,SAAS;AAAA,MACT,UAAU;AAAA,MACV,OAAO;AAAA,MACP;AAAA,IACF;AACA,UAAM,WAAW,CAAC,MAAa;AAM7B,UAAK,EAAU,gBAAgB,OAAW,CAAC,EAAU,cAAc;AACnE,YAAM,QAAQ,CAAC;AAAA,IACjB;AACA,aAAS,GAAG,IAAI;AAChB,OAAG,iBAAiB,WAAW,MAAM,UAAU,OAAO;AACtD;AAAA,EACF;AAEA,MAAI,UAAU;AAIZ,QAAI,SAAS,UAAU,aAAa,SAAS,YAAY,SAAS;AAChE,SAAG,oBAAoB,SAAS,OAAO,SAAS,UAAU,SAAS,OAAO;AAC1E,eAAS,QAAQ;AACjB,eAAS,UAAU;AACnB,SAAG,iBAAiB,WAAW,SAAS,UAAU,OAAO;AAAA,IAC3D;AACA,aAAS,UAAU;AAAA,EACrB;AACF;AAEA,SAAS,YAAY,gBAAwB,IAAqB;AAChE,QAAM,QAAQ,eAAe,YAAY;AAKzC,MAAI,UAAU,UAAU;AACtB,UAAM,MAAM,GAAG;AACf,QAAI,QAAQ,WAAY,QAAO;AAC/B,QAAI,QAAQ,SAAS;AACnB,YAAM,QAAS,GAAwB,QAAQ,QAAQ,YAAY;AACnE,UAAI,SAAS,cAAc,SAAS,WAAW,SAAS,QAAQ;AAC9D,eAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AACA,MAAI,UAAU,cAAe,QAAO;AACpC,SAAO;AACT;",
6
6
  "names": []
7
7
  }
@@ -3,6 +3,7 @@ import {
3
3
  FiberTag,
4
4
  REACT_ELEMENT_TYPE
5
5
  } from "../../../core";
6
+ import { attributeName } from "../../../core/attributes";
6
7
  import { createHostNode, setProp } from "../../dom";
7
8
  import { drainReplayQueue } from "../../event-replay";
8
9
  import { discardPendingWork, findRoot, flushSyncWork, renderRoot } from "../../reconcile";
@@ -84,7 +85,14 @@ var HydrationCursor = class {
84
85
  has() {
85
86
  let n = this.n;
86
87
  while (n && n !== this.e) {
87
- if (n.nodeType === 1 || n.nodeType === 3) return true;
88
+ if (n.nodeType === 1) {
89
+ if (n.tagName === "SCRIPT") {
90
+ n = n.nextSibling;
91
+ continue;
92
+ }
93
+ return true;
94
+ }
95
+ if (n.nodeType === 3 && n.data.trim() !== "") return true;
88
96
  n = n.nextSibling;
89
97
  }
90
98
  return false;
@@ -104,7 +112,10 @@ function hydrateRootImpl(container, initialChildren, options) {
104
112
  const target = container;
105
113
  const isDocument = container.nodeType === 9;
106
114
  const body = isDocument ? target.body : null;
107
- const root = createFiberRoot(target, options);
115
+ const root = createFiberRoot(target, {
116
+ ...options,
117
+ identifierPrefix: options.identifierPrefix ?? ":R"
118
+ });
108
119
  installHydrationScrollGuard();
109
120
  const normalizedInitialChildren = isDocument ? normalizeDocumentChildren(initialChildren) : initialChildren;
110
121
  let documentBodyFallback = false;
@@ -138,6 +149,8 @@ function hydrateRootImpl(container, initialChildren, options) {
138
149
  }
139
150
  resetAfterHydrationFailure(root, recoveryContainer);
140
151
  try {
152
+ root.i = options.identifierPrefix ?? ":r";
153
+ root.ic = 0;
141
154
  flushSyncWork(() => {
142
155
  renderRoot(root, recoveryChildren);
143
156
  });
@@ -348,14 +361,19 @@ function findHostRecoveryParent(fiber) {
348
361
  return findNearestSafeHostAboveComposite(fiber.parent);
349
362
  }
350
363
  function findNearestSafeHostAboveComposite(fiber) {
364
+ let host = null;
351
365
  let f = fiber;
352
366
  while (f) {
353
367
  if (f.tag === FiberTag.Host && f.dom) {
354
- return isSafeHostRecoveryElement(f) ? f : null;
368
+ if (!isSafeHostRecoveryElement(f)) return null;
369
+ const parentTag = f.parent?.tag;
370
+ if (!host || parentTag > FiberTag.Text && parentTag < FiberTag.Suspense) {
371
+ host = f;
372
+ }
355
373
  }
356
374
  f = f.parent;
357
375
  }
358
- return null;
376
+ return host;
359
377
  }
360
378
  function isSafeHostRecoveryElement(fiber) {
361
379
  const tag = fiber.type.toLowerCase();
@@ -384,7 +402,7 @@ function clearHydrationContainer(container) {
384
402
  }
385
403
  function getRecoverableHostChildren(error) {
386
404
  const host = error.f;
387
- if (!host || host.tag !== FiberTag.Host || !host.dom || !isSafeHostRecoveryElement(host) || !findNearestSafeHostAboveComposite(host.parent)) {
405
+ if (host?.tag !== FiberTag.Host || !host.dom || !findNearestSafeHostAboveComposite(host.parent)) {
388
406
  return null;
389
407
  }
390
408
  return [host.dom, (host.pp ?? host.mp)?.children ?? null];
@@ -548,7 +566,7 @@ function validateHydrationProps(fiber, el, props, tag, isSvg) {
548
566
  continue;
549
567
  }
550
568
  const stringifiedBoolean = k.startsWith("aria-") || k.startsWith("data-");
551
- const attr = k === "className" ? "class" : k === "htmlFor" ? "for" : stringifiedBoolean ? k : k.toLowerCase();
569
+ const attr = attributeName(k, isSvg);
552
570
  let expectedValue;
553
571
  if (value == null || value === false && !stringifiedBoolean) {
554
572
  expectedValue = null;
@@ -559,6 +577,9 @@ function validateHydrationProps(fiber, el, props, tag, isSvg) {
559
577
  }
560
578
  const actualValue = el.getAttribute(attr);
561
579
  if (expectedValue !== actualValue) {
580
+ if (attr === "id" && expectedValue != null && actualValue != null) {
581
+ continue;
582
+ }
562
583
  if (true) {
563
584
  failHydration(
564
585
  fiber,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/dom/features/hydration/full.ts"],
4
- "sourcesContent": ["import {\n FiberTag,\n REACT_ELEMENT_TYPE,\n type Fiber,\n type FiberRoot,\n type ReactElement,\n type ReactNode,\n} from '../../../core'\nimport { createHostNode, setProp } from '../../dom'\nimport { drainReplayQueue } from '../../event-replay'\nimport { discardPendingWork, findRoot, flushSyncWork, renderRoot } from '../../reconcile'\nimport { attachRootFiber, createFiberRoot } from '../../root-internal'\n\n// Re-export from event-replay so all hydration concerns live behind one\n// feature boundary \u2014 the plugin's stub swap strips drainReplayQueue too.\nexport { drainReplayQueue }\n\n/**\n * Preserve the user's scroll position across hydration. If the user scrolled\n * between SSR paint and hydrate (common in dev where JS takes seconds to\n * load), libraries that wire scroll-restoration into a `useLayoutEffect`\n * near the root (e.g. TanStack Router) will run during our synchronous\n * hydrate and call `window.scrollTo(savedFromLastVisit)` \u2014 overwriting the\n * user's fresh scroll. We install a short-lived wrapper around scrollTo that\n * suppresses programmatic calls when a user-initiated scroll happened\n * recently. Only runs in the hydration feature \u2014 the stub skips it.\n */\nexport function installHydrationScrollGuard(): void {\n if (typeof window === 'undefined') return\n const w = window as any\n if (w._r) return\n const time = Date.now\n const guardStartedAt = w._r = time()\n let lastUserScrollAt = 0\n let programmatic = false\n w.addEventListener(\n 'scroll',\n () => {\n if (!programmatic) {\n lastUserScrollAt = time()\n }\n },\n { capture: true, passive: true },\n )\n const origScrollTo = w.scrollTo\n w.scrollTo = function (...args: any[]) {\n const now = time()\n if (\n now - guardStartedAt < 3000 &&\n now - lastUserScrollAt < 1500\n ) {\n return\n }\n programmatic = true\n try {\n return (origScrollTo as any).apply(w, args)\n } finally {\n queueMicrotask(() => {\n programmatic = false\n })\n }\n }\n}\n\n/**\n * Hydration cursor: walks existing DOM children in document order so we can\n * adopt them during fiber tree construction. One cursor per host parent.\n *\n * `endBefore` scopes the cursor to a subrange \u2014 used by rehydrateBoundary()\n * so we only adopt DOM up to the closing `/$` marker for that boundary.\n */\nexport class HydrationCursor {\n n: ChildNode | null\n p: Node\n e: ChildNode | null\n constructor(parent: Node, start: ChildNode | null = null, endBefore: ChildNode | null = null) {\n this.p = parent\n this.n = start ?? parent.firstChild\n this.e = endBefore\n }\n take(): ChildNode | null {\n while (this.n && this.n !== this.e) {\n const n = this.n\n // Skip anything that isn't an element (1) or text (3):\n // comments (8), doctype (10), processing instructions (7), cdata (4).\n if (n.nodeType !== 1 && n.nodeType !== 3) {\n this.n = n.nextSibling\n continue\n }\n this.n = n.nextSibling\n return n\n }\n return null\n }\n /**\n * Position-insensitive lookup for head/html adoption. Scans forward past\n * non-matching nodes without removing them, matching by tag AND the key\n * attributes that identify head elements uniquely (rel/href for links,\n * name/property for meta, src for script). Non-matching nodes stay in\n * place so the SSR'd stylesheet/script order is preserved.\n */\n head(tag: string, props: Record<string, any>): ChildNode | null {\n const target = tag.toLowerCase()\n const keyAttrs = HEAD_KEY_ATTRS[target]\n let scan = this.p.firstChild\n while (scan) {\n if (\n scan.nodeType === 1 &&\n (scan as Element).tagName.toLowerCase() === target &&\n headAttrsMatch(scan as Element, props, keyAttrs)\n ) {\n CLAIMED.add(scan)\n return scan\n }\n scan = scan.nextSibling\n }\n return null\n }\n has(): boolean {\n let n = this.n\n while (n && n !== this.e) {\n if (n.nodeType === 1 || n.nodeType === 3) return true\n n = n.nextSibling\n }\n return false\n }\n}\n\nconst hydrationCursors = new WeakMap<Fiber, HydrationCursor>()\nconst PROD_HYDRATION_ERROR = 'Hydration mismatch.'\n\nexport interface HydrationBailoutError extends Error {\n f: Fiber | null\n}\n\nexport function isHydrationBailout(error: unknown): error is HydrationBailoutError {\n return !!error && (error as any).f !== undefined\n}\n\nexport function abortHydration(cause: unknown, fiber: Fiber | null = null): never {\n const error = (cause instanceof Error ? cause : new Error(PROD_HYDRATION_ERROR)) as HydrationBailoutError\n ;(error as any).f = fiber\n throw error\n}\n\ninterface HydrateRootOptions {\n identifierPrefix?: string\n onRecoverableError?: (error: unknown) => void\n onCaughtError?: (error: unknown) => void\n onUncaughtError?: (error: unknown) => void\n}\n\ninterface HydratedRoot {\n render(children: ReactNode): void\n unmount(): void\n}\n\nexport function hydrateRootImpl(\n container: Element | Document,\n initialChildren: ReactNode,\n options: HydrateRootOptions,\n): HydratedRoot {\n const target = container as any as Element | Document\n const isDocument = (container as Node).nodeType === 9\n const body = isDocument ? (target as Document).body : null\n const root = createFiberRoot(target, options)\n\n installHydrationScrollGuard()\n\n const normalizedInitialChildren =\n isDocument ? normalizeDocumentChildren(initialChildren) : initialChildren\n let documentBodyFallback = false\n\n let hydrationError: unknown = null\n beginHydration(root)\n try {\n flushSyncWork(() => {\n renderRoot(root, normalizedInitialChildren)\n })\n } catch (e) {\n hydrationError = e\n }\n endHydration(root)\n\n if (hydrationError) {\n if (!isHydrationBailout(hydrationError)) {\n throw hydrationError\n }\n let recoveryContainer: Element | Document = target\n let recoveryChildren = normalizedInitialChildren\n const hostRecovery = getRecoverableHostChildren(hydrationError)\n if (hostRecovery) {\n recoveryContainer = hostRecovery[0]\n recoveryChildren = hostRecovery[1]\n } else if (body) {\n const bodyChildren = getRecoverableDocumentBodyChildren(hydrationError)\n if (bodyChildren != null) {\n documentBodyFallback = true\n recoveryContainer = body\n recoveryChildren = bodyChildren\n }\n }\n resetAfterHydrationFailure(root, recoveryContainer)\n try {\n flushSyncWork(() => {\n renderRoot(root, recoveryChildren)\n })\n } catch (clientError) {\n resetAfterHydrationFailure(root, recoveryContainer)\n throw clientError\n }\n }\n drainReplayQueue()\n\n return {\n render(children) {\n flushSyncWork(() => {\n const normalized = isDocument ? normalizeDocumentChildren(children) : children\n renderRoot(\n root,\n documentBodyFallback ? getStaticDocumentBodyChildren(normalized) ?? normalized : normalized,\n )\n })\n },\n unmount() {\n flushSyncWork(() => {\n renderRoot(root, null)\n })\n },\n }\n}\n\n// Head elements that we match against server DOM by attribute signature.\nconst HEAD_KEY_ATTRS: Record<string, ReadonlyArray<string>> = {\n link: ['rel', 'href', 'sizes', 'type'],\n meta: ['name', 'property', 'charset', 'http-equiv'],\n script: ['src', 'type'],\n}\n\nconst DOCUMENT_HEAD_TAGS = new Set(['base', 'link', 'meta', 'script', 'style', 'title'])\n\n// DOM elements already claimed by some fiber during this hydration pass.\nconst CLAIMED = new WeakSet<Node>()\n\nfunction headAttrsMatch(\n el: Element,\n props: Record<string, any>,\n keys: ReadonlyArray<string> | undefined,\n): boolean {\n if (CLAIMED.has(el)) return false\n if (!keys) return true\n let matched = false\n for (const k of keys) {\n const propVal = props[k] ?? (k === 'http-equiv' ? props.httpEquiv : undefined)\n const elVal = el.getAttribute(k)\n // If neither defines it, skip this key; if one defines it, they must match.\n if (propVal == null && elVal == null) continue\n matched = true\n if (propVal == null || elVal == null) continue // tolerate missing on either side\n if (String(propVal) !== elVal) return false\n }\n // At least one matching signal must be present.\n return matched\n}\n\nexport function beginHydration(root: FiberRoot): void {\n root.h = true\n hydrationCursors.set(root.r, new HydrationCursor(root.c))\n}\n\nexport function endHydration(root: FiberRoot): void {\n root.h = false\n hydrationCursors.delete(root.r)\n}\n\n/**\n * Inspect the current cursor position for a streaming-suspense boundary\n * marker emitted by the server. Returns info + advances the cursor past the\n * marker pair (start comment + fallback/real content + end comment).\n */\nexport type BoundaryInfo = [0 | 1, number, Comment, Comment]\n\nexport function tryConsumeBoundary(parent: Fiber): BoundaryInfo | null {\n const cursor = hydrationCursors.get(findHostParent(parent))\n if (!cursor) return null\n const peek = cursor.n\n if (!peek || peek.nodeType !== 8) return null\n const data = (peek as Comment).data\n const m = /^(\\$\\??)(\\d+)$/.exec(data)\n if (!m) return null\n const kind = m[1] === '$?' ? 1 : 0\n const id = Number(m[2])\n const startMark = peek as Comment\n // Advance past the start comment\n cursor.n = startMark.nextSibling\n // Locate end comment: closest <!--/$-->\n let endMark: Comment | null = null\n let scan = startMark.nextSibling\n while (scan) {\n if (scan.nodeType === 8 && (scan as Comment).data === '/$') {\n endMark = scan as Comment\n break\n }\n scan = scan.nextSibling\n }\n if (!endMark) return null\n return [kind, id, startMark, endMark]\n}\n\nexport function advanceCursorPast(parent: Fiber, node: Node): void {\n const cursor = hydrationCursors.get(findHostParent(parent))\n if (!cursor) return\n cursor.n = node.nextSibling\n}\n\nexport function getHydrationCursor(hostFiber: Fiber): HydrationCursor | undefined {\n return hydrationCursors.get(hostFiber)\n}\n\nexport function setHydrationCursor(hostFiber: Fiber, cursor: HydrationCursor): void {\n hydrationCursors.set(hostFiber, cursor)\n}\n\nexport function clearHydrationCursor(hostFiber: Fiber): void {\n hydrationCursors.delete(hostFiber)\n}\n\n/**\n * Try to adopt a DOM node for this host fiber. Returns true if adopted.\n * Attaches existing attrs/children via separate hydrate pass.\n */\nexport function adoptHostDom(fiber: Fiber, parent: Fiber): boolean {\n const hostParent = findHostParent(parent)\n const cursor = hydrationCursors.get(hostParent)\n if (!cursor) return false\n\n const tag = (fiber.type as string).toLowerCase()\n const documentHeadParent =\n cursor.p.nodeType === 9 && DOCUMENT_HEAD_TAGS.has(tag)\n ? (cursor.p as Document).head\n : null\n const parentEl = cursor.p as Element\n const parentTag =\n parentEl.nodeType === 1 ? (parentEl as Element).tagName.toLowerCase() : ''\n const isHeadish = parentTag === 'head' || parentTag === 'html' || !!documentHeadParent\n\n let candidate: ChildNode | null\n if (documentHeadParent) {\n // React 19 can project <meta>/<title>/<link> from anywhere in the tree into\n // document.head. Redact does not have that projection yet, so when a\n // document-root hydration pass sees a top-level head element, adopt it\n // from <head> rather than trying to append it beside <html>.\n candidate = new HydrationCursor(documentHeadParent).head(\n tag,\n fiber.pp ?? {},\n )\n } else if (isHeadish) {\n // Head/html children are position-insensitive \u2014 server may emit them in\n // a different order than the React tree (React 19 head hoisting, etc.).\n // Scan forward without removing non-matching nodes; match on attribute\n // signature so we don't adopt the wrong <link> and clobber its props.\n candidate = cursor.head(tag, fiber.pp ?? {})\n } else {\n candidate = cursor.take()\n }\n\n if (!candidate) {\n // Client expected a host here but the cursor is exhausted \u2014 server gave\n // fewer children than the client tree. Report the structural gap (React\n // fires `onRecoverableError` for this exact case) and let the reconciler\n // mount a fresh DOM for this fiber below.\n // Exception: <head> children are position-insensitive; a missing match\n // there means \"server didn't hoist this one yet\", which we silently mount.\n if (!isHeadish) onMismatch(fiber, null)\n return false\n }\n\n if (candidate.nodeType !== 1 || (candidate as Element).tagName.toLowerCase() !== tag) {\n // mismatch \u2014 log and re-render fresh from this point\n onMismatch(fiber, candidate)\n return false\n }\n fiber.dom = candidate\n // Apply props (attach events, sync IDL props). Don't re-set existing attrs.\n const props = fiber.pp ?? {}\n const isSvg =\n tag === 'svg' ||\n ((candidate as Element).namespaceURI === 'http://www.w3.org/2000/svg' &&\n tag !== 'foreignobject')\n validateHydrationProps(fiber, candidate as Element, props, tag, isSvg)\n for (const k in props) {\n if (k === 'children') continue\n if (k[0] === 'o' && k[1] === 'n' && typeof props[k] == 'function') {\n setProp(candidate as Element, k, props[k], undefined, isSvg)\n }\n // Non-event props: trust the server HTML, skip\n }\n // Set up child cursor for this host's children\n hydrationCursors.set(fiber, new HydrationCursor(candidate))\n return true\n}\n\nexport function adoptTextDom(fiber: Fiber, parent: Fiber, text: string): boolean {\n const cursor = hydrationCursors.get(findHostParent(parent))\n if (!cursor) return false\n const candidate = cursor.take()\n if (!candidate) onMismatch(fiber, null)\n if (candidate.nodeType === 3) {\n if ((candidate as Text).data !== text) {\n if (process.env.NODE_ENV !== 'production') {\n failHydration(\n fiber,\n new Error(`Hydration text mismatch: expected \"${text}\" but found \"${(candidate as Text).data}\".`),\n )\n }\n failHydration(fiber)\n }\n fiber.dom = candidate\n return true\n }\n onMismatch(fiber, candidate)\n return false\n}\n\nexport function findHostParent(fiber: Fiber): Fiber {\n let f: Fiber | null = fiber\n while (f) {\n // A fiber explicitly holding a cursor acts as a boundary for hydration\n // (e.g. Suspense with a scoped cursor during fallback/boundary hydration).\n if (hydrationCursors.has(f)) return f\n if (f.tag === FiberTag.Host || f.tag === FiberTag.Root || f.tag === FiberTag.Portal) {\n return f\n }\n f = f.parent\n }\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('No host parent found')\n }\n throw new Error()\n}\n\nfunction onMismatch(fiber: Fiber, actualNode: ChildNode | null): never {\n if (process.env.NODE_ENV !== 'production') {\n failHydration(\n fiber,\n new Error(\n `Hydration mismatch: expected <${(fiber.type as string) ?? 'text'}> but found ${\n actualNode ? (actualNode.nodeType === 1 ? (actualNode as Element).tagName : 'text') : 'nothing'\n }.`,\n ),\n )\n }\n failHydration(fiber)\n}\n\nfunction failHydration(fiber: Fiber, error: Error = new Error(PROD_HYDRATION_ERROR)): never {\n const root = findRoot(fiber)\n if (root?.re) {\n root.re(error)\n }\n abortHydration(error, findHostRecoveryParent(fiber) ?? fiber)\n}\n\nfunction findHostRecoveryParent(fiber: Fiber): Fiber | null {\n if (fiber.tag === FiberTag.Text) {\n let directHost = fiber.parent\n while (directHost && (directHost.tag !== FiberTag.Host || !directHost.dom)) {\n directHost = directHost.parent\n }\n if (!directHost) return null\n let hasEvent\n const props = directHost.pp ?? directHost.mp\n if (props) {\n for (const k in props) {\n if (k[0] === 'o' && k[1] === 'n' && typeof props[k] == 'function') {\n hasEvent = true\n }\n }\n }\n return findNearestSafeHostAboveComposite(\n hasEvent\n ? directHost.parent\n : directHost.parent?.tag === FiberTag.Host\n ? directHost.parent\n : directHost,\n )\n }\n\n return findNearestSafeHostAboveComposite(fiber.parent)\n}\n\nfunction findNearestSafeHostAboveComposite(fiber: Fiber | null): Fiber | null {\n let f = fiber\n while (f) {\n if (f.tag === FiberTag.Host && f.dom) {\n return isSafeHostRecoveryElement(f) ? f : null\n }\n f = f.parent\n }\n return null\n}\n\nfunction isSafeHostRecoveryElement(fiber: Fiber): boolean {\n const tag = fiber.type.toLowerCase()\n return tag !== 'html' && tag !== 'head' && tag !== 'body'\n}\n\nfunction resetAfterHydrationFailure(\n root: FiberRoot,\n container: Element | Document,\n): void {\n discardPendingWork(root)\n clearHydrationContainer(container)\n attachRootFiber(root, container)\n root.h = false\n}\n\nfunction clearHydrationContainer(container: Element | Document): void {\n if (container.nodeType === 9) {\n let node = container.firstChild\n while (node) {\n const next = node.nextSibling\n if (node.nodeType !== 10 /* DOCUMENT_TYPE_NODE */) {\n container.removeChild(node)\n }\n node = next\n }\n return\n }\n ;(container as Element).textContent = ''\n}\n\nfunction getRecoverableHostChildren(\n error: HydrationBailoutError,\n): [Element, ReactNode] | null {\n const host = error.f\n if (\n !host ||\n host.tag !== FiberTag.Host ||\n !host.dom ||\n !isSafeHostRecoveryElement(host) ||\n !findNearestSafeHostAboveComposite(host.parent)\n ) {\n return null\n }\n return [host.dom as Element, (host.pp ?? host.mp)?.children ?? null]\n}\n\nfunction getRecoverableDocumentBodyChildren(error: HydrationBailoutError): ReactNode | null {\n const bodyFiber = findBodyAncestor(error.f)\n if (!bodyFiber) return null\n return (bodyFiber.pp ?? bodyFiber.mp)?.children ?? null\n}\n\nfunction findBodyAncestor(fiber: Fiber | null): Fiber | null {\n let f = fiber\n while (f) {\n if (f.tag === FiberTag.Host && f.type === 'body') {\n return f === fiber ? null : f\n }\n f = f.parent\n }\n return null\n}\n\nfunction getStaticDocumentBodyChildren(children: ReactNode): ReactNode | null {\n const list = toChildArray(children)\n const html = list.find((child) => isHostElement(child, 'html')) as ReactElement | undefined\n if (!html) return null\n const htmlChildren = toChildArray(html.props?.children)\n const body = htmlChildren.find((child) => isHostElement(child, 'body')) as ReactElement | undefined\n return body ? body.props?.children ?? null : null\n}\n\nfunction normalizeDocumentChildren(children: ReactNode): ReactNode {\n const list = toChildArray(children)\n const htmlIndex = list.findIndex((child) => isHostElement(child, 'html'))\n if (htmlIndex === -1) return children\n\n const headNodes = list.filter(isHeadElement)\n if (headNodes.length === 0) return children\n\n const htmlElement = list[htmlIndex] as ReactElement\n const normalizedHtml = hoistIntoHtmlHead(htmlElement, headNodes)\n return list\n .filter((child, index) => index === htmlIndex || !isHeadElement(child))\n .map((child) => (child === htmlElement ? normalizedHtml : child))\n}\n\nfunction hoistIntoHtmlHead(htmlElement: ReactElement, headNodes: ReactNode[]): ReactElement {\n const htmlChildren = toChildArray(htmlElement.props?.children)\n const headIndex = htmlChildren.findIndex((child) => isHostElement(child, 'head'))\n let nextChildren: ReactNode[]\n\n if (headIndex === -1) {\n nextChildren = [\n createHostElement('head', { children: headNodes }),\n ...htmlChildren,\n ]\n } else {\n const headElement = htmlChildren[headIndex] as ReactElement\n const existingHeadChildren = toChildArray(headElement.props?.children)\n const nextHead = {\n ...headElement,\n props: {\n ...headElement.props,\n children: [...headNodes, ...existingHeadChildren],\n },\n }\n nextChildren = htmlChildren.map((child, index) => (index === headIndex ? nextHead : child))\n }\n\n return {\n ...htmlElement,\n props: {\n ...htmlElement.props,\n children: nextChildren,\n },\n }\n}\n\nfunction toChildArray(children: unknown): ReactNode[] {\n if (children == null || typeof children === 'boolean') return []\n if (Array.isArray(children)) return children as ReactNode[]\n if (isReactElement(children)) return [children]\n if (typeof children !== 'string' && isIterable(children)) return Array.from(children) as ReactNode[]\n return [children as ReactNode]\n}\n\nfunction isHeadElement(value: ReactNode): boolean {\n return isReactElement(value) && typeof value.type === 'string' && DOCUMENT_HEAD_TAGS.has(value.type)\n}\n\nfunction isHostElement(value: ReactNode, tag: string): boolean {\n return isReactElement(value) && value.type === tag\n}\n\nfunction isReactElement(value: unknown): value is ReactElement {\n return !!value && typeof value === 'object' && (value as ReactElement).$$typeof === REACT_ELEMENT_TYPE\n}\n\nfunction isIterable(value: unknown): value is Iterable<ReactNode> {\n return !!value && typeof (value as { [Symbol.iterator]?: unknown })[Symbol.iterator] == 'function'\n}\n\nfunction createHostElement(type: string, props: Record<string, unknown>): ReactElement {\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type,\n key: null,\n ref: null,\n props,\n }\n}\n\nfunction validateHydrationProps(\n fiber: Fiber,\n el: Element,\n props: Record<string, any>,\n tag: string,\n isSvg: boolean,\n): void {\n if (props.suppressHydrationWarning) return\n\n let expected: Element | undefined\n\n for (const k in props) {\n const value = props[k]\n if (\n k === 'children' ||\n k === 'key' ||\n k === 'ref' ||\n k === 'suppressHydrationWarning' ||\n k === 'suppressContentEditableWarning' ||\n (k[0] === 'o' && k[1] === 'n' && typeof value == 'function')\n ) continue\n\n if (k === 'dangerouslySetInnerHTML') {\n const probe = document.createElement('div')\n probe.innerHTML = value?.__html ?? ''\n if ((el as HTMLElement).innerHTML !== probe.innerHTML) {\n if (process.env.NODE_ENV !== 'production') {\n failHydration(\n fiber,\n new Error(`Hydration HTML mismatch inside <${tag}>.`),\n )\n }\n failHydration(fiber)\n }\n continue\n }\n\n if (k === 'value' || k === 'defaultValue') {\n if (tag === 'select') continue\n if (tag === 'input' || tag === 'textarea') {\n if (k === 'value' || props.value == null) {\n if (value != null && (el as HTMLInputElement).value !== '' + value) {\n if (process.env.NODE_ENV !== 'production') {\n failHydration(fiber, new Error(`Hydration ${tag} value mismatch on <${tag}>.`))\n }\n failHydration(fiber)\n }\n }\n continue\n }\n }\n\n if (tag === 'input' && (k === 'checked' || k === 'defaultChecked')) {\n if (k === 'checked' || props.checked == null) {\n if (value != null && (el as HTMLInputElement).checked !== !!value) {\n if (process.env.NODE_ENV !== 'production') {\n failHydration(fiber, new Error(`Hydration checked mismatch on <input>.`))\n }\n failHydration(fiber)\n }\n }\n continue\n }\n\n if (tag === 'option' && k === 'selected') {\n if (value != null && (el as HTMLOptionElement).selected !== !!value) {\n if (process.env.NODE_ENV !== 'production') {\n failHydration(fiber, new Error(`Hydration selected mismatch on <option>.`))\n }\n failHydration(fiber)\n }\n continue\n }\n\n if (k === 'style') {\n expected ??= createHostNode(tag, isSvg)\n setProp(expected, k, value, undefined, isSvg)\n if ((el as HTMLElement).style.cssText !== (expected as HTMLElement).style.cssText) {\n if (process.env.NODE_ENV !== 'production') {\n failHydration(\n fiber,\n new Error(`Hydration style mismatch on <${tag}>.`),\n )\n }\n failHydration(fiber)\n }\n continue\n }\n\n const stringifiedBoolean = k.startsWith('aria-') || k.startsWith('data-')\n const attr = k === 'className' ? 'class' : k === 'htmlFor' ? 'for' : stringifiedBoolean ? k : k.toLowerCase()\n\n let expectedValue: string | null\n if (value == null || (value === false && !stringifiedBoolean)) {\n expectedValue = null\n } else {\n expected ??= createHostNode(tag, isSvg)\n setProp(expected, k, value, undefined, isSvg)\n expectedValue = expected.getAttribute(attr)\n }\n const actualValue = el.getAttribute(attr)\n if (expectedValue !== actualValue) {\n if (process.env.NODE_ENV !== 'production') {\n failHydration(\n fiber,\n new Error(\n `Hydration attribute mismatch on <${tag}> for \"${attr}\": ` +\n `expected ${formatHydrationValue(expectedValue)} but found ${formatHydrationValue(actualValue)}.`,\n ),\n )\n }\n failHydration(fiber)\n }\n }\n}\n\nfunction formatHydrationValue(value: string | null): string {\n return value == null ? 'nothing' : JSON.stringify(value)\n}\n"],
5
- "mappings": ";AAAA;AAAA,EACE;AAAA,EACA;AAAA,OAKK;AACP,SAAS,gBAAgB,eAAe;AACxC,SAAS,wBAAwB;AACjC,SAAS,oBAAoB,UAAU,eAAe,kBAAkB;AACxE,SAAS,iBAAiB,uBAAuB;AAgB1C,SAAS,8BAAoC;AAClD,MAAI,OAAO,WAAW,YAAa;AACnC,QAAM,IAAI;AACV,MAAI,EAAE,GAAI;AACV,QAAM,OAAO,KAAK;AAClB,QAAM,iBAAiB,EAAE,KAAK,KAAK;AACnC,MAAI,mBAAmB;AACvB,MAAI,eAAe;AACnB,IAAE;AAAA,IACA;AAAA,IACA,MAAM;AACJ,UAAI,CAAC,cAAc;AACjB,2BAAmB,KAAK;AAAA,MAC1B;AAAA,IACF;AAAA,IACA,EAAE,SAAS,MAAM,SAAS,KAAK;AAAA,EACjC;AACA,QAAM,eAAe,EAAE;AACvB,IAAE,WAAW,YAAa,MAAa;AACrC,UAAM,MAAM,KAAK;AACjB,QACE,MAAM,iBAAiB,OACvB,MAAM,mBAAmB,MACzB;AACA;AAAA,IACF;AACA,mBAAe;AACf,QAAI;AACF,aAAQ,aAAqB,MAAM,GAAG,IAAI;AAAA,IAC5C,UAAE;AACA,qBAAe,MAAM;AACnB,uBAAe;AAAA,MACjB,CAAC;AAAA,IACH;AAAA,EACF;AACF;AASO,IAAM,kBAAN,MAAsB;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA,YAAY,QAAc,QAA0B,MAAM,YAA8B,MAAM;AAC5F,SAAK,IAAI;AACT,SAAK,IAAI,SAAS,OAAO;AACzB,SAAK,IAAI;AAAA,EACX;AAAA,EACA,OAAyB;AACvB,WAAO,KAAK,KAAK,KAAK,MAAM,KAAK,GAAG;AAClC,YAAM,IAAI,KAAK;AAGf,UAAI,EAA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;AAAA,MACrB;AACA;AAAA,IACF;AAEA,QAAI,MAAM,SAAS;AACjB,mBAAa,eAAe,KAAK,KAAK;AACtC,cAAQ,UAAU,GAAG,OAAO,QAAW,KAAK;AAC5C,UAAK,GAAmB,MAAM,YAAa,SAAyB,MAAM,SAAS;AACjF,YAAI,MAAuC;AACzC;AAAA,YACE;AAAA,YACA,IAAI,MAAM,gCAAgC,GAAG,IAAI;AAAA,UACnD;AAAA,QACF;AACA,sBAAc,KAAK;AAAA,MACrB;AACA;AAAA,IACF;AAEA,UAAM,qBAAqB,EAAE,WAAW,OAAO,KAAK,EAAE,WAAW,OAAO;AACxE,UAAM,OAAO,MAAM,cAAc,UAAU,MAAM,YAAY,QAAQ,qBAAqB,IAAI,EAAE,YAAY;AAE5G,QAAI;AACJ,QAAI,SAAS,QAAS,UAAU,SAAS,CAAC,oBAAqB;AAC7D,sBAAgB;AAAA,IAClB,OAAO;AACL,mBAAa,eAAe,KAAK,KAAK;AACtC,cAAQ,UAAU,GAAG,OAAO,QAAW,KAAK;AAC5C,sBAAgB,SAAS,aAAa,IAAI;AAAA,IAC5C;AACA,UAAM,cAAc,GAAG,aAAa,IAAI;AACxC,QAAI,kBAAkB,aAAa;AACjC,UAAI,MAAuC;AACzC;AAAA,UACE;AAAA,UACA,IAAI;AAAA,YACF,oCAAoC,GAAG,UAAU,IAAI,eACvC,qBAAqB,aAAa,CAAC,cAAc,qBAAqB,WAAW,CAAC;AAAA,UAClG;AAAA,QACF;AAAA,MACF;AACA,oBAAc,KAAK;AAAA,IACrB;AAAA,EACF;AACF;AAEA,SAAS,qBAAqB,OAA8B;AAC1D,SAAO,SAAS,OAAO,YAAY,KAAK,UAAU,KAAK;AACzD;",
4
+ "sourcesContent": ["import {\n FiberTag,\n REACT_ELEMENT_TYPE,\n type Fiber,\n type FiberRoot,\n type ReactElement,\n type ReactNode,\n} from '../../../core'\nimport { attributeName } from '../../../core/attributes'\nimport { createHostNode, setProp } from '../../dom'\nimport { drainReplayQueue } from '../../event-replay'\nimport { discardPendingWork, findRoot, flushSyncWork, renderRoot } from '../../reconcile'\nimport { attachRootFiber, createFiberRoot } from '../../root-internal'\n\n// Re-export from event-replay so all hydration concerns live behind one\n// feature boundary \u2014 the plugin's stub swap strips drainReplayQueue too.\nexport { drainReplayQueue }\n\n/**\n * Preserve the user's scroll position across hydration. If the user scrolled\n * between SSR paint and hydrate (common in dev where JS takes seconds to\n * load), libraries that wire scroll-restoration into a `useLayoutEffect`\n * near the root (e.g. TanStack Router) will run during our synchronous\n * hydrate and call `window.scrollTo(savedFromLastVisit)` \u2014 overwriting the\n * user's fresh scroll. We install a short-lived wrapper around scrollTo that\n * suppresses programmatic calls when a user-initiated scroll happened\n * recently. Only runs in the hydration feature \u2014 the stub skips it.\n */\nexport function installHydrationScrollGuard(): void {\n if (typeof window === 'undefined') return\n const w = window as any\n if (w._r) return\n const time = Date.now\n const guardStartedAt = w._r = time()\n let lastUserScrollAt = 0\n let programmatic = false\n w.addEventListener(\n 'scroll',\n () => {\n if (!programmatic) {\n lastUserScrollAt = time()\n }\n },\n { capture: true, passive: true },\n )\n const origScrollTo = w.scrollTo\n w.scrollTo = function (...args: any[]) {\n const now = time()\n if (\n now - guardStartedAt < 3000 &&\n now - lastUserScrollAt < 1500\n ) {\n return\n }\n programmatic = true\n try {\n return (origScrollTo as any).apply(w, args)\n } finally {\n queueMicrotask(() => {\n programmatic = false\n })\n }\n }\n}\n\n/**\n * Hydration cursor: walks existing DOM children in document order so we can\n * adopt them during fiber tree construction. One cursor per host parent.\n *\n * `endBefore` scopes the cursor to a subrange \u2014 used by rehydrateBoundary()\n * so we only adopt DOM up to the closing `/$` marker for that boundary.\n */\nexport class HydrationCursor {\n n: ChildNode | null\n p: Node\n e: ChildNode | null\n constructor(parent: Node, start: ChildNode | null = null, endBefore: ChildNode | null = null) {\n this.p = parent\n this.n = start ?? parent.firstChild\n this.e = endBefore\n }\n take(): ChildNode | null {\n while (this.n && this.n !== this.e) {\n const n = this.n\n // Skip anything that isn't an element (1) or text (3):\n // comments (8), doctype (10), processing instructions (7), cdata (4).\n if (n.nodeType !== 1 && n.nodeType !== 3) {\n this.n = n.nextSibling\n continue\n }\n this.n = n.nextSibling\n return n\n }\n return null\n }\n /**\n * Position-insensitive lookup for head/html adoption. Scans forward past\n * non-matching nodes without removing them, matching by tag AND the key\n * attributes that identify head elements uniquely (rel/href for links,\n * name/property for meta, src for script). Non-matching nodes stay in\n * place so the SSR'd stylesheet/script order is preserved.\n */\n head(tag: string, props: Record<string, any>): ChildNode | null {\n const target = tag.toLowerCase()\n const keyAttrs = HEAD_KEY_ATTRS[target]\n let scan = this.p.firstChild\n while (scan) {\n if (\n scan.nodeType === 1 &&\n (scan as Element).tagName.toLowerCase() === target &&\n headAttrsMatch(scan as Element, props, keyAttrs)\n ) {\n CLAIMED.add(scan)\n return scan\n }\n scan = scan.nextSibling\n }\n return null\n }\n has(): boolean {\n let n = this.n\n while (n && n !== this.e) {\n if (n.nodeType === 1) {\n if ((n as Element).tagName === 'SCRIPT') {\n n = n.nextSibling\n continue\n }\n return true\n }\n if (n.nodeType === 3 && (n as Text).data.trim() !== '') return true\n n = n.nextSibling\n }\n return false\n }\n}\n\nconst hydrationCursors = new WeakMap<Fiber, HydrationCursor>()\nconst PROD_HYDRATION_ERROR = 'Hydration mismatch.'\n\nexport interface HydrationBailoutError extends Error {\n f: Fiber | null\n}\n\nexport function isHydrationBailout(error: unknown): error is HydrationBailoutError {\n return !!error && (error as any).f !== undefined\n}\n\nexport function abortHydration(cause: unknown, fiber: Fiber | null = null): never {\n const error = (cause instanceof Error ? cause : new Error(PROD_HYDRATION_ERROR)) as HydrationBailoutError\n ;(error as any).f = fiber\n throw error\n}\n\ninterface HydrateRootOptions {\n identifierPrefix?: string\n onRecoverableError?: (error: unknown) => void\n onCaughtError?: (error: unknown) => void\n onUncaughtError?: (error: unknown) => void\n}\n\ninterface HydratedRoot {\n render(children: ReactNode): void\n unmount(): void\n}\n\nexport function hydrateRootImpl(\n container: Element | Document,\n initialChildren: ReactNode,\n options: HydrateRootOptions,\n): HydratedRoot {\n const target = container as any as Element | Document\n const isDocument = (container as Node).nodeType === 9\n const body = isDocument ? (target as Document).body : null\n const root = createFiberRoot(target, {\n ...options,\n identifierPrefix: options.identifierPrefix ?? ':R',\n })\n\n installHydrationScrollGuard()\n\n const normalizedInitialChildren =\n isDocument ? normalizeDocumentChildren(initialChildren) : initialChildren\n let documentBodyFallback = false\n\n let hydrationError: unknown = null\n beginHydration(root)\n try {\n flushSyncWork(() => {\n renderRoot(root, normalizedInitialChildren)\n })\n } catch (e) {\n hydrationError = e\n }\n endHydration(root)\n\n if (hydrationError) {\n if (!isHydrationBailout(hydrationError)) {\n throw hydrationError\n }\n let recoveryContainer: Element | Document = target\n let recoveryChildren = normalizedInitialChildren\n const hostRecovery = getRecoverableHostChildren(hydrationError)\n if (hostRecovery) {\n recoveryContainer = hostRecovery[0]\n recoveryChildren = hostRecovery[1]\n } else if (body) {\n const bodyChildren = getRecoverableDocumentBodyChildren(hydrationError)\n if (bodyChildren != null) {\n documentBodyFallback = true\n recoveryContainer = body\n recoveryChildren = bodyChildren\n }\n }\n resetAfterHydrationFailure(root, recoveryContainer)\n try {\n root.i = options.identifierPrefix ?? ':r'\n root.ic = 0\n flushSyncWork(() => {\n renderRoot(root, recoveryChildren)\n })\n } catch (clientError) {\n resetAfterHydrationFailure(root, recoveryContainer)\n throw clientError\n }\n }\n drainReplayQueue()\n\n return {\n render(children) {\n flushSyncWork(() => {\n const normalized = isDocument ? normalizeDocumentChildren(children) : children\n renderRoot(\n root,\n documentBodyFallback ? getStaticDocumentBodyChildren(normalized) ?? normalized : normalized,\n )\n })\n },\n unmount() {\n flushSyncWork(() => {\n renderRoot(root, null)\n })\n },\n }\n}\n\n// Head elements that we match against server DOM by attribute signature.\nconst HEAD_KEY_ATTRS: Record<string, ReadonlyArray<string>> = {\n link: ['rel', 'href', 'sizes', 'type'],\n meta: ['name', 'property', 'charset', 'http-equiv'],\n script: ['src', 'type'],\n}\n\nconst DOCUMENT_HEAD_TAGS = new Set(['base', 'link', 'meta', 'script', 'style', 'title'])\n\n// DOM elements already claimed by some fiber during this hydration pass.\nconst CLAIMED = new WeakSet<Node>()\n\nfunction headAttrsMatch(\n el: Element,\n props: Record<string, any>,\n keys: ReadonlyArray<string> | undefined,\n): boolean {\n if (CLAIMED.has(el)) return false\n if (!keys) return true\n let matched = false\n for (const k of keys) {\n const propVal = props[k] ?? (k === 'http-equiv' ? props.httpEquiv : undefined)\n const elVal = el.getAttribute(k)\n // If neither defines it, skip this key; if one defines it, they must match.\n if (propVal == null && elVal == null) continue\n matched = true\n if (propVal == null || elVal == null) continue // tolerate missing on either side\n if (String(propVal) !== elVal) return false\n }\n // At least one matching signal must be present.\n return matched\n}\n\nexport function beginHydration(root: FiberRoot): void {\n root.h = true\n hydrationCursors.set(root.r, new HydrationCursor(root.c))\n}\n\nexport function endHydration(root: FiberRoot): void {\n root.h = false\n hydrationCursors.delete(root.r)\n}\n\n/**\n * Inspect the current cursor position for a streaming-suspense boundary\n * marker emitted by the server. Returns info + advances the cursor past the\n * marker pair (start comment + fallback/real content + end comment).\n */\nexport type BoundaryInfo = [0 | 1, number, Comment, Comment]\n\nexport function tryConsumeBoundary(parent: Fiber): BoundaryInfo | null {\n const cursor = hydrationCursors.get(findHostParent(parent))\n if (!cursor) return null\n const peek = cursor.n\n if (!peek || peek.nodeType !== 8) return null\n const data = (peek as Comment).data\n const m = /^(\\$\\??)(\\d+)$/.exec(data)\n if (!m) return null\n const kind = m[1] === '$?' ? 1 : 0\n const id = Number(m[2])\n const startMark = peek as Comment\n // Advance past the start comment\n cursor.n = startMark.nextSibling\n // Locate end comment: closest <!--/$-->\n let endMark: Comment | null = null\n let scan = startMark.nextSibling\n while (scan) {\n if (scan.nodeType === 8 && (scan as Comment).data === '/$') {\n endMark = scan as Comment\n break\n }\n scan = scan.nextSibling\n }\n if (!endMark) return null\n return [kind, id, startMark, endMark]\n}\n\nexport function advanceCursorPast(parent: Fiber, node: Node): void {\n const cursor = hydrationCursors.get(findHostParent(parent))\n if (!cursor) return\n cursor.n = node.nextSibling\n}\n\nexport function getHydrationCursor(hostFiber: Fiber): HydrationCursor | undefined {\n return hydrationCursors.get(hostFiber)\n}\n\nexport function setHydrationCursor(hostFiber: Fiber, cursor: HydrationCursor): void {\n hydrationCursors.set(hostFiber, cursor)\n}\n\nexport function clearHydrationCursor(hostFiber: Fiber): void {\n hydrationCursors.delete(hostFiber)\n}\n\n/**\n * Try to adopt a DOM node for this host fiber. Returns true if adopted.\n * Attaches existing attrs/children via separate hydrate pass.\n */\nexport function adoptHostDom(fiber: Fiber, parent: Fiber): boolean {\n const hostParent = findHostParent(parent)\n const cursor = hydrationCursors.get(hostParent)\n if (!cursor) return false\n\n const tag = (fiber.type as string).toLowerCase()\n const documentHeadParent =\n cursor.p.nodeType === 9 && DOCUMENT_HEAD_TAGS.has(tag)\n ? (cursor.p as Document).head\n : null\n const parentEl = cursor.p as Element\n const parentTag =\n parentEl.nodeType === 1 ? (parentEl as Element).tagName.toLowerCase() : ''\n const isHeadish = parentTag === 'head' || parentTag === 'html' || !!documentHeadParent\n\n let candidate: ChildNode | null\n if (documentHeadParent) {\n // React 19 can project <meta>/<title>/<link> from anywhere in the tree into\n // document.head. Redact does not have that projection yet, so when a\n // document-root hydration pass sees a top-level head element, adopt it\n // from <head> rather than trying to append it beside <html>.\n candidate = new HydrationCursor(documentHeadParent).head(\n tag,\n fiber.pp ?? {},\n )\n } else if (isHeadish) {\n // Head/html children are position-insensitive \u2014 server may emit them in\n // a different order than the React tree (React 19 head hoisting, etc.).\n // Scan forward without removing non-matching nodes; match on attribute\n // signature so we don't adopt the wrong <link> and clobber its props.\n candidate = cursor.head(tag, fiber.pp ?? {})\n } else {\n candidate = cursor.take()\n }\n\n if (!candidate) {\n // Client expected a host here but the cursor is exhausted \u2014 server gave\n // fewer children than the client tree. Report the structural gap (React\n // fires `onRecoverableError` for this exact case) and let the reconciler\n // mount a fresh DOM for this fiber below.\n // Exception: <head> children are position-insensitive; a missing match\n // there means \"server didn't hoist this one yet\", which we silently mount.\n if (!isHeadish) onMismatch(fiber, null)\n return false\n }\n\n if (candidate.nodeType !== 1 || (candidate as Element).tagName.toLowerCase() !== tag) {\n // mismatch \u2014 log and re-render fresh from this point\n onMismatch(fiber, candidate)\n return false\n }\n fiber.dom = candidate\n // Apply props (attach events, sync IDL props). Don't re-set existing attrs.\n const props = fiber.pp ?? {}\n const isSvg =\n tag === 'svg' ||\n ((candidate as Element).namespaceURI === 'http://www.w3.org/2000/svg' &&\n tag !== 'foreignobject')\n validateHydrationProps(fiber, candidate as Element, props, tag, isSvg)\n for (const k in props) {\n if (k === 'children') continue\n if (k[0] === 'o' && k[1] === 'n' && typeof props[k] == 'function') {\n setProp(candidate as Element, k, props[k], undefined, isSvg)\n }\n // Non-event props: trust the server HTML, skip\n }\n // Set up child cursor for this host's children\n hydrationCursors.set(fiber, new HydrationCursor(candidate))\n return true\n}\n\nexport function adoptTextDom(fiber: Fiber, parent: Fiber, text: string): boolean {\n const cursor = hydrationCursors.get(findHostParent(parent))\n if (!cursor) return false\n const candidate = cursor.take()\n if (!candidate) onMismatch(fiber, null)\n if (candidate.nodeType === 3) {\n if ((candidate as Text).data !== text) {\n if (process.env.NODE_ENV !== 'production') {\n failHydration(\n fiber,\n new Error(`Hydration text mismatch: expected \"${text}\" but found \"${(candidate as Text).data}\".`),\n )\n }\n failHydration(fiber)\n }\n fiber.dom = candidate\n return true\n }\n onMismatch(fiber, candidate)\n return false\n}\n\nexport function findHostParent(fiber: Fiber): Fiber {\n let f: Fiber | null = fiber\n while (f) {\n // A fiber explicitly holding a cursor acts as a boundary for hydration\n // (e.g. Suspense with a scoped cursor during fallback/boundary hydration).\n if (hydrationCursors.has(f)) return f\n if (f.tag === FiberTag.Host || f.tag === FiberTag.Root || f.tag === FiberTag.Portal) {\n return f\n }\n f = f.parent\n }\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('No host parent found')\n }\n throw new Error()\n}\n\nfunction onMismatch(fiber: Fiber, actualNode: ChildNode | null): never {\n if (process.env.NODE_ENV !== 'production') {\n failHydration(\n fiber,\n new Error(\n `Hydration mismatch: expected <${(fiber.type as string) ?? 'text'}> but found ${\n actualNode ? (actualNode.nodeType === 1 ? (actualNode as Element).tagName : 'text') : 'nothing'\n }.`,\n ),\n )\n }\n failHydration(fiber)\n}\n\nfunction failHydration(fiber: Fiber, error: Error = new Error(PROD_HYDRATION_ERROR)): never {\n const root = findRoot(fiber)\n if (root?.re) {\n root.re(error)\n }\n abortHydration(error, findHostRecoveryParent(fiber) ?? fiber)\n}\n\nfunction findHostRecoveryParent(fiber: Fiber): Fiber | null {\n if (fiber.tag === FiberTag.Text) {\n let directHost = fiber.parent\n while (directHost && (directHost.tag !== FiberTag.Host || !directHost.dom)) {\n directHost = directHost.parent\n }\n if (!directHost) return null\n let hasEvent\n const props = directHost.pp ?? directHost.mp\n if (props) {\n for (const k in props) {\n if (k[0] === 'o' && k[1] === 'n' && typeof props[k] == 'function') {\n hasEvent = true\n }\n }\n }\n return findNearestSafeHostAboveComposite(\n hasEvent\n ? directHost.parent\n : directHost.parent?.tag === FiberTag.Host\n ? directHost.parent\n : directHost,\n )\n }\n\n return findNearestSafeHostAboveComposite(fiber.parent)\n}\n\nfunction findNearestSafeHostAboveComposite(fiber: Fiber | null): Fiber | null {\n let host: Fiber | null = null\n let f = fiber\n while (f) {\n if (f.tag === FiberTag.Host && f.dom) {\n if (!isSafeHostRecoveryElement(f)) return null\n const parentTag = f.parent?.tag as number\n if (!host || (parentTag > FiberTag.Text && parentTag < FiberTag.Suspense)) {\n host = f\n }\n }\n f = f.parent\n }\n return host\n}\n\nfunction isSafeHostRecoveryElement(fiber: Fiber): boolean {\n const tag = fiber.type.toLowerCase()\n return tag !== 'html' && tag !== 'head' && tag !== 'body'\n}\n\nfunction resetAfterHydrationFailure(\n root: FiberRoot,\n container: Element | Document,\n): void {\n discardPendingWork(root)\n clearHydrationContainer(container)\n attachRootFiber(root, container)\n root.h = false\n}\n\nfunction clearHydrationContainer(container: Element | Document): void {\n if (container.nodeType === 9) {\n let node = container.firstChild\n while (node) {\n const next = node.nextSibling\n if (node.nodeType !== 10 /* DOCUMENT_TYPE_NODE */) {\n container.removeChild(node)\n }\n node = next\n }\n return\n }\n ;(container as Element).textContent = ''\n}\n\nfunction getRecoverableHostChildren(\n error: HydrationBailoutError,\n): [Element, ReactNode] | null {\n const host = error.f\n if (\n host?.tag !== FiberTag.Host ||\n !host.dom ||\n !findNearestSafeHostAboveComposite(host.parent)\n ) {\n return null\n }\n return [host.dom as Element, (host.pp ?? host.mp)?.children ?? null]\n}\n\nfunction getRecoverableDocumentBodyChildren(error: HydrationBailoutError): ReactNode | null {\n const bodyFiber = findBodyAncestor(error.f)\n if (!bodyFiber) return null\n return (bodyFiber.pp ?? bodyFiber.mp)?.children ?? null\n}\n\nfunction findBodyAncestor(fiber: Fiber | null): Fiber | null {\n let f = fiber\n while (f) {\n if (f.tag === FiberTag.Host && f.type === 'body') {\n return f === fiber ? null : f\n }\n f = f.parent\n }\n return null\n}\n\nfunction getStaticDocumentBodyChildren(children: ReactNode): ReactNode | null {\n const list = toChildArray(children)\n const html = list.find((child) => isHostElement(child, 'html')) as ReactElement | undefined\n if (!html) return null\n const htmlChildren = toChildArray(html.props?.children)\n const body = htmlChildren.find((child) => isHostElement(child, 'body')) as ReactElement | undefined\n return body ? body.props?.children ?? null : null\n}\n\nfunction normalizeDocumentChildren(children: ReactNode): ReactNode {\n const list = toChildArray(children)\n const htmlIndex = list.findIndex((child) => isHostElement(child, 'html'))\n if (htmlIndex === -1) return children\n\n const headNodes = list.filter(isHeadElement)\n if (headNodes.length === 0) return children\n\n const htmlElement = list[htmlIndex] as ReactElement\n const normalizedHtml = hoistIntoHtmlHead(htmlElement, headNodes)\n return list\n .filter((child, index) => index === htmlIndex || !isHeadElement(child))\n .map((child) => (child === htmlElement ? normalizedHtml : child))\n}\n\nfunction hoistIntoHtmlHead(htmlElement: ReactElement, headNodes: ReactNode[]): ReactElement {\n const htmlChildren = toChildArray(htmlElement.props?.children)\n const headIndex = htmlChildren.findIndex((child) => isHostElement(child, 'head'))\n let nextChildren: ReactNode[]\n\n if (headIndex === -1) {\n nextChildren = [\n createHostElement('head', { children: headNodes }),\n ...htmlChildren,\n ]\n } else {\n const headElement = htmlChildren[headIndex] as ReactElement\n const existingHeadChildren = toChildArray(headElement.props?.children)\n const nextHead = {\n ...headElement,\n props: {\n ...headElement.props,\n children: [...headNodes, ...existingHeadChildren],\n },\n }\n nextChildren = htmlChildren.map((child, index) => (index === headIndex ? nextHead : child))\n }\n\n return {\n ...htmlElement,\n props: {\n ...htmlElement.props,\n children: nextChildren,\n },\n }\n}\n\nfunction toChildArray(children: unknown): ReactNode[] {\n if (children == null || typeof children === 'boolean') return []\n if (Array.isArray(children)) return children as ReactNode[]\n if (isReactElement(children)) return [children]\n if (typeof children !== 'string' && isIterable(children)) return Array.from(children) as ReactNode[]\n return [children as ReactNode]\n}\n\nfunction isHeadElement(value: ReactNode): boolean {\n return isReactElement(value) && typeof value.type === 'string' && DOCUMENT_HEAD_TAGS.has(value.type)\n}\n\nfunction isHostElement(value: ReactNode, tag: string): boolean {\n return isReactElement(value) && value.type === tag\n}\n\nfunction isReactElement(value: unknown): value is ReactElement {\n return !!value && typeof value === 'object' && (value as ReactElement).$$typeof === REACT_ELEMENT_TYPE\n}\n\nfunction isIterable(value: unknown): value is Iterable<ReactNode> {\n return !!value && typeof (value as { [Symbol.iterator]?: unknown })[Symbol.iterator] == 'function'\n}\n\nfunction createHostElement(type: string, props: Record<string, unknown>): ReactElement {\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type,\n key: null,\n ref: null,\n props,\n }\n}\n\nfunction validateHydrationProps(\n fiber: Fiber,\n el: Element,\n props: Record<string, any>,\n tag: string,\n isSvg: boolean,\n): void {\n if (props.suppressHydrationWarning) return\n\n let expected: Element | undefined\n\n for (const k in props) {\n const value = props[k]\n if (\n k === 'children' ||\n k === 'key' ||\n k === 'ref' ||\n k === 'suppressHydrationWarning' ||\n k === 'suppressContentEditableWarning' ||\n (k[0] === 'o' && k[1] === 'n' && typeof value == 'function')\n ) continue\n\n if (k === 'dangerouslySetInnerHTML') {\n const probe = document.createElement('div')\n probe.innerHTML = value?.__html ?? ''\n if ((el as HTMLElement).innerHTML !== probe.innerHTML) {\n if (process.env.NODE_ENV !== 'production') {\n failHydration(\n fiber,\n new Error(`Hydration HTML mismatch inside <${tag}>.`),\n )\n }\n failHydration(fiber)\n }\n continue\n }\n\n if (k === 'value' || k === 'defaultValue') {\n if (tag === 'select') continue\n if (tag === 'input' || tag === 'textarea') {\n if (k === 'value' || props.value == null) {\n if (value != null && (el as HTMLInputElement).value !== '' + value) {\n if (process.env.NODE_ENV !== 'production') {\n failHydration(fiber, new Error(`Hydration ${tag} value mismatch on <${tag}>.`))\n }\n failHydration(fiber)\n }\n }\n continue\n }\n }\n\n if (tag === 'input' && (k === 'checked' || k === 'defaultChecked')) {\n if (k === 'checked' || props.checked == null) {\n if (value != null && (el as HTMLInputElement).checked !== !!value) {\n if (process.env.NODE_ENV !== 'production') {\n failHydration(fiber, new Error(`Hydration checked mismatch on <input>.`))\n }\n failHydration(fiber)\n }\n }\n continue\n }\n\n if (tag === 'option' && k === 'selected') {\n if (value != null && (el as HTMLOptionElement).selected !== !!value) {\n if (process.env.NODE_ENV !== 'production') {\n failHydration(fiber, new Error(`Hydration selected mismatch on <option>.`))\n }\n failHydration(fiber)\n }\n continue\n }\n\n if (k === 'style') {\n expected ??= createHostNode(tag, isSvg)\n setProp(expected, k, value, undefined, isSvg)\n if ((el as HTMLElement).style.cssText !== (expected as HTMLElement).style.cssText) {\n if (process.env.NODE_ENV !== 'production') {\n failHydration(\n fiber,\n new Error(`Hydration style mismatch on <${tag}>.`),\n )\n }\n failHydration(fiber)\n }\n continue\n }\n\n const stringifiedBoolean = k.startsWith('aria-') || k.startsWith('data-')\n const attr = attributeName(k, isSvg)\n\n let expectedValue: string | null\n if (value == null || (value === false && !stringifiedBoolean)) {\n expectedValue = null\n } else {\n expected ??= createHostNode(tag, isSvg)\n setProp(expected, k, value, undefined, isSvg)\n expectedValue = expected.getAttribute(attr)\n }\n const actualValue = el.getAttribute(attr)\n if (expectedValue !== actualValue) {\n if (attr === 'id' && expectedValue != null && actualValue != null) {\n continue\n }\n if (process.env.NODE_ENV !== 'production') {\n failHydration(\n fiber,\n new Error(\n `Hydration attribute mismatch on <${tag}> for \"${attr}\": ` +\n `expected ${formatHydrationValue(expectedValue)} but found ${formatHydrationValue(actualValue)}.`,\n ),\n )\n }\n failHydration(fiber)\n }\n }\n}\n\nfunction formatHydrationValue(value: string | null): string {\n return value == null ? 'nothing' : JSON.stringify(value)\n}\n"],
5
+ "mappings": ";AAAA;AAAA,EACE;AAAA,EACA;AAAA,OAKK;AACP,SAAS,qBAAqB;AAC9B,SAAS,gBAAgB,eAAe;AACxC,SAAS,wBAAwB;AACjC,SAAS,oBAAoB,UAAU,eAAe,kBAAkB;AACxE,SAAS,iBAAiB,uBAAuB;AAgB1C,SAAS,8BAAoC;AAClD,MAAI,OAAO,WAAW,YAAa;AACnC,QAAM,IAAI;AACV,MAAI,EAAE,GAAI;AACV,QAAM,OAAO,KAAK;AAClB,QAAM,iBAAiB,EAAE,KAAK,KAAK;AACnC,MAAI,mBAAmB;AACvB,MAAI,eAAe;AACnB,IAAE;AAAA,IACA;AAAA,IACA,MAAM;AACJ,UAAI,CAAC,cAAc;AACjB,2BAAmB,KAAK;AAAA,MAC1B;AAAA,IACF;AAAA,IACA,EAAE,SAAS,MAAM,SAAS,KAAK;AAAA,EACjC;AACA,QAAM,eAAe,EAAE;AACvB,IAAE,WAAW,YAAa,MAAa;AACrC,UAAM,MAAM,KAAK;AACjB,QACE,MAAM,iBAAiB,OACvB,MAAM,mBAAmB,MACzB;AACA;AAAA,IACF;AACA,mBAAe;AACf,QAAI;AACF,aAAQ,aAAqB,MAAM,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