@askrjs/askr 0.0.11 → 0.0.13
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/dist/{chunk-SUQBZD2N.js → chunk-2T3T4RZC.js} +1 -1
- package/dist/chunk-BP2CKUO6.js +1 -0
- package/dist/chunk-HGMOQ3I7.js +1 -0
- package/dist/chunk-HZKAD5DE.js +1 -0
- package/dist/chunk-LMNN4PPU.js +1 -0
- package/dist/{chunk-WKLC6NZC.js → chunk-O3XARUHF.js} +1 -1
- package/dist/chunk-V7SQ5U7C.js +1 -0
- package/dist/chunk-WGORSKNX.js +2 -0
- package/dist/{component-mtwBWhUr.d.ts → component-AJMg1Gmv.d.ts} +1 -1
- package/dist/for/index.d.ts +9 -7
- package/dist/for/index.js +1 -1
- package/dist/foundations/index.d.ts +668 -5
- package/dist/foundations/index.js +1 -1
- package/dist/fx/index.js +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.js +1 -1
- package/dist/{jsx-CSWf4VFg.d.ts → jsx-CPjsGyEg.d.ts} +1 -1
- package/dist/jsx-dev-runtime.d.ts +3 -8
- package/dist/jsx-dev-runtime.js +1 -1
- package/dist/jsx-runtime.d.ts +3 -3
- package/dist/jsx-runtime.js +1 -1
- package/dist/logger-NGZDJLVS.js +1 -0
- package/dist/navigate-2T6BK5D5.js +1 -0
- package/dist/resources/index.d.ts +2 -2
- package/dist/resources/index.js +1 -1
- package/dist/{route-I3FHHF6U.js → route-B4ZJ6FEJ.js} +1 -1
- package/dist/router/index.js +1 -1
- package/dist/ssr/index.d.ts +23 -6
- package/dist/ssr/index.js +1 -1
- package/dist/{types-DxdosFWx.d.ts → types-BTT0Fc9S.d.ts} +1 -1
- package/package.json +1 -9
- package/dist/chunk-72PLUBKM.js +0 -1
- package/dist/chunk-CI6AOGB5.js +0 -1
- package/dist/chunk-DPHQ4JD6.js +0 -1
- package/dist/chunk-FFSNBDHN.js +0 -1
- package/dist/chunk-IOUHU5SL.js +0 -1
- package/dist/chunk-JJDSOK6C.js +0 -1
- package/dist/chunk-OQMK7H2R.js +0 -1
- package/dist/chunk-UJ6R5KBB.js +0 -2
- package/dist/foundations/core.d.ts +0 -449
- package/dist/foundations/core.js +0 -1
- package/dist/foundations/structures.d.ts +0 -223
- package/dist/foundations/structures.js +0 -1
- package/dist/logger-MPMIVXAP.js +0 -1
- package/dist/navigate-FFGHH7CQ.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {a}from'./chunk-D2JSJKCW.js';import {j as j$1}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-D2JSJKCW.js';import {j as j$1}from'./chunk-WGORSKNX.js';import {c}from'./chunk-62D2TNHX.js';var q={};c(q,{_lockRouteRegistrationForTests:()=>T,_unlockRouteRegistrationForTests:()=>U,clearRoutes:()=>C,getLoadedNamespaces:()=>F,getNamespaceRoutes:()=>Q,getRoutes:()=>W,lockRouteRegistration:()=>L,registerRoute:()=>_,resolveRoute:()=>J,route:()=>S,setServerLocation:()=>O,unloadNamespace:()=>j});function h(e,r){let o=e.endsWith("/")&&e!=="/"?e.slice(0,-1):e,i=r.endsWith("/")&&r!=="/"?r.slice(0,-1):r,t=o.split("/").filter(Boolean),n=i.split("/").filter(Boolean);if(n.length===1&&n[0]==="*")return {matched:true,params:{"*":t.length>1?o:t[0]}};if(t.length!==n.length)return {matched:false,params:{}};let s={};for(let a=0;a<n.length;a++){let c=n[a],u=t[a];if(c.startsWith("{")&&c.endsWith("}")){let f=c.slice(1,-1);s[f]=decodeURIComponent(u);}else if(c==="*")s["*"]=u;else if(c!==u)return {matched:false,params:{}}}return {matched:true,params:s}}var l=[],g=new Set,P=Symbol.for("__ASKR_HAS_ROUTES__");function b(e){try{let r=globalThis;r[P]=e;}catch{}}b(false);var p=new Map;function z(e){let r=e.endsWith("/")&&e!=="/"?e.slice(0,-1):e;return r==="/"?0:r.split("/").filter(Boolean).length}function v(e){let r=e.endsWith("/")&&e!=="/"?e.slice(0,-1):e;if(r==="/*")return 0;let o=r.split("/").filter(Boolean),i=0;for(let t of o)t.startsWith("{")&&t.endsWith("}")?i+=2:t==="*"?i+=1:i+=3;return i}var w=null;function O(e){w=e;}function M(e){try{let r=new URL(e,"http://localhost");return {pathname:r.pathname,search:r.search,hash:r.hash}}catch{return {pathname:"/",search:"",hash:""}}}function m(e){if(e&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let r of Object.keys(e)){let o=e[r];o&&typeof o=="object"&&m(o);}}return e}function N(e){let r=new URLSearchParams(e||""),o=new Map;for(let[t,n]of r.entries()){let s=o.get(t);s?s.push(n):o.set(t,[n]);}return m({get(t){let n=o.get(t);return n?n[0]:null},getAll(t){let n=o.get(t);return n?[...n]:[]},has(t){return o.has(t)},toJSON(){let t={};for(let[n,s]of o.entries())t[n]=s.length>1?[...s]:s[0];return t}})}function B(e){let r=W(),o=[];function i(t){let n=t.endsWith("/")&&t!=="/"?t.slice(0,-1):t;if(n==="/*")return 0;let s=n.split("/").filter(Boolean),a=0;for(let c of s)c.startsWith("{")&&c.endsWith("}")?a+=2:c==="*"?a+=1:a+=3;return a}for(let t of r){let n=h(e,t.path);n.matched&&o.push({pattern:t.path,params:n.params,name:t.name,namespace:t.namespace,specificity:i(t.path)});}return o.sort((t,n)=>n.specificity-t.specificity),o.map(t=>({path:t.pattern,params:m({...t.params}),name:t.name,namespace:t.namespace}))}var d=false;function L(){d=true;}function T(){d=true;}function U(){d=false;}function S(e,r,o){if(a()==="islands")throw new Error("Routes are not supported with islands. Use createSPA (client) or createSSR (server) instead.");if(typeof e>"u"){let a=j$1();if(!a)throw new Error("route() can only be called during component render execution. Call route() from inside your component function.");let c="/",u="",f="";if(typeof window<"u"&&window.location)c=window.location.pathname||"/",u=window.location.search||"",f=window.location.hash||"";else if(w){let R=M(w);c=R.pathname,u=R.search,f=R.hash;}let A=m({...a.props||{}}),D=N(u),E=B(c);return Object.freeze({path:c,params:A,query:D,hash:f||null,matches:Object.freeze(E)})}let i=j$1();if(i&&i.ssr)throw new Error("route() cannot be called during SSR rendering. Register routes at module load time instead.");if(d)throw new Error("Route registration is locked after app startup. Register routes at module load time before calling createSPA or createSSR.");if(typeof r!="function")throw new Error("route(path, handler) requires a function handler that returns a VNode (e.g. () => <Page />). Passing JSX elements or VNodes directly is not supported.");let t={path:e,handler:r,namespace:o};l.push(t),b(true);let n=z(e),s=p.get(n);s||(s=[],p.set(n,s)),s.push(t),o&&g.add(o);}function W(){return [...l]}function Q(e){return l.filter(r=>r.namespace===e)}function j(e){let r=l.length;for(let o=l.length-1;o>=0;o--)if(l[o].namespace===e){let i=l[o];l.splice(o,1);let t=z(i.path),n=p.get(t);if(n){let s=n.indexOf(i);s>=0&&n.splice(s,1);}}return g.delete(e),r-l.length}function C(){l.length=0,g.clear(),p.clear(),d=false,b(false);}function k(e){if(e!=null&&typeof e=="function")return (r,o)=>{try{return e(r,o)}catch{return e(r)}}}function _(e,r,...o){let i=!e.startsWith("/"),t={path:e,handler:r,children:o.filter(Boolean),_isDescriptor:true};if(!i){let n=k(r);if(r!=null&&!n)throw new Error("registerRoute(path, handler) requires a function handler. Passing JSX elements or VNodes directly is not supported.");n&&S(e,n);for(let s of t.children||[]){let c=`${e==="/"?"":e.replace(/\/$/,"")}/${s.path.replace(/^\//,"")}`.replace(/\/\//g,"/");if(s.handler){let u=k(s.handler);if(!u)throw new Error("registerRoute child handler must be a function. Passing JSX elements directly is not supported.");u&&S(c,u);}s.children&&s.children.length&&_(c,null,...s.children);}return t}return t}function F(){return Array.from(g)}function J(e){let r=e.endsWith("/")&&e!=="/"?e.slice(0,-1):e,o=r==="/"?0:r.split("/").filter(Boolean).length,i=[],t=p.get(o);if(t)for(let n of t){let s=h(e,n.path);s.matched&&i.push({route:n,specificity:v(n.path),params:s.params});}for(let n of l){if(t?.includes(n))continue;let s=h(e,n.path);s.matched&&i.push({route:n,specificity:v(n.path),params:s.params});}if(i.sort((n,s)=>s.specificity-n.specificity),i.length>0){let n=i[0];return {handler:n.route.handler,params:n.params}}return null}
|
|
2
2
|
export{O as a,L as b,T as c,U as d,S as e,W as f,Q as g,j as h,C as i,_ as j,F as k,J as l,q as m};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {b,l}from'./chunk-2T3T4RZC.js';import {p,o}from'./chunk-WGORSKNX.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {l,n,a,e,b}from'./chunk-
|
|
1
|
+
import {l,n,a,e,b}from'./chunk-WGORSKNX.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'./chunk-O3XARUHF.js';import {h,f}from'./chunk-WGORSKNX.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};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a}from'./chunk-HGMOQ3I7.js';import {b}from'./chunk-37RC6ZT3.js';function fe(e,n,t){if(!e){let r=t?`
|
|
2
|
+
`+JSON.stringify(t,null,2):"";throw new Error(`[Askr Invariant] ${n}${r}`)}}function Te(e,n){fe(e,`[Scheduler Precondition] ${n}`);}function Q(){try{let e=globalThis.__ASKR_FASTLANE;return typeof e?.isBulkCommitActive=="function"?!!e.isBulkCommitActive():!1}catch(e){return false}}var me=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){Te(typeof n=="function","enqueue() requires a function"),!(Q()&&!this.allowSyncProgress)&&(this.q.push(n),this.taskCount++,!this.running&&!this.kickScheduled&&!this.inHandler&&!Q()&&(this.kickScheduled=true,queueMicrotask(()=>{if(this.kickScheduled=false,!this.running&&!Q())try{this.flush();}catch(t){setTimeout(()=>{throw t});}})));}flush(){fe(!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__||{},l={flushVersion:this.flushVersion,queueLen:this.q.length-this.head,running:this.running,inHandler:this.inHandler,bulk:Q(),namespace:a};s(new Error(`waitForFlush timeout ${t}ms: ${JSON.stringify(l)}`));},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();}},C=new me;function Ce(){return C.isExecuting()}var ve=Symbol("__tempoContextFrame__"),Z=null;function U(e,n){let t=Z;Z=e;try{return n()}finally{Z=t;}}function Ct(e,n){try{return n()}finally{}}function Ne(){return Z}function Re(){try{let e=globalThis;return e.__ASKR_DIAG||(e.__ASKR_DIAG={}),e.__ASKR_DIAG}catch(e){return {}}}function A(e,n){try{let t=Re();t[e]=n;try{let r=globalThis;try{let o=r.__ASKR__||(r.__ASKR__={});try{o[e]=n;}catch(s){}}catch(o){}}catch(r){}}catch(t){}}function v(e){try{let n=Re(),r=(typeof n[e]=="number"?n[e]:0)+1;n[e]=r;try{let o=globalThis,s=o.__ASKR__||(o.__ASKR__={});try{let i=typeof s[e]=="number"?s[e]:0;s[e]=i+1;}catch(i){}}catch(o){}}catch(n){}}function q(e){return !e.startsWith("on")||e.length<=2?null:e.slice(2).charAt(0).toLowerCase()+e.slice(3).toLowerCase()}function j(e){if(e==="wheel"||e==="scroll"||e.startsWith("touch"))return {passive:true}}function $(e,n=false){return t=>{C.setInHandler(true);try{e(t);}catch(r){a.error("[Askr] Event handler error:",r);}finally{if(C.setInHandler(false),n){let r=C.getState();(r.queueLength??0)>0&&!r.running&&queueMicrotask(()=>{try{C.isExecuting()||C.flush();}catch(o){queueMicrotask(()=>{throw o});}});}}}}function he(e){return e==="children"||e==="key"||e==="ref"}function ee(e){return !!(e==="children"||e==="key"||e.startsWith("on")&&e.length>2||e.startsWith("data-"))}function ge(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 we(e){for(let n of Object.keys(e))if(!ee(n))return true;return false}function xe(e,n){for(let t of Object.keys(n))if(!ee(t)&&ge(e,t,n[t]))return true;return false}function O(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 Fe(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 ne(e){try{v("__DOM_REPLACE_COUNT"),A(`__LAST_DOM_REPLACE_STACK_${e}`,new Error().stack);}catch{}}function te(e,n){try{A("__LAST_FASTPATH_STATS",e),A("__LAST_FASTPATH_COMMIT_COUNT",1),n&&v(n);}catch{}}function re(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 W(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}var S=new WeakMap;function oe(e){return S.get(e)}function Me(e){try{if(S.has(e))return;let n=Fe(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 Ie=new WeakSet;function an(e){let n=[];for(let t of e){let r=O(t);r!==void 0&&n.push({key:r,vnode:t});}return n}function un(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 ln(e){for(let{vnode:n}of e){if(typeof n!="object"||n===null)continue;let t=n;if(t.props&&we(t.props))return true}return false}function cn(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(!ee(a)&&ge(o,a,i[a]))return true}return false}function L(e,n,t){let r=an(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 g=o>=128&&i.length>0&&a>Math.max(64,Math.floor(o*.1)),c=false,u=0;if(o>=128){let p=Array.from(e.children),b=r.map(({key:x})=>{let P=t?.get(x);return P?.parentElement===e?p.indexOf(P):-1});u=un(b),c=u<Math.floor(o*.5);}let d=ln(r),h=cn(r,t);return {useFastPath:(g||c)&&!h&&!d,totalKeyed:o,moveCount:a,lisLen:u,hasPropChanges:h}}var ye=false,V=null;function Pe(){ye=true,V=new WeakSet;try{let e=C.clearPendingSyncTasks?.()??0;}catch{}}function Oe(){ye=false,V=null;}function G(){return ye}function _e(e){if(V)try{V.add(e);}catch(n){}}function dn(e){return !!(V&&V.has(e))}function fn(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 mn(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 pn(e,n){let t=mn(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 m of i)if(typeof m=="object"&&m!==null&&"type"in m&&typeof m.type=="function")return {useFastPath:false,reason:"component-child-present"};if(e.mountOperations.length>0)return {useFastPath:false,reason:"pending-mounts"};try{Me(s);}catch{}let a=oe(s),l=L(s,i,a);return !l.useFastPath||l.totalKeyed<128?{...l,useFastPath:false,reason:"renderer-declined"}:{...l,useFastPath:true}}function hn(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;Pe();try{C.runWithSyncProgress(()=>{t(n,e.target);try{fn(e);}catch{}});let o=C.clearPendingSyncTasks?.()??0;return !0}finally{Oe();}}function gn(e,n){if(!pn(e,n).useFastPath)return false;try{return hn(e,n)}catch{return false}}typeof globalThis<"u"&&(globalThis.__ASKR_FASTLANE={isBulkCommitActive:G,enterBulkCommit:Pe,exitBulkCommit:Oe,tryRuntimeFastLaneSync:gn,markFastPathApplied:_e,isFastPathApplied:dn});var De=Symbol("__FOR_BOUNDARY__");function N(e){return typeof e=="object"&&e!==null&&"type"in e}function Ke(e,n,t){let r=e.__ASKR_INSTANCE;if(r){try{He(r);}catch(o){a.warn("[Askr] cleanupComponent failed:",o);}try{delete e.__ASKR_INSTANCE;}catch(o){}}}function Ve(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 F(e,n){if(!e||!(e instanceof Element))return;let t=false,r=null;try{Ke(e,r,t);}catch(o){a.warn("[Askr] cleanupInstanceIfPresent failed:",o);}try{Ve(e,o=>{try{Ke(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 Ee(e,n){F(e);}var T=new WeakMap;function Le(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&&(Le(e),Ve(e,Le));}var k=globalThis;function ie(e,n){}var _n=(e,n)=>e!=null&&typeof e=="object"&&"id"in e?e.id:n;function Wt(e,n,t){let r=typeof e=="function"?null:e,o=z();return {sourceState:r,items:new Map,orderedKeys:[],byFn:t||_n,renderFn:n,parentInstance:o,mounted:false}}var Be=1;function Ue(e,n,t,r){let o=t,s=Object.assign(()=>o,{set(u){let d=typeof u=="function"?u(o):u;d!==o&&(o=d);}}),i=()=>null,a=ae(`for-item-${e}`,i,{},null);r.parentInstance&&(a.ownerFrame=r.parentInstance.ownerFrame);let l=z();X(a);let m=je();a._currentRenderToken=Be++,a._pendingReadStates=new Set;let g=r.renderFn(n,()=>s());D(a),X(l);let c={key:e,item:n,indexSignal:s,componentInstance:a,vnode:g,_startStateIndex:m};return a._pendingFlushTask=()=>{let u=z();X(a),a.stateIndexCheck=-1;let d=a.stateValues;for(let f=0;f<d.length;f++){let p=d[f];p&&(p._hasBeenRead=false);}$e(m),a._currentRenderToken=Be++,a._pendingReadStates=new Set;try{let f=r.renderFn(n,()=>s());c.vnode=f,D(a);}finally{X(u);}let h=r.parentInstance;h&&h._enqueueRun?.();},c}function En(e,n){let t=k.__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 u=0;u<i;u++)if(s(n[u],u)!==o[u]){c=false;break}if(c){let u=[];for(let d=0;d<i;d++){let h=n[d],f=o[d],p=r.get(f);let b=p.item!==h,x=p.indexSignal()!==d;if(b){p.item=h;let P=k.__ASKR_CURRENT_INSTANCE__;k.__ASKR_CURRENT_INSTANCE__=p.componentInstance,p.vnode=e.renderFn(h,()=>p.indexSignal()),k.__ASKR_CURRENT_INSTANCE__=P;}x&&p.indexSignal.set(d),u.push(p.vnode);}for(let d=i;d<a;d++){let h=n[d],f=s(h,d),p=Ue(f,h,d,e);r.set(f,p),u.push(p.vnode),o[d]=f;}return k.__ASKR_BENCH__&&ie("reconcile",performance.now()-t),u}}if(a<=i){let c=true;for(let u=0;u<a;u++)if(s(n[u],u)!==o[u]){c=false;break}if(c){let u=[];for(let d=0;d<a;d++){let h=n[d],f=o[d],p=r.get(f);let b=p.item!==h,x=p.indexSignal()!==d;if(b){p.item=h;let P=k.__ASKR_CURRENT_INSTANCE__;k.__ASKR_CURRENT_INSTANCE__=p.componentInstance,p.vnode=e.renderFn(h,()=>p.indexSignal()),k.__ASKR_CURRENT_INSTANCE__=P;}x&&p.indexSignal.set(d),u.push(p.vnode);}for(let d=a;d<i;d++){let h=o[d],f=r.get(h);if(f){let p=f.componentInstance;p.abortController.abort();for(let b of p.cleanupFns)try{b();}catch{}r.delete(h);}}return o.length=a,e.orderedKeys=o,k.__ASKR_BENCH__&&ie("reconcile",performance.now()-t),u}}if(i===a){let c=true;for(let u=0;u<i;u++)if(s(n[u],u)!==o[u]){c=false;break}if(c){let u=[];for(let d=0;d<i;d++){let h=n[d],f=o[d],p=r.get(f);let b=p.item!==h,x=p.indexSignal()!==d;if(b){p.item=h;let P=k.__ASKR_CURRENT_INSTANCE__;k.__ASKR_CURRENT_INSTANCE__=p.componentInstance,p.vnode=e.renderFn(h,()=>p.indexSignal()),k.__ASKR_CURRENT_INSTANCE__=P;}x&&p.indexSignal.set(d),u.push(p.vnode);}return k.__ASKR_BENCH__&&ie("reconcile",performance.now()-t),u}}let l=new Set(o),m=[],g=[];for(let c=0;c<n.length;c++){let u=n[c],d=s(u,c);l.delete(d),m.push(d);let h=r.get(d);if(h){let f=h.item!==u,p=h.indexSignal()!==c;if(f){h.item=u;let b=k.__ASKR_CURRENT_INSTANCE__;k.__ASKR_CURRENT_INSTANCE__=h.componentInstance,h.vnode=e.renderFn(u,()=>h.indexSignal()),k.__ASKR_CURRENT_INSTANCE__=b;}p&&h.indexSignal.set(c),g.push(h.vnode);}else {let f=Ue(d,u,c,e);r.set(d,f),g.push(f.vnode);}}for(let c of l){let u=r.get(c);if(u){let d=u.componentInstance;d.abortController.abort();for(let h of d.cleanupFns)try{h();}catch{}r.delete(c);}}return e.orderedKeys=m,k.__ASKR_BENCH__&&ie("reconcile",performance.now()-t),g}function qe(e,n){let t=n();if(!Array.isArray(t))throw new Error("For source must evaluate to an array");return En(e,t)}var Sn=typeof document<"u",We=0;function kn(){let e="__COMPONENT_INSTANCE_ID";try{v(e);let t=globalThis.__ASKR_DIAG,r=t?t[e]:void 0;if(typeof r=="number"&&Number.isFinite(r))return `comp-${r}`}catch{}return We++,`comp-${We}`}function bn(e,n,t){let r=$(t,true),o=j(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});}function An(e,n,t){for(let r in n){let o=n[r];if(he(r)||o==null||o===false)continue;if(r==="ref"){Tn(e,o);continue}let s=q(r);if(s){bn(e,s,o);continue}r==="class"||r==="className"?e.className=String(o):r==="value"||r==="checked"?Cn(e,r,o,t):e.setAttribute(r,String(o));}}function Tn(e,n){let t=n;if(t){if(typeof t=="function"){t(e);return}try{t.current=e;}catch{}}}function Cn(e,n,t,r){n==="value"?((J(r,"input")||J(r,"textarea")||J(r,"select"))&&(e.value=String(t)),e.setAttribute("value",String(t))):n==="checked"&&(J(r,"input")&&(e.checked=!!t),e.setAttribute("checked",String(!!t)));}function Ge(e,n,t){let r=n.key??t?.key;r!==void 0&&e.setAttribute("data-key",String(r));}function _(e){if(!Sn)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=_(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 vn(e,n,t);if(typeof n=="function")return Nn(e,n,t);if(n===De)return wn(e,t);if(typeof n=="symbol"&&(n===b||String(n)==="Symbol(Fragment)"))return Rn(e,t)}return null}function vn(e,n,t){let r=document.createElement(n);Ge(r,e,t),An(r,t,n);let o=t.children||e.children;if(o)if(Array.isArray(o)){for(let s of o){let i=_(s);i&&r.appendChild(i);}}else {let s=_(o);s&&r.appendChild(s);}return r}function Nn(e,n,t){let o=e[ve]||Ne(),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=ae(kn(),s,t||{},null),e.__instance=a),o&&(a.ownerFrame=o);let l=U(o,()=>Je(a));if(l instanceof Promise)throw new Error("Async components are not supported. Components must return synchronously.");let m=U(o,()=>_(l));if(m instanceof Element)return ke(a,m),m;if(!m){let c=document.createComment("");return a._placeholder=c,a.mounted=true,a.notifyUpdate=a._enqueueRun,c}let g=document.createElement("div");return g.appendChild(m),ke(a,g),g}function Rn(e,n){let t=document.createDocumentFragment(),r=n.children||e.children;if(r)if(Array.isArray(r))for(let o of r){let s=_(o);s&&t.appendChild(s);}else {let o=_(r);o&&t.appendChild(o);}return t}function wn(e,n){let t=e._forState;if(!t)return document.createDocumentFragment();let r=n.source,o=qe(t,r),s=[],i=false;for(let l=0;l<o.length;l++){let m=o[l],g=m.key,c=null;if(g!=null&&t.items.has(g)){let u=t.items.get(g);u._dom&&u.vnode===m&&(c=u._dom);}c||(c=_(m),i=true,g!=null&&t.items.has(g)&&(t.items.get(g)._dom=c??void 0)),s.push(c);}if(!i&&s.length!==t.orderedKeys.length&&(i=true),!i)return document.createDocumentFragment();let a=document.createDocumentFragment();for(let l of s)l&&a.appendChild(l);return a}function I(e,n,t=true){if(!N(n))return;let r=n.props||{};Ge(e,n,r);let o=T.get(e),s=null;for(let i in r){let a=r[i];if(he(i))continue;let l=q(i);if(a==null||a===false){if(i==="class"||i==="className")e.className="";else if(l&&o?.has(l)){let m=o.get(l);m.options!==void 0?e.removeEventListener(l,m.handler,m.options):e.removeEventListener(l,m.handler),o.delete(l);}else e.removeAttribute(i);continue}if(i==="class"||i==="className")e.className=String(a);else if(i==="value"||i==="checked")e[i]=a;else if(l){o&&o.size>0&&(s??=new Set).add(l);let m=o?.get(l);if(m&&m.original===a)continue;m&&(m.options!==void 0?e.removeEventListener(l,m.handler,m.options):e.removeEventListener(l,m.handler));let g=$(a,false),c=j(l);c!==void 0?e.addEventListener(l,g,c):e.addEventListener(l,g),T.has(e)||T.set(e,new Map),T.get(e).set(l,{handler:g,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;xn(e,i);}}function xn(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)){be(e,n);return}e.textContent="";let t=_(n);t&&e.appendChild(t);}function be(e,n){let t=Array.from(e.children);if(n.length===1&&t.length===0&&e.childNodes.length===1){let o=n[0],s=e.firstChild;if((typeof o=="string"||typeof o=="number")&&s?.nodeType===3){s.data=String(o);return}}t.length===0&&e.childNodes.length>0&&(e.textContent="");let r=Math.max(t.length,n.length);for(let o=0;o<r;o++){let s=t[o],i=n[o];if(i===void 0&&s){F(s),s.remove();continue}if(!s&&i!==void 0){let a=_(i);a&&e.appendChild(a);continue}if(!(!s||i===void 0))if(typeof i=="string"||typeof i=="number")s.textContent=String(i);else if(N(i))if(typeof i.type=="string")if(Y(s.tagName,i.type))I(s,i);else {let a=_(i);a&&(s instanceof Element&&M(s),F(s),e.replaceChild(a,s));}else {let a=_(i);a&&(s instanceof Element&&M(s),F(s),e.replaceChild(a,s));}else {let a=_(i);a&&(s instanceof Element&&M(s),F(s),e.replaceChild(a,s));}}}function ue(e,n){let t=n.length,r=0,o=0,s=W(),i=process.env.ASKR_FASTPATH_DEBUG==="1"||process.env.ASKR_FASTPATH_DEBUG==="true";for(let m=0;m<t;m++){let{key:g,vnode:c}=n[m],u=e.children[m];if(u&&N(c)&&typeof c.type=="string"){let d=c.type;if(Y(u.tagName,d)){let h=c.children||c.props?.children;i&&re("positional idx",m,{chTag:u.tagName,vnodeType:d,chChildNodes:u.childNodes.length,childrenType:Array.isArray(h)?"array":typeof h}),Fn(u,h,c),In(u,g,()=>o++),r++;continue}else i&&re("positional tag mismatch",m,{chTag:u.tagName,vnodeType:d});}else i&&re("positional missing or invalid",m,{ch:!!u});On(e,m,c);}let a=W()-s;Dn(e,n);let l={n:t,reused:r,updatedKeys:o,t:a};return te(l,"bulkKeyedPositionalHits"),l}function Fn(e,n,t){typeof n=="string"||typeof n=="number"?H(e,String(n)):Array.isArray(n)&&n.length===1&&(typeof n[0]=="string"||typeof n[0]=="number")?H(e,String(n[0])):Mn(e,t)||I(e,t);}function Mn(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(!N(r)||!N(o)||typeof r.type!="string"||typeof o.type!="string")return false;let s=e.children[0],i=e.children[1];if(!s||!i||!Y(s.tagName,r.type)||!Y(i.tagName,o.type))return false;let a=r.children||r.props?.children,l=o.children||o.props?.children;if(typeof a=="string"||typeof a=="number")H(s,String(a));else if(Array.isArray(a)&&a.length===1&&(typeof a[0]=="string"||typeof a[0]=="number"))H(s,String(a[0]));else return false;if(typeof l=="string"||typeof l=="number")H(i,String(l));else if(Array.isArray(l)&&l.length===1&&(typeof l[0]=="string"||typeof l[0]=="number"))H(i,String(l[0]));else return false;return true}function H(e,n){e.childNodes.length===1&&e.firstChild?.nodeType===3?e.firstChild.data=n:e.textContent=n;}function In(e,n,t){try{let r=String(n);if(e.getAttribute("data-key")===r)return;e.setAttribute("data-key",r),t();}catch{}}function Pn(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 J(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 Y(e,n){let t=Pn(n);return t!==null&&e===t?true:J(e,n)}function On(e,n,t){let r=_(t);if(r){let o=e.children[n];o?(F(o),e.replaceChild(r,o)):e.appendChild(r);}}function Dn(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 Xe(e,n){let t=W(),r=Array.from(e.childNodes),o=[],s=0,i=0;for(let g=0;g<n.length;g++){let c=Kn(n[g],r[g],o);c==="reused"?s++:c==="created"&&i++;}let a=W()-t,l=Hn(e,o);S.delete(e);let m={n:n.length,reused:s,created:i,tBuild:a,tCommit:l};return Bn(m),m}function Kn(e,n,t){return typeof e=="string"||typeof e=="number"?Ln(String(e),n,t):typeof e=="object"&&e!==null&&"type"in e?Vn(e,n,t):"skipped"}function Ln(e,n,t){return n&&n.nodeType===3?(n.data=e,t.push(n),"reused"):(t.push(document.createTextNode(e)),"created")}function Vn(e,n,t){let r=e;if(typeof r.type=="string"){let s=r.type;if(n&&n.nodeType===1&&Y(n.tagName,s))return I(n,e),t.push(n),"reused"}let o=_(e);return o?(t.push(o),"created"):"skipped"}function Hn(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),F(o),o=s;}}catch{}return ne("bulk-text-replace"),e.replaceChildren(r),Date.now()-t}function Bn(e){try{A("__LAST_BULK_TEXT_FASTPATH_STATS",e),A("__LAST_FASTPATH_STATS",e),A("__LAST_FASTPATH_COMMIT_COUNT",1),v("bulkTextFastpathHits");}catch{}}function ze(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 Se({phase:"bulk-unkeyed-eligible",reason:"too-small",total:o,threshold:t}),false;let s=Un(n);if(s.componentFound!==void 0)return Se({phase:"bulk-unkeyed-eligible",reason:"component-child",index:s.componentFound}),false;let i=s.simple/o,a=i>=r&&e.childNodes.length>=o;return Se({phase:"bulk-unkeyed-eligible",total:o,simple:s.simple,fraction:i,requiredFraction:r,eligible:a}),a}function Un(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"&&qn(o)&&n++;}}return {simple:n}}function qn(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 Se(e){if(process.env.ASKR_FASTPATH_DEBUG==="1")try{A("__BULK_DIAG",e);}catch{}}function Ye(e,n,t,r){if(typeof document>"u")return null;let o=n.length;if(o===0&&(!r||r.length===0))return null;Ce()||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 u=0;u<c.length;u++)s[u]=c[u];}catch(c){s=void 0;}else {i=new Map;try{for(let c=e.firstElementChild;c;c=c.nextElementSibling){let u=c.getAttribute("data-key");if(u!==null){i.set(u,c);let d=Number(u);Number.isNaN(d)||i.set(d,c);}}}catch(c){i=void 0;}}let a$1=[],l=0,m=0,g=0;for(let c=0;c<n.length;c++){let{key:u,vnode:d}=n[c];l++;let h;if(o<=20&&s){let f=String(u);for(let p=0;p<s.length;p++){let b=s[p],x=b.getAttribute("data-key");if(x!==null&&(x===f||Number(x)===u)){h=b;break}}h||(h=t?.get(u));}else h=i?.get(u)??t?.get(u);if(h)a$1.push(h),g++;else {let f=_(d);f&&(a$1.push(f),m++);}}if(r&&r.length)for(let c of r){let u=_(c);u&&(a$1.push(u),m++);}try{let c=Date.now(),u=document.createDocumentFragment(),d=0;for(let f=0;f<a$1.length;f++)u.appendChild(a$1[f]),d++;try{for(let f=e.firstChild;f;){let p=f.nextSibling;f instanceof Element&&M(f),F(f),f=p;}}catch(f){}try{v("__DOM_REPLACE_COUNT"),A("__LAST_DOM_REPLACE_STACK_FASTPATH",new Error().stack);}catch(f){}e.replaceChildren(u);try{A("__LAST_FASTPATH_COMMIT_COUNT",1);}catch(f){}try{G()&&_e(e);}catch(f){}let h=new Map;for(let f=0;f<n.length;f++){let p=n[f].key,b=a$1[f];b instanceof Element&&h.set(p,b);}try{let f={n:o,moves:0,lisLen:0,t_lookup:0,t_fragment:Date.now()-c,t_commit:0,t_bookkeeping:0,fragmentAppendCount:d,mapLookups:l,createdNodes:m,reusedCount:g};typeof globalThis<"u"&&(A("__LAST_FASTPATH_STATS",f),A("__LAST_FASTPATH_REUSED",g>0),v("fastpathHistoryPush")),(process.env.ASKR_FASTPATH_DEBUG==="1"||process.env.ASKR_FASTPATH_DEBUG==="true")&&a.warn("[Askr][FASTPATH]",JSON.stringify({n:o,createdNodes:m,reusedCount:g}));}catch(f){}try{Ie.add(e);}catch(f){}return h}catch(c){return null}}function le(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 ce(e,n,t){let{keyedVnodes:r,unkeyedVnodes:o}=$n(n),s=t||jn(e),i=Wn(e,n,r,o,s);return i||Qn(e,n,r,s)}function jn(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 $n(e){let n=[],t=[];for(let r=0;r<e.length;r++){let o=e[r],s=O(o);s!==void 0?n.push({key:s,vnode:o}):t.push(o);}return {keyedVnodes:n,unkeyedVnodes:t}}function Wn(e,n,t,r,o){try{let s=Gn(e,n,t,r,o);if(s)return s;let i=Xn(e,t);if(i)return i}catch{}return null}function Gn(e,n,t,r,o){if(L(e,n,o).useFastPath&&t.length>=128||G())try{let i=Ye(e,t,o,r);if(i)return S.set(e,i),i}catch{}return null}function Xn(e,n){let t=n.length;if(t<10||zn(e,n)/t<.9||Jn(e,n))return null;try{let o=ue(e,n);return te(o,"bulkKeyedPositionalHits"),Yn(e),S.get(e)}catch{return null}}function zn(e,n){let t=0;try{for(let r=0;r<n.length;r++){let o=n[r].vnode;if(!o||typeof o!="object"||typeof o.type!="string")continue;let s=e.children[r];s&&le(s.tagName,o.type)&&t++;}}catch{}return t}function Jn(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")&&xe(o,r.props||{}))return !0}}catch{return true}return false}function Yn(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 Qn(e,n,t,r){let o=new Map,s=[],i=new WeakSet,a=Zn(e,r,i);for(let l=0;l<n.length;l++){let m=n[l],g=nt(m,l,e,a,i,o);g&&s.push(g);}return typeof document>"u"||(at(e,s),S.delete(e)),o}function Zn(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 l=n.get(a);if(l&&!t.has(l))return t.add(l),l}return et(e,r,s,t)}}function et(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 nt(e,n,t,r,o,s){let i=O(e);return i!==void 0?tt(e,i,t,r,s):rt(e,n,t,o)}function tt(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"&&le(s.tagName,a.type))return I(s,e),o.set(n,s),s}catch{}let i=_(e);return i?(i instanceof Element&&o.set(n,i),i):null}function rt(e,n,t,r){try{let s=t.children[n];if(s&&(typeof e=="string"||typeof e=="number")&&s.nodeType===1)return s.textContent=String(e),r.add(s),s;if(ot(s,e))return I(s,e),r.add(s),s;let i=st(t,r);if(i){let a=it(i,e,r);if(a)return a}}catch{}return _(e)}function ot(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"&&le(e.tagName,t.type)}function st(e,n){for(let t=e.firstElementChild;t;t=t.nextElementSibling)if(!n.has(t)&&t.getAttribute("data-key")===null)return t}function it(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"&&le(e.tagName,r.type))return I(e,n),t.add(e),e}return null}function at(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),F(r),r=o;}}catch{}ne("reconcile"),e.replaceChildren(t);}var Ae=new WeakMap;function Qe(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 ut(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 lt(e,n){return e.childNodes.length===1&&e.firstChild?.nodeType===3?(e.firstChild.data=n,true):false}function Ze(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 ct(e){let n=S.get(e);return n||(n=Ze(e),n.size>0&&S.set(e,n)),n.size>0?n:void 0}function en(e){for(let n=0;n<e.length;n++)if(O(e[n])!==void 0)return true;return false}function dt(e,n,t){if(process.env.ASKR_FORCE_BULK_POSREUSE==="1"&&ft(e,n))return;let r=ce(e,n,t);S.set(e,r);}function ft(e,n){try{let t=[];for(let s of n)N(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=ue(e,t);if(process.env.ASKR_FASTPATH_DEBUG==="1")try{A("__LAST_FASTPATH_STATS",r),A("__LAST_FASTPATH_COMMIT_COUNT",1),v("bulkKeyedPositionalForced");}catch{}let o=Ze(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 mt(e,n){if(ze(e,n)){Xe(e,n);}else be(e,n);S.delete(e);}function pt(e,n){if(!n){e.textContent="",S.delete(e);return}if(!Array.isArray(n)){e.textContent="";let t=_(n);t&&e.appendChild(t),S.delete(e);return}if(en(n)){let t=ct(e);try{dt(e,n,t);}catch{let r=ce(e,n,t);S.set(e,r);}}else mt(e,n);}function nn(e,n){let t=n.children||n.props?.children,r=ut(t);r.isSimple&<(e,r.text)||pt(e,t),I(e,n,false);}function ht(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&&N(o)&&typeof o.type=="string"&&Qe(t.tagName,o.type)){nn(t,o),t=s;continue}let i=_(o);i&&(t?e.replaceChild(i,t):e.appendChild(i)),t=s;}for(;t;){let r=t.nextElementSibling;e.removeChild(t),t=r;}}function gt(e,n){for(let[t,r]of Object.entries(n)){if(t==="children"||t==="key"||r==null||r===false)continue;if(t==="ref"){yt(e,r);continue}let o=q(t);if(o){let s=$(r,false),i=j(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 yt(e,n){let t=n;if(t){if(typeof t=="function"){t(e);return}try{t.current=e;}catch{}}}function _t(e,n){let t=n.children;if(!Array.isArray(t)||!en(t))return false;let r=document.createElement(n.type);e.appendChild(r),gt(r,n.props||{});let o=ce(r,t,void 0);return S.set(r,o),true}function Et(e){return N(e)&&typeof e.type=="symbol"&&(e.type===b||String(e.type)==="Symbol(askr.fragment)")}function St(e){let n=e.props?.children||e.children||[];return Array.isArray(n)?n:[n]}function B(e,n,t){if(n&&!(typeof document>"u"))if(t&&Ae.has(t)){let r=Ae.get(t),o=r.start.nextSibling;for(;o&&o!==r.end;){let i=o.nextSibling;o.remove(),o=i;}let s=_(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),Ae.set(t,{start:r,end:o});let s=_(e);s&&n.insertBefore(s,o);}else {let r=e;if(Et(r)){let s=St(r);if(s.length===1&&N(s[0])&&typeof s[0].type=="string")r=s[0];else {ht(n,s);return}}let o=n.children[0];if(o&&N(r)&&typeof r.type=="string"&&Qe(o.tagName,r.type))nn(o,r);else {if(n.textContent="",N(r)&&typeof r.type=="string"&&_t(n,r))return;let s=_(r);s&&n.appendChild(s);}}}if(typeof globalThis<"u"){let e=globalThis;e.__ASKR_RENDERER={evaluate:B,isKeyedReorderFastPathEligible:L,getKeyMapForElement:oe};}function ae(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,on(o);},o._enqueueRun=()=>{o.hasPendingUpdate||(o.hasPendingUpdate=true,C.enqueue(o._pendingRunTask));},o._pendingFlushTask=()=>{o.hasPendingUpdate=false,o._enqueueRun?.();},o}var w=null,de=0;function $r(){return w}function X(e){w=e;}function tn(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 ke(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&&tn(e);}var rn=0;function on(e){e.notifyUpdate=e._enqueueRun,e._currentRenderToken=++rn,e._pendingReadStates=new Set;let n=e.target?e.target.innerHTML:"",t=sn(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{}C.enqueue(()=>{if(!e.target&&e._placeholder){if(t==null){D(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=w;w=e;try{B(t,i),s.replaceChild(i,o),e.target=i,e._placeholder=void 0,i.__ASKR_INSTANCE=e,D(e);}finally{w=a$1;}return}if(e.target){let o=[];try{let s=!e.mounted,i=w;w=e,o=Array.from(e.target.childNodes);try{B(t,e.target);}catch(a$1){try{let l=Array.from(e.target.childNodes);for(let m of l)try{Ee(m);}catch(g){a.warn("[Askr] error cleaning up failed commit children:",g);}}catch(l){}try{v("__DOM_REPLACE_COUNT"),A("__LAST_DOM_REPLACE_STACK_COMPONENT_RESTORE",new Error().stack);}catch(l){}throw e.target.replaceChildren(...o),a$1}finally{w=i;}D(e),e.mounted=!0,s&&e.mountOperations.length>0&&tn(e);}catch(s){try{let i=Array.from(e.target.childNodes);for(let a$1 of i)try{Ee(a$1);}catch(l){a.warn("[Askr] error cleaning up partial children during rollback:",l);}}catch(i){}try{try{v("__DOM_REPLACE_COUNT"),A("__LAST_DOM_REPLACE_STACK_COMPONENT_ROLLBACK",new Error().stack);}catch(i){}e.target.replaceChildren(...o);}catch{e.target.innerHTML=n;}throw s}}});}}function Je(e){let n=e._currentRenderToken!==void 0,t=e._currentRenderToken,r=e._pendingReadStates;n||(e._currentRenderToken=++rn,e._pendingReadStates=new Set);try{let o=sn(e);return n||D(e),o}finally{e._currentRenderToken=t,e._pendingReadStates=r??new Set;}}function sn(e){e.stateIndexCheck=-1;for(let n of e.stateValues)n&&(n._hasBeenRead=false);e._pendingReadStates=new Set,w=e,de=0;try{let t={signal:e.abortController.signal},r={parent:e.ownerFrame,values:null},o=U(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 l=e.fn?.name||"<anonymous>";a.warn(`[askr] Unused state variable detected in ${l} 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{w=null;}}function kt(e){e.abortController=new AbortController,e.notifyUpdate=e._enqueueRun,C.enqueue(()=>on(e));}function z(){return w}function Gr(){if(!w)throw new Error("getSignal() can only be called during component render execution. Ensure you are calling this from inside your component function.");return w.abortController.signal}function D(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 Xr(){return de++}function je(){return de}function $e(e){de=e;}function zr(e){kt(e);}function He(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{fe as a,C as b,Ct as c,Ne as d,G as e,De as f,M as g,Wt as h,ae as i,$r as j,X as k,z as l,Gr as m,Xr as n,zr as o,He as p};
|
package/dist/for/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as State, a as ComponentInstance } from '../component-
|
|
2
|
-
import { P as Props } from '../jsx-
|
|
1
|
+
import { S as State, a as ComponentInstance } from '../component-AJMg1Gmv.js';
|
|
2
|
+
import { P as Props } from '../jsx-CPjsGyEg.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* For primitive runtime
|
|
@@ -9,17 +9,19 @@ import { P as Props } from '../jsx-CSWf4VFg.js';
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
interface ForItemInstance<T> {
|
|
12
|
-
key: string | number;
|
|
12
|
+
key: string | number | null;
|
|
13
13
|
item: T;
|
|
14
14
|
indexSignal: State<number>;
|
|
15
15
|
componentInstance: ComponentInstance;
|
|
16
16
|
vnode: VNode | undefined;
|
|
17
|
+
_startStateIndex: number;
|
|
18
|
+
_dom?: Node;
|
|
17
19
|
}
|
|
18
20
|
interface ForState<T> {
|
|
19
21
|
sourceState: State<T[]> | null;
|
|
20
|
-
items: Map<string | number, ForItemInstance<T>>;
|
|
21
|
-
orderedKeys: Array<string | number>;
|
|
22
|
-
byFn: (item: T, index: number) => string | number;
|
|
22
|
+
items: Map<string | number | null, ForItemInstance<T>>;
|
|
23
|
+
orderedKeys: Array<string | number | null>;
|
|
24
|
+
byFn: (item: T, index: number) => string | number | null;
|
|
23
25
|
renderFn: (item: T, index: () => number) => VNode;
|
|
24
26
|
parentInstance: ComponentInstance | null;
|
|
25
27
|
mounted: boolean;
|
|
@@ -33,7 +35,7 @@ interface DOMElement {
|
|
|
33
35
|
type: string | ((props: Props) => unknown) | symbol;
|
|
34
36
|
props?: Props;
|
|
35
37
|
children?: VNode[];
|
|
36
|
-
key?: string | number;
|
|
38
|
+
key?: string | number | null;
|
|
37
39
|
[Symbol.iterator]?: never;
|
|
38
40
|
_forState?: ForState<unknown>;
|
|
39
41
|
}
|
package/dist/for/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export{a as For}from'../chunk-V7SQ5U7C.js';import'../chunk-O3XARUHF.js';import'../chunk-WGORSKNX.js';import'../chunk-HGMOQ3I7.js';import'../chunk-BP2CKUO6.js';import'../chunk-37RC6ZT3.js';import'../chunk-62D2TNHX.js';
|