@askrjs/askr 0.0.21 → 0.0.24
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.
- package/LICENSE +201 -201
- package/README.md +160 -46
- package/dist/_virtual/___vite-browser-external.js +1 -0
- package/dist/_virtual/__vite-browser-external.js +1 -0
- package/dist/_virtual/_commonjsHelpers.js +1 -0
- package/dist/_virtual/main.js +1 -0
- package/dist/_virtual/preload-helper.js +1 -0
- package/dist/{benchmark.d.ts → bench/benchmark-entry.d.ts} +3 -3
- package/dist/bench/benchmark-entry.d.ts.map +1 -0
- package/dist/benchmark.js +1 -1
- package/dist/boot/index.d.ts +70 -0
- package/dist/boot/index.d.ts.map +1 -0
- package/dist/boot/index.js +2 -0
- package/dist/common/component.d.ts +16 -0
- package/dist/common/component.d.ts.map +1 -0
- package/dist/common/errors.d.ts +53 -0
- package/dist/common/errors.d.ts.map +1 -0
- package/dist/common/index.d.ts +14 -0
- package/dist/common/index.d.ts.map +1 -0
- package/dist/common/jsx.d.ts +17 -0
- package/dist/common/jsx.d.ts.map +1 -0
- package/dist/common/jsx.js +1 -0
- package/dist/{jsx-CPjsGyEg.d.ts → common/props.d.ts} +6 -18
- package/dist/common/props.d.ts.map +1 -0
- package/dist/{router-DaGtH1Sq.d.ts → common/router.d.ts} +10 -7
- package/dist/common/router.d.ts.map +1 -0
- package/dist/common/ssr-errors.d.ts +8 -0
- package/dist/common/ssr-errors.d.ts.map +1 -0
- package/dist/common/ssr-errors.js +1 -0
- package/dist/common/ssr.d.ts +17 -0
- package/dist/common/ssr.d.ts.map +1 -0
- package/dist/common/vnode.d.ts +17 -0
- package/dist/common/vnode.d.ts.map +1 -0
- package/dist/common/vnode.js +1 -0
- package/dist/components/link.d.ts +56 -0
- package/dist/components/link.d.ts.map +1 -0
- package/dist/components/link.js +1 -0
- package/dist/dev/invariant.d.ts +83 -0
- package/dist/dev/invariant.d.ts.map +1 -0
- package/dist/dev/invariant.js +2 -0
- package/dist/dev/logger.d.ts +13 -0
- package/dist/dev/logger.d.ts.map +1 -0
- package/dist/dev/logger.js +1 -0
- package/dist/dev/vite-plugin-askr.d.ts +18 -0
- package/dist/dev/vite-plugin-askr.d.ts.map +1 -0
- package/dist/dev/warnings.d.ts +5 -0
- package/dist/dev/warnings.d.ts.map +1 -0
- package/dist/for/for.d.ts +16 -0
- package/dist/for/for.d.ts.map +1 -0
- package/dist/for/for.js +1 -0
- package/dist/for/index.d.ts +2 -63
- package/dist/for/index.d.ts.map +1 -0
- package/dist/for/index.js +1 -1
- package/dist/foundations/core.d.ts +23 -0
- package/dist/foundations/core.d.ts.map +1 -0
- package/dist/foundations/core.js +1 -0
- package/dist/foundations/index.d.ts +3 -669
- package/dist/foundations/index.d.ts.map +1 -0
- package/dist/foundations/index.js +1 -1
- package/dist/foundations/interactions/dismissable.d.ts +58 -0
- package/dist/foundations/interactions/dismissable.d.ts.map +1 -0
- package/dist/foundations/interactions/dismissable.js +1 -0
- package/dist/foundations/interactions/focusable.d.ts +16 -0
- package/dist/foundations/interactions/focusable.d.ts.map +1 -0
- package/dist/foundations/interactions/focusable.js +1 -0
- package/dist/foundations/interactions/hoverable.d.ts +19 -0
- package/dist/foundations/interactions/hoverable.d.ts.map +1 -0
- package/dist/foundations/interactions/hoverable.js +1 -0
- package/dist/foundations/interactions/index.d.ts +5 -0
- package/dist/foundations/interactions/index.d.ts.map +1 -0
- package/dist/foundations/interactions/interaction-policy.d.ts +96 -0
- package/dist/foundations/interactions/interaction-policy.d.ts.map +1 -0
- package/dist/foundations/interactions/interaction-policy.js +1 -0
- package/dist/foundations/interactions/pressable.d.ts +54 -0
- package/dist/foundations/interactions/pressable.d.ts.map +1 -0
- package/dist/foundations/interactions/pressable.js +1 -0
- package/dist/foundations/interactions/roving-focus.d.ts +117 -0
- package/dist/foundations/interactions/roving-focus.d.ts.map +1 -0
- package/dist/foundations/interactions/roving-focus.js +1 -0
- package/dist/foundations/state/controllable.d.ts +53 -0
- package/dist/foundations/state/controllable.d.ts.map +1 -0
- package/dist/foundations/state/controllable.js +1 -0
- package/dist/foundations/state/index.d.ts +2 -0
- package/dist/foundations/state/index.d.ts.map +1 -0
- package/dist/foundations/structures/collection.d.ts +67 -0
- package/dist/foundations/structures/collection.d.ts.map +1 -0
- package/dist/foundations/structures/collection.js +1 -0
- package/dist/foundations/structures/index.d.ts +5 -0
- package/dist/foundations/structures/index.d.ts.map +1 -0
- package/dist/foundations/structures/layer.d.ts +102 -0
- package/dist/foundations/structures/layer.d.ts.map +1 -0
- package/dist/foundations/structures/layer.js +1 -0
- package/dist/{layout-BINPv-nz.d.ts → foundations/structures/layout.d.ts} +3 -4
- package/dist/foundations/structures/layout.d.ts.map +1 -0
- package/dist/foundations/structures/layout.js +1 -0
- package/dist/foundations/structures/portal.d.ts +33 -0
- package/dist/foundations/structures/portal.d.ts.map +1 -0
- package/dist/foundations/structures/portal.js +1 -0
- package/dist/foundations/structures/presence.d.ts +30 -0
- package/dist/foundations/structures/presence.d.ts.map +1 -0
- package/dist/foundations/structures/presence.js +1 -0
- package/dist/foundations/structures/slot.d.ts +31 -0
- package/dist/foundations/structures/slot.d.ts.map +1 -0
- package/dist/foundations/structures/slot.js +1 -0
- package/dist/foundations/structures.d.ts +14 -0
- package/dist/foundations/structures.d.ts.map +1 -0
- package/dist/foundations/structures.js +1 -0
- package/dist/foundations/utilities/aria.d.ts +13 -0
- package/dist/foundations/utilities/aria.d.ts.map +1 -0
- package/dist/foundations/utilities/aria.js +1 -0
- package/dist/foundations/utilities/compose-handlers.d.ts +34 -0
- package/dist/foundations/utilities/compose-handlers.d.ts.map +1 -0
- package/dist/foundations/utilities/compose-handlers.js +1 -0
- package/dist/foundations/utilities/compose-ref.d.ts +24 -0
- package/dist/foundations/utilities/compose-ref.d.ts.map +1 -0
- package/dist/foundations/utilities/compose-ref.js +1 -0
- package/dist/foundations/utilities/event-types.d.ts +17 -0
- package/dist/foundations/utilities/event-types.d.ts.map +1 -0
- package/dist/foundations/utilities/index.d.ts +7 -0
- package/dist/foundations/utilities/index.d.ts.map +1 -0
- package/dist/foundations/utilities/merge-props.d.ts +2 -0
- package/dist/foundations/utilities/merge-props.d.ts.map +1 -0
- package/dist/foundations/utilities/merge-props.js +1 -0
- package/dist/foundations/utilities/use-id.d.ts +29 -0
- package/dist/foundations/utilities/use-id.d.ts.map +1 -0
- package/dist/foundations/utilities/use-id.js +1 -0
- package/dist/fx/fx.d.ts +30 -0
- package/dist/fx/fx.d.ts.map +1 -0
- package/dist/fx/fx.js +1 -0
- package/dist/fx/index.d.ts +5 -184
- package/dist/fx/index.d.ts.map +1 -0
- package/dist/fx/index.js +1 -1
- package/dist/fx/noop.d.ts +12 -0
- package/dist/fx/noop.d.ts.map +1 -0
- package/dist/fx/noop.js +1 -0
- package/dist/fx/timing.d.ts +155 -0
- package/dist/fx/timing.d.ts.map +1 -0
- package/dist/fx/timing.js +1 -0
- package/dist/index.d.ts +18 -37
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -1
- package/dist/jsx/index.d.ts +4 -0
- package/dist/jsx/index.d.ts.map +1 -0
- package/dist/jsx/index.js +1 -0
- package/dist/jsx/jsx-dev-runtime.d.ts +4 -0
- package/dist/jsx/jsx-dev-runtime.d.ts.map +1 -0
- package/dist/jsx/jsx-runtime.d.ts +10 -0
- package/dist/jsx/jsx-runtime.d.ts.map +1 -0
- package/dist/{types-BTT0Fc9S.d.ts → jsx/types.d.ts} +6 -3
- package/dist/jsx/types.d.ts.map +1 -0
- package/dist/jsx/types.js +1 -0
- package/dist/jsx/utils.d.ts +4 -0
- package/dist/jsx/utils.d.ts.map +1 -0
- package/dist/jsx/utils.js +1 -0
- package/dist/jsx-dev-runtime.js +1 -1
- package/dist/jsx-runtime.js +1 -1
- package/dist/node_modules/esbuild/lib/main.js +65 -0
- package/dist/renderer/cleanup.d.ts +25 -0
- package/dist/renderer/cleanup.d.ts.map +1 -0
- package/dist/renderer/cleanup.js +1 -0
- package/dist/renderer/dom.d.ts +44 -0
- package/dist/renderer/dom.d.ts.map +1 -0
- package/dist/renderer/dom.js +1 -0
- package/dist/renderer/evaluate.d.ts +4 -0
- package/dist/renderer/evaluate.d.ts.map +1 -0
- package/dist/renderer/evaluate.js +1 -0
- package/dist/renderer/fastpath.d.ts +7 -0
- package/dist/renderer/fastpath.d.ts.map +1 -0
- package/dist/renderer/fastpath.js +1 -0
- package/dist/renderer/index.d.ts +6 -0
- package/dist/renderer/index.d.ts.map +1 -0
- package/dist/renderer/index.js +1 -0
- package/dist/renderer/keyed.d.ts +23 -0
- package/dist/renderer/keyed.d.ts.map +1 -0
- package/dist/renderer/keyed.js +1 -0
- package/dist/renderer/reconcile.d.ts +88 -0
- package/dist/renderer/reconcile.d.ts.map +1 -0
- package/dist/renderer/reconcile.js +1 -0
- package/dist/renderer/types.d.ts +3 -0
- package/dist/renderer/types.d.ts.map +1 -0
- package/dist/renderer/types.js +1 -0
- package/dist/renderer/utils.d.ts +63 -0
- package/dist/renderer/utils.d.ts.map +1 -0
- package/dist/renderer/utils.js +1 -0
- package/dist/resources/index.d.ts +7 -22
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +1 -1
- package/dist/router/index.d.ts +8 -87
- package/dist/router/index.d.ts.map +1 -0
- package/dist/router/index.js +1 -1
- package/dist/router/match.d.ts +22 -0
- package/dist/router/match.d.ts.map +1 -0
- package/dist/router/match.js +1 -0
- package/dist/router/navigate.d.ts +20 -0
- package/dist/router/navigate.d.ts.map +1 -0
- package/dist/router/navigate.js +1 -0
- package/dist/router/route.d.ts +52 -0
- package/dist/router/route.d.ts.map +1 -0
- package/dist/router/route.js +1 -0
- package/dist/runtime/component.d.ts +123 -0
- package/dist/runtime/component.d.ts.map +1 -0
- package/dist/runtime/component.js +1 -0
- package/dist/runtime/context.d.ts +80 -0
- package/dist/runtime/context.d.ts.map +1 -0
- package/dist/runtime/context.js +1 -0
- package/dist/runtime/derive.d.ts +7 -0
- package/dist/runtime/derive.d.ts.map +1 -0
- package/dist/runtime/derive.js +1 -0
- package/dist/runtime/dev-namespace.d.ts +31 -0
- package/dist/runtime/dev-namespace.d.ts.map +1 -0
- package/dist/runtime/dev-namespace.js +1 -0
- package/dist/runtime/events.d.ts +52 -0
- package/dist/runtime/events.d.ts.map +1 -0
- package/dist/runtime/events.js +1 -0
- package/dist/runtime/execution-model.d.ts +4 -0
- package/dist/runtime/execution-model.d.ts.map +1 -0
- package/dist/runtime/execution-model.js +1 -0
- package/dist/runtime/fastlane.d.ts +27 -0
- package/dist/runtime/fastlane.d.ts.map +1 -0
- package/dist/runtime/fastlane.js +1 -0
- package/dist/runtime/for.d.ts +52 -0
- package/dist/runtime/for.d.ts.map +1 -0
- package/dist/runtime/for.js +1 -0
- package/dist/runtime/hydration.d.ts +25 -0
- package/dist/runtime/hydration.d.ts.map +1 -0
- package/dist/runtime/operations.d.ts +39 -0
- package/dist/runtime/operations.d.ts.map +1 -0
- package/dist/runtime/operations.js +1 -0
- package/dist/runtime/resource-cell.d.ts +35 -0
- package/dist/runtime/resource-cell.d.ts.map +1 -0
- package/dist/runtime/resource-cell.js +1 -0
- package/dist/runtime/scheduler.d.ts +48 -0
- package/dist/runtime/scheduler.d.ts.map +1 -0
- package/dist/runtime/scheduler.js +1 -0
- package/dist/runtime/snapshot.d.ts +25 -0
- package/dist/runtime/snapshot.d.ts.map +1 -0
- package/dist/runtime/ssr-bridge.d.ts +10 -0
- package/dist/runtime/ssr-bridge.d.ts.map +1 -0
- package/dist/runtime/ssr-bridge.js +1 -0
- package/dist/runtime/state.d.ts +56 -0
- package/dist/runtime/state.d.ts.map +1 -0
- package/dist/runtime/state.js +1 -0
- package/dist/ssr/attrs.d.ts +26 -0
- package/dist/ssr/attrs.d.ts.map +1 -0
- package/dist/ssr/attrs.js +1 -0
- package/dist/ssr/context.d.ts +47 -0
- package/dist/ssr/context.d.ts.map +1 -0
- package/dist/ssr/context.js +1 -0
- package/dist/ssr/create-ssr.d.ts +19 -0
- package/dist/ssr/create-ssr.d.ts.map +1 -0
- package/dist/ssr/errors.d.ts +6 -0
- package/dist/ssr/errors.d.ts.map +1 -0
- package/dist/ssr/errors.js +1 -0
- package/dist/ssr/escape.d.ts +38 -0
- package/dist/ssr/escape.d.ts.map +1 -0
- package/dist/ssr/escape.js +1 -0
- package/dist/ssr/index.d.ts +18 -94
- package/dist/ssr/index.d.ts.map +1 -0
- package/dist/ssr/index.js +1 -1
- package/dist/ssr/render-keys.d.ts +39 -0
- package/dist/ssr/render-keys.d.ts.map +1 -0
- package/dist/ssr/render-keys.js +1 -0
- package/dist/ssr/sink.d.ts +23 -0
- package/dist/ssr/sink.d.ts.map +1 -0
- package/dist/ssr/sink.js +1 -0
- package/dist/ssr/stream-render.d.ts +7 -0
- package/dist/ssr/stream-render.d.ts.map +1 -0
- package/dist/ssr/stream-render.js +1 -0
- package/dist/ssr/types.d.ts +21 -0
- package/dist/ssr/types.d.ts.map +1 -0
- package/dist/vite/index.js +3 -1
- package/package.json +11 -10
- package/dist/chunk-37RC6ZT3.js +0 -1
- package/dist/chunk-3L6PFAJ3.js +0 -1
- package/dist/chunk-47D5SNYH.js +0 -1
- package/dist/chunk-4RTKQ7SC.js +0 -1
- package/dist/chunk-5PLQPS3O.js +0 -1
- package/dist/chunk-62D2TNHX.js +0 -1
- package/dist/chunk-BP2CKUO6.js +0 -1
- package/dist/chunk-D2JSJKCW.js +0 -1
- package/dist/chunk-EQ5S5GU4.js +0 -1
- package/dist/chunk-HGMOQ3I7.js +0 -1
- package/dist/chunk-HZKAD5DE.js +0 -1
- package/dist/chunk-ILZCMHZM.js +0 -2
- package/dist/chunk-NL44ANML.js +0 -2
- package/dist/chunk-YRY4OLQF.js +0 -1
- package/dist/component-AJMg1Gmv.d.ts +0 -177
- package/dist/jsx-dev-runtime.d.ts +0 -7
- package/dist/jsx-runtime.d.ts +0 -14
- package/dist/logger-NGZDJLVS.js +0 -1
- package/dist/main-EPE35NMW.js +0 -65
- package/dist/navigate-4VAVLF3A.js +0 -1
- package/dist/route-IVG3V65Y.js +0 -1
- package/dist/vite/index.d.ts +0 -17
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTML escaping utilities for SSR
|
|
3
|
+
*
|
|
4
|
+
* Centralizes text and attribute escaping to avoid duplication
|
|
5
|
+
* between sync and streaming SSR renderers.
|
|
6
|
+
*/
|
|
7
|
+
export declare const VOID_ELEMENTS: Set<string>;
|
|
8
|
+
/**
|
|
9
|
+
* Clear the escape cache. Call between SSR requests in long-running servers
|
|
10
|
+
* to prevent memory buildup from unique strings.
|
|
11
|
+
*/
|
|
12
|
+
export declare function clearEscapeCache(): void;
|
|
13
|
+
/**
|
|
14
|
+
* Fast check if a string needs text escaping.
|
|
15
|
+
* Used to skip the full escape call when not needed.
|
|
16
|
+
*/
|
|
17
|
+
export declare function needsEscapeText(text: string): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Fast check if a string needs attribute escaping.
|
|
20
|
+
* Checks for & " ' < > characters.
|
|
21
|
+
*/
|
|
22
|
+
export declare function needsEscapeAttr(value: string): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Escape HTML special characters in text content
|
|
25
|
+
* Fast-path: cache first, then scan-then-escape for new strings
|
|
26
|
+
*/
|
|
27
|
+
export declare function escapeText(text: string): string;
|
|
28
|
+
/**
|
|
29
|
+
* Escape HTML special characters in attribute values
|
|
30
|
+
* Fast-path: scan for escapable characters, only escape if found
|
|
31
|
+
*/
|
|
32
|
+
export declare function escapeAttr(value: string): string;
|
|
33
|
+
/**
|
|
34
|
+
* Convert style object to CSS string with value escaping
|
|
35
|
+
* Optimized to avoid Object.entries allocation
|
|
36
|
+
*/
|
|
37
|
+
export declare function styleObjToCss(value: unknown): string | null;
|
|
38
|
+
//# sourceMappingURL=escape.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"escape.d.ts","sourceRoot":"","sources":["../../src/ssr/escape.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,eAAO,MAAM,aAAa,aAexB,CAAC;AA4CH;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAEvC;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAMrD;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAStD;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CA4B/C;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAGhD;AAsCD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAkB3D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const A=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),o=new Map,u=256;const f=/[&"'<>]/g,l=/[{}<>\\]/g,p=/(?:url|expression|javascript)\s*\(/i,a=new Map,E=512;const C=t=>{const e=t.charCodeAt(0);return e===38?"&":e===34?""":e===39?"'":e===60?"<":e===62?">":t};function _(t){const e=a.get(t);if(e!==void 0)return e;const r=t.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`);return a.size<E&&a.set(t,r),r}function d(){o.clear()}function g(t){for(let e=0;e<t.length;e++){const r=t.charCodeAt(e);if(r===38||r===60||r===62)return!0}return!1}function S(t){for(let e=0;e<t.length;e++){const r=t.charCodeAt(e);if(r===38||r===34||r===39||r===60||r===62)return!0}return!1}function b(t){const e=t.length<=64;if(e){const n=o.get(t);if(n!==void 0)return n}if(!g(t))return e&&o.size<u&&o.set(t,t),t;let r=t;return r=r.replace(/&/g,"&"),r=r.replace(/</g,"<"),r=r.replace(/>/g,">"),e&&o.size<u&&o.set(t,r),r}function T(t){return t.replace(f,C)}function h(t){const e=String(t);let r=!1,n=-1;for(let c=0;c<e.length;c++){const s=e.charCodeAt(c);if(s===123||s===125||s===60||s===62||s===92){if(r=!0,n>=0)break}else if(s===40&&n<0&&(n=c,r))break}return!r&&n===-1?e:n!==-1&&p.test(e)?"":r?e.replace(l,""):e}function R(t){if(!t||typeof t!="object")return null;const e=t;let r="";for(const n in e){const c=e[n];if(c==null||c===!1)continue;const s=_(n),i=h(String(c));i&&(r+=`${s}:${i};`)}return r||null}export{A as VOID_ELEMENTS,d as clearEscapeCache,T as escapeAttr,b as escapeText,S as needsEscapeAttr,g as needsEscapeText,R as styleObjToCss};
|
package/dist/ssr/index.d.ts
CHANGED
|
@@ -1,84 +1,3 @@
|
|
|
1
|
-
import { P as Props, J as JSXElement } from '../jsx-CPjsGyEg.js';
|
|
2
|
-
import { b as RouteHandler } from '../router-DaGtH1Sq.js';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Common call contracts: SSR error types
|
|
6
|
-
*/
|
|
7
|
-
declare class SSRDataMissingError extends Error {
|
|
8
|
-
readonly code = "SSR_DATA_MISSING";
|
|
9
|
-
constructor(message?: string);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Common call contracts: SSR types
|
|
14
|
-
*/
|
|
15
|
-
type SSRData = Record<string, unknown>;
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* SSR Context Management
|
|
19
|
-
*
|
|
20
|
-
* Provides concurrency-safe context for server-side rendering.
|
|
21
|
-
* In Node.js, uses AsyncLocalStorage for isolation between concurrent requests.
|
|
22
|
-
* Falls back to stack-based approach in non-Node environments.
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
interface RenderContext {
|
|
26
|
-
url: string;
|
|
27
|
-
seed: number;
|
|
28
|
-
data?: SSRData;
|
|
29
|
-
params?: Record<string, string>;
|
|
30
|
-
signal?: AbortSignal;
|
|
31
|
-
keyCounter: number;
|
|
32
|
-
renderData: Record<string, unknown> | null;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Shared SSR types
|
|
37
|
-
*/
|
|
38
|
-
|
|
39
|
-
/** VNode representation for SSR rendering */
|
|
40
|
-
type VNode = {
|
|
41
|
-
type: string | SSRComponent | symbol;
|
|
42
|
-
props?: Props;
|
|
43
|
-
children?: unknown[];
|
|
44
|
-
};
|
|
45
|
-
/**
|
|
46
|
-
* Component function signature for SSR.
|
|
47
|
-
* Components receive props and an optional context with signal and SSR context.
|
|
48
|
-
*/
|
|
49
|
-
type SSRComponent = (props: Props, context?: {
|
|
50
|
-
signal?: AbortSignal;
|
|
51
|
-
ssr?: RenderContext;
|
|
52
|
-
}) => VNode | JSXElement | string | number | boolean | null;
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* SSR Data Management
|
|
56
|
-
*
|
|
57
|
-
* Manages render-phase keying for deterministic SSR data lookup.
|
|
58
|
-
* All state is stored in the per-render context for concurrency safety.
|
|
59
|
-
*/
|
|
60
|
-
|
|
61
|
-
type ResourceDescriptor = {
|
|
62
|
-
key: string;
|
|
63
|
-
fn: (opts: {
|
|
64
|
-
signal?: AbortSignal;
|
|
65
|
-
}) => Promise<unknown> | unknown;
|
|
66
|
-
deps: unknown[];
|
|
67
|
-
index: number;
|
|
68
|
-
};
|
|
69
|
-
type ResourcePlan = {
|
|
70
|
-
resources: ResourceDescriptor[];
|
|
71
|
-
};
|
|
72
|
-
/** @deprecated SSR prepass has been removed */
|
|
73
|
-
declare function resolvePlan(_plan: ResourcePlan): Promise<Record<string, unknown>>;
|
|
74
|
-
/** @deprecated SSR prepass has been removed */
|
|
75
|
-
declare function collectResources(_opts: {
|
|
76
|
-
url: string;
|
|
77
|
-
routes: SSRRoute[];
|
|
78
|
-
}): ResourcePlan;
|
|
79
|
-
/** @deprecated Alias for resolvePlan */
|
|
80
|
-
declare const resolveResources: typeof resolvePlan;
|
|
81
|
-
|
|
82
1
|
/**
|
|
83
2
|
* SSR - Server-Side Rendering
|
|
84
3
|
*
|
|
@@ -90,20 +9,25 @@ declare const resolveResources: typeof resolvePlan;
|
|
|
90
9
|
* Concurrency: Each render call uses AsyncLocalStorage (Node.js) to isolate
|
|
91
10
|
* render state, making concurrent SSR requests safe.
|
|
92
11
|
*/
|
|
93
|
-
|
|
94
|
-
type
|
|
95
|
-
|
|
96
|
-
|
|
12
|
+
import type { JSXElement } from '../common/jsx';
|
|
13
|
+
import type { RouteHandler } from '../common/router';
|
|
14
|
+
import { type SSRData } from './context';
|
|
15
|
+
import type { VNode, SSRComponent } from './types';
|
|
16
|
+
export { SSRDataMissingError } from './context';
|
|
17
|
+
export type { VNode, SSRComponent } from './types';
|
|
18
|
+
export type Component = SSRComponent;
|
|
19
|
+
export declare function pushSSRStrictPurityGuard(): void;
|
|
20
|
+
export declare function popSSRStrictPurityGuard(): void;
|
|
97
21
|
/**
|
|
98
22
|
* Single synchronous SSR entrypoint: render a component to an HTML string.
|
|
99
23
|
* This is strictly synchronous and deterministic. Optionally provide a seed
|
|
100
24
|
* for deterministic randomness via `options.seed`.
|
|
101
25
|
*/
|
|
102
|
-
declare function renderToStringSync(component: (props?: Record<string, unknown>) => VNode | JSXElement | string | number | null, props?: Record<string, unknown>, options?: {
|
|
26
|
+
export declare function renderToStringSync(component: (props?: Record<string, unknown>) => VNode | JSXElement | string | number | boolean | null | undefined, props?: Record<string, unknown>, options?: {
|
|
103
27
|
seed?: number;
|
|
104
28
|
data?: SSRData;
|
|
105
29
|
}): string;
|
|
106
|
-
declare function renderToStringSyncForUrl(opts: {
|
|
30
|
+
export declare function renderToStringSyncForUrl(opts: {
|
|
107
31
|
url: string;
|
|
108
32
|
routes: Array<{
|
|
109
33
|
path: string;
|
|
@@ -115,20 +39,20 @@ declare function renderToStringSyncForUrl(opts: {
|
|
|
115
39
|
data?: SSRData;
|
|
116
40
|
};
|
|
117
41
|
}): string;
|
|
118
|
-
|
|
119
|
-
type SSRRoute = {
|
|
42
|
+
import { collectResources, resolvePlan, resolveResources, type ResourcePlan } from './render-keys';
|
|
43
|
+
export type SSRRoute = {
|
|
120
44
|
path: string;
|
|
121
45
|
handler: RouteHandler;
|
|
122
46
|
namespace?: string;
|
|
123
47
|
};
|
|
124
|
-
declare function renderToString(component: (props?: Record<string, unknown>) => VNode | JSXElement | string | number | null): string;
|
|
125
|
-
declare function renderToString(opts: {
|
|
48
|
+
export declare function renderToString(component: (props?: Record<string, unknown>) => VNode | JSXElement | string | number | null): string;
|
|
49
|
+
export declare function renderToString(opts: {
|
|
126
50
|
url: string;
|
|
127
51
|
routes: SSRRoute[];
|
|
128
52
|
seed?: number;
|
|
129
53
|
data?: SSRData;
|
|
130
54
|
}): string;
|
|
131
|
-
declare function renderToStream(opts: {
|
|
55
|
+
export declare function renderToStream(opts: {
|
|
132
56
|
url: string;
|
|
133
57
|
routes: SSRRoute[];
|
|
134
58
|
seed?: number;
|
|
@@ -136,5 +60,5 @@ declare function renderToStream(opts: {
|
|
|
136
60
|
onChunk(html: string): void;
|
|
137
61
|
onComplete(): void;
|
|
138
62
|
}): void;
|
|
139
|
-
|
|
140
|
-
|
|
63
|
+
export { collectResources, resolvePlan, resolveResources, ResourcePlan };
|
|
64
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ssr/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAKrD,OAAO,EAML,KAAK,OAAO,EACb,MAAM,WAAW,CAAC;AAWnB,OAAO,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAwCnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAChD,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAGnD,MAAM,MAAM,SAAS,GAAG,YAAY,CAAC;AAQrC,wBAAgB,wBAAwB,SAiBvC;AAED,wBAAgB,uBAAuB,SAQtC;AA8UD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,CACT,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,KAAK,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,EACtE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,OAAO,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,GAC1C,MAAM,CA6CR;AAQD,wBAAgB,wBAAwB,CAAC,IAAI,EAAE;IAC7C,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,YAAY,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC3E,OAAO,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;CAC7C,GAAG,MAAM,CA+DT;AAKD,OAAO,EAGL,gBAAgB,EAChB,WAAW,EACX,gBAAgB,EAChB,KAAK,YAAY,EAClB,MAAM,eAAe,CAAC;AAEvB,MAAM,MAAM,QAAQ,GAAG;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,YAAY,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,wBAAgB,cAAc,CAC5B,SAAS,EAAE,CACT,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,KAAK,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,GAC/C,MAAM,CAAC;AACV,wBAAgB,cAAc,CAAC,IAAI,EAAE;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,QAAQ,EAAE,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,GAAG,MAAM,CAAC;AAsBX,wBAAgB,cAAc,CAAC,IAAI,EAAE;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,QAAQ,EAAE,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,UAAU,IAAI,IAAI,CAAC;CACpB,GAAG,IAAI,CAIP;AA0DD,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,gBAAgB,EAAE,YAAY,EAAE,CAAC"}
|
package/dist/ssr/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {d}from'../chunk-4RTKQ7SC.js';import {b as b$1,a as a$1}from'../chunk-YRY4OLQF.js';export{a as SSRDataMissingError}from'../chunk-YRY4OLQF.js';import {m}from'../chunk-NL44ANML.js';import'../chunk-D2JSJKCW.js';import {j,i,k as k$1}from'../chunk-ILZCMHZM.js';import'../chunk-HGMOQ3I7.js';import'../chunk-BP2CKUO6.js';import {b as b$2,a as a$2}from'../chunk-37RC6ZT3.js';import {a}from'../chunk-62D2TNHX.js';var b=null;try{let n=a("async_hooks");n?.AsyncLocalStorage&&(b=new n.AsyncLocalStorage);}catch{}var N=null;function D(n=12345,e={}){return {url:e.url??"",seed:n,data:e.data,params:e.params,signal:e.signal,keyCounter:0,renderData:null}}function _(n,e){if(b)return b.run(n,e);let t=N;N=n;try{return e()}finally{N=t;}}function y(){return b?b.getStore()??null:N}function x(){throw new a$1}function Q(){return y()?.renderData??null}function ee(){let n=y();return n?`r:${n.keyCounter++}`:"r:0"}function T(n){let e=y();e&&(e.renderData=n??null,e.keyCounter=0);}function v(){let n=y();n&&(n.renderData=null,n.keyCounter=0);}var ne="SSR collection/prepass is removed: SSR is strictly synchronous";async function te(n){throw new Error(`${ne}; async resource plans are not supported`)}function fe(n){throw new Error(`${ne}; collectResources is disabled`)}var pe=te;var L=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),E=new Map,re=256,le=/[&<>]/g,de=/[&"'<>]/g,ge=/[{}<>\\]/g,Se=/(?:url|expression|javascript)\s*\(/i,I=new Map,me=512,ye=n=>{let e=n.charCodeAt(0);return e===38?"&":e===60?"<":e===62?">":n},he=n=>{let e=n.charCodeAt(0);return e===38?"&":e===34?""":e===39?"'":e===60?"<":e===62?">":n};function Re(n){let e=I.get(n);if(e!==void 0)return e;let t=n.replace(/[A-Z]/g,r=>`-${r.toLowerCase()}`);return I.size<me&&I.set(n,t),t}function we(n){for(let e=0;e<n.length;e++){let t=n.charCodeAt(e);if(t===38||t===60||t===62)return true}return false}function X(n){for(let e=0;e<n.length;e++){let t=n.charCodeAt(e);if(t===38||t===34||t===39||t===60||t===62)return true}return false}function h(n){let e=n.length<=64;if(e){let r=E.get(n);if(r!==void 0)return r}if(!we(n))return e&&E.size<re&&E.set(n,n),n;let t=n.replace(le,ye);return e&&E.size<re&&E.set(n,t),t}function k(n){return n.replace(de,he)}function Ce(n){let e=String(n),t=false,r=-1;for(let o=0;o<e.length;o++){let s=e.charCodeAt(o);if(s===123||s===125||s===60||s===62||s===92){if(t=true,r>=0)break}else if(s===40&&r<0&&(r=o,t))break}return !t&&r===-1?e:r!==-1&&Se.test(e)?"":t?e.replace(ge,""):e}function J(n){if(!n||typeof n!="object")return null;let e=n,t="";for(let r in e){let o=e[r];if(o==null||o===false)continue;let s=Re(r),a=Ce(String(o));a&&(t+=`${s}:${a};`);}return t||null}function oe(n){return n.length>=3&&n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&n.charCodeAt(2)>=65&&n.charCodeAt(2)<=90}function U(n,e){if(!n||typeof n!="object")return;let t=n;for(let r in t){let o=t[r];if(r==="children"||r==="key"||r==="ref"||r==="dangerouslySetInnerHTML"||oe(r)||r.charCodeAt(0)===95)continue;let s=r==="className"?"class":r;if(s==="style"){let i=typeof o=="string"?o:J(o);if(!i)continue;e.write(' style="'),X(i)?e.write(k(i)):e.write(i),e.write('"');continue}if(o===true){e.write(" "),e.write(s);continue}if(o===false||o===null||o===void 0)continue;let a=String(o);e.write(" "),e.write(s),e.write('="'),X(a)?e.write(k(a)):e.write(a),e.write('"');}}function P(n,e){if(!n||typeof n!="object")return e?.returnDangerousHtml?{attrs:""}:"";let t=[],r,o=n;for(let a in o){let i=o[a];if(a==="children"||a==="key"||a==="ref")continue;if(a==="dangerouslySetInnerHTML"){i&&typeof i=="object"&&"__html"in i&&(r=String(i.__html));continue}if(oe(a)||a.charCodeAt(0)===95)continue;let c=a==="class"||a==="className"?"class":a;if(c==="style"){let p=typeof i=="string"?i:J(i);if(p===null||p==="")continue;t.push(` style="${k(p)}"`);continue}if(i===true)t.push(` ${c}`);else {if(i===false||i===null||i===void 0)continue;{let p=String(i);t.push(` ${c}="${k(p)}"`);}}}let s=t.join("");return e?.returnDangerousHtml?{attrs:s,dangerousHtml:r}:s}var R=class R{constructor(){this.chunks=[];this.bufferChunks=[];this.bufferLen=0;}write(e){e&&(this.bufferChunks.push(e),this.bufferLen+=e.length,this.bufferLen>=R.FLUSH_THRESHOLD&&(this.chunks.push(this.bufferChunks.join("")),this.bufferChunks.length=0,this.bufferLen=0));}write2(e,t){e&&(this.bufferChunks.push(e),this.bufferLen+=e.length),t&&(this.bufferChunks.push(t),this.bufferLen+=t.length),this.bufferLen>=R.FLUSH_THRESHOLD&&(this.chunks.push(this.bufferChunks.join("")),this.bufferChunks.length=0,this.bufferLen=0);}write3(e,t,r){e&&(this.bufferChunks.push(e),this.bufferLen+=e.length),t&&(this.bufferChunks.push(t),this.bufferLen+=t.length),r&&(this.bufferChunks.push(r),this.bufferLen+=r.length),this.bufferLen>=R.FLUSH_THRESHOLD&&(this.chunks.push(this.bufferChunks.join("")),this.bufferChunks.length=0,this.bufferLen=0);}end(){this.bufferLen&&(this.chunks.push(this.bufferChunks.join("")),this.bufferChunks.length=0,this.bufferLen=0);}toString(){return this.bufferLen&&(this.chunks.push(this.bufferChunks.join("")),this.bufferChunks.length=0,this.bufferLen=0),this.chunks.join("")}};R.FLUSH_THRESHOLD=32*1024;var w=R,V=class{constructor(e,t){this.onChunk=e;this.onComplete=t;}write(e){e&&this.onChunk(e);}end(){this.onComplete();}};function be(n){return !n||typeof n!="object"?false:typeof n.then=="function"}function xe(n,e,t){let r=n(e??{},{signal:t.signal});return be(r)&&x(),r}function F(n,e,t){let r=n.children;if(r===void 0&&(r=n.props?.children),!(r==null||r===false)){if(Array.isArray(r)){for(let o=0;o<r.length;o++)A(r[o],e,t);return}A(r,e,t);}}function A(n,e,t){if(n==null)return;if(typeof n=="string"){e.write(h(n));return}if(typeof n=="number"){e.write(String(n));return}if(typeof n=="boolean"||typeof n!="object")return;let r=n,o=r.type;if(o===b$2){F(r,e,t);return}if(typeof o=="symbol"){F(r,e,t);return}if(typeof o=="function"){let p=xe(o,r.props,t);A(p,e,t);return}let s=o,a=r.props,i=a?.dangerouslySetInnerHTML,c=i&&typeof i=="object"&&"__html"in i?String(i.__html):void 0;if(L.has(s)){e.write("<"),e.write(s),U(a,e),e.write(" />");return}e.write("<"),e.write(s),U(a,e),e.write(">"),c!==void 0?e.write(c):F(r,e,t),e.write("</"),e.write(s),e.write(">");}var G=new Map;function C(n){let e=G.get(n);return e||(e={open:`<${n}`,close:`</${n}>`,selfClose:`<${n} />`},G.size<256&&G.set(n,e)),e}b$1({getCurrentSSRContext:y,throwSSRDataMissing:x,getCurrentRenderData:Q,getNextKey:ee});function Ye(){}function Ze(){}function Ee(n,e,t){if(!(n==null||n===false)){if(typeof n=="string"){e.write(h(n));return}if(typeof n=="number"){e.write(h(String(n)));return}n&&typeof n=="object"&&"type"in n&&H(n,e,t);}}function K(n,e,t){if(!(!n||!Array.isArray(n)||n.length===0))for(let r=0;r<n.length;r++)Ee(n[r],e,t);}function H(n,e,t){let{type:r,props:o}=n;if(typeof r=="function"){let u=z(r,o,t);H(u,e,t);return}if(typeof r=="symbol"){if(r===b$2){let u=Array.isArray(n.children)?n.children:Array.isArray(o?.children)?o?.children:void 0;K(u,e,t);return}throw new Error(`renderNodeSyncToSink: unsupported VNode symbol type: ${String(r)}`)}let s=r;if(L.has(s)){let u=o?P(o):"",{selfClose:f}=C(s);e.write(u?`${f.slice(0,-3)}${u} />`:f);return}let a=o?o?.dangerouslySetInnerHTML:void 0;if(a!=null){let{attrs:u,dangerousHtml:f}=P(o,{returnDangerousHtml:true}),{open:d,close:l}=C(s);e.write(u?`${d}${u}>`:`${d}>`),f!==void 0?e.write(f):K(n.children,e,t),e.write(l);return}let i=o?P(o):"",c=n.children;if(c===void 0&&o?.children!==void 0){let u=o.children;Array.isArray(u)?c=u:u!==null&&u!==false&&(c=[u]);}if(!c||Array.isArray(c)&&c.length===0){let{open:u,close:f}=C(s);e.write(i?`${u}${i}>${f}`:`${u}>${f}`);return}if(Array.isArray(c)&&c.length===1){let u=c[0];if(typeof u=="string"){let{open:f,close:d}=C(s),l=h(u);e.write(i?`${f}${i}>${l}${d}`:`${f}>${l}${d}`);return}if(typeof u=="number"){let{open:f,close:d}=C(s),l=h(String(u));e.write(i?`${f}${i}>${l}${d}`:`${f}>${l}${d}`);return}}let{open:p,close:S}=C(s);e.write(i?`${p}${i}>`:`${p}>`),K(c,e,t),e.write(S);}function z(n,e,t){{let r=j(),o=i("ssr-temp",n,e||{},null);o.ssr=true,k$1(o);try{let s=n(e||{},{ssr:t});if(s instanceof Promise&&x(),typeof s=="string"||typeof s=="number"||typeof s=="boolean"||s===null||s===void 0){let a=s==null||s===!1?"":String(s);return {$$typeof:a$2,type:b$2,props:{children:a?[a]:[]}}}return s}finally{k$1(r);}}}function ke(n,e,t){let r=t?.seed??12345,o=D(r,{data:t?.data});return _(o,()=>{T(t?.data??null);try{let a=z((c,p)=>{let S=n(c??{},p),u={$$typeof:a$2,type:d,props:{},key:"__default_portal"};return S==null?{$$typeof:a$2,type:b$2,props:{children:[u]}}:{$$typeof:a$2,type:b$2,props:{children:[S,u]}}},e||{},o);if(!a)throw new Error("renderToStringSync: wrapped component returned empty");let i=new w;return H(a,i,o),i.end(),i.toString()}finally{v();}})}function qe(n){let{url:e,routes:t,options:r}=n,{clearRoutes:o,route:s,setServerLocation:a,lockRouteRegistration:i,resolveRoute:c}=m;o();for(let f of t)s(f.path,f.handler,f.namespace);a(e),i();let p=c(e);if(!p)throw new Error(`renderToStringSync: no route found for url: ${e}`);let S=r?.seed??12345,u=D(S,{url:e,data:r?.data});return _(u,()=>{T(r?.data??null);try{let d$1=z((ue,ae)=>{let B=p.handler(ue??{},ae),Y={$$typeof:a$2,type:d,props:{},key:"__default_portal"};return B==null?{$$typeof:a$2,type:b$2,props:{children:[Y]}}:{$$typeof:a$2,type:b$2,props:{children:[B,Y]}}},p.params||{},u),l=new w;return H(d$1,l,u),l.end(),l.toString()}finally{v();}})}function nn(n){if(typeof n=="function")return ke(n);let e=n,t=new w;return ie({...e,sink:t}),t.end(),t.toString()}function tn(n){let e=new V(n.onChunk,n.onComplete);ie({...n,sink:e}),e.end();}function ie(n){let{url:e,routes:t,seed:r=12345,data:o,sink:s}=n,{clearRoutes:a,route:i,setServerLocation:c,lockRouteRegistration:p,resolveRoute:S}=m;a();for(let l of t)i(l.path,l.handler,l.namespace);c(e),p();let u=S(e);if(!u)throw new Error(`SSR: no route found for url: ${e}`);let f=D(r,{url:e,data:o,params:u.params}),d=u.handler(u.params);_(f,()=>{T(o||null);try{A(d,s,f);}finally{v();}});}export{fe as collectResources,Ze as popSSRStrictPurityGuard,Ye as pushSSRStrictPurityGuard,tn as renderToStream,nn as renderToString,ke as renderToStringSync,qe as renderToStringSyncForUrl,te as resolvePlan,pe as resolveResources};
|
|
1
|
+
import*as N from"../router/route.js";import"../jsx/index.js";import{DefaultPortal as H}from"../foundations/structures/portal.js";import{throwSSRDataMissing as G,getRenderContext as V,createRenderContext as A,withRenderContext as C}from"./context.js";import{installSSRBridge as j}from"../runtime/ssr-bridge.js";import{getNextKey as U,getCurrentRenderData as B,startRenderPhase as T,stopRenderPhase as E}from"./render-keys.js";import{collectResources as mr,resolvePlan as $r,resolveResources as gr}from"./render-keys.js";import{getCurrentComponentInstance as F,createComponentInstance as z,setCurrentComponentInstance as M}from"../runtime/component.js";import{escapeText as g,VOID_ELEMENTS as K}from"./escape.js";import{renderAttrs as h}from"./attrs.js";import{logger as sr}from"../dev/logger.js";import{StringSink as D,StreamSink as O}from"./sink.js";import{renderNodeToSink as Y}from"./stream-render.js";import{Fragment as $,ELEMENT_TYPE as S}from"../common/jsx.js";import{SSRDataMissingError as hr}from"../common/ssr-errors.js";const R=new Map;function m(r){let e=R.get(r);return e||(e={open:`<${r}`,close:`</${r}>`,selfClose:`<${r} />`},R.size<256&&R.set(r,e)),e}j({getCurrentSSRContext:V,throwSSRDataMissing:G,getCurrentRenderData:B,getNextKey:U});const I=[];function fr(){}function cr(){}function q(r,e,s){if(!(r==null||r===!1)){if(typeof r=="string"){e.write(g(r));return}if(typeof r=="number"){e.write(g(String(r)));return}r&&typeof r=="object"&&"type"in r&&w(r,e,s)}}function v(r,e,s){if(!(!r||!Array.isArray(r)||r.length===0))for(let u=0;u<r.length;u++)q(r[u],e,s)}function w(r,e,s){const{type:u,props:n}=r;if(typeof u=="function"){const t=P(u,n,s);w(t,e,s);return}if(typeof u=="symbol"){if(u===$){const t=Array.isArray(r.children)?r.children:Array.isArray(n?.children)?n?.children:void 0;v(t,e,s);return}throw new Error(`renderNodeSyncToSink: unsupported VNode symbol type: ${String(u)}`)}const o=u;if(K.has(o)){const t=n?h(n):"",{selfClose:i}=m(o);e.write(t?`${i.slice(0,-3)}${t} />`:i);return}const l=n?n?.dangerouslySetInnerHTML:void 0;if(l!=null){const{attrs:t,dangerousHtml:i}=h(n,{returnDangerousHtml:!0}),{open:p,close:c}=m(o);e.write(t?`${p}${t}>`:`${p}>`),i!==void 0?e.write(i):v(r.children,e,s),e.write(c);return}const a=n?h(n):"";let f=r.children;if(f===void 0&&n?.children!==void 0){const t=n.children;Array.isArray(t)?f=t:t!==null&&t!==!1&&(f=[t])}if(!f||Array.isArray(f)&&f.length===0){const{open:t,close:i}=m(o);e.write(a?`${t}${a}>${i}`:`${t}>${i}`);return}if(Array.isArray(f)&&f.length===1){const t=f[0];if(typeof t=="string"){const{open:i,close:p}=m(o),c=g(t);e.write(a?`${i}${a}>${c}${p}`:`${i}>${c}${p}`);return}if(typeof t=="number"){const{open:i,close:p}=m(o),c=g(String(t));e.write(a?`${i}${a}>${c}${p}`:`${i}>${c}${p}`);return}}const{open:y,close:d}=m(o);e.write(a?`${y}${a}>`:`${y}>`),v(f,e,s),e.write(d)}function P(r,e,s){{const u=F(),n=z("ssr-temp",r,e||{},null);n.ssr=!0,M(n);try{const o=r(e||{},{ssr:s});if(o instanceof Promise&&G(),typeof o=="string"||typeof o=="number"||typeof o=="boolean"||o===null||o===void 0){const l=o==null||o===!1?"":String(o);return{$$typeof:S,type:$,props:{children:l?[l]:[]}}}return o}finally{M(u)}}}function J(r,e,s){const u=s?.seed??12345,n=A(u,{data:s?.data});return C(n,()=>{T(s?.data??null);try{const l=P((f,y)=>{const d=r(f??{},y),t={$$typeof:S,type:H,props:{},key:"__default_portal"};return d==null?{$$typeof:S,type:$,props:{children:[t]}}:{$$typeof:S,type:$,props:{children:[d,t]}}},e||{},n);if(!l)throw new Error("renderToStringSync: wrapped component returned empty");const a=new D;return w(l,a,n),a.end(),a.toString()}finally{E()}})}function lr(r){const{url:e,routes:s,options:u}=r,{clearRoutes:n,route:o,setServerLocation:l,lockRouteRegistration:a,resolveRoute:f}=N;n();for(const i of s)o(i.path,i.handler,i.namespace);l(e),a();const y=f(e);if(!y)throw new Error(`renderToStringSync: no route found for url: ${e}`);const d=u?.seed??12345,t=A(d,{url:e,data:u?.data});return C(t,()=>{T(u?.data??null);try{const p=P((k,x)=>{const b=y.handler(k??{},x),_={$$typeof:S,type:H,props:{},key:"__default_portal"};return b==null?{$$typeof:S,type:$,props:{children:[_]}}:{$$typeof:S,type:$,props:{children:[b,_]}}},y.params||{},t),c=new D;return w(p,c,t),c.end(),c.toString()}finally{E()}})}function pr(r){if(typeof r=="function")return J(r);const e=r,s=new D;return L({...e,sink:s}),s.end(),s.toString()}function yr(r){const e=new O(r.onChunk,r.onComplete);L({...r,sink:e}),e.end()}function L(r){const{url:e,routes:s,seed:u=12345,data:n,sink:o}=r,{clearRoutes:l,route:a,setServerLocation:f,lockRouteRegistration:y,resolveRoute:d}=N;l();for(const c of s)a(c.path,c.handler,c.namespace);f(e),y();const t=d(e);if(!t)throw new Error(`SSR: no route found for url: ${e}`);const i=A(u,{url:e,data:n,params:t.params}),p=t.handler(t.params);C(i,()=>{T(n||null);try{Y(p,o,i)}finally{E()}})}export{hr as SSRDataMissingError,mr as collectResources,cr as popSSRStrictPurityGuard,fr as pushSSRStrictPurityGuard,yr as renderToStream,pr as renderToString,J as renderToStringSync,lr as renderToStringSyncForUrl,$r as resolvePlan,gr as resolveResources};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SSR Data Management
|
|
3
|
+
*
|
|
4
|
+
* Manages render-phase keying for deterministic SSR data lookup.
|
|
5
|
+
* All state is stored in the per-render context for concurrency safety.
|
|
6
|
+
*/
|
|
7
|
+
import type { SSRRoute } from './index';
|
|
8
|
+
export type ResourceDescriptor = {
|
|
9
|
+
key: string;
|
|
10
|
+
fn: (opts: {
|
|
11
|
+
signal?: AbortSignal;
|
|
12
|
+
}) => Promise<unknown> | unknown;
|
|
13
|
+
deps: unknown[];
|
|
14
|
+
index: number;
|
|
15
|
+
};
|
|
16
|
+
export type ResourcePlan = {
|
|
17
|
+
resources: ResourceDescriptor[];
|
|
18
|
+
};
|
|
19
|
+
export declare function getCurrentRenderData(): Record<string, unknown> | null;
|
|
20
|
+
export declare function resetKeyCounter(): void;
|
|
21
|
+
export declare function getNextKey(): string;
|
|
22
|
+
export declare function startRenderPhase(data: Record<string, unknown> | null): void;
|
|
23
|
+
export declare function stopRenderPhase(): void;
|
|
24
|
+
/** @deprecated SSR prepass has been removed */
|
|
25
|
+
export declare function startCollection(): never;
|
|
26
|
+
/** @deprecated SSR prepass has been removed */
|
|
27
|
+
export declare function stopCollection(): ResourcePlan;
|
|
28
|
+
/** @deprecated SSR prepass has been removed */
|
|
29
|
+
export declare function registerResourceIntent(_fn: ResourceDescriptor['fn'], _deps: unknown[]): string;
|
|
30
|
+
/** @deprecated SSR prepass has been removed */
|
|
31
|
+
export declare function resolvePlan(_plan: ResourcePlan): Promise<Record<string, unknown>>;
|
|
32
|
+
/** @deprecated SSR prepass has been removed */
|
|
33
|
+
export declare function collectResources(_opts: {
|
|
34
|
+
url: string;
|
|
35
|
+
routes: SSRRoute[];
|
|
36
|
+
}): ResourcePlan;
|
|
37
|
+
/** @deprecated Alias for resolvePlan */
|
|
38
|
+
export declare const resolveResources: typeof resolvePlan;
|
|
39
|
+
//# sourceMappingURL=render-keys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-keys.d.ts","sourceRoot":"","sources":["../../src/ssr/render-keys.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGxC,MAAM,MAAM,kBAAkB,GAAG;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,CAAC,IAAI,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IACnE,IAAI,EAAE,OAAO,EAAE,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,SAAS,EAAE,kBAAkB,EAAE,CAAC;CACjC,CAAC;AAEF,wBAAgB,oBAAoB,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAGrE;AAED,wBAAgB,eAAe,SAG9B;AAED,wBAAgB,UAAU,IAAI,MAAM,CAInC;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,QAMpE;AAED,wBAAgB,eAAe,SAM9B;AAOD,+CAA+C;AAC/C,wBAAgB,eAAe,IAAI,KAAK,CAEvC;AAED,+CAA+C;AAC/C,wBAAgB,cAAc,IAAI,YAAY,CAE7C;AAED,+CAA+C;AAC/C,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,kBAAkB,CAAC,IAAI,CAAC,EAC7B,KAAK,EAAE,OAAO,EAAE,GACf,MAAM,CAIR;AAED,+CAA+C;AAC/C,wBAAsB,WAAW,CAC/B,KAAK,EAAE,YAAY,GAClB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAIlC;AAED,+CAA+C;AAC/C,wBAAgB,gBAAgB,CAAC,KAAK,EAAE;IACtC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,QAAQ,EAAE,CAAC;CACpB,GAAG,YAAY,CAEf;AAED,wCAAwC;AACxC,eAAO,MAAM,gBAAgB,oBAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getRenderContext as t}from"./context.js";function c(){return t()?.renderData??null}function l(){const e=t();e&&(e.keyCounter=0)}function u(){const e=t();return e?`r:${e.keyCounter++}`:"r:0"}function i(e){const n=t();n&&(n.renderData=e??null,n.keyCounter=0)}function a(){const e=t();e&&(e.renderData=null,e.keyCounter=0)}const r="SSR collection/prepass is removed: SSR is strictly synchronous";function f(){throw new Error(`${r}; do not call startCollection()`)}function p(){throw new Error(`${r}; do not call stopCollection()`)}function d(e,n){throw new Error(`${r}; resource() no longer registers intents for prepass`)}async function o(e){throw new Error(`${r}; async resource plans are not supported`)}function R(e){throw new Error(`${r}; collectResources is disabled`)}const C=o;export{R as collectResources,c as getCurrentRenderData,u as getNextKey,d as registerResourceIntent,l as resetKeyCounter,o as resolvePlan,C as resolveResources,f as startCollection,i as startRenderPhase,p as stopCollection,a as stopRenderPhase};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface RenderSink {
|
|
2
|
+
write(html: string): void;
|
|
3
|
+
end(): void;
|
|
4
|
+
}
|
|
5
|
+
export declare class StringSink implements RenderSink {
|
|
6
|
+
private chunks;
|
|
7
|
+
private bufferChunks;
|
|
8
|
+
private bufferLen;
|
|
9
|
+
private static readonly FLUSH_THRESHOLD;
|
|
10
|
+
write(html: string): void;
|
|
11
|
+
write2(a: string, b: string): void;
|
|
12
|
+
write3(a: string, b: string, c: string): void;
|
|
13
|
+
end(): void;
|
|
14
|
+
toString(): string;
|
|
15
|
+
}
|
|
16
|
+
export declare class StreamSink implements RenderSink {
|
|
17
|
+
private readonly onChunk;
|
|
18
|
+
private readonly onComplete;
|
|
19
|
+
constructor(onChunk: (html: string) => void, onComplete: () => void);
|
|
20
|
+
write(html: string): void;
|
|
21
|
+
end(): void;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=sink.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sink.d.ts","sourceRoot":"","sources":["../../src/ssr/sink.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,GAAG,IAAI,IAAI,CAAC;CACb;AAED,qBAAa,UAAW,YAAW,UAAU;IAC3C,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,YAAY,CAAgB;IACpC,OAAO,CAAC,SAAS,CAAK;IAKtB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAa;IAEpD,KAAK,CAAC,IAAI,EAAE,MAAM;IAYlB,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM;IAgB3B,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM;IAoBtC,GAAG;IAQH,QAAQ;CAST;AAED,qBAAa,UAAW,YAAW,UAAU;IAEzC,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,UAAU;gBADV,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,EAC/B,UAAU,EAAE,MAAM,IAAI;IAGzC,KAAK,CAAC,IAAI,EAAE,MAAM;IAIlB,GAAG;CAGJ"}
|
package/dist/ssr/sink.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const f=class f{constructor(){this.chunks=[],this.bufferChunks=[],this.bufferLen=0}write(h){h&&(this.bufferChunks.push(h),this.bufferLen+=h.length,this.bufferLen>=f.FLUSH_THRESHOLD&&(this.chunks.push(this.bufferChunks.join("")),this.bufferChunks.length=0,this.bufferLen=0))}write2(h,s){h&&(this.bufferChunks.push(h),this.bufferLen+=h.length),s&&(this.bufferChunks.push(s),this.bufferLen+=s.length),this.bufferLen>=f.FLUSH_THRESHOLD&&(this.chunks.push(this.bufferChunks.join("")),this.bufferChunks.length=0,this.bufferLen=0)}write3(h,s,e){h&&(this.bufferChunks.push(h),this.bufferLen+=h.length),s&&(this.bufferChunks.push(s),this.bufferLen+=s.length),e&&(this.bufferChunks.push(e),this.bufferLen+=e.length),this.bufferLen>=f.FLUSH_THRESHOLD&&(this.chunks.push(this.bufferChunks.join("")),this.bufferChunks.length=0,this.bufferLen=0)}end(){this.bufferLen&&(this.chunks.push(this.bufferChunks.join("")),this.bufferChunks.length=0,this.bufferLen=0)}toString(){return this.bufferLen&&(this.chunks.push(this.bufferChunks.join("")),this.bufferChunks.length=0,this.bufferLen=0),this.chunks.join("")}};f.FLUSH_THRESHOLD=32*1024;let u=f;class n{constructor(h,s){this.onChunk=h,this.onComplete=s}write(h){h&&this.onChunk(h)}end(){this.onComplete()}}export{n as StreamSink,u as StringSink};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { RenderSink } from './sink';
|
|
2
|
+
import type { SSRComponent } from './types';
|
|
3
|
+
import { type RenderContext } from './context';
|
|
4
|
+
export type Component = SSRComponent;
|
|
5
|
+
export type SSRContext = RenderContext;
|
|
6
|
+
export declare function renderNodeToSink(node: unknown, sink: RenderSink, ctx: RenderContext): void;
|
|
7
|
+
//# sourceMappingURL=stream-render.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stream-render.d.ts","sourceRoot":"","sources":["../../src/ssr/stream-render.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,KAAK,EAAS,YAAY,EAAE,MAAM,SAAS,CAAC;AAEnD,OAAO,EAAE,KAAK,aAAa,EAAuB,MAAM,WAAW,CAAC;AAKpE,MAAM,MAAM,SAAS,GAAG,YAAY,CAAC;AAGrC,MAAM,MAAM,UAAU,GAAG,aAAa,CAAC;AA4CvC,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,OAAO,EACb,IAAI,EAAE,UAAU,EAChB,GAAG,EAAE,aAAa,GACjB,IAAI,CA6FN"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../jsx/index.js";import{throwSSRDataMissing as y}from"./context.js";import{escapeText as w,VOID_ELEMENTS as s}from"./escape.js";import{renderAttrsDirect as a}from"./attrs.js";import{Fragment as g}from"../common/jsx.js";function h(e){return!e||typeof e!="object"?!1:typeof e.then=="function"}function d(e,r,o){const t=e(r??{},{signal:o.signal});return h(t)&&y(),t}function p(e,r,o){let t=e.children;if(t===void 0&&(t=e.props?.children),!(t==null||t===!1)){if(Array.isArray(t)){for(let i=0;i<t.length;i++)l(t[i],r,o);return}l(t,r,o)}}function l(e,r,o){if(e==null)return;if(typeof e=="string"){r.write(w(e));return}if(typeof e=="number"){r.write(String(e));return}if(typeof e=="boolean"||typeof e!="object")return;const t=e,i=t.type;if(i===g){p(t,r,o);return}if(typeof i=="symbol"){p(t,r,o);return}if(typeof i=="function"){const m=d(i,t.props,o);l(m,r,o);return}const f=i,u=t.props,n=u?.dangerouslySetInnerHTML,c=n&&typeof n=="object"&&"__html"in n?String(n.__html):void 0;if(s.has(f)){r.write("<"),r.write(f),a(u,r),r.write(" />");return}r.write("<"),r.write(f),a(u,r),r.write(">"),c!==void 0?r.write(c):p(t,r,o),r.write("</"),r.write(f),r.write(">")}export{l as renderNodeToSink};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared SSR types
|
|
3
|
+
*/
|
|
4
|
+
import type { JSXElement } from '../common/jsx';
|
|
5
|
+
import type { Props } from '../common/props';
|
|
6
|
+
import type { RenderContext } from './context';
|
|
7
|
+
/** VNode representation for SSR rendering */
|
|
8
|
+
export type VNode = {
|
|
9
|
+
type: string | SSRComponent | symbol;
|
|
10
|
+
props?: Props;
|
|
11
|
+
children?: unknown[];
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Component function signature for SSR.
|
|
15
|
+
* Components receive props and an optional context with signal and SSR context.
|
|
16
|
+
*/
|
|
17
|
+
export type SSRComponent = (props: Props, context?: {
|
|
18
|
+
signal?: AbortSignal;
|
|
19
|
+
ssr?: RenderContext;
|
|
20
|
+
}) => VNode | JSXElement | string | number | boolean | null | undefined;
|
|
21
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/ssr/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/C,6CAA6C;AAC7C,MAAM,MAAM,KAAK,GAAG;IAClB,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,MAAM,CAAC;IACrC,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;CACtB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,CACzB,KAAK,EAAE,KAAK,EACZ,OAAO,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,WAAW,CAAC;IAAC,GAAG,CAAC,EAAE,aAAa,CAAA;CAAE,KACpD,KAAK,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC"}
|
package/dist/vite/index.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_virtual/main.js","_virtual/_commonjsHelpers.js","node_modules/esbuild/lib/main.js","_virtual/___vite-browser-external.js","_virtual/__vite-browser-external.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{__vitePreload as f}from"../_virtual/preload-helper.js";function p(e,l){if(!/\.(jsx|tsx)$/.test(l)||l.includes("node_modules"))return null;const i=/(?:function\s+(\w+)|(?:const|let|var)\s+(\w+)\s*=\s*(?:\([^)]*\)|[^=])\s*=>|(\w+)\s*:\s*(?:\([^)]*\)|[^=])\s*=>)/g;let t;const r=[];for(;(t=i.exec(e))!==null;){const o=t[1]||t[2]||t[3];o&&!r.includes(o)&&r.push(o)}if(r.length===0)return null;let s=e;return e.includes("import { __ssrTemplate__ }")||(s=`import { __ssrTemplate__ } from '@askrjs/askr/ssr-template';
|
|
3
|
+
`+s),{code:s}}function d(e={}){const l="askr:vite",i=e.transformJsx??!0,t=e.ssrPrecompile??!1;return{name:l,enforce:"pre",config(){return{resolve:{alias:[]},optimizeDeps:{include:["@askrjs/askr","@askrjs/askr/jsx-runtime","@askrjs/askr/jsx-dev-runtime"]},esbuild:{jsxInject:"import { jsx, jsxs, Fragment } from '@askrjs/askr/jsx-runtime';"}}},async transform(r,s,o){if(t&&o?.ssr){const u=p(r,s);if(u)return u}if(!i||!/\.(jsx|tsx)$/.test(s)||s.includes("node_modules"))return null;try{const u=await f(()=>import("../_virtual/main.js").then(m=>m.m),__vite__mapDeps([0,1,2,3,4])),c={loader:s.endsWith(".tsx")?"tsx":"jsx",jsx:"automatic",jsxImportSource:"@askrjs/askr",sourcefile:s,sourcemap:!0},a=u;let n=null;return typeof a.transformSync=="function"?n=a.transformSync(r,c):typeof a.transform=="function"&&(n=await a.transform(r,c)),!n||!n.code?null:{code:n.code,map:n.map}}catch{return null}}}}const _=d;export{_ as askr,d as askrVitePlugin,d as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@askrjs/askr",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.24",
|
|
4
4
|
"description": "Actor-backed deterministic UI framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -76,9 +76,11 @@
|
|
|
76
76
|
},
|
|
77
77
|
"scripts": {
|
|
78
78
|
"build": "npm run build:prod",
|
|
79
|
-
"build:prod": "cross-env NODE_ENV=production
|
|
79
|
+
"build:prod": "cross-env NODE_ENV=production vite build && npm run build:types",
|
|
80
|
+
"build:types": "tsc -p tsconfig.json --emitDeclarationOnly",
|
|
80
81
|
"build:bench": "npm run build:prod",
|
|
81
82
|
"prepare": "npm run build:prod",
|
|
83
|
+
"dev": "vite",
|
|
82
84
|
"test": "vitest run",
|
|
83
85
|
"test:types": "npm run build && tsd",
|
|
84
86
|
"bench": "cross-env NODE_ENV=production vitest bench --run",
|
|
@@ -86,19 +88,18 @@
|
|
|
86
88
|
"lint": "eslint src tests benches --ext .ts,.tsx"
|
|
87
89
|
},
|
|
88
90
|
"devDependencies": {
|
|
89
|
-
"@eslint/js": "^
|
|
90
|
-
"@types/node": "^25.
|
|
91
|
+
"@eslint/js": "^10.0.1",
|
|
92
|
+
"@types/node": "^25.3.2",
|
|
91
93
|
"cross-env": "^10.1.0",
|
|
92
|
-
"eslint": "^
|
|
94
|
+
"eslint": "^10.0.2",
|
|
93
95
|
"eslint-config-prettier": "^10.1.8",
|
|
94
96
|
"jiti": "^2.6.1",
|
|
95
|
-
"jsdom": "^
|
|
97
|
+
"jsdom": "^28.1.0",
|
|
96
98
|
"prettier": "^3.8.1",
|
|
97
|
-
"tsup": "^8.5.1",
|
|
98
99
|
"tsd": "^0.33.0",
|
|
99
100
|
"typescript": "^5.9.3",
|
|
100
|
-
"typescript-eslint": "^8.
|
|
101
|
-
"
|
|
102
|
-
"
|
|
101
|
+
"typescript-eslint": "^8.56.1",
|
|
102
|
+
"vite": "^7.3.1",
|
|
103
|
+
"vitest": "^4.0.18"
|
|
103
104
|
}
|
|
104
105
|
}
|
package/dist/chunk-37RC6ZT3.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=Symbol.for("askr.element"),r=Symbol.for("askr.fragment");export{e as a,r as b};
|
package/dist/chunk-3L6PFAJ3.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {l,n,a,e,b}from'./chunk-ILZCMHZM.js';function C(l$1){let e=l();if(!e)throw new Error("state() can only be called during component render execution. Move state() calls to the top level of your component function.");let t=n(),s=e.stateValues;if(t<e.stateIndexCheck)throw new Error(`State index violation: state() call at index ${t}, but previously saw index ${e.stateIndexCheck}. This happens when state() is called conditionally (inside if/for/etc). Move all state() calls to the top level of your component function, before any conditionals.`);if(a(t>=e.stateIndexCheck,"[State] State indices must increase monotonically"),e.stateIndexCheck=t,e.firstRenderComplete){if(!e.expectedStateIndices.includes(t))throw new Error(`Hook order violation: state() called at index ${t}, but this index was not in the first render's sequence [${e.expectedStateIndices.join(", ")}]. This usually means state() is inside a conditional or loop. Move all state() calls to the top level of your component function.`)}else e.expectedStateIndices.push(t);if(s[t]){let n=s[t];if(n._owner!==e)throw new Error(`State ownership violation: state() called at index ${t} is owned by a different component instance. State ownership is positional and immutable.`);return n}let o=S(l$1,e);return s[t]=o,o}function S(l$1,e$1){let t=l$1,s=new Map;function o(){o._hasBeenRead=true;let n=l();return n&&n._currentRenderToken!==void 0&&(n._pendingReadStates||(n._pendingReadStates=new Set),n._pendingReadStates.add(o)),t}return o._readers=s,o._owner=e$1,o.set=n=>{if(l()!==null)throw new Error("[Askr] state.set() cannot be called during component render. State mutations during render break the actor model and cause infinite loops. Move state updates to event handlers or use conditional rendering instead.");let r;if(typeof n=="function"?r=n(t):r=n,Object.is(t,r))return;if(e()){t=r;return}t=r;let c=o._readers;if(c){for(let[a,m]of c)if(a.lastRenderToken===m&&!a.hasPendingUpdate){a.hasPendingUpdate=true;let p=a._pendingFlushTask;p?b.enqueue(p):b.enqueue(()=>{a.hasPendingUpdate=false,a.notifyUpdate?.();});}}let u=c?.get(e$1);if(u!==void 0&&e$1.lastRenderToken===u&&!e$1.hasPendingUpdate){e$1.hasPendingUpdate=true;let a=e$1._pendingFlushTask;a?b.enqueue(a):b.enqueue(()=>{e$1.hasPendingUpdate=false,e$1.notifyUpdate?.();});}},o}export{C as a};
|
package/dist/chunk-47D5SNYH.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {d}from'./chunk-4RTKQ7SC.js';import {b}from'./chunk-D2JSJKCW.js';import {j,g,p,i,o,b as b$1}from'./chunk-ILZCMHZM.js';import {a,b as b$2}from'./chunk-37RC6ZT3.js';var x=Symbol.for("__ASKR_HAS_ROUTES__");var P=0,l=new WeakMap,A=Symbol.for("__tempoCleanup__");function R(e,n){e[A]=()=>{let t=[];try{g(e);}catch(o){t.push(o);}try{let o=e.querySelectorAll("*");for(let s of Array.from(o))try{let r=s.__ASKR_INSTANCE;if(r){try{p(r);}catch(a){t.push(a);}try{delete s.__ASKR_INSTANCE;}catch(a){t.push(a);}}}catch(r){t.push(r);}}catch(o){t.push(o);}try{p(n);}catch(o){t.push(o);}if(t.length>0&&n.cleanupStrict)throw new AggregateError(t,"cleanup failed for app root")};try{let t=Object.getOwnPropertyDescriptor(e,"innerHTML")||Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),"innerHTML")||Object.getOwnPropertyDescriptor(Element.prototype,"innerHTML");t&&(t.get||t.set)&&Object.defineProperty(e,"innerHTML",{get:t.get?function(){return t.get.call(this)}:void 0,set:function(o){if(o===""&&l.get(this)===n){try{g(e);}catch(s){if(n.cleanupStrict)throw s}try{p(n);}catch(s){if(n.cleanupStrict)throw s}}if(t.set)return t.set.call(this,o)},configurable:!0});}catch{}}function w(e,n,t){let o$1=(a$1,c)=>{let i=n(a$1,c),d$1={$$typeof:a,type:d,props:{},key:"__default_portal"};return {$$typeof:a,type:b$2,props:{children:i==null?[d$1]:[i,d$1]}}};Object.defineProperty(o$1,"name",{value:n.name||"Component"});let s=e[A];s&&s();let r=l.get(e);if(r){g(e);try{p(r);}catch{}r.fn=o$1,r.evaluationGeneration++,r.mounted=false,r.expectedStateIndices=[],r.firstRenderComplete=false,r.isRoot=true,t&&typeof t.cleanupStrict=="boolean"&&(r.cleanupStrict=t.cleanupStrict);}else {let a=String(++P);r=i(a,o$1,{},e),l.set(e,r),r.isRoot=true,t&&typeof t.cleanupStrict=="boolean"&&(r.cleanupStrict=t.cleanupStrict);}R(e,r),o(r),b$1.flush();}function N(e){if(b("islands"),!e||typeof e!="object")throw new Error("createIsland requires a config object");if(typeof e.component!="function")throw new Error("createIsland: component must be a function");let n=typeof e.root=="string"?document.getElementById(e.root):e.root;if(!n)throw new Error(`Root element not found: ${e.root}`);if("routes"in e)throw new Error("createIsland does not accept routes; use createSPA for routed apps");try{if(globalThis[x])throw new Error("Routes are not supported with islands. Use createSPA (client) or createSSR (server) instead.")}catch{}w(n,e.component,{cleanupStrict:e.cleanupStrict});}async function k(e){if(b("spa"),!e||typeof e!="object")throw new Error("createSPA requires a config object");if(!Array.isArray(e.routes)||e.routes.length===0)throw new Error("createSPA requires a route table. If you are enhancing existing HTML, use createIsland instead.");let n=typeof e.root=="string"?document.getElementById(e.root):e.root;if(!n)throw new Error(`Root element not found: ${e.root}`);let{clearRoutes:t,route:o,lockRouteRegistration:s,resolveRoute:r}=await import('./route-IVG3V65Y.js');t();for(let p of e.routes)o(p.path,p.handler,p.namespace);s();let a=typeof window<"u"?window.location.pathname:"/",c=r(a);if(!c){w(n,()=>({type:"div",children:[]}),{cleanupStrict:false});let{registerAppInstance:p,initializeNavigation:b}=await import('./navigate-4VAVLF3A.js'),E=l.get(n);if(!E)throw new Error("Internal error: app instance missing");p(E,a),b();return}w(n,c.handler,{cleanupStrict:false});let{registerAppInstance:i,initializeNavigation:d}=await import('./navigate-4VAVLF3A.js'),y=l.get(n);if(!y)throw new Error("Internal error: app instance missing");i(y,a),d();}var O=new WeakMap;function _(e){let n=O.get(e);return n||(n=new Map,O.set(e,n)),n}function L(e,n){if(n===void 0&&typeof e=="function"){let a=e();if(a==null)return null;let c=j();if(!c)return a;let i=_(c);return i.has(a)?i.get(a):(i.set(a,a),a)}let t;if(typeof e=="function"&&!("value"in e)?t=e():t=e?.value??e,t==null)return null;let o=j();if(!o)return n(t);let s=_(o);if(s.has(t))return s.get(t);let r=n(t);return s.set(t,r),r}export{N as a,k as b,L as c};
|
package/dist/chunk-4RTKQ7SC.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-37RC6ZT3.js';function f(n){return typeof n=="object"&&n!==null&&n.$$typeof===a$1}function c(n,e){return {...n,props:{...n.props,...e}}}function d(){if(typeof createPortalSlot=="function"){let t=function(){return o.read()};let o=createPortalSlot();return t.render=function(i){return o.write(i.children),null},t}let n=false,e;function r(){return n=true,e}return r.render=function(t){return n&&(e=t.children),null},r}var u;function a(){return u||(u=d()),u}var S=(()=>{function n(){let e=a()();return e===void 0?null:e}return n.render=function(r){return a().render(r),null},n})();export{f as a,c as b,d as c,S as d};
|
package/dist/chunk-5PLQPS3O.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {a}from'./chunk-3L6PFAJ3.js';import {h,f}from'./chunk-ILZCMHZM.js';function m(t,n,a$1){let p=a(h(t,n,a$1?.by))();return {type:f,props:{source:t},_forState:p}}export{m as a};
|
package/dist/chunk-62D2TNHX.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var d=Object.defineProperty;var e=(b=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(b,{get:(a,c)=>(typeof require<"u"?require:a)[c]}):b)(function(b){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+b+'" is not supported')});var f=(b,a)=>()=>(a||b((a={exports:{}}).exports,a),a.exports),g=(b,a)=>{for(var c in a)d(b,c,{get:a[c],enumerable:true});};export{e as a,f as b,g as c};
|
package/dist/chunk-BP2CKUO6.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {a}from'./chunk-37RC6ZT3.js';function e(n,r,o){return {$$typeof:a,type:n,props:r??{},key:o??null}}function s(n,r,o){return e(n,r,o)}function m(n,r,o){return e(n,r,o)}export{e as a,s as b,m as c};
|
package/dist/chunk-D2JSJKCW.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var o=Symbol.for("__ASKR_EXECUTION_MODEL__");function s(){return globalThis[o]}function i(e){let t=globalThis,n=t[o];if(n&&n!==e)throw new Error(`[Askr] mixing execution models is not allowed (current: ${n}, attempted: ${e}). Choose exactly one: createSPA, createSSR, or createIslands.`);n||(t[o]=e);}export{s as a,i as b};
|
package/dist/chunk-EQ5S5GU4.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {b,l}from'./chunk-NL44ANML.js';import {p,o}from'./chunk-ILZCMHZM.js';var e=null;function f(n,t){e=n,b();}function c(n){if(typeof window>"u")return;let t=l(n);t&&(window.history.pushState({path:n},"",n),e&&(p(e),e.fn=t.handler,e.props=t.params,e.stateValues=[],e.expectedStateIndices=[],e.firstRenderComplete=false,e.stateIndexCheck=-1,e.evaluationGeneration++,e.notifyUpdate=null,e.abortController=new AbortController,o(e)));}function s(n){let t=window.location.pathname;if(!e)return;let o$1=l(t);o$1&&(p(e),e.fn=o$1.handler,e.props=o$1.params,e.stateValues=[],e.expectedStateIndices=[],e.firstRenderComplete=false,e.stateIndexCheck=-1,e.evaluationGeneration++,e.notifyUpdate=null,e.abortController=new AbortController,o(e));}function u(){typeof window<"u"&&window.addEventListener("popstate",s);}function m(){typeof window<"u"&&window.removeEventListener("popstate",s);}export{f as a,c as b,u as c,m as d};
|
package/dist/chunk-HGMOQ3I7.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function o(n,u){let r=typeof console<"u"?console:void 0;if(!r)return;let e=r[n];if(typeof e=="function")try{e.apply(console,u);}catch{}}var c={debug:(...n)=>{},info:(...n)=>{},warn:(...n)=>{},error:(...n)=>{o("error",n);}};export{c as a};
|
package/dist/chunk-HZKAD5DE.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function P(e){return typeof e=="object"&&e!==null&&"defaultPrevented"in e&&e.defaultPrevented===true}function u(e,n,r){if(!e&&!n)return m;if(!e)return n;if(!n)return e;let o=r?.checkDefaultPrevented!==false;return function(...a){e(...a),!(o&&P(a[0]))&&n(...a);}}function m(){}function g(e){return e.startsWith("on")}function l(e,n){let r=Object.keys(e);if(r.length===0)return n;let o={...n};for(let t of r){let a=e[t],i=n[t];if(g(t)&&typeof a=="function"&&typeof i=="function"){o[t]=u(i,a);continue}o[t]=a;}return o}function c(e){return e?{"aria-disabled":"true"}:{}}function D(e){return e===void 0?{}:{"aria-expanded":String(e)}}function I(e){return e===void 0?{}:{"aria-selected":String(e)}}function x(e,n){if(e){if(typeof e=="function"){e(n);return}try{e.current=n;}catch{}}}function k(...e){return n=>{for(let r of e)x(r,n);}}function y({disabled:e,onPress:n,isNativeButton:r=false}){let o={onClick:t=>{if(e){t.preventDefault?.(),t.stopPropagation?.();return}n?.(t);}};return r?(e&&(o.disabled=true,Object.assign(o,c(e))),o):(o.role="button",o.tabIndex=e?-1:0,o.onKeyDown=t=>{if(e){t.preventDefault?.(),t.stopPropagation?.();return}if(t.key==="Enter"){t.preventDefault?.(),n?.(t);return}t.key===" "&&t.preventDefault?.();},o.onKeyUp=t=>{if(e){t.preventDefault?.(),t.stopPropagation?.();return}t.key===" "&&(t.preventDefault?.(),n?.(t));},e&&Object.assign(o,c(e)),o)}function L({isNative:e,disabled:n,onPress:r,ref:o}){function t(i){if(n){i.preventDefault?.();return}r?.(i);}if(e)return {disabled:n||void 0,onClick:i=>t(i),ref:o};let a=y({disabled:n,isNativeButton:false,onPress:i=>t(i)});return {...a,"aria-disabled":n||void 0,tabIndex:n?-1:a.tabIndex??0,ref:o}}function S(e,n,r){let o=l(e,n);r&&(o=l(o,r));for(let s in o){if(!s.startsWith("on"))continue;let d=n?.[s],p=r?.[s],v=e?.[s];if(d||p||v){let f=b=>typeof b=="function"?b:void 0;o[s]=u(f(d),u(f(p),f(v)));}}let t=e?.ref,a=r?.ref,i=n?.ref;return o.ref=k(t,a,i),o}function N(e){return (n,r)=>{let o={...r,children:n};return e(o)}}export{u as a,l as b,c,D as d,I as e,x as f,k as g,y as h,L as i,S as j,N as k};
|
package/dist/chunk-ILZCMHZM.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {a}from'./chunk-HGMOQ3I7.js';import {b,a as a$1}from'./chunk-37RC6ZT3.js';function Se(e,n,t){if(!e){let r=t?`
|
|
2
|
-
`+JSON.stringify(t,null,2):"";throw new Error(`[Askr Invariant] ${n}${r}`)}}function De(e,n){Se(e,`[Scheduler Precondition] ${n}`);}function se(){try{let e=globalThis.__ASKR_FASTLANE;return typeof e?.isBulkCommitActive=="function"?!!e.isBulkCommitActive():!1}catch(e){return false}}var ke=class{constructor(){this.q=[];this.head=0;this.running=false;this.inHandler=false;this.depth=0;this.executionDepth=0;this.flushVersion=0;this.kickScheduled=false;this.allowSyncProgress=false;this.waiters=[];this.taskCount=0;}enqueue(n){De(typeof n=="function","enqueue() requires a function"),!(se()&&!this.allowSyncProgress)&&(this.q.push(n),this.taskCount++,!this.running&&!this.kickScheduled&&!this.inHandler&&!se()&&(this.kickScheduled=true,queueMicrotask(()=>{if(this.kickScheduled=false,!this.running&&!se())try{this.flush();}catch(t){setTimeout(()=>{throw t});}})));}flush(){Se(!this.running,"[Scheduler] flush() called while already running"),this.running=true,this.depth=0;let n=null;try{for(;this.head<this.q.length;){this.depth++;let t=this.q[this.head++];try{this.executionDepth++,t(),this.executionDepth--;}catch(r){this.executionDepth>0&&(this.executionDepth=0),n=r;break}this.taskCount>0&&this.taskCount--;}}finally{if(this.running=false,this.depth=0,this.executionDepth=0,this.head>=this.q.length)this.q.length=0,this.head=0;else if(this.head>0){let t=this.q.length-this.head;for(let r=0;r<t;r++)this.q[r]=this.q[this.head+r];this.q.length=t,this.head=0;}this.flushVersion++,this.resolveWaiters();}if(n)throw n}runWithSyncProgress(n){let t=this.allowSyncProgress;this.allowSyncProgress=true;let i=this.flushVersion;try{let a=n();return !this.running&&this.q.length-this.head>0&&this.flush(),a}finally{try{this.flushVersion===i&&(this.flushVersion++,this.resolveWaiters());}catch(a){}this.allowSyncProgress=t;}}waitForFlush(n,t=2e3){let r=typeof n=="number"?n:this.flushVersion+1;return this.flushVersion>=r?Promise.resolve():new Promise((o,s)=>{let i=setTimeout(()=>{let a=globalThis.__ASKR__||{},u={flushVersion:this.flushVersion,queueLen:this.q.length-this.head,running:this.running,inHandler:this.inHandler,bulk:se(),namespace:a};s(new Error(`waitForFlush timeout ${t}ms: ${JSON.stringify(u)}`));},t);this.waiters.push({target:r,resolve:o,reject:s,timer:i});})}getState(){return {queueLength:this.q.length-this.head,running:this.running,depth:this.depth,executionDepth:this.executionDepth,taskCount:this.taskCount,flushVersion:this.flushVersion,inHandler:this.inHandler,allowSyncProgress:this.allowSyncProgress}}setInHandler(n){this.inHandler=n;}isInHandler(){return this.inHandler}isExecuting(){return this.running||this.executionDepth>0}clearPendingSyncTasks(){let n=this.q.length-this.head;return n<=0?0:this.running?(this.q.length=this.head,this.taskCount=Math.max(0,this.taskCount-n),queueMicrotask(()=>{try{this.flushVersion++,this.resolveWaiters();}catch(t){}}),n):(this.q.length=0,this.head=0,this.taskCount=Math.max(0,this.taskCount-n),this.flushVersion++,this.resolveWaiters(),n)}resolveWaiters(){if(this.waiters.length===0)return;let n=[],t=[];for(let r of this.waiters)this.flushVersion>=r.target?(r.timer&&clearTimeout(r.timer),n.push(r.resolve)):t.push(r);this.waiters=t;for(let r of n)r();}},v=new ke;function Oe(){return v.isExecuting()}var Le=Symbol("__tempoContextFrame__"),ie=null;function z(e,n){let t=ie;ie=e;try{return n()}finally{ie=t;}}function Dt(e,n){try{return n()}finally{}}function Ve(){return ie}function J(e){return !e.startsWith("on")||e.length<=2?null:e.slice(2).charAt(0).toLowerCase()+e.slice(3).toLowerCase()}function Y(e){if(e==="wheel"||e==="scroll"||e.startsWith("touch"))return {passive:true}}function Q(e,n=false){return t=>{v.setInHandler(true);try{e(t);}catch(r){a.error("[Askr] Event handler error:",r);}finally{if(v.setInHandler(false),n)try{let r=v.getState();(r.queueLength??0)>0&&!r.running&&(v.isExecuting()||v.flush());}catch(r){queueMicrotask(()=>{throw r});}}}}function Ae(e){return e==="children"||e==="key"||e==="ref"}function ae(e){return !!(e==="children"||e==="key"||e.startsWith("on")&&e.length>2||e.startsWith("data-"))}function ve(e,n,t){try{if(n==="class"||n==="className")return e.className!==String(t);if(n==="value"||n==="checked")return e[n]!==t;let r=e.getAttribute(n);return t==null||t===!1?r!==null:String(t)!==r}catch{return true}}function Z(e){for(let n of Object.keys(e))if(!ae(n))return true;return false}function Ke(e,n){for(let t of Object.keys(n))if(!ae(t)&&ve(e,t,n[t]))return true;return false}function L(e){if(typeof e!="object"||e===null)return;let n=e,t=n.key??n.props?.key;if(t!==void 0)return typeof t=="symbol"?String(t):t}function He(e){let n=new Map;for(let t=e.firstElementChild;t;t=t.nextElementSibling){let r=t.getAttribute("data-key");if(r!==null){n.set(r,t);let o=Number(r);Number.isNaN(o)||n.set(o,t);}}return n}function ue(e){try{`${e}`,new Error().stack;}catch{}}function le(e,n){try{n&&void 0;}catch{}}function ce(e,n,t){(process.env.ASKR_FASTPATH_DEBUG==="1"||process.env.ASKR_FASTPATH_DEBUG==="true")&&(t!==void 0?a.warn(`[Askr][FASTPATH] ${e}`,n,t):n!==void 0?a.warn(`[Askr][FASTPATH] ${e}`,n):a.warn(`[Askr][FASTPATH] ${e}`));}function ee(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}var S=new WeakMap;function de(e){return S.get(e)}function Be(e){try{if(S.has(e))return;let n=He(e);if(n.size===0){n=new Map;let t=Array.from(e.children);for(let r of t){let o=(r.textContent||"").trim();if(o){n.set(o,r);let s=Number(o);Number.isNaN(s)||n.set(s,r);}}}n.size>0&&S.set(e,n);}catch{}}var Ue=new WeakSet;function _n(e){let n=[];for(let t of e){let r=L(t);r!==void 0&&n.push({key:r,vnode:t});}return n}function Sn(e){let n=[];for(let t of e){if(t===-1)continue;let r=0,o=n.length;for(;r<o;){let s=r+o>>1;n[s]<t?r=s+1:o=s;}r===n.length?n.push(t):n[r]=t;}return n.length}function kn(e){for(let{vnode:n}of e){if(typeof n!="object"||n===null)continue;let t=n;if(t.props&&Z(t.props))return true}return false}function bn(e,n){for(let{key:t,vnode:r}of e){let o=n?.get(t);if(!o||typeof r!="object"||r===null)continue;let i=r.props||{};for(let a of Object.keys(i))if(!ae(a)&&ve(o,a,i[a]))return true}return false}function q(e,n,t){let r=_n(n),o=r.length,s=r.map(p=>p.key),i=t?Array.from(t.keys()):[],a=0;for(let p=0;p<s.length;p++){let b=s[p];(p>=i.length||i[p]!==b||!t?.has(b))&&a++;}let f=o>=128&&i.length>0&&a>Math.max(64,Math.floor(o*.1)),c=false,d=0;if(o>=128){let p=Array.from(e.children),b=r.map(({key:N})=>{let O=t?.get(N);return O?.parentElement===e?p.indexOf(O):-1});d=Sn(b),c=d<Math.floor(o*.5);}let m=kn(r),g=bn(r,t);return {useFastPath:(f||c)&&!g&&!m,totalKeyed:o,moveCount:a,lisLen:d,hasPropChanges:g}}var Ce=false,j=null;function qe(){Ce=true,j=new WeakSet;try{let e=v.clearPendingSyncTasks?.()??0;}catch{}}function je(){Ce=false,j=null;}function ne(){return Ce}function Te(e){if(j)try{j.add(e);}catch(n){}}function An(e){return !!(j&&j.has(e))}function vn(e){let n=e._pendingReadStates??new Set,t=e._lastReadStates??new Set,r=e._currentRenderToken;if(r!==void 0){for(let o of t)if(!n.has(o)){let s=o._readers;s&&s.delete(e);}e.lastRenderToken=r;for(let o of n){let s=o._readers;s||(s=new Map,o._readers=s),s.set(e,e.lastRenderToken??0);}e._lastReadStates=n,e._pendingReadStates=new Set,e._currentRenderToken=void 0;}}function Cn(e){if(!e||typeof e!="object"||!("type"in e))return e;let n=e;if(typeof n.type=="symbol"&&(n.type===b||String(n.type)==="Symbol(askr.fragment)")){let t=n.children||n.props?.children;if(Array.isArray(t)&&t.length>0){for(let r of t)if(r&&typeof r=="object"&&"type"in r&&typeof r.type=="string")return r}}return e}function Tn(e,n){let t=Cn(n);if(!t||typeof t!="object"||!("type"in t))return {useFastPath:false,reason:"not-vnode"};let r=t;if(r==null||typeof r.type!="string")return {useFastPath:false,reason:"not-intrinsic"};let o=e.target;if(!o)return {useFastPath:false,reason:"no-root"};let s=o.children[0];if(!s)return {useFastPath:false,reason:"no-first-child"};if(s.tagName.toLowerCase()!==String(r.type).toLowerCase())return {useFastPath:false,reason:"root-tag-mismatch"};let i=r.children||r.props?.children;if(!Array.isArray(i))return {useFastPath:false,reason:"no-children-array"};for(let l of i)if(typeof l=="object"&&l!==null&&"type"in l&&typeof l.type=="function")return {useFastPath:false,reason:"component-child-present"};if(e.mountOperations.length>0)return {useFastPath:false,reason:"pending-mounts"};try{Be(s);}catch{}let a=de(s),u=q(s,i,a);return !u.useFastPath||u.totalKeyed<128?{...u,useFastPath:false,reason:"renderer-declined"}:{...u,useFastPath:true}}function Nn(e,n){let t=globalThis.__ASKR_RENDERER?.evaluate;if(typeof t!="function")return a.warn("[Tempo][FASTPATH][DEV] renderer.evaluate not available; declining fast-lane"),false;qe();try{v.runWithSyncProgress(()=>{t(n,e.target);try{vn(e);}catch{}});let o=v.clearPendingSyncTasks?.()??0;return !0}finally{je();}}function wn(e,n){if(!Tn(e,n).useFastPath)return false;try{return Nn(e,n)}catch{return false}}typeof globalThis<"u"&&(globalThis.__ASKR_FASTLANE={isBulkCommitActive:ne,enterBulkCommit:qe,exitBulkCommit:je,tryRuntimeFastLaneSync:wn,markFastPathApplied:Te,isFastPathApplied:An});var V=Symbol("__FOR_BOUNDARY__");function k(e){return typeof e=="object"&&e!==null&&"type"in e}function $e(e,n,t){let r=e.__ASKR_INSTANCE;if(r){try{ze(r);}catch(o){a.warn("[Askr] cleanupComponent failed:",o);}try{delete e.__ASKR_INSTANCE;}catch(o){}}}function Xe(e,n){try{let r=e.ownerDocument,o=r?.createTreeWalker;if(typeof o=="function"){let s=o.call(r,e,1),i=s.firstChild();for(;i;)n(i),i=s.nextNode();return}}catch{}let t=e.querySelectorAll("*");for(let r=0;r<t.length;r++)n(t[r]);}function w(e,n){if(!e||!(e instanceof Element))return;let t=false,r=null;try{$e(e,r,t);}catch(o){a.warn("[Askr] cleanupInstanceIfPresent failed:",o);}try{Xe(e,o=>{try{$e(o,r,t);}catch(s){t?r.push(s):a.warn("[Askr] cleanupInstanceIfPresent descendant cleanup failed:",s);}});}catch(o){a.warn("[Askr] cleanupInstanceIfPresent descendant query failed:",o);}}function Ne(e,n){w(e);}var T=new WeakMap,I=new WeakMap;function We(e){let n=I.get(e);if(n){for(let t of n.values())try{t.cleanup();}catch(r){a.warn("[Askr] reactive prop cleanup failed:",r);}I.delete(e);}}function Ge(e){let n=T.get(e);if(n){for(let[t,r]of n)r.options!==void 0?e.removeEventListener(t,r.handler,r.options):e.removeEventListener(t,r.handler);T.delete(e);}}function M(e){e&&(Ge(e),We(e),Xe(e,n=>{Ge(n),We(n);}));}var D=globalThis;function me(e,n){}var Rn=(e,n)=>{if(e!=null&&typeof e=="object"){if("id"in e)return e.id;if("key"in e)return e.key}return typeof e=="string"||typeof e=="number"?e:n};function K(e){if(e&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===a$1){let n=e;if(typeof n.type=="function"){let t=n.type,r=t(n.props||{});return K(r)}return n}return e}function nr(e,n,t){let r=typeof e=="function"?null:e,o=P();return {sourceState:r,items:new Map,orderedKeys:[],byFn:t||Rn,renderFn:n,parentInstance:o,mounted:false}}var Je=1;function Ye(e,n,t,r){let o=t,s=Object.assign(()=>o,{set(d){let m=typeof d=="function"?d(o):d;m!==o&&(o=m);}}),i=()=>null,a=pe(`for-item-${e}`,i,{},null);r.parentInstance&&(a.ownerFrame=r.parentInstance.ownerFrame);let u=P();C(a);let l=Qe();a._currentRenderToken=Je++,a._pendingReadStates=new Set;let f=K(r.renderFn(n,()=>s()));try{f&&typeof f=="object"&&"type"in f&&(f.key=e);}catch(d){}H(a),C(u);let c={key:e,item:n,indexSignal:s,componentInstance:a,vnode:f,_startStateIndex:l};return a._pendingFlushTask=()=>{let d=P();C(a),a.stateIndexCheck=-1;let m=a.stateValues;for(let h=0;h<m.length;h++){let p=m[h];p&&(p._hasBeenRead=false);}Ze(l),a._currentRenderToken=Je++,a._pendingReadStates=new Set;try{let h=K(r.renderFn(n,()=>s()));c.vnode=h,H(a);}finally{C(d);}let g=r.parentInstance;g&&g._enqueueRun?.();},c}function Fn(e,n){let t=D.__ASKR_BENCH__?performance.now():0,{items:r,orderedKeys:o,byFn:s}=e,i=o.length,a=n.length;if(i<=a){let c=true;for(let d=0;d<i;d++)if(s(n[d],d)!==o[d]){c=false;break}if(c){let d=[];for(let m=0;m<i;m++){let g=n[m],h=o[m],p=r.get(h);let b=p.item!==g,N=p.indexSignal()!==m;if(b){p.item=g;let O=P();C(p.componentInstance),p.vnode=K(e.renderFn(g,()=>p.indexSignal()));try{p.vnode&&typeof p.vnode=="object"&&"type"in p.vnode&&(p.vnode.key=h);}catch(X){}C(O);}N&&p.indexSignal.set(m),d.push(p.vnode);}for(let m=i;m<a;m++){let g=n[m],h=s(g,m),p=Ye(h,g,m,e);r.set(h,p),d.push(p.vnode),o[m]=h;}return D.__ASKR_BENCH__&&me("reconcile",performance.now()-t),d}}if(a<=i){let c=true;for(let d=0;d<a;d++)if(s(n[d],d)!==o[d]){c=false;break}if(c){let d=[];for(let m=0;m<a;m++){let g=n[m],h=o[m],p=r.get(h);let b=p.item!==g,N=p.indexSignal()!==m;if(b){p.item=g;let O=P();C(p.componentInstance),p.vnode=K(e.renderFn(g,()=>p.indexSignal()));try{p.vnode&&typeof p.vnode=="object"&&"type"in p.vnode&&(p.vnode.key=h);}catch(X){}C(O);}N&&p.indexSignal.set(m),d.push(p.vnode);}for(let m=a;m<i;m++){let g=o[m],h=r.get(g);if(h){let p=h.componentInstance;p.abortController.abort();for(let b of p.cleanupFns)try{b();}catch{}r.delete(g);}}return o.length=a,e.orderedKeys=o,D.__ASKR_BENCH__&&me("reconcile",performance.now()-t),d}}if(i===a){let c=true;for(let d=0;d<i;d++)if(s(n[d],d)!==o[d]){c=false;break}if(c){let d=[];for(let m=0;m<i;m++){let g=n[m],h=o[m],p=r.get(h);let b=p.item!==g,N=p.indexSignal()!==m;if(b){p.item=g;let O=P();C(p.componentInstance);let X=K(e.renderFn(g,()=>p.indexSignal()));p.vnode=X,C(O);}N&&p.indexSignal.set(m),d.push(p.vnode);}return D.__ASKR_BENCH__&&me("reconcile",performance.now()-t),d}}let u=new Set(o),l=[],f=[];for(let c=0;c<n.length;c++){let d=n[c],m=s(d,c);u.delete(m),l.push(m);let g=r.get(m);if(g){let h=g.item!==d,p=g.indexSignal()!==c;if(h){g.item=d;let b=P();C(g.componentInstance),g.vnode=K(e.renderFn(d,()=>g.indexSignal()));try{g.vnode&&typeof g.vnode=="object"&&"type"in g.vnode&&(g.vnode.key=m);}catch(N){}C(b);}p&&g.indexSignal.set(c),f.push(g.vnode);}else {let h=Ye(m,d,c,e);r.set(m,h),f.push(h.vnode);}}for(let c of u){let d=r.get(c);if(d){let m=d.componentInstance;m.abortController.abort();for(let g of m.cleanupFns)try{g();}catch{}r.delete(c);}}return e.orderedKeys=l,D.__ASKR_BENCH__&&me("reconcile",performance.now()-t),f}function te(e,n){let t=n();if(!Array.isArray(t))throw new Error("For source must evaluate to an array");return Fn(e,t)}function en(e,n,t,r){if(typeof document>"u")return null;let o=n.length;if(o===0&&(!r||r.length===0))return null;Oe()||a.warn("[Askr][FASTPATH][DEV] Fast-path reconciliation invoked outside scheduler execution");let s,i;if(o<=20)try{let c=e.children;s=new Array(c.length);for(let d=0;d<c.length;d++)s[d]=c[d];}catch(c){s=void 0;}else {i=new Map;try{for(let c=e.firstElementChild;c;c=c.nextElementSibling){let d=c.getAttribute("data-key");if(d!==null){i.set(d,c);let m=Number(d);Number.isNaN(m)||i.set(m,c);}}}catch(c){i=void 0;}}let a$1=[],u=0,l=0,f=0;for(let c=0;c<n.length;c++){let{key:d,vnode:m}=n[c];u++;let g;if(o<=20&&s){let h=String(d);for(let p=0;p<s.length;p++){let b=s[p],N=b.getAttribute("data-key");if(N!==null&&(N===h||Number(N)===d)){g=b;break}}g||(g=t?.get(d));}else g=i?.get(d)??t?.get(d);if(g)a$1.push(g),f++;else {let h=E(m);h&&(a$1.push(h),l++);}}if(r&&r.length)for(let c of r){let d=E(c);d&&(a$1.push(d),l++);}try{let c=Date.now(),d=document.createDocumentFragment(),m=0;for(let h=0;h<a$1.length;h++)d.appendChild(a$1[h]),m++;try{for(let h=e.firstChild;h;){let p=h.nextSibling;h instanceof Element&&M(h),w(h),h=p;}}catch(h){}try{new Error().stack;}catch(h){}e.replaceChildren(d);try{}catch(h){}try{ne()&&Te(e);}catch(h){}let g=new Map;for(let h=0;h<n.length;h++){let p=n[h].key,b=a$1[h];b instanceof Element&&g.set(p,b);}try{let h={n:o,moves:0,lisLen:0,t_lookup:0,t_fragment:Date.now()-c,t_commit:0,t_bookkeeping:0,fragmentAppendCount:m,mapLookups:u,createdNodes:l,reusedCount:f};typeof globalThis<"u"&&(f>0,void 0),(process.env.ASKR_FASTPATH_DEBUG==="1"||process.env.ASKR_FASTPATH_DEBUG==="true")&&a.warn("[Askr][FASTPATH]",JSON.stringify({n:o,createdNodes:l,reusedCount:f}));}catch(h){}try{Ue.add(e);}catch(h){}return g}catch(c){return null}}function he(e,n){if(e===n)return true;if(e.length!==n.length)return false;for(let t=0;t<e.length;t++){let r=e.charCodeAt(t),o=n.charCodeAt(t);if(r===o)continue;let s=r>=65&&r<=90?r+32:r,i=o>=65&&o<=90?o+32:o;if(s!==i)return false}return true}function B(e,n,t){let{keyedVnodes:r,unkeyedVnodes:o}=Pn(n),s=t||Mn(e),i=In(e,n,r,o,s);return i||Hn(e,n,r,s)}function Mn(e){let n=new Map;try{for(let t=e.firstElementChild;t;t=t.nextElementSibling){let r=t.getAttribute("data-key");if(r!==null){n.set(r,t);let o=Number(r);Number.isNaN(o)||n.set(o,t);}}}catch{}return n}function Pn(e){let n=[],t=[];for(let r=0;r<e.length;r++){let o=e[r],s=L(o);s!==void 0?n.push({key:s,vnode:o}):t.push(o);}return {keyedVnodes:n,unkeyedVnodes:t}}function In(e,n,t,r,o){try{let s=Dn(e,n,t,r,o);if(s)return s;let i=On(e,t);if(i)return i}catch{}return null}function Dn(e,n,t,r,o){if(q(e,n,o).useFastPath&&t.length>=128||ne())try{let i=en(e,t,o,r);if(i)return S.set(e,i),i}catch{}return null}function On(e,n){let t=n.length;if(t<10||e.children.length!==t)return null;let r=Ln(e,n),o=r/t;if(n.length>0){if(r!==t&&o>=.1)return null}else if(o<.9)return null;if(Vn(e,n))return null;try{let s=ge(e,n);return le(s,"bulkKeyedPositionalHits"),Kn(e),S.get(e)}catch{return null}}function Ln(e,n){let t=0;try{for(let r=0;r<n.length;r++){let o=n[r].vnode,s=n[r].key;if(!o||typeof o!="object"||typeof o.type!="string")continue;let i=e.children[r];if(i&&he(i.tagName,o.type)){let a=i.getAttribute("data-key");(a===String(s)||a!==null&&!Number.isNaN(Number(a))&&Number(a)===s)&&t++;}}}catch{}return t}function Vn(e,n){try{for(let t=0;t<n.length;t++){let r=n[t].vnode,o=e.children[t];if(!(!o||!r||typeof r!="object")&&Ke(o,r.props||{}))return !0}}catch{return true}return false}function Kn(e){try{let n=new Map;for(let t=e.firstElementChild;t;t=t.nextElementSibling){let r=t.getAttribute("data-key");if(r!==null){n.set(r,t);let o=Number(r);Number.isNaN(o)||n.set(o,t);}}S.set(e,n);}catch{}}function Hn(e,n,t,r){let o=new Map,s=[],i=new WeakSet,a=Bn(e,r,i);for(let u=0;u<n.length;u++){let l=n[u],f=qn(l,u,e,a,i,o);f&&s.push(f);}return typeof document>"u"||(zn(e,s),S.delete(e)),o}function Bn(e,n,t){return r=>{if(!n)return;let o=n.get(r);if(o&&!t.has(o))return t.add(o),o;let s=String(r),i=n.get(s);if(i&&!t.has(i))return t.add(i),i;let a=Number(s);if(!Number.isNaN(a)){let u=n.get(a);if(u&&!t.has(u))return t.add(u),u}return Un(e,r,s,t)}}function Un(e,n,t,r){try{for(let o=e.firstElementChild;o;o=o.nextElementSibling){if(r.has(o))continue;let s=o.getAttribute("data-key");if(s===t)return r.add(o),o;if(s!==null){let i=Number(s);if(!Number.isNaN(i)&&i===n)return r.add(o),o}}}catch{}}function qn(e,n,t,r,o,s){let i=L(e);return i!==void 0?jn(e,i,t,r,s):$n(e,n,t,o)}function jn(e,n,t,r,o){let s=r(n);if(s&&s.parentElement===t)try{let a=e;if(a&&typeof a=="object"&&typeof a.type=="string"&&he(s.tagName,a.type))return R(s,e),o.set(n,s),s}catch{}let i=E(e);return i?(i instanceof Element&&o.set(n,i),i):null}function $n(e,n,t,r){try{let s=t.childNodes[n];if((typeof e=="string"||typeof e=="number")&&s&&s.nodeType===3)return s.data=String(e),r.add(s),s;if(s instanceof Element&&Wn(s,e))return R(s,e),r.add(s),s;let i=Gn(t,r);if(i){let a=Xn(i,e,r);if(a)return a}}catch{}return E(e)}function Wn(e,n){if(!e||typeof n!="object"||n===null||!("type"in n))return false;let t=n,r=e.getAttribute("data-key");return r==null&&typeof t.type=="string"&&he(e.tagName,t.type)}function Gn(e,n){for(let t=e.firstElementChild;t;t=t.nextElementSibling)if(!n.has(t)&&t.getAttribute("data-key")===null)return t}function Xn(e,n,t){if(typeof n=="string"||typeof n=="number")return e.textContent=String(n),t.add(e),e;if(typeof n=="object"&&n!==null&&"type"in n){let r=n;if(typeof r.type=="string"&&he(e.tagName,r.type))return R(e,n),t.add(e),e}return null}function zn(e,n){let t=document.createDocumentFragment();for(let r=0;r<n.length;r++)t.appendChild(n[r]);try{for(let r=e.firstChild;r;){let o=r.nextSibling;r instanceof Element&&M(r),w(r),r=o;}}catch{}ue("reconcile"),e.replaceChildren(t);}var Jn=typeof document<"u",nn=0;function Yn(){try{let n=void 0;if(typeof n=="number"&&Number.isFinite(n));}catch{}return nn++,`comp-${nn}`}function Qn(e,n,t){let r=Q(t,true),o=Y(n);o!==void 0?e.addEventListener(n,r,o):e.addEventListener(n,r),T.has(e)||T.set(e,new Map),T.get(e).set(n,{handler:r,original:t,options:o});}var oe=new Set,A=null,ye=false;function Zn(){if(!A){A={id:"reactive-props-coordinator",lastRenderToken:0,hasPendingUpdate:false,notifyUpdate:null,abortController:new AbortController};let e=()=>{if(!ye)return;ye=false;let n=P();try{for(let t of oe){if(!t.isActive)continue;for(let s of t.readStates)s._readers&&s._readers.delete(A);t.readStates.clear();let r=new Set,o={_pendingReadStates:r,_currentRenderToken:A.lastRenderToken};C(o);try{let s=t.propFn();rn(t.el,t.propName,s,t.tagName),t.readStates=r;}catch{}}A&&(A.lastRenderToken=(A.lastRenderToken??0)+1);for(let t of oe)if(t.isActive)for(let r of t.readStates)r._readers||(r._readers=new Map),r._readers.set(A,A.lastRenderToken??0);}finally{C(n);}};A.notifyUpdate=()=>{ye||(ye=true,v.isExecuting()?e():v.enqueue(e));},A._pendingFlushTask=()=>{A.hasPendingUpdate=false,A.notifyUpdate();};}return A}function tn(e,n,t,r){let o=Zn(),s={el:e,propName:n,propFn:t,tagName:r,readStates:new Set,isActive:true};oe.add(s);let i=P(),a=new Set,u={_pendingReadStates:a,_currentRenderToken:o.lastRenderToken};C(u);try{let l=t();rn(e,n,l,r),s.readStates=a;for(let f of a)f._readers||(f._readers=new Map),f._readers.set(o,o.lastRenderToken??0);}finally{C(i);}return ()=>{if(s.isActive=false,oe.delete(s),A)for(let l of s.readStates)l._readers&&l._readers.delete(A);s.readStates.clear(),oe.size===0&&A&&(A.abortController.abort(),A=null);}}function rn(e,n,t,r){if(t==null||t===false){n==="class"||n==="className"?e.className="":e.removeAttribute(n);return}n==="class"||n==="className"?e.className=String(t):n==="value"||n==="checked"?on(e,n,t,r):e.setAttribute(n,String(t));}function et(e,n,t){for(let r in n){let o=n[r];if(r==="ref"){nt(e,o);continue}if(Ae(r)||o==null||o===false)continue;let s=J(r);if(s){Qn(e,s,o);continue}if(typeof o=="function"&&!s&&r!=="ref"){let i=tn(e,r,o,t);I.has(e)||I.set(e,new Map),I.get(e).set(r,{cleanup:i,fnRef:o});continue}r==="class"||r==="className"?e.className=String(o):r==="value"||r==="checked"?on(e,r,o,t):e.setAttribute(r,String(o));}}function nt(e,n){let t=n;if(t){if(typeof t=="function"){t(e);return}try{t.current=e;}catch{}}}function on(e,n,t,r){n==="value"?((re(r,"input")||re(r,"textarea")||re(r,"select"))&&(e.value=String(t)),e.setAttribute("value",String(t))):n==="checked"&&(re(r,"input")&&(e.checked=!!t),e.setAttribute("checked",String(!!t)));}function Ee(e,n,t){let r=n.key??t?.key;r!==void 0&&e.setAttribute("data-key",String(r));}function E(e){if(!Jn)return null;if(typeof e=="string")return document.createTextNode(e);if(typeof e=="number")return document.createTextNode(String(e));if(!e)return null;if(Array.isArray(e)){let n=document.createDocumentFragment();for(let t of e){let r=E(t);r&&n.appendChild(r);}return n}if(typeof e=="object"&&e!==null&&"type"in e){let n=e.type,t=e.props||{};if(typeof n=="string")return tt(e,n,t);if(typeof n=="function")return rt(e,n,t);if(n===V)return it(e,t);if(typeof n=="symbol"&&(n===b||String(n)==="Symbol(Fragment)"))return ot(e,t)}return null}function tt(e,n,t){let r=document.createElement(n);Ee(r,e,t),et(r,t,n);let o=t.children??e.children;if(o!=null)if(Array.isArray(o)){for(let s of o){let i=E(s);i&&r.appendChild(i);}}else {let s=E(o);s&&r.appendChild(s);}return r}function rt(e,n,t){let o=e[Le]||Ve(),s=n;if(s.constructor.name==="AsyncFunction")throw new Error("Async components are not supported. Use resource() for async work.");let a=e.__instance;a||(a=pe(Yn(),s,t||{},null),e.__instance=a),o&&(a.ownerFrame=o);let u=z(o,()=>un(a));if(u instanceof Promise)throw new Error("Async components are not supported. Components must return synchronously.");let l=z(o,()=>E(u));if(l instanceof Element)return xe(a,l),Ee(l,e,t),l;if(!l){let c=document.createComment("");return a._placeholder=c,a.mounted=true,a.notifyUpdate=a._enqueueRun,c}let f=document.createElement("div");return f.appendChild(l),xe(a,f),Ee(f,e,t),f}function ot(e,n){let t=document.createDocumentFragment(),r=n.children||e.children;if(r)if(Array.isArray(r))for(let o of r){let s=E(o);s&&t.appendChild(s);}else {let o=E(r);o&&t.appendChild(o);}return t}function st(e,n){if(!k(n)||!(e instanceof Element))return true;let t=n.type;return typeof t!="string"?true:e.tagName.toLowerCase()!==t.toLowerCase()}function it(e,n){let t=e._forState;if(!t)return document.createDocumentFragment();let r=n.source,o=te(t,r),s=document.createDocumentFragment();for(let i=0;i<o.length;i++){let a=o[i],u=t.orderedKeys[i],l=u!=null?t.items.get(u):null,f=null;if(l&&l._dom){let c=l._dom;st(c,a)||(f=c);}f||(f=E(a),l&&(l._dom=f??void 0)),f&&(f instanceof Element&&R(f,a,true),s.appendChild(f));}return s}function R(e,n,t=true){if(!k(n))return;let r=n.props||{};Ee(e,n,r);let o=T.get(e),s=null;for(let i in r){let a=r[i];if(Ae(i))continue;let u=J(i);if(a==null||a===false){if(i==="class"||i==="className")e.className="";else if(u&&o?.has(u)){let l=o.get(u);l.options!==void 0?e.removeEventListener(u,l.handler,l.options):e.removeEventListener(u,l.handler),o.delete(u);}else e.removeAttribute(i);continue}if(typeof a=="function"&&!u&&i!=="ref"){let f=I.get(e)?.get(i);if(f&&f.fnRef===a)continue;f&&f.cleanup();let c=tn(e,i,a,n.type);I.has(e)||I.set(e,new Map),I.get(e).set(i,{cleanup:c,fnRef:a});continue}if(i==="class"||i==="className")e.className=String(a);else if(i==="value"||i==="checked")e[i]=a;else if(u){o&&o.size>0&&(s??=new Set).add(u);let l=o?.get(u);if(l&&l.original===a)continue;l&&(l.options!==void 0?e.removeEventListener(u,l.handler,l.options):e.removeEventListener(u,l.handler));let f=Q(a,true),c=Y(u);c!==void 0?e.addEventListener(u,f,c):e.addEventListener(u,f),T.has(e)||T.set(e,new Map),T.get(e).set(u,{handler:f,original:a,options:c});}else e.setAttribute(i,String(a));}if(o&&o.size>0)if(s===null){for(let[i,a]of o)a.options!==void 0?e.removeEventListener(i,a.handler,a.options):e.removeEventListener(i,a.handler);T.delete(e);}else {for(let[i,a]of o)s.has(i)||(a.options!==void 0?e.removeEventListener(i,a.handler,a.options):e.removeEventListener(i,a.handler),o.delete(i));o.size===0&&T.delete(e);}if(t){let i=n.children||r.children;at(e,i);}}function at(e,n){if(!n){e.textContent="";return}if(!Array.isArray(n)&&(typeof n=="string"||typeof n=="number")){e.childNodes.length===1&&e.firstChild?.nodeType===3?e.firstChild.data=String(n):e.textContent=String(n);return}if(Array.isArray(n)&&n.length===1&&k(n[0])&&n[0].type===V){let r=n[0],o=r._forState;if(!o)throw new Error("[updateElementChildren] For boundary missing _forState");let s=(r.props||{}).source,i=te(o,s),a=S.get(e),u=B(e,i,a||new Map);S.set(e,u);return}if(Array.isArray(n)){Re(e,n);return}e.textContent="";let t=E(n);t&&e.appendChild(t);}function Re(e,n){let t=Array.from(e.children),r=n.some(i=>typeof i=="string"||typeof i=="number"),o=n.some(i=>k(i));if(r&&o){let i=Array.from(e.childNodes),a=Math.max(i.length,n.length);for(let u=0;u<a;u++){let l=i[u],f=n[u];if(f===void 0&&l){l.nodeType===1&&w(l),l.remove();continue}if(!l&&f!==void 0){let c=E(f);c&&e.appendChild(c);continue}if(!(!l||f===void 0)){if(typeof f=="string"||typeof f=="number")if(l.nodeType===3)l.data=String(f);else {let c=document.createTextNode(String(f));e.replaceChild(c,l);}else if(k(f))if(l.nodeType===1){let c=l;if(typeof f.type=="string")if(W(c.tagName,f.type))R(c,f);else {let d=E(f);d&&(M(c),w(c),e.replaceChild(d,l));}}else {let c=E(f);c&&e.replaceChild(c,l);}}}return}if(n.length===1&&t.length===0&&e.childNodes.length===1){let i=n[0],a=e.firstChild;if((typeof i=="string"||typeof i=="number")&&a?.nodeType===3){a.data=String(i);return}}t.length===0&&e.childNodes.length>0&&(e.textContent="");let s=Math.max(t.length,n.length);for(let i=0;i<s;i++){let a=t[i],u=n[i];if(u===void 0&&a){w(a),a.remove();continue}if(!a&&u!==void 0){let l=E(u);l&&e.appendChild(l);continue}if(!(!a||u===void 0))if(typeof u=="string"||typeof u=="number")a.textContent=String(u);else if(k(u))if(typeof u.type=="string")if(W(a.tagName,u.type))R(a,u);else {let l=E(u);l&&(a instanceof Element&&M(a),w(a),e.replaceChild(l,a));}else {let l=E(u);l&&(a instanceof Element&&M(a),w(a),e.replaceChild(l,a));}else {let l=E(u);l&&(a instanceof Element&&M(a),w(a),e.replaceChild(l,a));}}}function ge(e,n){let t=n.length,r=0,o=0,s=ee(),i=process.env.ASKR_FASTPATH_DEBUG==="1"||process.env.ASKR_FASTPATH_DEBUG==="true";for(let l=0;l<t;l++){let{key:f,vnode:c}=n[l],d=e.children[l];if(d&&k(c)&&typeof c.type=="string"){let m=c.type;if(W(d.tagName,m)){let g=c.children||c.props?.children;i&&ce("positional idx",l,{chTag:d.tagName,vnodeType:m,chChildNodes:d.childNodes.length,childrenType:Array.isArray(g)?"array":typeof g}),ut(d,g,c),ct(d,f,()=>o++),r++;continue}else i&&ce("positional tag mismatch",l,{chTag:d.tagName,vnodeType:m});}else i&&ce("positional missing or invalid",l,{ch:!!d});ft(e,l,c);}let a=ee()-s;mt(e,n);let u={n:t,reused:r,updatedKeys:o,t:a};return le(u,"bulkKeyedPositionalHits"),u}function ut(e,n,t){typeof n=="string"||typeof n=="number"?($(e,String(n)),t.props&&Z(t.props)&&R(e,t,false)):Array.isArray(n)&&n.length===1&&(typeof n[0]=="string"||typeof n[0]=="number")?($(e,String(n[0])),t.props&&Z(t.props)&&R(e,t,false)):lt(e,t)||R(e,t);}function lt(e,n){let t=n.children||n.props?.children;if(!Array.isArray(t)||t.length!==2)return false;let r=t[0],o=t[1];if(!k(r)||!k(o)||typeof r.type!="string"||typeof o.type!="string")return false;let s=e.children[0],i=e.children[1];if(!s||!i||!W(s.tagName,r.type)||!W(i.tagName,o.type))return false;let a=r.children||r.props?.children,u=o.children||o.props?.children;if(typeof a=="string"||typeof a=="number")$(s,String(a));else if(Array.isArray(a)&&a.length===1&&(typeof a[0]=="string"||typeof a[0]=="number"))$(s,String(a[0]));else return false;if(typeof u=="string"||typeof u=="number")$(i,String(u));else if(Array.isArray(u)&&u.length===1&&(typeof u[0]=="string"||typeof u[0]=="number"))$(i,String(u[0]));else return false;return true}function $(e,n){e.childNodes.length===1&&e.firstChild?.nodeType===3?e.firstChild.data=n:e.textContent=n;}function ct(e,n,t){try{let r=String(n);if(e.getAttribute("data-key")===r)return;e.setAttribute("data-key",r),t();}catch{}}function dt(e){switch(e){case "div":return "DIV";case "span":return "SPAN";case "p":return "P";case "a":return "A";case "button":return "BUTTON";case "input":return "INPUT";case "ul":return "UL";case "ol":return "OL";case "li":return "LI";default:return null}}function re(e,n){if(e===n)return true;let t=e.length;if(t!==n.length)return false;for(let r=0;r<t;r++){let o=e.charCodeAt(r),s=n.charCodeAt(r);if(o===s)continue;let i=o>=65&&o<=90?o+32:o,a=s>=65&&s<=90?s+32:s;if(i!==a)return false}return true}function W(e,n){let t=dt(n);return t!==null&&e===t?true:re(e,n)}function ft(e,n,t){let r=E(t);if(r){let o=e.children[n];o?(w(o),e.replaceChild(r,o)):e.appendChild(r);}}function mt(e,n){try{let t=S.get(e),r=t?(t.clear(),t):new Map;for(let o=0;o<n.length;o++){let s=n[o].key,i=e.children[o];i&&r.set(s,i);}S.set(e,r);}catch{}}function sn(e,n){let t=ee(),r=Array.from(e.childNodes),o=[],s=0,i=0;for(let f=0;f<n.length;f++){let c=pt(n[f],r[f],o);c==="reused"?s++:c==="created"&&i++;}let a=ee()-t,u=yt(e,o);S.delete(e);let l={n:n.length,reused:s,created:i,tBuild:a,tCommit:u};return l}function pt(e,n,t){return typeof e=="string"||typeof e=="number"?ht(String(e),n,t):typeof e=="object"&&e!==null&&"type"in e?gt(e,n,t):"skipped"}function ht(e,n,t){return n&&n.nodeType===3?(n.data=e,t.push(n),"reused"):(t.push(document.createTextNode(e)),"created")}function gt(e,n,t){let r=e;if(typeof r.type=="string"){let s=r.type;if(n&&n.nodeType===1&&W(n.tagName,s))return R(n,e),t.push(n),"reused"}let o=E(e);return o?(t.push(o),"created"):"skipped"}function yt(e,n){let t=Date.now(),r=document.createDocumentFragment();for(let o=0;o<n.length;o++)r.appendChild(n[o]);try{for(let o=e.firstChild;o;){let s=o.nextSibling;o instanceof Element&&M(o),w(o),o=s;}}catch{}return ue("bulk-text-replace"),e.replaceChildren(r),Date.now()-t}function an(e,n){let t=Number(process.env.ASKR_BULK_TEXT_THRESHOLD)||1024,r=.8,o=Array.isArray(n)?n.length:0;if(o<t)return we(),false;let s=_t(n);if(s.componentFound!==void 0)return we({index:s.componentFound}),false;let i=s.simple/o,a=i>=r&&e.childNodes.length>=o;return we({simple:s.simple}),a}function _t(e){let n=0;for(let t=0;t<e.length;t++){let r=e[t];if(typeof r=="string"||typeof r=="number"){n++;continue}if(typeof r=="object"&&r!==null&&"type"in r){let o=r;if(typeof o.type=="function")return {simple:n,componentFound:t};typeof o.type=="string"&&St(o)&&n++;}}return {simple:n}}function St(e){let n=e.children||e.props?.children;return !!(!n||typeof n=="string"||typeof n=="number"||Array.isArray(n)&&n.length===1&&(typeof n[0]=="string"||typeof n[0]=="number"))}function we(e){if(process.env.ASKR_FASTPATH_DEBUG==="1");}var Fe=new WeakMap;function Me(e,n){if(e===n)return true;if(e.length!==n.length)return false;for(let t=0;t<e.length;t++){let r=e.charCodeAt(t),o=n.charCodeAt(t);if(r===o)continue;let s=r>=65&&r<=90?r+32:r,i=o>=65&&o<=90?o+32:o;if(s!==i)return false}return true}function kt(e){if(Array.isArray(e)){if(e.length===1){let n=e[0];if(typeof n=="string"||typeof n=="number")return {isSimple:true,text:String(n)}}}else if(typeof e=="string"||typeof e=="number")return {isSimple:true,text:String(e)};return {isSimple:false}}function bt(e,n){return e.childNodes.length===1&&e.firstChild?.nodeType===3?(e.firstChild.data=n,true):false}function dn(e){let n=new Map;for(let t=e.firstElementChild;t;t=t.nextElementSibling){let r=t.getAttribute("data-key");if(r!==null){n.set(r,t);let o=Number(r);Number.isNaN(o)||n.set(o,t);}}return n}function fn(e){let n=S.get(e);return n||(n=dn(e),n.size>0&&S.set(e,n)),n.size>0?n:void 0}function mn(e){for(let n=0;n<e.length;n++)if(L(e[n])!==void 0)return true;return false}function pn(e,n,t){if(process.env.ASKR_FORCE_BULK_POSREUSE==="1"&&At(e,n))return;let r=B(e,n,t);S.set(e,r);}function At(e,n){try{let t=[];for(let s of n)k(s)&&s.key!==void 0&&t.push({key:s.key,vnode:s});if(t.length===0||t.length!==n.length)return !1;(process.env.ASKR_FASTPATH_DEBUG==="1"||process.env.ASKR_FASTPATH_DEBUG==="true")&&a.warn("[Askr][FASTPATH] forced positional bulk keyed reuse (evaluate-level)");let r=ge(e,t);if(process.env.ASKR_FASTPATH_DEBUG==="1")try{}catch{}let o=dn(e);return S.set(e,o),!0}catch(t){return (process.env.ASKR_FASTPATH_DEBUG==="1"||process.env.ASKR_FASTPATH_DEBUG==="true")&&a.warn("[Askr][FASTPATH] forced bulk path failed, falling back",t),false}}function vt(e,n){if(an(e,n)){sn(e,n);}else Re(e,n);S.delete(e);}function ln(e,n){let t=n._forState;if(!t)return;let r=(n.props||{}).source,o=te(t,r);if(o.length>0){let s=fn(e);try{pn(e,o,s);}catch{let i=B(e,o,s);S.set(e,i);}}else e.textContent="",S.delete(e);}function cn(e,n){if(!n){e.textContent="",S.delete(e);return}if(!Array.isArray(n)&&k(n)&&n.type===V){ln(e,n);return}if(!Array.isArray(n)){e.textContent="";let t=E(n);t&&e.appendChild(t),S.delete(e);return}if(n.length===1&&k(n[0])&&n[0].type===V){ln(e,n[0]);return}if(mn(n)){let t=fn(e);try{pn(e,n,t);}catch{let r=B(e,n,t);S.set(e,r);}}else vt(e,n);}function Pe(e,n){let t=n.children||n.props?.children;if(t&&k(t)&&t.type===V){cn(e,t),R(e,n,false);return}t&&!Array.isArray(t)&&(t=[t]);let r=kt(t);r.isSimple&&bt(e,r.text)||cn(e,t),R(e,n,false);}function Ct(e,n){let t=e.firstElementChild;for(let r=0;r<n.length;r++){let o=n[r],s=t?t.nextElementSibling:null;if(t&&k(o)&&typeof o.type=="string"&&Me(t.tagName,o.type)){Pe(t,o),t=s;continue}let i=E(o);i&&(t?e.replaceChild(i,t):e.appendChild(i)),t=s;}for(;t;){let r=t.nextElementSibling;e.removeChild(t),t=r;}}function Tt(e,n){for(let[t,r]of Object.entries(n)){if(t==="children"||t==="key"||r==null||r===false)continue;if(t==="ref"){Nt(e,r);continue}let o=J(t);if(o){let s=Q(r,true),i=Y(o);i!==void 0?e.addEventListener(o,s,i):e.addEventListener(o,s),T.has(e)||T.set(e,new Map),T.get(e).set(o,{handler:s,original:r,options:i});continue}t==="class"||t==="className"?e.className=String(r):t==="value"||t==="checked"?e[t]=r:e.setAttribute(t,String(r));}}function Nt(e,n){let t=n;if(t){if(typeof t=="function"){t(e);return}try{t.current=e;}catch{}}}function wt(e,n){let t=n.children;if(!Array.isArray(t)||!mn(t))return false;let r=document.createElement(n.type);e.appendChild(r),Tt(r,n.props||{});let o=B(r,t,void 0);return S.set(r,o),true}function xt(e){return k(e)&&typeof e.type=="symbol"&&(e.type===b||String(e.type)==="Symbol(askr.fragment)")}function Rt(e){let n=e.props?.children||e.children||[];return Array.isArray(n)?n:[n]}function G(e,n,t){if(n&&!(typeof document>"u"))if(t&&Fe.has(t)){let r=Fe.get(t),o=r.start.nextSibling;for(;o&&o!==r.end;){let i=o.nextSibling;o.remove(),o=i;}let s=E(e);s&&n.insertBefore(s,r.end);}else if(t){let r=document.createComment("component-start"),o=document.createComment("component-end");n.appendChild(r),n.appendChild(o),Fe.set(t,{start:r,end:o});let s=E(e);s&&n.insertBefore(s,o);}else {let r=e;if(xt(r)){let a=Rt(r);if(a.length===1&&k(a[0])&&typeof a[0].type=="string")r=a[0];else {Ct(n,a);return}}let s=n.__ASKR_INSTANCE;if(s&&s.target===n)if(k(r)&&typeof r.type=="string"&&Me(n.tagName,r.type)){Pe(n,r);return}else {let a=E(r);if(a&&n.parentNode){a instanceof Element&&(a.__ASKR_INSTANCE=s,s.target=a),M(n),n.parentNode.replaceChild(a,n);return}}let i=n.children[0];if(i&&k(r)&&typeof r.type=="string"&&Me(i.tagName,r.type))Pe(i,r);else {if(n.textContent="",k(r)&&typeof r.type=="string"&&wt(n,r))return;let a=E(r);a&&n.appendChild(a);}}}if(typeof globalThis<"u"){let e=globalThis;e.__ASKR_RENDERER={evaluate:G,isKeyedReorderFastPathEligible:q,getKeyMapForElement:de};}function pe(e,n,t,r){let o={id:e,fn:n,props:t,target:r,mounted:false,abortController:new AbortController,stateValues:[],evaluationGeneration:0,notifyUpdate:null,_pendingFlushTask:void 0,_pendingRunTask:void 0,_enqueueRun:void 0,stateIndexCheck:-1,expectedStateIndices:[],firstRenderComplete:false,mountOperations:[],cleanupFns:[],hasPendingUpdate:false,ownerFrame:null,ssr:false,cleanupStrict:false,isRoot:false,_currentRenderToken:void 0,lastRenderToken:0,_pendingReadStates:new Set,_lastReadStates:new Set};return o._pendingRunTask=()=>{o.hasPendingUpdate=false,yn(o);},o._enqueueRun=()=>{o.hasPendingUpdate||(o.hasPendingUpdate=true,v.enqueue(o._pendingRunTask));},o._pendingFlushTask=()=>{o.hasPendingUpdate=false,o._enqueueRun?.();},o}var F=null,_e=0;function eo(){return F}function C(e){F=e;}function hn(e){if(e.isRoot){for(let n of e.mountOperations){let t=n();t instanceof Promise?t.then(r=>{typeof r=="function"&&e.cleanupFns.push(r);}):typeof t=="function"&&e.cleanupFns.push(t);}e.mountOperations=[];}}function xe(e,n){e.target=n;try{n instanceof Element&&(n.__ASKR_INSTANCE=e);}catch(r){}e.notifyUpdate=e._enqueueRun;let t=!e.mounted;e.mounted=true,t&&e.mountOperations.length>0&&hn(e);}var gn=0;function yn(e){e.notifyUpdate=e._enqueueRun,e._currentRenderToken=++gn,e._pendingReadStates=new Set;let n=e.target?e.target.innerHTML:"",t=En(e);if(t instanceof Promise)throw new Error("Async components are not supported. Components must be synchronous.");{let r=globalThis.__ASKR_FASTLANE;try{if(r?.tryRuntimeFastLaneSync?.(e,t))return}catch{}v.enqueue(()=>{if(!e.target&&e._placeholder){if(t==null){H(e);return}let o=e._placeholder,s=o.parentNode;if(!s){a.warn("[Askr] placeholder no longer in DOM, cannot render component");return}let i=document.createElement("div"),a$1=F;F=e;try{G(t,i),s.replaceChild(i,o),e.target=i,e._placeholder=void 0,i.__ASKR_INSTANCE=e,H(e);}finally{F=a$1;}return}if(e.target){let o=[];try{let s=!e.mounted,i=F;F=e,o=Array.from(e.target.childNodes);try{G(t,e.target);}catch(a$1){try{let u=Array.from(e.target.childNodes);for(let l of u)try{Ne(l);}catch(f){a.warn("[Askr] error cleaning up failed commit children:",f);}}catch(u){}try{new Error().stack;}catch(u){}throw e.target.replaceChildren(...o),a$1}finally{F=i;}H(e),e.mounted=!0,s&&e.mountOperations.length>0&&hn(e);}catch(s){try{let i=Array.from(e.target.childNodes);for(let a$1 of i)try{Ne(a$1);}catch(u){a.warn("[Askr] error cleaning up partial children during rollback:",u);}}catch(i){}try{try{new Error().stack;}catch(i){}e.target.replaceChildren(...o);}catch{e.target.innerHTML=n;}throw s}}});}}function un(e){let n=e._currentRenderToken!==void 0,t=e._currentRenderToken,r=e._pendingReadStates;n||(e._currentRenderToken=++gn,e._pendingReadStates=new Set);try{let o=En(e);return n||H(e),o}finally{e._currentRenderToken=t,e._pendingReadStates=r??new Set;}}function En(e){e.stateIndexCheck=-1;for(let n of e.stateValues)n&&(n._hasBeenRead=false);e._pendingReadStates=new Set,F=e,_e=0;try{let t={signal:e.abortController.signal},r={parent:e.ownerFrame,values:null},o=z(r,()=>e.fn(e.props,t)),s=Date.now()-0;s>5&&a.warn(`[askr] Slow render detected: ${s}ms. Consider optimizing component performance.`),e.firstRenderComplete||(e.firstRenderComplete=!0);for(let i=0;i<e.stateValues.length;i++){let a$1=e.stateValues[i];if(a$1&&!a$1._hasBeenRead)try{let u=e.fn?.name||"<anonymous>";a.warn(`[askr] Unused state variable detected in ${u} at index ${i}. State should be read during render or removed.`);}catch{a.warn("[askr] Unused state variable detected. State should be read during render or removed.");}}return o}finally{F=null;}}function Ft(e){e.abortController=new AbortController,e.notifyUpdate=e._enqueueRun,v.enqueue(()=>yn(e));}function P(){return F}function to(){if(!F)throw new Error("getSignal() can only be called during component render execution. Ensure you are calling this from inside your component function.");return F.abortController.signal}function H(e){let n=e._pendingReadStates??new Set,t=e._lastReadStates??new Set,r=e._currentRenderToken;if(r!==void 0){for(let o of t)if(!n.has(o)){let s=o._readers;s&&s.delete(e);}e.lastRenderToken=r;for(let o of n){let s=o._readers;s||(s=new Map,o._readers=s),s.set(e,e.lastRenderToken??0);}e._lastReadStates=n,e._pendingReadStates=new Set,e._currentRenderToken=void 0;}}function ro(){return _e++}function Qe(){return _e}function Ze(e){_e=e;}function oo(e){Ft(e);}function ze(e){let n=[];for(let t of e.cleanupFns)try{t();}catch(r){e.cleanupStrict&&n.push(r);}if(e.cleanupFns=[],n.length>0)throw new AggregateError(n,`Cleanup failed for component ${e.id}`);if(e._lastReadStates){for(let t of e._lastReadStates){let r=t._readers;r&&r.delete(e);}e._lastReadStates=new Set;}e.abortController.abort(),e.notifyUpdate=null,e.mounted=false;}export{Se as a,v as b,Dt as c,Ve as d,ne as e,V as f,M as g,nr as h,pe as i,eo as j,C as k,P as l,to as m,ro as n,oo as o,ze as p};
|