@krate/runtime 0.5.0-beta.3 → 0.5.0-rc.1
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/dev-overlay.js +31 -19
- package/dist/dev-overlay.test.js +14 -1
- package/dist/dom.d.ts +4 -0
- package/dist/dom.js +44 -13
- package/dist/dom.test.js +8 -0
- package/dist/effect-errors.test.js +37 -1
- package/dist/effects.js +41 -8
- package/dist/events.d.ts +2 -0
- package/dist/events.js +18 -0
- package/dist/krate-core.js +1 -1
- package/dist/krate-dev.js +27 -19
- package/dist/krate-f-list.js +1 -1
- package/dist/krate-f-router.js +1 -1
- package/dist/krate-features.json +1 -0
- package/dist/krate-hydrate-lite.js +5 -5
- package/dist/krate-hydrate.js +5 -5
- package/dist/krate-runtime.js +5 -5
- package/dist/krate-suspense.js +1 -1
- package/dist/list.js +26 -18
- package/dist/list.test.js +91 -0
- package/dist/patterns.test.js +27 -0
- package/dist/react-effects.test.js +37 -0
- package/dist/router-nav.test.js +95 -0
- package/dist/router.js +47 -2
- package/dist/signal.js +47 -14
- package/dist/slots.test.js +18 -0
- package/dist/suspense.js +34 -2
- package/dist/suspense.test.js +39 -1
- package/package.json +1 -1
package/dist/krate-core.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var __krate_exports=(()=>{var cn=Object.defineProperty;var Oo=Object.getOwnPropertyDescriptor;var Po=Object.getOwnPropertyNames;var Ho=Object.prototype.hasOwnProperty;var Mo=(e,n)=>{for(var t in n)cn(e,t,{get:n[t],enumerable:!0})},Lo=(e,n,t,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of Po(n))!Ho.call(e,r)&&r!==t&&cn(e,r,{get:()=>n[r],enumerable:!(o=Oo(n,r))||o.enumerable});return e};var Fo=e=>Lo(cn({},"__esModule",{value:!0}),e);var Vi={};Mo(Vi,{BLOCKED_URL:()=>io,KRATE_CONTEXT:()=>at,__krate_useId:()=>Ki,adoptValue:()=>on,afterFlush:()=>Zo,appendChild:()=>xe,clearBetween:()=>it,clearNodes:()=>lo,clearPersisted:()=>zo,createCSSChoice:()=>rr,createCSSFlags:()=>sr,createCSSGroup:()=>cr,createCSSRange:()=>ur,createCSSStack:()=>ar,createCSSToggle:()=>ir,createCallbackDeps:()=>Dr,createContext:()=>an,createEffect:()=>y,createEffectDeps:()=>Or,createEffectEvent:()=>Kr,createMemo:()=>wr,createMemoDeps:()=>Dt,createReducer:()=>vr,createResource:()=>Pi,createRoot:()=>mr,createScope:()=>Do,createScopeFlags:()=>Io,createSignal:()=>S,disposeAll:()=>wt,disposeNode:()=>ce,flushPassive:()=>ne,forwardRef:()=>xr,h:()=>Ni,hydrate:()=>Oi,insert:()=>mi,insertAt:()=>se,isDerivedGetter:()=>Ke,isSignalGetter:()=>dr,krateApplyStyle:()=>fo,krateAttachRef:()=>we,krateBindRef:()=>gi,krateCommitSnapshot:()=>gt,krateCommitting:()=>Q,krateCondActivity:()=>_r,krateCondDetached:()=>ai,krateCondReset:()=>li,krateCondSwap:()=>fi,krateContextRows:()=>jo,krateControl:()=>Qe,krateCurrentScope:()=>F,krateCustomProp:()=>po,krateDepsOf:()=>Ir,krateDerived:()=>lr,krateDisposeExcept:()=>tr,krateDisposeOwner:()=>me,krateDisposeScopes:()=>or,krateEnterScope:()=>Wo,krateEpoch:()=>Pe,krateEventName:()=>Qn,krateEventRoot:()=>$e,krateFlushSync:()=>De,krateForgetOwner:()=>Ar,krateGetOwner:()=>Le,krateHintPreconnect:()=>ji,krateHintPrefetchDNS:()=>qi,krateHintPreinit:()=>zi,krateHintPreinitModule:()=>Bi,krateHintPreload:()=>Di,krateHintPreloadModule:()=>Ii,krateHook:()=>fr,krateHookState:()=>Vo,krateIsDiscrete:()=>Yo,krateKeepScopes:()=>$o,krateLeaveScope:()=>Go,krateMount:()=>Rr,krateMountFields:()=>Xe,krateMountPortals:()=>si,krateOn:()=>ve,krateOnAfterFlush:()=>Rn,krateOnBeforeFlush:()=>An,krateOnDispose:()=>Nn,krateOnHookError:()=>Pr,krateOnLayoutCommit:()=>Lr,krateOnSettle:()=>gr,krateOnUnmount:()=>br,krateOwner:()=>Cr,krateOwnerId:()=>Er,krateParam:()=>Hi,kratePendingFlush:()=>_n,kratePortalFind:()=>ci,kratePortalMount:()=>Yn,kratePortalReset:()=>ui,kratePortalScan:()=>to,kratePortalTarget:()=>oi,kratePortalUnmount:()=>Ze,kratePortalsEnter:()=>nt,kratePortalsIn:()=>et,kratePortalsLeave:()=>tt,kratePruneSnapshots:()=>xn,krateReadAt:()=>He,krateRefsEnter:()=>Ue,krateRefsFlush:()=>Bn,krateRefsHold:()=>qt,krateRefsLeave:()=>Ve,krateRenderPhase:()=>Xo,krateRequestFlush:()=>hr,krateRunEvent:()=>Me,krateSanitizeAttr:()=>ot,krateScopeOfId:()=>On,krateSetControl:()=>B,krateSetOwner:()=>N,krateSetRef:()=>jt,krateSlotReplaced:()=>Nr,krateSpread:()=>vi,krateSynthetic:()=>Ge,krateTagOwner:()=>he,krateTakeSyncLane:()=>En,krateTrackNode:()=>en,krateTransitionWrites:()=>Jo,krateUnmount:()=>te,krateWithIdScope:()=>Fi,krateWithOwner:()=>jn,mount:()=>_i,onCleanup:()=>j,onMount:()=>kr,readDurableState:()=>pn,readPersisted:()=>gn,removeRest:()=>bo,resetContexts:()=>Ee,resolvePersist:()=>dn,runAfterFlush:()=>ke,sameValue:()=>nr,setOwnerHooks:()=>Uo,subscribePersist:()=>mn,trackEffect:()=>R,untrack:()=>b,useRef:()=>Sr,withDOM:()=>mo,withVNodes:()=>ho,writePersisted:()=>hn});var Ko=0,at=Symbol.for("krate.context"),le=class{constructor(n){this.get=n}};function un(e){if(e instanceof Node)return e;let n=document.createDocumentFragment();if(Array.isArray(e))for(let t of e)n.appendChild(un(t));else e!=null&&e!==!1&&e!==!0&&n.appendChild(document.createTextNode(String(e)));return n}var O=new Map;function Ee(){for(let[e,n]of O)if(n.length>0){let t=n[0];O.set(e,[t])}}function Do(){return an({})}function Io(){return an({})}function an(e){let n=Ko++;O.set(n,[e]);let t=()=>{let c=O.get(n);if(c&&c.length>0){let u=c[c.length-1];return u instanceof le?u.get():u}return e},o=()=>{let c=O.get(n),u=c&&c.length>0?c[c.length-1]:e;return u instanceof le?()=>u.get():()=>u},r=c=>{let u=O.get(n)||[e];u.push(c.value),O.set(n,u);let a=document.createElement("div");a.style.display="contents";let f=c.children;if(f)for(let p of Array.isArray(f)?f:[f])p instanceof Node?a.appendChild(p):p!=null&&a.appendChild(document.createTextNode(String(p)));return u.pop(),u.length===0&&u.push(e),a},i=c=>{let u=c.children;return Array.isArray(u)&&(u=u.find(a=>typeof a=="function")),un(typeof u=="function"?u(t()):null)},s=(c=>r(c));return s.$$typeof=at,s.id=n,s.defaultValue=e,s.Provider=r,s.Consumer=i,s.useContext=t,s.use=t,s.useContextLive=o,s}function jo(e,n){return(...t)=>{let o=[];for(let[r,i]of e){let s=O.get(r.id);s&&(s.push(new le(i)),o.push(s))}try{return n(...t)}finally{for(let r of o)r.pop()}}}function qo(){let e=new Map;return{getItem:n=>e.has(n)?e.get(n):null,setItem:(n,t)=>{e.set(n,t)},removeItem:n=>{e.delete(n)}}}var ln=qo();function ft(){return typeof window<"u"}function fn(e){if(e&&typeof e=="object")return e;if(!ft())return ln;try{return e==="session"?window.sessionStorage:e==="memory"?ln:window.localStorage}catch{return ln}}function dn(e){let n=typeof e=="string"?{key:e}:e;if(!n.key)throw new Error("[krate] createSignal persist requires a key");let t=n.store??"local";return{key:n.key,store:t,serialize:n.serialize??(o=>JSON.stringify(o)),deserialize:n.deserialize??(o=>JSON.parse(o)),sync:n.sync??t==="local"}}function pn(e,n){let o=globalThis.__KRATE_STATE__;if(!o||!Object.prototype.hasOwnProperty.call(o,e))return{found:!1};let r=o[e];if(typeof r=="string")try{return{found:!0,value:n(r)}}catch{return{found:!0,value:r}}return{found:!0,value:r}}function gn(e){let n=fn(e.store),t;try{t=n.getItem(e.key)}catch{return{found:!1}}if(t==null)return{found:!1};try{return{found:!0,value:e.deserialize(t)}}catch{return{found:!1}}}function hn(e,n){let t=fn(e.store);try{t.setItem(e.key,e.serialize(n))}catch{}}function zo(e){let n=fn(e.store);try{n.removeItem(e.key)}catch{}}var Ce=new Map,lt=!1;function Bo(){lt||!ft()||(lt=!0,window.addEventListener("storage",e=>{if(e.key===null)return;let n=Ce.get(e.key);if(n)for(let t of n)t(e.newValue)}))}function mn(e,n){if(!e.sync)return()=>{};let t=Ce.get(e.key)??new Set;return t.add(n),Ce.set(e.key,t),Bo(),()=>{t.delete(n),t.size===0&&Ce.delete(e.key)}}var Vo={react:!0},d=[],dt=[],yn=!1,m=null;function Uo(e){m=e}var Ne=[],T=new Set,fe=[],U=null,pt=new Set,L=new Map;function Wo(e){return pt.has(e)?!1:(U=e,h=null,!0)}function Go(){U=null,h=null}function F(){let e=d[d.length-1];return e?e.scope:U!==null?U:h!==null&&L.has(h)?L.get(h)??null:null}function $o(e){pt=new Set(e)}function he(e,n){e!==null&&!L.has(e)&&L.set(e,n)}var w=[],de=!1;function W(e){let n=F(),t={fn:e,cleanups:[],disposed:!1,sources:new Set,running:!1,rerun:!1,queued:!1,owner:h,boundaryOwner:m?m.current():null,scope:n};if(h!==null){he(h,n);let o=K.get(h);o||K.set(h,o=new Set),o.add(t)}return t}var K=new Map,G=new Map;function me(e){let n=K.get(e);if(K.delete(e),n)for(let o of n)I(o),T.delete(o);let t=G.get(e);if(G.delete(e),L.delete(e),t)for(let o of t)try{o()}catch{}}var D=0,v=null,Ae=0,$=new Set,pe=new Set;function Xo(e){D++;let n=v;v=null;try{return e()}finally{v=n,D--}}function gt(){Ae++;for(let e of $)e.commit(Ae);return $.clear(),Ae}function Pe(){return Ae}function He(e,n){let t=v;v=e;try{return n()}finally{v=t}}function xn(e){for(let n of pe)n.prune(e)||pe.delete(n)}var Tn=new Set("auxclick beforeinput blur cancel change click close compositionend compositionstart compositionupdate contextmenu copy cut dblclick dragend dragstart drop focusin focusout input invalid keydown keypress keyup mousedown mouseup paste pause play pointercancel pointerdown pointerup ratechange reset resize seeked select submit touchcancel touchend touchstart volumechange focus".split(" ")),bn=0,ge=!1,Re=0;function Qo(){if(Re>0)return!0;let e=typeof window<"u"?window.event:void 0;return!!e&&Tn.has(e.type)}var _e=0;function Jo(e){_e++;try{return e()}finally{_e--}}function Yo(e){return Tn.has(e)}function Me(e,n,t){if(!Tn.has(e)){t();return}Re++;try{t()}finally{Re--,n&&Re===0&&wn===0&&bn===0&&(w.length>0||ge)&&De()}}function Q(e){bn+=e?1:-1}function En(){let e=ge;return ge=!1,e}function ht(){return d[d.length-1]||null}var h=null;function Le(){return h}function N(e){let n=h;return h=e,n}var mt=[],kt=[],Cn=[];function An(e){mt.push(e)}function Rn(e){kt.push(e)}function Nn(e){Cn.push(e)}function _n(){return w.length>0}function b(e){d.push(null);try{return e()}finally{d.pop()}}function Zo(e){Ne.push(e),Hn()}function er(){if(Ne.length===0)return;let e=Ne.splice(0);for(let n of e)n()}function nr(e,n){return Object.is(e,n)}function I(e){if(!e.disposed){e.disposed=!0,e.owner!==null&&K.get(e.owner)?.delete(e);for(let n of e.sources)n.delete(e);e.sources.clear();for(let n of e.cleanups)n();e.cleanups.length=0}}function tr(e){if(e.length===0){wt();return}let n=new Set(e);yt(t=>!(t!=null&&n.has(t)),!0)}function or(e){if(e.length===0)return;let n=new Set(e);yt(t=>t!=null&&n.has(t),!1)}function On(e){if(e.charCodeAt(0)!==95)return null;let n=e.indexOf("_",1);return n>0?e.slice(0,n+1):null}function yt(e,n){for(let s of Cn)try{s(e)}catch{}for(let s of Array.from(T))e(s.scope)&&(I(s),T.delete(s));let t=[];for(let s of fe.splice(0)){if(!e(s.scope)){t.push(s);continue}try{s.fn()}catch{}}fe.push(...t);let o=new Set([...G.keys(),...K.keys()]);for(let s of o)e(L.get(s)??null)&&me(s);if(!n)return;let r=globalThis,i=r.__krate_island_cleanups;if(Array.isArray(i)){r.__krate_island_cleanups=[];for(let s of i)try{s()}catch{}}U=null,Ee()}function wt(){U=null;for(let t of Cn)try{t(null)}catch{}for(let t of T)I(t);T.clear();for(let t of fe)try{t.fn()}catch{}fe.length=0;for(let t of Array.from(G.keys()))me(t);K.clear(),L.clear(),$.clear(),pe.clear(),v=null;let e=globalThis,n=e.__krate_island_cleanups;if(Array.isArray(n)){e.__krate_island_cleanups=[];for(let t of n)try{t()}catch{}}w.length=0,Ne.length=0,de=!1,P=0,X++,ge=!1,Ee()}function rr(e,n){return Fe(S(e))}function ir(e,n){return Fe(S(e))}function sr(e,n){let t={};for(let i of e){let[s]=S(!1);t[i]=s}let r=[t,(i,s)=>{}];return r.trigger=i=>({"data-krate-scope":"trigger",value:i}),r.panel=i=>({"data-krate-scope":"panel",value:i}),r.close=()=>({"data-krate-scope":"close"}),r}function cr(e,n){return Fe(S(e))}function ur(e,n){return Fe(S(e))}function Fe(e){let n=e;return n.trigger=t=>({"data-krate-scope":"trigger",value:t}),n.panel=t=>({"data-krate-scope":"panel",value:t}),n.close=()=>({"data-krate-scope":"close"}),n.current=()=>e[0](),n}function ar(e,n){let t=()=>e[0];return[{top:t,peek:t},{push:o=>{},pop:()=>{},clear:()=>{}}]}function S(e,n){let t=e,o=null;if(n?.persist){o=dn(n.persist);let l=pn(o.key,o.deserialize);if(l.found)t=l.value;else{let g=gn(o);g.found&&(t=g.value)}}let r=new Set,i=!!n?.react,s=t,c=null,u=i?{commit(l){Object.is(s,t)||(c||(c=[[0,s]]),c.push([l,t]),s=t,pe.add(u))},prune(l){if(!c)return!1;for(;c.length>1&&c[1][0]<=l;)c.shift();return c.length===1?(c=null,!1):!0}}:null,a=l=>{if(!c)return s;for(let g=c.length-1;g>=0;g--)if(c[g][0]<=l)return c[g][1];return c[0][1]},f=()=>{let l=d[d.length-1];if(l&&!l.disposed&&(r.add(l),l.sources.add(r)),i){if(v!==null)return a(v);if(D===0)return s}return t},p=(l=!1)=>vt(r,l),C=l=>{let g=typeof l=="function"?l(t):l;Object.is(g,t)||(t=g,o&&hn(o,t),u&&$.add(u),p(i))};if(o&&o.sync){let l=o,g=mn(l,ae=>{if(ae!==null)try{let Te=l.deserialize(ae);Object.is(Te,t)||(t=Te,p())}catch{}});j(g)}return Pn.add(f),[f,C]}function vt(e,n=!1){let t=Array.from(e);for(let o of t){if(o.disposed){e.delete(o);continue}if(o.mark){o.mark(n);continue}if(o.running){o.rerun=!0;continue}o.queued||(o.queued=!0,w.push(o))}Hn(n)}var St=new WeakSet;function lr(e,n){let t,o=!0,r=new Set,i=W(()=>{});i.mark=u=>{o||(o=!0,vt(r,u))},T.add(i);let s=()=>{let u=d[d.length-1];if(u&&!u.disposed&&(r.add(u),u.sources.add(r)),(D===0||v!==null)&&($.size>0||v!==null&&pe.size>0))return b(e);if(o&&!i.disposed){for(let a of i.sources)a.delete(i);i.sources.clear(),o=!1,d.push(i);try{n&&n(),t=e()}catch(a){throw o=!0,a}finally{d.pop()}}else if(i.disposed)return b(e);return t},c=d[d.length-1];return c&&c.cleanups.push(()=>{I(i),T.delete(i)}),St.add(s),Pn.add(s),s}function Ke(e){return typeof e=="function"&&St.has(e)}function fr(e){return Ke(e)?e:()=>e}var Pn=new WeakSet;function dr(e){return typeof e=="function"&&Pn.has(e)}var P=0,X=0;function Hn(e=!1){let n=_e===0&&Qo();n&&(ge=!0);let o=!(e||_e>0)||n||bn>0||D>0||typeof setTimeout!="function";if(P===1||!o&&P===2)return;de=!0;let r=++X,i=()=>{r===X&&Mn()};o?(P=1,queueMicrotask(i)):(P=2,setTimeout(i,0))}var wn=0;function Mn(){wn++;try{pr()}finally{wn--}}function pr(){de=!1,P=0,X++;let e=!1,n,t=r=>{e?typeof console<"u"&&console.error(r):(e=!0,n=r)};for(let r of mt)r();let o=0;for(;w.length>0&&o<xt;o++){let r=w.splice(0);vn=r;for(let i of r)if(!i.disposed){i.queued=!1,i.rerun=!1;try{Oe(i)}catch(s){t(s)}if(i.rerun&&!i.disposed){i.rerun=!1;try{Oe(i)}catch(s){t(s)}}}}if(w.length>0)try{Sn()}catch(r){t(r)}if(w.length===0&&(P=0,de=!1,X++),w.length===0){for(let r of Tt)try{r()}catch(i){t(i)}if(w.length>0){if(kn>=50)try{Sn()}catch(r){throw t(r),n}kn++;try{Mn()}catch(r){t(r)}finally{kn--}if(e)throw n;return}try{ke()}catch(r){t(r)}}if(e)throw n}var xt=100,vn=[];function Sn(){let e=w.splice(0);for(let r of e)r.queued=!1;de=!1,P=0,X++;let n=e.length>0?e:vn;vn=[];let t=Array.from(new Set(n.map(r=>r.fn.name||"anonymous effect"))).slice(0,3).join(", "),o=new Error("Maximum update depth exceeded. An effect keeps writing state that re-runs itself or another effect ("+t+"). Make the write conditional or remove the dependency that changes on every run.");for(let r of n)if(r.boundaryOwner&&m&&m.error(r.boundaryOwner,o))return;throw o}var Tt=[],kn=0;function gr(e){Tt.push(e)}function hr(){Hn()}function ke(){$.size>0&>(),typeof document<"u"&&document.activeElement;for(let e of kt)e();er()}function De(){if(w.length===0){ke();return}let e=0;for(;w.length>0;)e++>=xt&&Sn(),Mn()}function Oe(e){e.running=!0;let n=!1,t=h;h=e.owner,D++;let o=v;v=null;try{for(let i of e.cleanups.splice(0))i();for(let i of e.sources)i.delete(e);e.sources.clear(),d.push(e),n=!0;let r=e.fn();typeof r=="function"&&e.cleanups.push(r)}catch(r){if(!(e.boundaryOwner&&m&&m.error(e.boundaryOwner,r)))throw r}finally{v=o,D--,h=t,n&&d.pop(),e.running=!1}}function y(e){let n=W(e);T.add(n);let t=d[d.length-1],o=()=>{I(n),T.delete(n)};return n.boundaryOwner&&m&&m.cleanup(n.boundaryOwner,o),Oe(n),t&&!t.disposed?t.cleanups.push(o):t&&t.root&&Ln(t,o),o}function j(e){let n=ht();if(n){Ln(n,e);return}let t=m?m.current():null;if(t&&m)m.cleanup(t,e);else if(h!==null){he(h,F());let o=G.get(h);o||G.set(h,o=[]),o.push(e)}else fe.push({fn:e,scope:F()})}function Ln(e,n){if(e.dead){n();return}e.cleanups.push(n)}function mr(e){let n=W(()=>{});n.disposed=!0,n.root=!0;let t=()=>{if(n.dead)return;n.dead=!0;let o=n.cleanups.splice(0);for(let r of o)try{r()}catch(i){console.error(i)}};d.push(n);try{return e(t)}finally{d.pop()}}function kr(e){dt.push({fn:e,owner:d[d.length-1],boundary:m?m.current():null}),yn||(yn=!0,queueMicrotask(yr))}function yr(){yn=!1;let e=dt.splice(0);for(let{fn:n,owner:t,boundary:o}of e){let r=()=>{if(!t){n();return}if(t.dead||!t.root&&t.disposed)return;let i=W(()=>{});i.disposed=!0,d.push(i);try{n()}finally{d.pop()}for(let s of i.cleanups)Ln(t,s)};o&&m?m.run(o,r):r()}}function wr(e){let[n,t]=S(void 0),o=!0,r=W(()=>{});T.add(r);let i=()=>{for(let p of r.cleanups.splice(0))p();for(let p of r.sources)p.delete(r);r.sources.clear(),o=!1,d.push(r);let f;try{f=e()}catch(p){throw o=!0,p}finally{d.pop()}t(f)},s=W(()=>{o&&!r.disposed&&i()});T.add(s),r.mark=()=>{o=!0,!s.queued&&!s.disposed&&(s.queued=!0,w.push(s))},Oe(s);let c=()=>(o&&!r.disposed&&i(),n()),u=ht(),a=()=>{r.disposed||(I(r),T.delete(r),I(s),T.delete(s))};return u?u.cleanups.push(a):s.boundaryOwner&&m&&m.cleanup(s.boundaryOwner,a),c}function vr(e,n,t,o){t&&typeof t=="object"&&(o=t,t=void 0);let r=typeof t=="function"?t(n):n,[i,s]=S(r,o);return[i,u=>s(a=>e(a,u))]}function Sr(e){return{current:e}}function xr(e){return n=>e(n,n.ref||(()=>{}))}var k=je(null,null),E=new Map,A=new Map,z=new Set,_=new Set,Tr=0,Ie=!1,H=null,M=[],q=[],J=[],Y=new Map,Ct=[];function je(e,n){let t=n&&n.parent!==null?n.scope:n?F():null,o={id:e,parent:n,children:[],hooks:[],disposed:!1,shown:!0,conds:[],slot:null,record:null,scope:t};return n&&he(o,t),o}function br(e){Ct.push(e)}function Er(e){return qe(e).id}function qe(e){return e&&typeof e=="object"&&"hooks"in e?e:k}function Z(e){for(let n=e;n;n=n.parent)if(n.disposed||!n.shown)return!1;return!0}function At(e){for(let[n,t]of e.conds){let o=A.get(n);if(o!==void 0&&o!==t)return!1}return!0}function Cr(e,n,t,o){if(e==null){N(null);return}let r=E.get(e);if(!r){let i=n!=null&&E.get(n)||k;r=je(e,i);for(let s=i;s;s=s.parent)s.disposed&&(r.disposed=!0);i.children.push(r),E.set(e,r);for(let[s,c,u]of t||[])r.conds.push([s,c]),A.has(s)||A.set(s,u?c:c==="c"?"a":"c");r.shown=At(r),o&&(r.slot=o,z.has(o)&&(r.disposed=!0))}N(r)}function jn(e){let n=qe(Le()),t=je(null,n);n.children.push(t);let o=N(t);try{return{value:e(),owner:t}}finally{N(o)}}function te(e){let n=qe(e);if(n===k||n.disposed)return;let t=Z(n),o=[];if(ze(n,t,o),n.parent){let r=n.parent.children,i=r.indexOf(n);i>=0&&r.splice(i,1)}o.length&&(M.push(...o),qn())}function ze(e,n,t){e.disposed=!0;for(let o of e.hooks){if(o.stop(),_.delete(o),!n){o.mounted&&(o.mounted=!1,o.cleanup=null,In(o.epoch));continue}if(o.phase==="passive"){let r=oe(o);r&&t.push(r)}else ee(o)}for(let o of Ct)o(e,e.id);me(e),e.record&&e.record.owner===e&&(e.record.owner=null);for(let o of e.children.slice())ze(o,n&&o.shown,t)}function Ar(e){let n=E.get(e);n&&(te(n),E.delete(e))}function Rr(e,n,t,o,r){let i={id:e,parentId:n,conds:[],slot:o||null,fn:r,owner:null};for(let[s,c,u]of t||[])i.conds.push([s,c]),A.has(s)||A.set(s,u?c:c==="c"?"a":"c");J.push(i),Fn(i)&&Nt(i)}function Rt(e){if(e.parentId==null)return k;let n=E.get(e.parentId);if(!n)return k;for(let t=n;t;t=t.parent)if(t.disposed)return null;return n}function Fn(e){if(e.slot&&z.has(e.slot))return!1;for(let[n,t]of e.conds){let o=A.get(n);if(o!==void 0&&o!==t)return!1}return Rt(e)!==null}function Nt(e){let n=Rt(e)||k,t=je(e.id,n);t.record=e,t.slot=e.slot,n.children.push(t),E.set(e.id,t),e.owner=t;let o=N(t);try{b(e.fn)}finally{N(o)}}function Nr(e){if(!z.has(e)){z.add(e);for(let n of Array.from(E.values()))n.slot===e&&te(n)}}function _r(e,n){if(A.get(e)===n)return;A.set(e,n);for(let r of J)r.owner&&!r.owner.disposed&&!Fn(r)&&te(r.owner);for(let r of J)!r.owner&&Fn(r)&&Nt(r);let t=[];for(let r of E.values())!r.record&&r.conds.some(([i])=>i===e)&&t.push(r);let o=[];for(let r of t){let i=At(r);if(i===r.shown)continue;let s=Z(r);r.shown=i;let c=Z(r);s&&!c?_t(r,o):!s&&c&&Ot(r)}o.length&&(M.push(...o),o=[],qn()),Lt()}function _t(e,n){for(let t of e.hooks)if(_.delete(t),t.phase==="passive"){let o=oe(t);o&&n.push(o)}else ee(t);for(let t of e.children)t.shown&&!t.disposed&&_t(t,n)}function Ot(e){for(let n of e.hooks)Mt(n);for(let n of e.children)n.shown&&!n.disposed&&Ot(n)}function Pt(e,n){if(!e||!n||e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(!Object.is(e[t],n[t]))return!1;return!0}function Ht(e){if(e!=null)return Array.isArray(e)?e:Array.from(e)}function Mt(e){e.dirty=!0,_.add(e),Lt()}function Lt(){Ie||(Ie=!0,queueMicrotask(()=>{_n()||(ne(),ke())}))}function Or(e,n,t="passive"){let o=qe(Le()),r={owner:o,phase:t,fn:e,deps:n||null,prev:void 0,hasPrev:!1,cleanup:null,mounted:!1,epoch:0,dirty:!1,seq:Tr++,stop:()=>{},scope:o===k?F():o.scope};o.hooks.push(r),!o.disposed&&(r.stop=y(()=>{let i=r.deps?Ht(r.deps()):[];r.hasPrev&&Pt(r.prev,i)||(r.prev=i,r.hasPrev=!0,Z(r.owner)&&Mt(r))}))}function Kn(e,n){if(e.owner.disposed)return;let t;try{t=He(n,()=>b(e.fn))}catch(o){Ft(o,e.owner);return}e.cleanup=typeof t=="function"?t:null,e.mounted=!0,e.epoch=n,Y.set(n,(Y.get(n)||0)+1)}var Dn=null;function Pr(e){Dn=e}function Ft(e,n){let t=null;for(let o=n;o&&t===null;o=o.parent)t=o.id;if(!(Dn&&Dn(e,t)))throw e}function Hr(e,n){try{b(e)}catch(t){Ft(t,n)}}function oe(e){if(!e.mounted)return null;e.mounted=!1;let n=e.epoch,t=e.cleanup;return e.cleanup=null,t?()=>{try{He(n,()=>b(t))}finally{In(n)}}:(In(n),null)}function In(e){let n=(Y.get(e)||1)-1;n>0?Y.set(e,n):Y.delete(e)}function ee(e){let n=oe(e);n&&Hr(n,e.owner)}function bt(){let e=Pe();for(let n of Y.keys())n<e&&(e=n);xn(e)}function Mr(e){let n=new Map,t=0,o=r=>{for(let i of r.children)o(i);n.set(r,t++)};for(let r of k.children)o(r);return n.set(k,t++),Array.from(e).sort((r,i)=>{let s=n.get(r.owner)??t,c=n.get(i.owner)??t;return s!==c?s-c:r.seq-i.seq})}var Kt=[];function Lr(e){Kt.push(e)}function Et(){for(let e of Kt)e()}function Fr(){Ie=!1;let e=Pe(),n=En();if(_.size===0){Et(),n&&ne(),bt();return}let t=Mr(_).filter(o=>Z(o.owner));_.clear();for(let o of t)o.dirty=!1;Q(!0);try{let o=0;for(;o<t.length;){let i=t[o].owner,s=o;for(;s<t.length&&t[s].owner===i;)s++;for(let c=o;c<s;c++)t[c].phase==="insertion"&&(ee(t[c]),Kn(t[c],e));for(let c=o;c<s;c++)t[c].phase==="layout"&&ee(t[c]);o=s}for(let i of t)i.phase==="layout"&&Kn(i,e);Et();let r=!1;for(let i of t){if(i.phase!=="passive")continue;let s=oe(i);s&&M.push(s),q.push([i,e]),r=!0}r&&qn(),n&&ne()}finally{Q(!1)}bt()}function qn(){H===null&&(H=setTimeout(ne,0))}function ne(){for(H!==null&&(clearTimeout(H),H=null);M.length||q.length;){let e=M,n=q;M=[],q=[],Q(!0);try{for(let t of e)t();for(let[t,o]of n)Z(t.owner)&&Kn(t,o)}finally{Q(!1)}}}function Dt(e,n){let t,o=!1,r;return()=>{let i=Ht(n())||[];return(!o||!Pt(t,i))&&(t=i,o=!0,r=b(e)),r}}function Kr(e){return function(...t){return b(()=>e.apply(this,t))}}function Dr(e,n){let t=!0;return Dt(()=>{if(t)return t=!1,e;let o=e;return function(...r){return o.apply(this,r)}},n)}function Ir(e){if(e&&typeof e=="object"){let n=Object.getPrototypeOf(e);if(n===Object.prototype||n===null){let t=[];for(let o of Object.keys(e))o!=="children"&&t.push(e[o]);return t}}return[e]}function jr(e){let n=[];for(let r of k.children.slice()){if(!e(r.scope))continue;ze(r,r.shown,n);let i=k.children.indexOf(r);i>=0&&k.children.splice(i,1)}let t=[];for(let r of k.hooks){if(!e(r.scope)){t.push(r);continue}if(r.stop(),_.delete(r),r.phase==="passive"){let i=oe(r);i&&n.push(i)}else ee(r)}k.hooks=t;for(let[r,i]of Array.from(E))(i.disposed||e(i.scope))&&E.delete(r);let o=r=>!e(On(r));for(let r of Array.from(A.keys()))o(r)||A.delete(r);for(let r of Array.from(z))o(r)||z.delete(r);for(let r=J.length-1;r>=0;r--)o(J[r].id)||J.splice(r,1);for(let r of Array.from(_))r.owner.disposed&&_.delete(r);q=q.filter(([r])=>!r.owner.disposed&&!(r.owner===k&&e(r.scope)));for(let r of n)try{b(r)}catch{}N(null)}function qr(e){if(e){jr(e);return}let n=[];for(let o of k.children.slice())ze(o,o.shown,n);for(let o of k.hooks)if(o.stop(),o.phase==="passive"){let r=oe(o);r&&n.push(r)}else ee(o);k.children.length=0,k.hooks.length=0,E.clear(),A.clear(),z.clear(),_.clear(),q=[];let t=M.concat(n);M=[],H!==null&&(clearTimeout(H),H=null);for(let o of t)try{b(o)}catch{}Ie=!1,N(null)}An(ne);Rn(Fr);Nn(qr);var ye=new Set;function It(e){let n,t=!1;if(y(()=>{try{e()}catch(o){n=o,t=!0}})(),t)throw n}function Be(e){if(e.on)return;e.on=!0;let n=e.ref;It(()=>{if(typeof n=="function"){let t=n(e.el);e.undo=typeof t=="function"?t:()=>n(null)}else if(n&&typeof n=="object")n.current=e.el,e.undo=()=>{n.current=null};else if(e.assign){let t=e.assign;t(e.el),e.undo=()=>t(null)}else e.undo=null})}function zn(e){if(!e.on)return;e.on=!1;let n=e.undo;e.undo=null,n&&It(n)}function jt(e,n){let t={el:n,ref:e,on:!1,undo:null};return Be(t),()=>zn(t)}var re=null;function qt(){re||(re=[],queueMicrotask(Bn))}function Bn(){let e=re;if(re=null,!!e)for(let n of e)ye.has(n)&&n.el.isConnected&&Be(n)}function we(e,n,t,o){let r={el:e,ref:n,assign:t,on:!1,undo:null};return ye.add(r),o==="defer"&&re?re.push(r):(o==="now"||e.isConnected)&&Be(r),()=>{ye.delete(r),zn(r)}}function Ve(e){for(let n of ye)n.on&&e.contains(n.el)&&zn(n)}function Ue(){for(let e of ye)!e.on&&e.el.isConnected&&Be(e)}var zr={doubleclick:"dblclick",focus:"focusin",blur:"focusout"},Br={dblclick:"doubleclick",focusin:"focus",focusout:"blur"},Vr={focusin:"focus",focusout:"blur"},Ur=new Set("scroll scrollend load error abort cancel close invalid toggle beforetoggle mouseenter mouseleave pointerenter pointerleave canplay canplaythrough durationchange emptied encrypted ended loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" ")),Wt={change:["change","input","click"],beforeinput:["beforeinput","compositionend"]},Wr={preventDefault(){this.defaultPrevented=!0,this.nativeEvent.preventDefault()},stopPropagation(){this._s=!0,this.nativeEvent.stopPropagation()},isDefaultPrevented(){return this.defaultPrevented},isPropagationStopped(){return!!this._s},persist(){},isPersistent(){return!0}},Gr={get(e,n){if(n in e)return e[n];let t=e.nativeEvent,o=t[n];return typeof o=="function"?o.bind(t):o}};function Ge(e,n,t){let o=Object.create(Wr),r=t===void 0?e.target:t;return r&&r.nodeType===3&&(r=r.parentNode),o.type=n||Vr[e.type]||e.type,o.target=r,o.currentTarget=null,o.nativeEvent=e,o.defaultPrevented=e.defaultPrevented,new Proxy(o,Gr)}var Vn,We=!1;function Gt(e,n){try{e(n)}catch(t){We||(We=!0,Vn=t)}}function $t(){if(We){let e=Vn;throw We=!1,Vn=void 0,e}}function Xn(e,n,t,o,r){let i=[],s=[];for(let a=t;a;a=a.__kpp||a.parentNode){let f=a.__kh;if(!f)continue;let p;o&1&&(p=f[n+"$"])&&i.unshift(a,p),o&2&&(p=f[n])&&s.push(a,p)}if(!i.length&&!s.length)return null;let c=Ge(e,r,t),u=i.concat(s);for(let a=0;a<u.length&&!c._s;a+=2)c.currentTarget=u[a],Gt(u[a+1],c);return c.currentTarget=null,c}var zt=new WeakMap,Un=new Set,Xt=new Set;function $r(){return typeof document>"u"?null:document.getElementById("root")||document.body}function Wn(e,n){let t=zt.get(e);t||(t=new Set,zt.set(e,t)),!t.has(n)&&(t.add(n),e.addEventListener(n,Xr,!0),e.addEventListener(n,Qr,!1))}function Gn(e){Xt.add(e);let n=$r();n&&(Un.add(n),Wn(n,e));for(let t of Un)t!==n&&t.isConnected&&Wn(t,e)}function $e(e){Un.add(e);for(let n of Xt)Wn(e,n)}function Xr(e){Qt(e,!0)}function Qr(e){Qt(e,!1)}function Qt(e,n){let t=n?"__kdc":"__kdb",o=e;if(o[t])return;o[t]=1;let r=e.type,i=e.target;Me(r,!n,()=>{r!=="change"&&r!=="beforeinput"&&Xn(e,Br[r]||r,i,n?1:2),n||(r==="change"||r==="input"||r==="click"?ni(e):(r==="beforeinput"||r==="compositionend")&&ti(e))}),$t()}function Jr(e){Jt(this,e,!1)}function Yr(e){Jt(this,e,!0)}function Jt(e,n,t){let o=e.__kh,r=o&&o[n.type+(t?"$":"")];if(!r)return;let i=Ge(n);i.currentTarget=e,Me(n.type,!0,()=>Gt(r,i)),i.currentTarget=null,$t()}function Qn(e){let n=e.slice(2),t=!1;return n.length>7&&n.slice(-7)==="Capture"&&!/^(Got|Lost)PointerCapture$/.test(n)&&(n=n.slice(0,-7),t=!0),[n.toLowerCase(),t]}function ve(e,n,t){let[o,r]=Qn(n),i=e,s=i.__kh||(i.__kh={}),c=o+(r?"$":"");if(typeof t!="function"){s[c]=void 0;return}if(s[c]=t,Ur.has(o)){let a=i.__kd||(i.__kd={});a[c]||(a[c]=1,e.addEventListener(o,r?Yr:Jr,r));return}let u=Wt[o];if(u){for(let a of u)Gn(a);o==="change"&&eo(e)}else Gn(zr[o]||o)}function Xe(e){let n=e.querySelectorAll("input[value]");for(let t=0;t<n.length;t++){let o=n[t];if(!Yt.has(o.type||"text")||!o.value||o.ownerDocument.activeElement===o)continue;let r=o.value;o.value="",o.value=r}}var Yt=new Set("color date datetime datetime-local email month number password range search tel text time url week".split(" "));function Jn(e){return e.tagName==="INPUT"&&(e.type==="checkbox"||e.type==="radio")}function Zt(e){return Jn(e)?String(e.checked):String(e.value)}function eo(e){e.__kv===void 0&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")&&(e.__kv=Zt(e))}function $n(e){let n=Zt(e);return e.__kv===n?!1:(e.__kv=n,!0)}function Zr(e){if(!e.name||!e.ownerDocument)return[e];let n=[],t=e.ownerDocument.getElementsByName(e.name);for(let o=0;o<t.length;o++){let r=t[o];r.tagName==="INPUT"&&r.type==="radio"&&r.form===e.form&&n.push(r)}return n}function ei(e){let n=e.target;if(!n||!n.tagName)return null;let t=e.type,o=n.tagName;return o==="SELECT"||o==="INPUT"&&n.type==="file"?t==="change"?n:null:Jn(n)?t==="click"&&$n(n)?n:null:(o==="TEXTAREA"||o==="INPUT"&&Yt.has(n.type||"text"))&&t!=="click"&&$n(n)?n:null}function ni(e){let n=ei(e);if(n)if(Xn(e,"change",n,3,"change"),n.type==="radio")for(let t of Zr(n))$n(t),Ut(t);else Ut(n)}function ti(e){let n=e;e.type==="beforeinput"&&(n.isComposing||typeof n.data!="string"||n.data==="")||e.type==="compositionend"&&!n.data||Xn(e,"beforeinput",e.target,3,"beforeinput")}function Bt(e,n){e.__kw||(e.__kw=1,console.error(n))}function Vt(e,n,t){let o=e.options;if(e.multiple){let s=new Set((Array.isArray(n)?n:[n]).map(String));for(let c=0;c<o.length;c++){let u=s.has(o[c].value);t?o[c].defaultSelected=u:o[c].selected!==u&&(o[c].selected=u)}return}let r=String(n),i=null;for(let s=0;s<o.length;s++){if(o[s].value===r){t?o[s].defaultSelected=!0:o[s].selected=!0;return}!i&&!o[s].disabled&&(i=o[s])}i&&!t&&(i.selected=!0)}function B(e,n,t){let o=e;switch(n){case"value":{if(t==null)return;if(o.tagName==="SELECT"){Vt(o,t,!1);return}let r=String(t);o.value!==r&&(o.value=r),o.type!=="file"&&!(o.type==="number"&&o.ownerDocument&&o.ownerDocument.activeElement===o)&&o.defaultValue!==r&&(o.defaultValue=r),Jn(o)||(o.__kv=r);return}case"checked":{if(t==null)return;let r=!!t;o.checked!==r&&(o.checked=r),o.__kv=String(r);return}case"defaultValue":o.tagName==="SELECT"?Vt(o,t,!0):o.defaultValue=t==null?"":String(t);return;case"defaultChecked":o.defaultChecked=!!t;return;default:o[n]=!!t}}function Ut(e){let n=e.__kc;n&&(De(),n.value&&B(e,"value",n.value()),n.checked&&B(e,"checked",n.checked()))}function Qe(e,n,t){let o=e,r=n==="value"||n==="checked";if(r){(o.__kc||(o.__kc={}))[n]=t;for(let c of Wt.change)Gn(c);eo(o)}let i,s=!1;return y(()=>{let c=t();if(r){let u=c!=null;c===null&&n==="value"?Bt(o,"`value` prop on `"+o.tagName.toLowerCase()+"` should not be null. Use an empty string to clear it or `undefined` for an uncontrolled field."):i!==void 0&&i!==u&&Bt(o,"A component is changing "+(i?"a controlled":"an uncontrolled")+" input to be "+(u?"controlled":"uncontrolled")+". Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://react.dev/link/controlled-components"),i=u}B(o,n,c),!s&&n==="value"&&o.tagName==="TEXTAREA"&&o.ownerDocument.activeElement!==o&&o.setSelectionRange(0,0),s=!0})}var no="template[data-krate-portal]",Je=new Map,Ye=new Set;function oi(e,n){Je.set(e,n)}function ri(e){return!!e&&typeof e=="object"&&(e.nodeType===1||e.nodeType===11)}function ii(e){let n=e.getAttribute("data-krate-portal")||"",t=Je.get(n);if(t){let r=null;try{r=t()}catch{r=null}return ri(r)?r:null}let o=e.getAttribute("data-krate-portal-target");if(!o||o==="body")return document.body;try{return document.querySelector(o)}catch{return null}}function Yn(e){if(e.__kpn||!e.isConnected)return;let n=ii(e);if(!n)return;let t=Array.from(e.content.childNodes),o=document.createDocumentFragment();for(let i of t)i.__kpp=e,o.appendChild(i);n.appendChild(o),e.__kpn=t,Ye.add(e);let r=document.getElementById("root");n.nodeType===1&&!(r&&r.contains(n))&&$e(n),e.__kpd||(e.__kpd=!0,en(e,()=>Ze(e,!0)))}function Ze(e,n){let t=e.__kpn;if(t){e.__kpn=void 0,Ye.delete(e);for(let o of t)n?o.parentNode&&o.parentNode.removeChild(o):e.content.appendChild(o),o.__kpp=void 0}}function Zn(e){let n=[];return e.matches?.(no)&&n.push(e),e.querySelectorAll(no).forEach(t=>n.push(t)),n}function si(e){if(!(typeof document>"u"))for(let n of Zn(e||document))Yn(n)}function et(e){return Zn(e)}function nt(e){for(let n of e)Yn(n)}function tt(e){for(let n of Zn(e))Ze(n)}function to(e,n){let t=e.slice(),o=new Set;for(;t.length;)t.shift().querySelectorAll("template").forEach(i=>{if(o.has(i))return;o.add(i);let s=i;s.hasAttribute("data-krate-portal")&&n(s.content),t.push(s.content)})}function ci(e,n){for(let o of Ye)for(let r of o.__kpn||[]){if(r.nodeType!==1)continue;let i=r;if(i.matches(e))return i;let s=i.querySelector(e);if(s)return s}let t=null;return to(n,o=>{t||(t=o.querySelector(e))}),t}function ui(){let e=new Set;for(let n of Array.from(Ye))n.isConnected?e.add(n.getAttribute("data-krate-portal")||""):Ze(n,!0);for(let n of Array.from(Je.keys()))e.has(n)||Je.delete(n)}var ie=new Set,ro=new WeakMap;function ai(){return Array.from(ie)}function li(){let e=new Set,n=!0;for(;n;){n=!1;for(let t of ie){if(e.has(t))continue;let o=ro.get(t);if(!o)continue;let r=o.getRootNode();(o.isConnected||e.has(r))&&(e.add(t),n=!0)}}for(let t of Array.from(ie))e.has(t)||ie.delete(t)}function oo(e){let n="/"+(e.nodeValue||"");for(let t=e.nextSibling;t;t=t.nextSibling)if(t.nodeType===8&&t.nodeValue===n)return t;return null}function fi(e,n,t){let o=e,r=n?"c":"a",i=o.__krateCond;if(!i){let l=t?t.getAttribute("data-kb"):null;i={shown:l==="c"?"a":l==="a"?"c":r,other:null,tpl:t,end:oo(e)},o.__krateCond=i}if(i.shown===r)return;let s=e.parentNode;if(!s)return;(!i.end||i.end.parentNode!==s)&&(i.end=oo(e));let c=i.end,u=document.createDocumentFragment(),a=e.nextSibling;for(;a&&a!==c;){let l=a.nextSibling;u.appendChild(a),a=l}Ve(u),tt(u);let f=i.other;if(!f&&(f=document.createDocumentFragment(),i.tpl&&(f.appendChild(i.tpl.content),i.tpl.getAttribute("data-kns")==="svg"))){let l=f.firstChild;if(l&&l.nodeType===1){for(;l.firstChild;)f.insertBefore(l.firstChild,l);f.removeChild(l)}}ie.delete(f);let p=f.querySelector("[autofocus]");Xe(f);let C=et(f);s.insertBefore(f,c),nt(C),i.other=u,ie.add(u),ro.set(u,e),i.shown=r,Ue(),p&&(p.removeAttribute("autofocus"),p.focus())}var di={href:!0,src:!0,action:!0,formaction:!0,"xlink:href":!0},pi=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i,io="javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')";function ot(e,n){return di[e.toLowerCase()]&&pi.test(n)?io:n}var Se=new WeakMap;function R(e,n){en(e,n)}function en(e,n){let t=Se.get(e);t||(t=[],Se.set(e,t)),t.push(n)}function ao(e,n){let t=()=>te(n);if(typeof DocumentFragment<"u"&&e instanceof DocumentFragment)for(let o=0;o<e.childNodes.length;o++)R(e.childNodes[o],t);else if(typeof Node<"u"&&e instanceof Node)R(e,t);else if(Array.isArray(e))for(let o of e)ao(o,n)}function gi(e,n,t){let o=!0,r=y(()=>{let i=we(e,n?n():void 0,t,o?"defer":void 0);o=!1,j(i)});return R(e,r),r}function ce(e){let n=Se.get(e);if(n){for(let t of n)t();n.length=0}for(let t=0;t<e.childNodes.length;t++)ce(e.childNodes[t])}function hi(e){let n=e.nextSibling;for(;n;){if(n.nodeType===8&&n.nodeValue==="k")return n;n=n.nextSibling}return null}function lo(e,n){let t=e.parentNode;if(!t)return;let o=e.nextSibling;for(;o&&o!==n;){let r=o.nextSibling;ce(o),t.removeChild(o),o=r}}function mi(e,n,t){let o=hi(t);o?(lo(t,o),rt(e,n,o)):rt(e,n,null)}function rt(e,n,t){if(!(n==null||n===!1||n===!0)){if(typeof n=="string"||typeof n=="number")e.insertBefore(document.createTextNode(String(n)),t);else if(n instanceof Node)e.insertBefore(n,t);else if(Array.isArray(n))for(let o of n)rt(e,o,t)}}var ki={htmlFor:"for"},yi=new Set(["animation-iteration-count","aspect-ratio","border-image-outset","border-image-slice","border-image-width","box-flex","box-flex-group","box-ordinal-group","column-count","columns","flex","flex-grow","flex-positive","flex-shrink","flex-negative","flex-order","grid-area","grid-row","grid-row-end","grid-row-span","grid-row-start","grid-column","grid-column-end","grid-column-span","grid-column-start","font-weight","line-clamp","line-height","opacity","order","orphans","scale","tab-size","widows","z-index","zoom","fill-opacity","flood-opacity","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-miterlimit","stroke-opacity","stroke-width"]);function wi(e){if(e.startsWith("--"))return e;let n=e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase());return n.startsWith("ms-")?"-"+n:n}var so=new WeakMap;function fo(e,n){let t=e.style;if(!t)return;let o=new Set;for(let i of Object.keys(n)){let s=n[i];if(s==null||typeof s=="boolean"||s==="")continue;let c=wi(i),u=c.replace(/^-(webkit|moz|ms|o)-/,""),a=typeof s=="number"&&s!==0&&!c.startsWith("--")&&!yi.has(u)?s+"px":String(s);t.setProperty(c,a),o.add(c)}let r=so.get(e);if(r)for(let i of r)o.has(i)||t.removeProperty(i);so.set(e,o)}function po(e,n,t){if(e.localName.indexOf("-")<1||n.indexOf("-")>=0)return!1;let o=typeof t=="object"&&t!==null||typeof t=="function";if(!o&&!(n in e))return!1;e[n]=t;let r=typeof customElements<"u"?customElements:null;return o&&r&&!r.get(e.localName)&&typeof r.whenDefined=="function"&&r.whenDefined(e.localName).then(()=>{let i=e;delete i[n],i[n]=t}),!0}function nn(e,n,t){if(!(e.localName.indexOf("-")>0&&n!=="class"&&n!=="className"&&n!=="style"&&n!=="ref"&&n!=="key"&&n!=="children"&&!n.startsWith("on")&&po(e,n,t))){if(n==="class"||n==="className"){let o=t===!1||t===null||t===void 0?"":String(t);if(e.getAttribute("class")!==o){if(o===""&&!e.hasAttribute("class")&&typeof t!="string")return;e.setAttribute("class",o)}}else if(n==="style")typeof t=="string"?e.getAttribute("style")!==t&&e.setAttribute("style",t):t&&typeof t=="object"?fo(e,t):(t==null||t===!1)&&e.removeAttribute("style");else if(n.startsWith("on")&&typeof t=="function")ve(e,n,t);else if(n==="value"||n==="checked"||n==="selected"||n==="defaultValue"||n==="defaultChecked")B(e,n,t);else if(n==="ref"){let o=we(e,t,void 0,"now");R(e,o),j(o)}else if(!(n==="key"||n==="children"||n==="dangerouslySetInnerHTML")){let o=ki[n]||n,r=/^(aria|data)-/.test(o);if(t==null||t===!1&&!r)e.hasAttribute(o)&&e.removeAttribute(o);else{let i=t===!0&&!r?"":ot(o,String(t));e.getAttribute(o)!==i&&e.setAttribute(o,i)}}}}function go(e,n){for(let o in n){let r=n[o];typeof r=="function"&&(o==="value"||o==="checked")?R(e,Qe(e,o,r)):typeof r=="function"&&!o.startsWith("on")&&o!=="ref"?R(e,y(()=>nn(e,o,r()))):nn(e,o,r)}let t=n.dangerouslySetInnerHTML;if(t&&typeof t=="object"&&t.__html!=null){let o=String(t.__html);e.innerHTML!==o&&(e.innerHTML=o)}}var co=new WeakMap;function vi(e,n){R(e,y(()=>{let t=n()||{},o=new Set;for(let i of Object.keys(t))i==="children"||i==="key"||i==="dangerouslySetInnerHTML"||(o.add(i),nn(e,i,t[i]));let r=co.get(e);if(r)for(let i of r)o.has(i)||(i.startsWith("on")?ve(e,i,null):nn(e,i,void 0));co.set(e,o)}))}var V=0;function ho(e){let n=V;V=n+1;try{return e()}finally{V=n}}function mo(e){let n=V;V=0;try{return e()}finally{V=n}}function ko(e){return!!e&&typeof e=="object"&&e.__kv===1}function yo(e){return!!e&&typeof e=="object"&&e.__ka===1}var tn="http://www.w3.org/2000/svg",Si=new Set(["svg","g","defs","symbol","use","switch","desc","metadata","path","circle","ellipse","line","polygon","polyline","rect","text","tspan","textPath","image","foreignObject","marker","mask","pattern","clipPath","linearGradient","radialGradient","stop","filter","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","animate","animateMotion","animateTransform","set","mpath","view"]);function xi(e){return Si.has(e)?document.createElementNS(tn,e):document.createElement(e)}function Ti(e){let n=e;return n.namespaceURI===tn&&n.localName!=="foreignObject"}function uo(e,n){let t=n;if(t.nodeType!==1||t.namespaceURI===tn||!Ti(e))return n;let o=document.createElementNS(tn,t.localName);for(let r of Array.from(t.attributes))o.setAttribute(r.name,r.value);for(;t.firstChild;)o.appendChild(t.firstChild);return o}function wo(e,n,t){let o=xi(e);if(n&&go(o,n),!n||!n.dangerouslySetInnerHTML)for(let r of t)xe(o,r);return o}function vo(e){return mo(()=>wo(e.tag,e.props,e.children))}function st(e){return e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="bigint"}function ct(e){return e==null||typeof e=="boolean"?"":String(e)}function xe(e,n){if(!(n==null||n===!1||n===!0)){if(Array.isArray(n)){for(let t of n)xe(e,t);return}if(typeof n=="function"){Ci(e,n,null);return}if(ko(n)){e.appendChild(uo(e,vo(n)));return}if(yo(n)){e.appendChild(n.mount());return}e.appendChild(n instanceof Node?uo(e,n):document.createTextNode(String(n)))}}function bi(e,n){let t=Se.get(e);if(t){Se.delete(e);for(let o of t)R(n,o)}}function it(e,n){let t=e.parentNode;if(!t)return;let o=e.nextSibling;for(;o&&o!==n;){let r=o.nextSibling;ce(o),t.removeChild(o),o=r}}function Ei(e){if(!e.text)return;let n=e.text,t=n.parentNode;e.start=document.createComment(""),e.end=document.createComment(""),t.insertBefore(e.start,n),t.insertBefore(e.end,n.nextSibling),bi(n,e.start),t.removeChild(n),e.text=null}function So(e,n){if(st(n)){let o=ct(n);if(e.text){e.text.data!==o&&(e.text.data=o);return}it(e.start,e.end),o!==""&&e.end.parentNode.insertBefore(document.createTextNode(o),e.end);return}Ei(e),it(e.start,e.end);let t=document.createDocumentFragment();xe(t,n),e.end.parentNode.insertBefore(t,e.end)}function Ci(e,n,t){let o={text:null,start:null,end:null},r=!0,i=y(()=>{let s=n();if(!r){So(o,s);return}if(r=!1,st(s)){o.text=document.createTextNode(ct(s)),e.insertBefore(o.text,t);return}o.start=document.createComment(""),o.end=document.createComment(""),e.insertBefore(o.start,t);let c=document.createDocumentFragment();xe(c,s),e.insertBefore(c,t),e.insertBefore(o.end,t)});R(o.text||o.start,i)}function xo(e){for(;e.next&&e.next.nodeType===8;)e.next=e.next.nextSibling}function se(e,n){e.parent.insertBefore(n,e.next)}function To(e,n){xo(e);let t=e.next;if(n!==""&&t&&t.nodeType===3){let r=t;return r.data.length>n.length&&r.data.startsWith(n)?r.splitText(n.length):r.data!==n&&(r.data=n),e.next=r.nextSibling,r}let o=document.createTextNode(n);return se(e,o),o}function bo(e,n){let t=e.next;for(;t&&t!==n;){let o=t.nextSibling;ce(t),e.parent.removeChild(t),t=o}e.next=n}function Ai(e,n){xo(n);let t=n.next;if(t&&t.nodeType===1&&t.localName.toLowerCase()===e.tag.toLowerCase()){n.next=t.nextSibling;let o=t;if(e.props&&go(o,e.props),!e.props||!e.props.dangerouslySetInnerHTML){let r={parent:o,next:o.firstChild};for(let i of e.children)on(i,r);bo(r,null)}return}se(n,vo(e))}function Ri(e,n){let t={text:null,start:null,end:null},o=!0,r=y(()=>{if(!o){So(t,e());return}o=!1;let i=ho(e);if(st(i)){t.text=To(n,ct(i));return}t.start=document.createComment(""),se(n,t.start),on(i,n),t.end=document.createComment(""),se(n,t.end)});R(t.text||t.start,r)}function on(e,n){if(!(e==null||typeof e=="boolean")){if(Array.isArray(e)){for(let t of e)on(t,n);return}if(typeof e=="function"){Ri(e,n);return}if(ko(e)){Ai(e,n);return}if(yo(e)){e.adopt(n);return}if(e instanceof Node){se(n,e);return}To(n,String(e))}}function Ni(e,n,...t){if(typeof e=="function"){let o=n||{};(t.length>0||!("children"in o))&&(o.children=t);let{value:r,owner:i}=jn(()=>e(o));return ao(r,i),r}return V>0?{__kv:1,tag:e,props:n,children:t}:wo(e,n,t)}function Eo(e){if(typeof e=="string"){let n=document.querySelector(e);if(!n)throw new Error(`Container "${e}" not found`);return n}return e}function _i(e,n){let t=Eo(n),o=!1;y(()=>{o||(o=!0,t.appendChild(e()))})}function Oi(e,n){let t=Eo(n);if(t.childNodes.length===0){t.appendChild(e());return}let o=e();o&&ce(o)}function Co(){return globalThis.__krateSuspenseHook}function Pi(e,n){let[t,o]=S(void 0),[r,i]=S(!0),[s,c]=S(void 0),[u,a]=S("unresolved"),[f,p]=S(0),C,l=Co()?.current()??null,g=null,ae=null,Te=()=>typeof e=="function"?e():e,Ro=()=>{let x=No();return g=x,x.then(()=>{g===x&&(g=null)}),x},No=async()=>{C&&C.abort(),C=new AbortController;let x=C,_o=Te();a(f()>0?"refreshing":"loading"),i(!0),c(void 0);try{let be=await n(_o,{signal:x.signal});x.signal.aborted||(o(()=>be),a("ready"))}catch(be){be?.name!=="AbortError"&&!x.signal.aborted&&(c(be),a("error"))}finally{x.signal.aborted||i(!1)}};y(()=>{typeof e=="function"&&e.length===0&&e(),f(),Ro(),j(()=>{C&&(C.abort(),C=void 0)})});let ut=function(){return l&&g&&ae!==g&&(ae=g,Co()?.suspend(l,g)),t()};return Object.defineProperties(ut,{loading:{get:()=>r()},error:{get:()=>s()},state:{get:()=>u()}}),[ut,{mutate:x=>{o(x)},refetch:()=>{p(x=>x+1)}}]}function Hi(e){return Ke(e)?e():e}var ue=null,Mi=0,Ao=typeof TextEncoder<"u"?new TextEncoder:null;function Li(e){return e.replace(/[^A-Za-z0-9_.:$-]/gu,n=>(Ao?Array.from(Ao.encode(n)):[n.charCodeAt(0)&255]).map(o=>"%"+o.toString(16).toUpperCase().padStart(2,"0")).join(""))}function Fi(e,n){if(!e)return n();let t=ue;ue={prefix:Li(e),n:0};try{return n()}finally{ue=t}}function Ki(){return ue?"krate-"+ue.prefix+"-u"+ue.n++:"krate_u"+Mi++}function rn(e){return!!document.head.querySelector(e)}function sn(e,n,t){if(typeof document>"u"||!n)return;let o='link[rel="'+e+'"][href="'+(window.CSS&&CSS.escape?CSS.escape(n):n)+'"]';if(rn(o))return;let r=document.createElement("link");r.rel=e,r.href=n,t&&(t.as&&(r.as=t.as),t.crossOrigin!==void 0&&(r.crossOrigin=t.crossOrigin),t.integrity&&(r.integrity=t.integrity),t.type&&(r.type=t.type),t.media&&(r.media=t.media),t.nonce&&(r.nonce=t.nonce),t.fetchPriority&&r.setAttribute("fetchpriority",t.fetchPriority),t.referrerPolicy&&(r.referrerPolicy=t.referrerPolicy),t.imageSrcSet&&r.setAttribute("imagesrcset",t.imageSrcSet),t.imageSizes&&r.setAttribute("imagesizes",t.imageSizes)),document.head.appendChild(r)}function Di(e,n){sn("preload",e,n)}function Ii(e,n){sn("modulepreload",e,n)}function ji(e,n){sn("preconnect",e,n)}function qi(e){sn("dns-prefetch",e)}function zi(e,n){if(typeof document>"u"||!e)return;if(n&&n.as==="script"){if(rn('script[src="'+e+'"]'))return;let o=document.createElement("script");o.src=e,o.async=!0,n.crossOrigin!==void 0&&(o.crossOrigin=n.crossOrigin),n.integrity&&(o.integrity=n.integrity),n.nonce&&(o.nonce=n.nonce),document.head.appendChild(o);return}if(rn('link[rel="stylesheet"][href="'+e+'"]'))return;let t=document.createElement("link");t.rel="stylesheet",t.href=e,n&&n.crossOrigin!==void 0&&(t.crossOrigin=n.crossOrigin),n&&n.integrity&&(t.integrity=n.integrity),n&&n.media&&(t.media=n.media),document.head.appendChild(t)}function Bi(e,n){if(typeof document>"u"||!e||rn('script[type="module"][src="'+e+'"]'))return;let t=document.createElement("script");t.type="module",t.src=e,n&&n.crossOrigin!==void 0&&(t.crossOrigin=n.crossOrigin),n&&n.integrity&&(t.integrity=n.integrity),document.head.appendChild(t)}return Fo(Vi);})();
|
|
1
|
+
var __krate_exports=(()=>{var un=Object.defineProperty;var Do=Object.getOwnPropertyDescriptor;var Io=Object.getOwnPropertyNames;var jo=Object.prototype.hasOwnProperty;var qo=(e,n)=>{for(var t in n)un(e,t,{get:n[t],enumerable:!0})},zo=(e,n,t,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of Io(n))!jo.call(e,r)&&r!==t&&un(e,r,{get:()=>n[r],enumerable:!(o=Do(n,r))||o.enumerable});return e};var Vo=e=>zo(un({},"__esModule",{value:!0}),e);var Ji={};qo(Ji,{BLOCKED_URL:()=>fo,KRATE_CONTEXT:()=>pt,__krate_useId:()=>Bi,adoptValue:()=>rn,afterFlush:()=>sr,appendChild:()=>xe,clearBetween:()=>ut,clearNodes:()=>yo,clearPersisted:()=>Xo,createCSSChoice:()=>fr,createCSSFlags:()=>pr,createCSSGroup:()=>gr,createCSSRange:()=>hr,createCSSStack:()=>mr,createCSSToggle:()=>dr,createCallbackDeps:()=>Br,createContext:()=>ln,createEffect:()=>y,createEffectDeps:()=>Dr,createEffectEvent:()=>Vr,createMemo:()=>Cr,createMemoDeps:()=>Bt,createReducer:()=>Ar,createResource:()=>Ii,createRoot:()=>xr,createScope:()=>Uo,createScopeFlags:()=>Wo,createSignal:()=>v,disposeAll:()=>xt,disposeNode:()=>se,flushPassive:()=>te,forwardRef:()=>Nr,h:()=>Fi,hydrate:()=>Di,insert:()=>xi,insertAt:()=>ie,isDerivedGetter:()=>Ke,isSignalGetter:()=>wr,krateApplyStyle:()=>wo,krateAttachRef:()=>Se,krateBindRef:()=>vi,krateCommitSnapshot:()=>yt,krateCommitting:()=>Q,krateCondActivity:()=>Kr,krateCondDetached:()=>mi,krateCondReset:()=>ki,krateCondSwap:()=>yi,krateContextRows:()=>Go,krateControl:()=>Je,krateCurrentScope:()=>F,krateCustomProp:()=>So,krateDepsOf:()=>Ur,krateDerived:()=>kr,krateDisposeExcept:()=>ar,krateDisposeOwner:()=>me,krateDisposeScopes:()=>lr,krateEnterScope:()=>Zo,krateEpoch:()=>He,krateEventName:()=>Zn,krateEventRoot:()=>Xe,krateFlushSync:()=>De,krateForgetOwner:()=>Mr,krateGetOwner:()=>J,krateHintPreconnect:()=>Gi,krateHintPrefetchDNS:()=>$i,krateHintPreinit:()=>Xi,krateHintPreinitModule:()=>Qi,krateHintPreload:()=>Ui,krateHintPreloadModule:()=>Wi,krateHook:()=>yr,krateHookState:()=>Jo,krateIsDiscrete:()=>ir,krateKeepScopes:()=>nr,krateLeaveScope:()=>er,krateMount:()=>Lr,krateMountFields:()=>Qe,krateMountPortals:()=>pi,krateMuteEvents:()=>oi,krateOn:()=>ve,krateOnAfterFlush:()=>Nn,krateOnBeforeFlush:()=>Rn,krateOnDispose:()=>_n,krateOnHookError:()=>Ir,krateOnLayoutCommit:()=>qr,krateOnSettle:()=>vr,krateOnUnmount:()=>Or,krateOwner:()=>Hr,krateOwnerId:()=>Pr,krateParam:()=>ji,kratePendingFlush:()=>On,kratePortalFind:()=>gi,kratePortalMount:()=>nt,kratePortalReset:()=>hi,kratePortalScan:()=>uo,kratePortalTarget:()=>li,kratePortalUnmount:()=>en,kratePortalsEnter:()=>rt,kratePortalsIn:()=>ot,kratePortalsLeave:()=>it,kratePruneSnapshots:()=>xn,krateReadAt:()=>Me,krateRefsEnter:()=>Ue,krateRefsFlush:()=>Wn,krateRefsHold:()=>Gt,krateRefsLeave:()=>Be,krateRenderPhase:()=>tr,krateRequestFlush:()=>Tr,krateRunEvent:()=>Le,krateSanitizeAttr:()=>st,krateScopeOfId:()=>Mn,krateSetControl:()=>V,krateSetOwner:()=>b,krateSetRef:()=>Wt,krateSlotReplaced:()=>Fr,krateSpread:()=>Ai,krateSynthetic:()=>$e,krateTagOwner:()=>he,krateTakeSyncLane:()=>Cn,krateTrackNode:()=>nn,krateTransitionWrites:()=>rr,krateUnmount:()=>z,krateWithIdScope:()=>Vi,krateWithOwner:()=>Vn,mount:()=>Ki,onCleanup:()=>I,onMount:()=>br,readDurableState:()=>gn,readPersisted:()=>hn,removeRest:()=>Oo,resetContexts:()=>Ce,resolvePersist:()=>pn,runAfterFlush:()=>ke,sameValue:()=>ur,setOwnerHooks:()=>Yo,subscribePersist:()=>kn,trackEffect:()=>A,untrack:()=>E,useRef:()=>Rr,withDOM:()=>bo,withVNodes:()=>xo,writePersisted:()=>mn});var Bo=0,pt=Symbol.for("krate.context"),ae=class{constructor(n){this.get=n}};function an(e){if(e instanceof Node)return e;let n=document.createDocumentFragment();if(Array.isArray(e))for(let t of e)n.appendChild(an(t));else e!=null&&e!==!1&&e!==!0&&n.appendChild(document.createTextNode(String(e)));return n}var O=new Map;function Ce(){for(let[e,n]of O)if(n.length>0){let t=n[0];O.set(e,[t])}}function Uo(){return ln({})}function Wo(){return ln({})}function ln(e){let n=Bo++;O.set(n,[e]);let t=()=>{let c=O.get(n);if(c&&c.length>0){let u=c[c.length-1];return u instanceof ae?u.get():u}return e},o=()=>{let c=O.get(n),u=c&&c.length>0?c[c.length-1]:e;return u instanceof ae?()=>u.get():()=>u},r=c=>{let u=O.get(n)||[e];u.push(c.value),O.set(n,u);let a=document.createElement("div");a.style.display="contents";let f=c.children;if(f)for(let p of Array.isArray(f)?f:[f])p instanceof Node?a.appendChild(p):p!=null&&a.appendChild(document.createTextNode(String(p)));return u.pop(),u.length===0&&u.push(e),a},i=c=>{let u=c.children;return Array.isArray(u)&&(u=u.find(a=>typeof a=="function")),an(typeof u=="function"?u(t()):null)},s=(c=>r(c));return s.$$typeof=pt,s.id=n,s.defaultValue=e,s.Provider=r,s.Consumer=i,s.useContext=t,s.use=t,s.useContextLive=o,s}function Go(e,n){return(...t)=>{let o=[];for(let[r,i]of e){let s=O.get(r.id);s&&(s.push(new ae(i)),o.push(s))}try{return n(...t)}finally{for(let r of o)r.pop()}}}function $o(){let e=new Map;return{getItem:n=>e.has(n)?e.get(n):null,setItem:(n,t)=>{e.set(n,t)},removeItem:n=>{e.delete(n)}}}var fn=$o();function ht(){return typeof window<"u"}function dn(e){if(e&&typeof e=="object")return e;if(!ht())return fn;try{return e==="session"?window.sessionStorage:e==="memory"?fn:window.localStorage}catch{return fn}}function pn(e){let n=typeof e=="string"?{key:e}:e;if(!n.key)throw new Error("[krate] createSignal persist requires a key");let t=n.store??"local";return{key:n.key,store:t,serialize:n.serialize??(o=>JSON.stringify(o)),deserialize:n.deserialize??(o=>JSON.parse(o)),sync:n.sync??t==="local"}}function gn(e,n){let o=globalThis.__KRATE_STATE__;if(!o||!Object.prototype.hasOwnProperty.call(o,e))return{found:!1};let r=o[e];if(typeof r=="string")try{return{found:!0,value:n(r)}}catch{return{found:!0,value:r}}return{found:!0,value:r}}function hn(e){let n=dn(e.store),t;try{t=n.getItem(e.key)}catch{return{found:!1}}if(t==null)return{found:!1};try{return{found:!0,value:e.deserialize(t)}}catch{return{found:!1}}}function mn(e,n){let t=dn(e.store);try{t.setItem(e.key,e.serialize(n))}catch{}}function Xo(e){let n=dn(e.store);try{n.removeItem(e.key)}catch{}}var Ae=new Map,gt=!1;function Qo(){gt||!ht()||(gt=!0,window.addEventListener("storage",e=>{if(e.key===null)return;let n=Ae.get(e.key);if(n)for(let t of n)t(e.newValue)}))}function kn(e,n){if(!e.sync)return()=>{};let t=Ae.get(e.key)??new Set;return t.add(n),Ae.set(e.key,t),Qo(),()=>{t.delete(n),t.size===0&&Ae.delete(e.key)}}var Jo={react:!0},d=[],mt=[],wn=!1,m=null;function Yo(e){m=e}var _e=[],x=new Set,le=[],U=null,kt=new Set,L=new Map;function Zo(e){return kt.has(e)?!1:(U=e,h=null,!0)}function er(){U=null,h=null}function F(){let e=d[d.length-1];return e?e.scope:U!==null?U:h!==null&&L.has(h)?L.get(h)??null:null}function nr(e){kt=new Set(e)}function he(e,n){e!==null&&!L.has(e)&&L.set(e,n)}var w=[],fe=!1;function W(e){let n=F(),t={fn:e,cleanups:[],disposed:!1,sources:new Set,running:!1,rerun:!1,queued:!1,owner:h,boundaryOwner:m?m.current():null,scope:n};if(h!==null){he(h,n);let o=K.get(h);o||K.set(h,o=new Set),o.add(t)}return t}var K=new Map,G=new Map;function me(e){let n=K.get(e);if(K.delete(e),n)for(let o of n)Hn(o),x.delete(o);let t=G.get(e);if(G.delete(e),L.delete(e),t)for(let o of t)try{o()}catch{}}var D=0,S=null,Re=0,$=new Set,de=new Set;function tr(e){D++;let n=S;S=null;try{return e()}finally{S=n,D--}}function yt(){Re++;for(let e of $)e.commit(Re);return $.clear(),Re}function He(){return Re}function Me(e,n){let t=S;S=e;try{return n()}finally{S=t}}function xn(e){for(let n of de)n.prune(e)||de.delete(n)}var bn=new Set("auxclick beforeinput blur cancel change click close compositionend compositionstart compositionupdate contextmenu copy cut dblclick dragend dragstart drop focusin focusout input invalid keydown keypress keyup mousedown mouseup paste pause play pointercancel pointerdown pointerup ratechange reset resize seeked select submit touchcancel touchend touchstart volumechange focus".split(" ")),En=0,pe=!1,Ne=0;function or(){if(Ne>0)return!0;let e=typeof window<"u"?window.event:void 0;return!!e&&bn.has(e.type)}var Oe=0;function rr(e){Oe++;try{return e()}finally{Oe--}}function ir(e){return bn.has(e)}function Le(e,n,t){if(!bn.has(e)){t();return}Ne++;try{t()}finally{Ne--,n&&Ne===0&&Sn===0&&En===0&&(w.length>0||pe)&&De()}}function Q(e){En+=e?1:-1}function Cn(){let e=pe;return pe=!1,e}function wt(){return d[d.length-1]||null}var h=null;function J(){return h}function b(e){let n=h;return h=e,n}var St=[],vt=[],An=[];function Rn(e){St.push(e)}function Nn(e){vt.push(e)}function _n(e){An.push(e)}function On(){return w.length>0}function E(e){d.push(null);try{return e()}finally{d.pop()}}function sr(e){_e.push(e),Fn()}function cr(){if(_e.length===0)return;let e=_e.splice(0);for(let n of e)n()}function ur(e,n){return Object.is(e,n)}function Pn(e){let n=!1,t;for(let o of e.splice(0))try{o()}catch(r){n?typeof console<"u"&&console.error(r):(n=!0,t=r)}if(n)throw t}function ge(e){if(!e.disposed){e.disposed=!0,e.owner!==null&&K.get(e.owner)?.delete(e);for(let n of e.sources)n.delete(e);e.sources.clear(),Pn(e.cleanups)}}function Hn(e){try{ge(e)}catch(n){typeof console<"u"&&console.error(n)}}function ar(e){if(e.length===0){xt();return}let n=new Set(e);Tt(t=>!(t!=null&&n.has(t)),!0)}function lr(e){if(e.length===0)return;let n=new Set(e);Tt(t=>t!=null&&n.has(t),!1)}function Mn(e){if(e.charCodeAt(0)!==95)return null;let n=e.indexOf("_",1);return n>0?e.slice(0,n+1):null}function Tt(e,n){for(let s of An)try{s(e)}catch(c){typeof console<"u"&&console.error(c)}for(let s of Array.from(x))e(s.scope)&&(Hn(s),x.delete(s));let t=[];for(let s of le.splice(0)){if(!e(s.scope)){t.push(s);continue}try{s.fn()}catch{}}le.push(...t);let o=new Set([...G.keys(),...K.keys()]);for(let s of o)e(L.get(s)??null)&&me(s);if(!n)return;let r=globalThis,i=r.__krate_island_cleanups;if(Array.isArray(i)){r.__krate_island_cleanups=[];for(let s of i)try{s()}catch{}}U=null,Ce()}function xt(){U=null;for(let t of An)try{t(null)}catch(o){typeof console<"u"&&console.error(o)}for(let t of x)Hn(t);x.clear();for(let t of le)try{t.fn()}catch{}le.length=0;for(let t of Array.from(G.keys()))me(t);K.clear(),L.clear(),$.clear(),de.clear(),S=null;let e=globalThis,n=e.__krate_island_cleanups;if(Array.isArray(n)){e.__krate_island_cleanups=[];for(let t of n)try{t()}catch{}}w.length=0,_e.length=0,fe=!1,P=0,X++,pe=!1,Ce()}function fr(e,n){return Fe(v(e))}function dr(e,n){return Fe(v(e))}function pr(e,n){let t={};for(let i of e){let[s]=v(!1);t[i]=s}let r=[t,(i,s)=>{}];return r.trigger=i=>({"data-krate-scope":"trigger",value:i}),r.panel=i=>({"data-krate-scope":"panel",value:i}),r.close=()=>({"data-krate-scope":"close"}),r}function gr(e,n){return Fe(v(e))}function hr(e,n){return Fe(v(e))}function Fe(e){let n=e;return n.trigger=t=>({"data-krate-scope":"trigger",value:t}),n.panel=t=>({"data-krate-scope":"panel",value:t}),n.close=()=>({"data-krate-scope":"close"}),n.current=()=>e[0](),n}function mr(e,n){let t=()=>e[0];return[{top:t,peek:t},{push:o=>{},pop:()=>{},clear:()=>{}}]}function v(e,n){let t=e,o=null;if(n?.persist){o=pn(n.persist);let l=gn(o.key,o.deserialize);if(l.found)t=l.value;else{let g=hn(o);g.found&&(t=g.value)}}let r=new Set,i=!!n?.react,s=t,c=null,u=i?{commit(l){Object.is(s,t)||(c||(c=[[0,s]]),c.push([l,t]),s=t,de.add(u))},prune(l){if(!c)return!1;for(;c.length>1&&c[1][0]<=l;)c.shift();return c.length===1?(c=null,!1):!0}}:null,a=l=>{if(!c)return s;for(let g=c.length-1;g>=0;g--)if(c[g][0]<=l)return c[g][1];return c[0][1]},f=()=>{let l=d[d.length-1];if(l&&!l.disposed&&(r.add(l),l.sources.add(r)),i){if(S!==null)return a(S);if(D===0)return s}return t},p=(l=!1)=>bt(r,l),R=l=>{let g=typeof l=="function"?l(t):l;Object.is(g,t)||(t=g,o&&mn(o,t),u&&$.add(u),p(i))};if(o&&o.sync){let l=o,g=kn(l,ue=>{if(ue!==null)try{let be=l.deserialize(ue);Object.is(be,t)||(t=be,p())}catch{}});I(g)}return Ln.add(f),[f,R]}function bt(e,n=!1){let t=Array.from(e);for(let o of t){if(o.disposed){e.delete(o);continue}if(o.mark){o.mark(n);continue}if(o.running){o.rerun=!0;continue}o.queued||(o.queued=!0,w.push(o))}Fn(n)}var Et=new WeakSet;function kr(e,n){let t,o=!0,r=new Set,i=W(()=>{});i.mark=u=>{o||(o=!0,bt(r,u))},x.add(i);let s=()=>{let u=d[d.length-1];if(u&&!u.disposed&&(r.add(u),u.sources.add(r)),(D===0||S!==null)&&($.size>0||S!==null&&de.size>0))return E(e);if(o&&!i.disposed){for(let a of i.sources)a.delete(i);i.sources.clear(),o=!1,d.push(i);try{n&&n(),t=e()}catch(a){throw o=!0,a}finally{d.pop()}}else if(i.disposed)return E(e);return t},c=d[d.length-1];return c&&c.cleanups.push(()=>{ge(i),x.delete(i)}),Et.add(s),Ln.add(s),s}function Ke(e){return typeof e=="function"&&Et.has(e)}function yr(e){return Ke(e)?e:()=>e}var Ln=new WeakSet;function wr(e){return typeof e=="function"&&Ln.has(e)}var P=0,X=0;function Fn(e=!1){let n=Oe===0&&or();n&&(pe=!0);let o=!(e||Oe>0)||n||En>0||D>0||typeof setTimeout!="function";if(P===1||!o&&P===2)return;fe=!0;let r=++X,i=()=>{r===X&&Kn()};o?(P=1,queueMicrotask(i)):(P=2,setTimeout(i,0))}var Sn=0;function Kn(){Sn++;try{Sr()}finally{Sn--}}function Sr(){fe=!1,P=0,X++;let e=!1,n,t=r=>{e?typeof console<"u"&&console.error(r):(e=!0,n=r)};for(let r of St)r();let o=0;for(;w.length>0&&o<Ct;o++){let r=w.splice(0);vn=r;for(let i of r)if(!i.disposed){i.queued=!1,i.rerun=!1;try{Pe(i)}catch(s){t(s)}if(i.rerun&&!i.disposed){i.rerun=!1;try{Pe(i)}catch(s){t(s)}}}}if(w.length>0)try{Tn()}catch(r){t(r)}if(w.length===0&&(P=0,fe=!1,X++),w.length===0){for(let r of At)try{r()}catch(i){t(i)}if(w.length>0){if(yn>=50)try{Tn()}catch(r){throw t(r),n}yn++;try{Kn()}catch(r){t(r)}finally{yn--}if(e)throw n;return}try{ke()}catch(r){t(r)}}if(e)throw n}var Ct=100,vn=[];function Tn(){let e=w.splice(0);for(let r of e)r.queued=!1;fe=!1,P=0,X++;let n=e.length>0?e:vn;vn=[];let t=Array.from(new Set(n.map(r=>r.fn.name||"anonymous effect"))).slice(0,3).join(", "),o=new Error("Maximum update depth exceeded. An effect keeps writing state that re-runs itself or another effect ("+t+"). Make the write conditional or remove the dependency that changes on every run.");for(let r of n)if(r.boundaryOwner&&m&&m.error(r.boundaryOwner,o))return;throw o}var At=[],yn=0;function vr(e){At.push(e)}function Tr(){Fn()}function ke(){$.size>0&&yt(),typeof document<"u"&&document.activeElement;for(let e of vt)e();cr()}function De(){if(w.length===0){ke();return}let e=0;for(;w.length>0;)e++>=Ct&&Tn(),Kn()}function Pe(e){e.running=!0;let n=!1,t=h;h=e.owner,D++;let o=S;S=null;try{Pn(e.cleanups);for(let i of e.sources)i.delete(e);e.sources.clear(),d.push(e),n=!0;let r=e.fn();typeof r=="function"&&e.cleanups.push(r)}catch(r){if(!(e.boundaryOwner&&m&&m.error(e.boundaryOwner,r)))throw r}finally{S=o,D--,h=t,n&&d.pop(),e.running=!1}}function y(e){let n=W(e);x.add(n);let t=d[d.length-1],o=()=>{ge(n),x.delete(n)};return n.boundaryOwner&&m&&m.cleanup(n.boundaryOwner,o),Pe(n),t&&!t.disposed?t.cleanups.push(o):t&&t.root&&Dn(t,o),o}function I(e){let n=wt();if(n){Dn(n,e);return}let t=m?m.current():null;if(t&&m)m.cleanup(t,e);else if(h!==null){he(h,F());let o=G.get(h);o||G.set(h,o=[]),o.push(e)}else le.push({fn:e,scope:F()})}function Dn(e,n){if(e.dead){n();return}e.cleanups.push(n)}function xr(e){let n=W(()=>{});n.disposed=!0,n.root=!0;let t=()=>{if(n.dead)return;n.dead=!0;let o=n.cleanups.splice(0);for(let r of o)try{r()}catch(i){console.error(i)}};d.push(n);try{return e(t)}finally{d.pop()}}function br(e){mt.push({fn:e,owner:d[d.length-1],boundary:m?m.current():null}),wn||(wn=!0,queueMicrotask(Er))}function Er(){wn=!1;let e=mt.splice(0);for(let{fn:n,owner:t,boundary:o}of e){let r=()=>{if(!t){n();return}if(t.dead||!t.root&&t.disposed)return;let i=W(()=>{});i.disposed=!0,d.push(i);try{n()}finally{d.pop()}for(let s of i.cleanups)Dn(t,s)};o&&m?m.run(o,r):r()}}function Cr(e){let[n,t]=v(void 0),o=!0,r=W(()=>{});x.add(r);let i=()=>{Pn(r.cleanups);for(let p of r.sources)p.delete(r);r.sources.clear(),o=!1,d.push(r);let f;try{f=e()}catch(p){throw o=!0,p}finally{d.pop()}t(f)},s=W(()=>{o&&!r.disposed&&i()});x.add(s),r.mark=()=>{o=!0,!s.queued&&!s.disposed&&(s.queued=!0,w.push(s))},Pe(s);let c=()=>(o&&!r.disposed&&i(),n()),u=wt(),a=()=>{r.disposed||(ge(r),x.delete(r),ge(s),x.delete(s))};return u?u.cleanups.push(a):s.boundaryOwner&&m&&m.cleanup(s.boundaryOwner,a),c}function Ar(e,n,t,o){t&&typeof t=="object"&&(o=t,t=void 0);let r=typeof t=="function"?t(n):n,[i,s]=v(r,o);return[i,u=>s(a=>e(a,u))]}function Rr(e){return{current:e}}function Nr(e){return n=>e(n,n.ref||(()=>{}))}var k=je(null,null),C=new Map,N=new Map,q=new Set,_=new Set,_r=0,Ie=!1,H=null,M=[],j=[],Y=[],Z=new Map,_t=[];function je(e,n){let t=n&&n.parent!==null?n.scope:n?F():null,o={id:e,parent:n,children:[],hooks:[],disposed:!1,shown:!0,conds:[],slot:null,record:null,scope:t};return n&&he(o,t),o}function Or(e){_t.push(e)}function Pr(e){return qe(e).id}function qe(e){return e&&typeof e=="object"&&"hooks"in e?e:k}function ee(e){for(let n=e;n;n=n.parent)if(n.disposed||!n.shown)return!1;return!0}function Ot(e){for(let[n,t]of e.conds){let o=N.get(n);if(o!==void 0&&o!==t)return!1}return!0}function Hr(e,n,t,o){if(e==null){b(null);return}let r=C.get(e);if(!r){let i=n!=null&&C.get(n)||k;r=je(e,i);for(let s=i;s;s=s.parent)s.disposed&&(r.disposed=!0);i.children.push(r),C.set(e,r);for(let[s,c,u]of t||[])r.conds.push([s,c]),N.has(s)||N.set(s,u?c:c==="c"?"a":"c");r.shown=Ot(r),o&&(r.slot=o,q.has(o)&&(r.disposed=!0))}b(r)}function Vn(e){let n=qe(J()),t=je(null,n);n.children.push(t);let o=b(t);try{return{value:e(),owner:t}}finally{b(o)}}function z(e){let n=qe(e);if(n===k||n.disposed)return;let t=ee(n),o=[];if(ze(n,t,o),n.parent){let r=n.parent.children,i=r.indexOf(n);i>=0&&r.splice(i,1)}o.length&&(M.push(...o),Bn())}function ze(e,n,t){e.disposed=!0;for(let o of e.hooks){if(o.stop(),_.delete(o),!n){o.mounted&&(o.mounted=!1,o.cleanup=null,zn(o.epoch));continue}if(o.phase==="passive"){let r=ye(o);r&&t.push(r)}else ne(o)}for(let o of _t)o(e,e.id);me(e),e.record&&e.record.owner===e&&(e.record.owner=null);for(let o of e.children.slice())ze(o,n&&o.shown,t)}function Mr(e){let n=C.get(e);n&&(z(n),C.delete(e))}function Lr(e,n,t,o,r){let i={id:e,parentId:n,conds:[],slot:o||null,fn:r,owner:null};for(let[s,c,u]of t||[])i.conds.push([s,c]),N.has(s)||N.set(s,u?c:c==="c"?"a":"c");Y.push(i),In(i)&&Ht(i)}function Pt(e){if(e.parentId==null)return k;let n=C.get(e.parentId);if(!n)return k;for(let t=n;t;t=t.parent)if(t.disposed)return null;return n}function In(e){if(e.slot&&q.has(e.slot))return!1;for(let[n,t]of e.conds){let o=N.get(n);if(o!==void 0&&o!==t)return!1}return Pt(e)!==null}function Ht(e){let n=Pt(e)||k,t=je(e.id,n);t.record=e,t.slot=e.slot,n.children.push(t),C.set(e.id,t),e.owner=t;let o=b(t);try{E(e.fn)}finally{b(o)}}function Fr(e){if(!q.has(e)){q.add(e);for(let n of Array.from(C.values()))n.slot===e&&z(n)}}function Kr(e,n){if(N.get(e)===n)return;N.set(e,n);for(let r of Y)r.owner&&!r.owner.disposed&&!In(r)&&z(r.owner);for(let r of Y)!r.owner&&In(r)&&Ht(r);let t=[];for(let r of C.values())!r.record&&r.conds.some(([i])=>i===e)&&t.push(r);let o=[];for(let r of t){let i=Ot(r);if(i===r.shown)continue;let s=ee(r);r.shown=i;let c=ee(r);s&&!c?Mt(r,o):!s&&c&&Lt(r)}o.length&&(M.push(...o),o=[],Bn()),It()}function Mt(e,n){for(let t of e.hooks)if(_.delete(t),t.phase==="passive"){let o=ye(t);o&&n.push(o)}else ne(t);for(let t of e.children)t.shown&&!t.disposed&&Mt(t,n)}function Lt(e){for(let n of e.hooks)Dt(n);for(let n of e.children)n.shown&&!n.disposed&&Lt(n)}function Ft(e,n){if(!e||!n||e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(!Object.is(e[t],n[t]))return!1;return!0}function Kt(e){if(e!=null)return Array.isArray(e)?e:Array.from(e)}function Dt(e){e.dirty=!0,_.add(e),It()}function It(){Ie||(Ie=!0,queueMicrotask(()=>{On()||(te(),ke())}))}function Dr(e,n,t="passive"){let o=qe(J()),r={owner:o,phase:t,fn:e,deps:n||null,prev:void 0,hasPrev:!1,cleanup:null,mounted:!1,epoch:0,dirty:!1,seq:_r++,stop:()=>{},scope:o===k?F():o.scope};o.hooks.push(r),!o.disposed&&(r.stop=y(()=>{let i=r.deps?Kt(r.deps()):[];r.hasPrev&&Ft(r.prev,i)||(r.prev=i,r.hasPrev=!0,ee(r.owner)&&Dt(r))}))}function jn(e,n){if(e.owner.disposed)return;let t;try{t=Me(n,()=>E(e.fn))}catch(o){jt(o,e.owner);return}e.cleanup=typeof t=="function"?t:null,e.mounted=!0,e.epoch=n,Z.set(n,(Z.get(n)||0)+1)}var qn=null;function Ir(e){qn=e}function jt(e,n){let t=null;for(let o=n;o&&t===null;o=o.parent)t=o.id;if(!(qn&&qn(e,t)))throw e}function qt(e,n){try{E(e)}catch(t){jt(t,n)}}function zt(e){if(!e.mounted)return null;e.mounted=!1;let n=e.epoch,t=e.cleanup;return e.cleanup=null,t?()=>{try{Me(n,()=>E(t))}finally{zn(n)}}:(zn(n),null)}function zn(e){let n=(Z.get(e)||1)-1;n>0?Z.set(e,n):Z.delete(e)}function ne(e){let n=zt(e);n&&qt(n,e.owner)}function ye(e){let n=zt(e);return n?()=>qt(n,e.owner):null}function Rt(){let e=He();for(let n of Z.keys())n<e&&(e=n);xn(e)}function jr(e){let n=new Map,t=0,o=r=>{for(let i of r.children)o(i);n.set(r,t++)};for(let r of k.children)o(r);return n.set(k,t++),Array.from(e).sort((r,i)=>{let s=n.get(r.owner)??t,c=n.get(i.owner)??t;return s!==c?s-c:r.seq-i.seq})}var Vt=[];function qr(e){Vt.push(e)}function Nt(){for(let e of Vt)e()}function zr(){Ie=!1;let e=He(),n=Cn();if(_.size===0){Nt(),n&&te(),Rt();return}let t=jr(_).filter(o=>ee(o.owner));_.clear();for(let o of t)o.dirty=!1;Q(!0);try{let o=0;for(;o<t.length;){let i=t[o].owner,s=o;for(;s<t.length&&t[s].owner===i;)s++;for(let c=o;c<s;c++)t[c].phase==="insertion"&&(ne(t[c]),jn(t[c],e));for(let c=o;c<s;c++)t[c].phase==="layout"&&ne(t[c]);o=s}for(let i of t)i.phase==="layout"&&jn(i,e);Nt();let r=!1;for(let i of t){if(i.phase!=="passive")continue;let s=ye(i);s&&M.push(s),j.push([i,e]),r=!0}r&&Bn(),n&&te()}finally{Q(!1)}Rt()}function Bn(){H===null&&(H=setTimeout(te,0))}function te(){H!==null&&(clearTimeout(H),H=null);let e=!1,n,t=o=>{e?typeof console<"u"&&console.error(o):(e=!0,n=o)};for(;M.length||j.length;){let o=M,r=j;M=[],j=[],Q(!0);try{for(let i of o)try{i()}catch(s){t(s)}for(let[i,s]of r)if(ee(i.owner))try{jn(i,s)}catch(c){t(c)}}finally{Q(!1)}}if(e)throw n}function Bt(e,n){let t,o=!1,r;return()=>{let i=Kt(n())||[];return(!o||!Ft(t,i))&&(t=i,o=!0,r=E(e)),r}}function Vr(e){return function(...t){return E(()=>e.apply(this,t))}}function Br(e,n){let t=!0;return Bt(()=>{if(t)return t=!1,e;let o=e;return function(...r){return o.apply(this,r)}},n)}function Ur(e){if(e&&typeof e=="object"){let n=Object.getPrototypeOf(e);if(n===Object.prototype||n===null){let t=[];for(let o of Object.keys(e))o!=="children"&&t.push(e[o]);return t}}return[e]}function Wr(e){let n=[];for(let r of k.children.slice()){if(!e(r.scope))continue;ze(r,r.shown,n);let i=k.children.indexOf(r);i>=0&&k.children.splice(i,1)}let t=[];for(let r of k.hooks){if(!e(r.scope)){t.push(r);continue}if(r.stop(),_.delete(r),r.phase==="passive"){let i=ye(r);i&&n.push(i)}else ne(r)}k.hooks=t;for(let[r,i]of Array.from(C))(i.disposed||e(i.scope))&&C.delete(r);let o=r=>!e(Mn(r));for(let r of Array.from(N.keys()))o(r)||N.delete(r);for(let r of Array.from(q))o(r)||q.delete(r);for(let r=Y.length-1;r>=0;r--)o(Y[r].id)||Y.splice(r,1);for(let r of Array.from(_))r.owner.disposed&&_.delete(r);j=j.filter(([r])=>!r.owner.disposed&&!(r.owner===k&&e(r.scope)));for(let r of n)try{E(r)}catch{}b(null)}function Gr(e){if(e){Wr(e);return}let n=[];for(let o of k.children.slice())ze(o,o.shown,n);for(let o of k.hooks)if(o.stop(),o.phase==="passive"){let r=ye(o);r&&n.push(r)}else ne(o);k.children.length=0,k.hooks.length=0,C.clear(),N.clear(),q.clear(),_.clear(),j=[];let t=M.concat(n);M=[],H!==null&&(clearTimeout(H),H=null);for(let o of t)try{E(o)}catch{}Ie=!1,b(null)}Rn(te);Nn(zr);_n(Gr);var we=new Set;function Ut(e){let n,t=!1;if(y(()=>{try{e()}catch(o){n=o,t=!0}})(),t)throw n}function Ve(e){if(e.on)return;e.on=!0;let n=e.ref;Ut(()=>{if(typeof n=="function"){let t=n(e.el);e.undo=typeof t=="function"?t:()=>n(null)}else if(n&&typeof n=="object")n.current=e.el,e.undo=()=>{n.current=null};else if(e.assign){let t=e.assign;t(e.el),e.undo=()=>t(null)}else e.undo=null})}function Un(e){if(!e.on)return;e.on=!1;let n=e.undo;e.undo=null,n&&Ut(n)}function Wt(e,n){let t={el:n,ref:e,on:!1,undo:null};return Ve(t),()=>Un(t)}var oe=null;function Gt(){oe||(oe=[],queueMicrotask(Wn))}function Wn(){let e=oe;if(oe=null,!!e)for(let n of e)we.has(n)&&n.el.isConnected&&Ve(n)}function Se(e,n,t,o){let r={el:e,ref:n,assign:t,on:!1,undo:null};return we.add(r),o==="defer"&&oe?oe.push(r):(o==="now"||e.isConnected)&&Ve(r),()=>{we.delete(r),Un(r)}}function Be(e){for(let n of we)n.on&&e.contains(n.el)&&Un(n)}function Ue(){for(let e of we)!e.on&&e.el.isConnected&&Ve(e)}var $r={doubleclick:"dblclick",focus:"focusin",blur:"focusout"},Xr={dblclick:"doubleclick",focusin:"focus",focusout:"blur"},Qr={focusin:"focus",focusout:"blur"},Jr=new Set("scroll scrollend load error abort cancel close invalid toggle beforetoggle mouseenter mouseleave pointerenter pointerleave canplay canplaythrough durationchange emptied encrypted ended loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" ")),Yt={change:["change","input","click"],beforeinput:["beforeinput","compositionend"]},Yr={preventDefault(){this.defaultPrevented=!0,this.nativeEvent.preventDefault()},stopPropagation(){this._s=!0,this.nativeEvent.stopPropagation()},isDefaultPrevented(){return this.defaultPrevented},isPropagationStopped(){return!!this._s},persist(){},isPersistent(){return!0}},Zr={get(e,n){if(n in e)return e[n];let t=e.nativeEvent,o=t[n];return typeof o=="function"?o.bind(t):o}};function $e(e,n,t){let o=Object.create(Yr),r=t===void 0?e.target:t;return r&&r.nodeType===3&&(r=r.parentNode),o.type=n||Qr[e.type]||e.type,o.target=r,o.currentTarget=null,o.nativeEvent=e,o.defaultPrevented=e.defaultPrevented,new Proxy(o,Zr)}var Gn,We=!1;function Zt(e,n){try{e(n)}catch(t){We||(We=!0,Gn=t)}}function eo(){if(We){let e=Gn;throw We=!1,Gn=void 0,e}}function Yn(e,n,t,o,r){let i=[],s=[];for(let a=t;a;a=a.__kpp||a.parentNode){let f=a.__kh;if(!f)continue;let p;o&1&&(p=f[n+"$"])&&i.unshift(a,p),o&2&&(p=f[n])&&s.push(a,p)}if(!i.length&&!s.length)return null;let c=$e(e,r,t),u=i.concat(s);for(let a=0;a<u.length&&!c._s;a+=2)c.currentTarget=u[a],Zt(u[a+1],c);return c.currentTarget=null,c}var $t=new WeakMap,$n=new Set,no=new Set;function ei(){return typeof document>"u"?null:document.getElementById("root")||document.body}function Xn(e,n){let t=$t.get(e);t||(t=new Set,$t.set(e,t)),!t.has(n)&&(t.add(n),e.addEventListener(n,ni,!0),e.addEventListener(n,ti,!1))}function Qn(e){no.add(e);let n=ei();n&&($n.add(n),Xn(n,e));for(let t of $n)t!==n&&t.isConnected&&Xn(t,e)}function Xe(e){$n.add(e);for(let n of no)Xn(e,n)}function ni(e){to(e,!0)}function ti(e){to(e,!1)}var Ge=0;function oi(e){Ge++;try{return e()}finally{Ge--}}function to(e,n){if(Ge>0)return;let t=n?"__kdc":"__kdb",o=e;if(o[t])return;o[t]=1;let r=e.type,i=e.target;Le(r,!n,()=>{r!=="change"&&r!=="beforeinput"&&Yn(e,Xr[r]||r,i,n?1:2),n||(r==="change"||r==="input"||r==="click"?ui(e):(r==="beforeinput"||r==="compositionend")&&ai(e))}),eo()}function ri(e){oo(this,e,!1)}function ii(e){oo(this,e,!0)}function oo(e,n,t){if(Ge>0)return;let o=e.__kh,r=o&&o[n.type+(t?"$":"")];if(!r)return;let i=$e(n);i.currentTarget=e,Le(n.type,!0,()=>Zt(r,i)),i.currentTarget=null,eo()}function Zn(e){let n=e.slice(2),t=!1;return n.length>7&&n.slice(-7)==="Capture"&&!/^(Got|Lost)PointerCapture$/.test(n)&&(n=n.slice(0,-7),t=!0),[n.toLowerCase(),t]}function ve(e,n,t){let[o,r]=Zn(n),i=e,s=i.__kh||(i.__kh={}),c=o+(r?"$":"");if(typeof t!="function"){s[c]=void 0;return}if(s[c]=t,Jr.has(o)){let a=i.__kd||(i.__kd={});a[c]||(a[c]=1,e.addEventListener(o,r?ii:ri,r));return}let u=Yt[o];if(u){for(let a of u)Qn(a);o==="change"&&so(e)}else Qn($r[o]||o)}function Qe(e){let n=e.querySelectorAll("input[value]");for(let t=0;t<n.length;t++){let o=n[t];if(!ro.has(o.type||"text")||!o.value||o.ownerDocument.activeElement===o)continue;let r=o.value;o.value="",o.value=r}}var ro=new Set("color date datetime datetime-local email month number password range search tel text time url week".split(" "));function et(e){return e.tagName==="INPUT"&&(e.type==="checkbox"||e.type==="radio")}function io(e){return et(e)?String(e.checked):String(e.value)}function so(e){e.__kv===void 0&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")&&(e.__kv=io(e))}function Jn(e){let n=io(e);return e.__kv===n?!1:(e.__kv=n,!0)}function si(e){if(!e.name||!e.ownerDocument)return[e];let n=[],t=e.ownerDocument.getElementsByName(e.name);for(let o=0;o<t.length;o++){let r=t[o];r.tagName==="INPUT"&&r.type==="radio"&&r.form===e.form&&n.push(r)}return n}function ci(e){let n=e.target;if(!n||!n.tagName)return null;let t=e.type,o=n.tagName;return o==="SELECT"||o==="INPUT"&&n.type==="file"?t==="change"?n:null:et(n)?t==="click"&&Jn(n)?n:null:(o==="TEXTAREA"||o==="INPUT"&&ro.has(n.type||"text"))&&t!=="click"&&Jn(n)?n:null}function ui(e){let n=ci(e);if(n)if(Yn(e,"change",n,3,"change"),n.type==="radio")for(let t of si(n))Jn(t),Jt(t);else Jt(n)}function ai(e){let n=e;e.type==="beforeinput"&&(n.isComposing||typeof n.data!="string"||n.data==="")||e.type==="compositionend"&&!n.data||Yn(e,"beforeinput",e.target,3,"beforeinput")}function Xt(e,n){e.__kw||(e.__kw=1,console.error(n))}function Qt(e,n,t){let o=e.options;if(e.multiple){let s=new Set((Array.isArray(n)?n:[n]).map(String));for(let c=0;c<o.length;c++){let u=s.has(o[c].value);t?o[c].defaultSelected=u:o[c].selected!==u&&(o[c].selected=u)}return}let r=String(n),i=null;for(let s=0;s<o.length;s++){if(o[s].value===r){t?o[s].defaultSelected=!0:o[s].selected=!0;return}!i&&!o[s].disabled&&(i=o[s])}i&&!t&&(i.selected=!0)}function V(e,n,t){let o=e;switch(n){case"value":{if(t==null)return;if(o.tagName==="SELECT"){Qt(o,t,!1);return}let r=String(t);o.value!==r&&(o.value=r),o.type!=="file"&&!(o.type==="number"&&o.ownerDocument&&o.ownerDocument.activeElement===o)&&o.defaultValue!==r&&(o.defaultValue=r),et(o)||(o.__kv=r);return}case"checked":{if(t==null)return;let r=!!t;o.checked!==r&&(o.checked=r),o.__kv=String(r);return}case"defaultValue":o.tagName==="SELECT"?Qt(o,t,!0):o.defaultValue=t==null?"":String(t);return;case"defaultChecked":o.defaultChecked=!!t;return;default:o[n]=!!t}}function Jt(e){let n=e.__kc;n&&(De(),n.value&&V(e,"value",n.value()),n.checked&&V(e,"checked",n.checked()))}function Je(e,n,t){let o=e,r=n==="value"||n==="checked";if(r){(o.__kc||(o.__kc={}))[n]=t;for(let c of Yt.change)Qn(c);so(o)}let i,s=!1;return y(()=>{let c=t();if(r){let u=c!=null;c===null&&n==="value"?Xt(o,"`value` prop on `"+o.tagName.toLowerCase()+"` should not be null. Use an empty string to clear it or `undefined` for an uncontrolled field."):i!==void 0&&i!==u&&Xt(o,"A component is changing "+(i?"a controlled":"an uncontrolled")+" input to be "+(u?"controlled":"uncontrolled")+". Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://react.dev/link/controlled-components"),i=u}V(o,n,c),!s&&n==="value"&&o.tagName==="TEXTAREA"&&o.ownerDocument.activeElement!==o&&o.setSelectionRange(0,0),s=!0})}var co="template[data-krate-portal]",Ye=new Map,Ze=new Set;function li(e,n){Ye.set(e,n)}function fi(e){return!!e&&typeof e=="object"&&(e.nodeType===1||e.nodeType===11)}function di(e){let n=e.getAttribute("data-krate-portal")||"",t=Ye.get(n);if(t){let r=null;try{r=t()}catch{r=null}return fi(r)?r:null}let o=e.getAttribute("data-krate-portal-target");if(!o||o==="body")return document.body;try{return document.querySelector(o)}catch{return null}}function nt(e){if(e.__kpn||!e.isConnected)return;let n=di(e);if(!n)return;let t=Array.from(e.content.childNodes),o=document.createDocumentFragment();for(let i of t)i.__kpp=e,o.appendChild(i);n.appendChild(o),e.__kpn=t,Ze.add(e);let r=document.getElementById("root");n.nodeType===1&&!(r&&r.contains(n))&&Xe(n),e.__kpd||(e.__kpd=!0,nn(e,()=>en(e,!0)))}function en(e,n){let t=e.__kpn;if(t){e.__kpn=void 0,Ze.delete(e);for(let o of t)n?o.parentNode&&o.parentNode.removeChild(o):e.content.appendChild(o),o.__kpp=void 0}}function tt(e){let n=[];return e.matches?.(co)&&n.push(e),e.querySelectorAll(co).forEach(t=>n.push(t)),n}function pi(e){if(!(typeof document>"u"))for(let n of tt(e||document))nt(n)}function ot(e){return tt(e)}function rt(e){for(let n of e)nt(n)}function it(e){for(let n of tt(e))en(n)}function uo(e,n){let t=e.slice(),o=new Set;for(;t.length;)t.shift().querySelectorAll("template").forEach(i=>{if(o.has(i))return;o.add(i);let s=i;s.hasAttribute("data-krate-portal")&&n(s.content),t.push(s.content)})}function gi(e,n){for(let o of Ze)for(let r of o.__kpn||[]){if(r.nodeType!==1)continue;let i=r;if(i.matches(e))return i;let s=i.querySelector(e);if(s)return s}let t=null;return uo(n,o=>{t||(t=o.querySelector(e))}),t}function hi(){let e=new Set;for(let n of Array.from(Ze))n.isConnected?e.add(n.getAttribute("data-krate-portal")||""):en(n,!0);for(let n of Array.from(Ye.keys()))e.has(n)||Ye.delete(n)}var re=new Set,lo=new WeakMap;function mi(){return Array.from(re)}function ki(){let e=new Set,n=!0;for(;n;){n=!1;for(let t of re){if(e.has(t))continue;let o=lo.get(t);if(!o)continue;let r=o.getRootNode();(o.isConnected||e.has(r))&&(e.add(t),n=!0)}}for(let t of Array.from(re))e.has(t)||re.delete(t)}function ao(e){let n="/"+(e.nodeValue||"");for(let t=e.nextSibling;t;t=t.nextSibling)if(t.nodeType===8&&t.nodeValue===n)return t;return null}function yi(e,n,t){let o=e,r=n?"c":"a",i=o.__krateCond;if(!i){let l=t?t.getAttribute("data-kb"):null;i={shown:l==="c"?"a":l==="a"?"c":r,other:null,tpl:t,end:ao(e)},o.__krateCond=i}if(i.shown===r)return;let s=e.parentNode;if(!s)return;(!i.end||i.end.parentNode!==s)&&(i.end=ao(e));let c=i.end,u=document.createDocumentFragment(),a=e.nextSibling;for(;a&&a!==c;){let l=a.nextSibling;u.appendChild(a),a=l}Be(u),it(u);let f=i.other;if(!f&&(f=document.createDocumentFragment(),i.tpl&&(f.appendChild(i.tpl.content),i.tpl.getAttribute("data-kns")==="svg"))){let l=f.firstChild;if(l&&l.nodeType===1){for(;l.firstChild;)f.insertBefore(l.firstChild,l);f.removeChild(l)}}re.delete(f);let p=f.querySelector("[autofocus]");Qe(f);let R=ot(f);s.insertBefore(f,c),rt(R),i.other=u,re.add(u),lo.set(u,e),i.shown=r,Ue(),p&&(p.removeAttribute("autofocus"),p.focus())}var wi={href:!0,src:!0,action:!0,formaction:!0,"xlink:href":!0},Si=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i,fo="javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')";function st(e,n){return wi[e.toLowerCase()]&&Si.test(n)?fo:n}var Te=new WeakMap;function A(e,n){nn(e,n)}function nn(e,n){let t=Te.get(e);t||(t=[],Te.set(e,t)),t.push(n)}function mo(e,n){let t=()=>z(n);if(typeof DocumentFragment<"u"&&e instanceof DocumentFragment)for(let o=0;o<e.childNodes.length;o++)A(e.childNodes[o],t);else if(typeof Node<"u"&&e instanceof Node)A(e,t);else if(Array.isArray(e))for(let o of e)mo(o,n);else at(e)&&(e.u||(e.u=[])).push(n)}function ko(e,n){if(e.u)for(let t of e.u)A(n,()=>z(t))}function vi(e,n,t){let o=!0,r=y(()=>{let i=Se(e,n?n():void 0,t,o?"defer":void 0);o=!1,I(i)});return A(e,r),r}function se(e){let n=Te.get(e);if(n){for(let t of n)t();n.length=0}for(let t=0;t<e.childNodes.length;t++)se(e.childNodes[t])}function Ti(e){let n=e.nextSibling;for(;n;){if(n.nodeType===8&&n.nodeValue==="k")return n;n=n.nextSibling}return null}function yo(e,n){let t=e.parentNode;if(!t)return;let o=e.nextSibling;for(;o&&o!==n;){let r=o.nextSibling;se(o),t.removeChild(o),o=r}}function xi(e,n,t){let o=Ti(t);o?(yo(t,o),ct(e,n,o)):ct(e,n,null)}function ct(e,n,t){if(!(n==null||n===!1||n===!0)){if(typeof n=="string"||typeof n=="number"||typeof n=="bigint")e.insertBefore(document.createTextNode(String(n)),t);else if(n instanceof Node)e.insertBefore(n,t);else if(Array.isArray(n))for(let o of n)ct(e,o,t)}}var bi={htmlFor:"for"},Ei=new Set(["animation-iteration-count","aspect-ratio","border-image-outset","border-image-slice","border-image-width","box-flex","box-flex-group","box-ordinal-group","column-count","columns","flex","flex-grow","flex-positive","flex-shrink","flex-negative","flex-order","grid-area","grid-row","grid-row-end","grid-row-span","grid-row-start","grid-column","grid-column-end","grid-column-span","grid-column-start","font-weight","line-clamp","line-height","opacity","order","orphans","scale","tab-size","widows","z-index","zoom","fill-opacity","flood-opacity","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-miterlimit","stroke-opacity","stroke-width"]);function Ci(e){if(e.startsWith("--"))return e;let n=e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase());return n.startsWith("ms-")?"-"+n:n}var po=new WeakMap;function wo(e,n){let t=e.style;if(!t)return;let o=new Set;for(let i of Object.keys(n)){let s=n[i];if(s==null||typeof s=="boolean"||s==="")continue;let c=Ci(i),u=c.replace(/^-(webkit|moz|ms|o)-/,""),a=typeof s=="number"&&s!==0&&!c.startsWith("--")&&!Ei.has(u)?s+"px":String(s);t.setProperty(c,a),o.add(c)}let r=po.get(e);if(r)for(let i of r)o.has(i)||t.removeProperty(i);po.set(e,o)}function So(e,n,t){if(e.localName.indexOf("-")<1||n.indexOf("-")>=0)return!1;let o=typeof t=="object"&&t!==null||typeof t=="function";if(!o&&!(n in e))return!1;e[n]=t;let r=typeof customElements<"u"?customElements:null;return o&&r&&!r.get(e.localName)&&typeof r.whenDefined=="function"&&r.whenDefined(e.localName).then(()=>{let i=e;delete i[n],i[n]=t}),!0}function tn(e,n,t){if(!(e.localName.indexOf("-")>0&&n!=="class"&&n!=="className"&&n!=="style"&&n!=="ref"&&n!=="key"&&n!=="children"&&!n.startsWith("on")&&So(e,n,t))){if(n==="class"||n==="className"){let o=t===!1||t===null||t===void 0?"":String(t);if(e.getAttribute("class")!==o){if(o===""&&!e.hasAttribute("class")&&typeof t!="string")return;e.setAttribute("class",o)}}else if(n==="style")typeof t=="string"?e.getAttribute("style")!==t&&e.setAttribute("style",t):t&&typeof t=="object"?wo(e,t):(t==null||t===!1)&&e.removeAttribute("style");else if(n.startsWith("on")&&typeof t=="function")ve(e,n,t);else if(n==="value"||n==="checked"||n==="selected"||n==="defaultValue"||n==="defaultChecked")V(e,n,t);else if(n==="ref"){let o=Se(e,t,void 0,"now");A(e,o),I(o)}else if(!(n==="key"||n==="children"||n==="dangerouslySetInnerHTML")){let o=bi[n]||n,r=/^(aria|data)-/.test(o);if(t==null||typeof t=="function"||typeof t=="symbol"||t===!1&&!r)e.hasAttribute(o)&&e.removeAttribute(o);else{let i=t===!0&&!r?"":st(o,String(t));e.getAttribute(o)!==i&&e.setAttribute(o,i)}}}}function vo(e,n){for(let o in n){let r=n[o];typeof r=="function"&&(o==="value"||o==="checked")?A(e,Je(e,o,r)):typeof r=="function"&&!o.startsWith("on")&&o!=="ref"?A(e,y(()=>tn(e,o,r()))):tn(e,o,r)}let t=n.dangerouslySetInnerHTML;if(t&&typeof t=="object"&&t.__html!=null){let o=String(t.__html);e.innerHTML!==o&&(e.innerHTML=o)}}var go=new WeakMap;function Ai(e,n){A(e,y(()=>{let t=n()||{},o=new Set;for(let i of Object.keys(t))i==="children"||i==="key"||i==="dangerouslySetInnerHTML"||(o.add(i),tn(e,i,t[i]));let r=go.get(e);if(r)for(let i of r)o.has(i)||(i.startsWith("on")?ve(e,i,null):tn(e,i,void 0));go.set(e,o)}))}function To(e,n){if(e===void 0)return n();let t=b(e);try{return n()}finally{b(t)}}var B=0;function xo(e){let n=B;B=n+1;try{return e()}finally{B=n}}function bo(e){let n=B;B=0;try{return e()}finally{B=n}}function at(e){return!!e&&typeof e=="object"&&e.__kv===1}function Eo(e){return!!e&&typeof e=="object"&&e.__ka===1}var on="http://www.w3.org/2000/svg",Ri=new Set(["svg","g","defs","symbol","use","switch","desc","metadata","path","circle","ellipse","line","polygon","polyline","rect","text","tspan","textPath","image","foreignObject","marker","mask","pattern","clipPath","linearGradient","radialGradient","stop","filter","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","animate","animateMotion","animateTransform","set","mpath","view"]);function Ni(e){return Ri.has(e)?document.createElementNS(on,e):document.createElement(e)}function _i(e){let n=e;return n.namespaceURI===on&&n.localName!=="foreignObject"}function ho(e,n){let t=n;if(t.nodeType!==1||t.namespaceURI===on||!_i(e))return n;let o=document.createElementNS(on,t.localName);for(let r of Array.from(t.attributes))o.setAttribute(r.name,r.value);for(;t.firstChild;)o.appendChild(t.firstChild);return o}function Co(e,n,t){let o=Ni(e);if(n&&vo(o,n),!n||!n.dangerouslySetInnerHTML)for(let r of t)xe(o,r);return o}function Ao(e){let n=To(e.o,()=>bo(()=>Co(e.tag,e.props,e.children)));return ko(e,n),n}function lt(e){return e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="bigint"}function ft(e){return e==null||typeof e=="boolean"?"":String(e)}function xe(e,n){if(!(n==null||n===!1||n===!0)){if(Array.isArray(n)){for(let t of n)xe(e,t);return}if(typeof n=="function"){Hi(e,n,null);return}if(at(n)){e.appendChild(ho(e,Ao(n)));return}if(Eo(n)){e.appendChild(n.mount());return}e.appendChild(n instanceof Node?ho(e,n):document.createTextNode(String(n)))}}function Oi(e,n){let t=Te.get(e);if(t){Te.delete(e);for(let o of t)A(n,o)}}function ut(e,n){let t=e.parentNode;if(!t)return;let o=e.nextSibling;for(;o&&o!==n;){let r=o.nextSibling;se(o),t.removeChild(o),o=r}}function Pi(e){if(!e.text)return;let n=e.text,t=n.parentNode;e.start=document.createComment(""),e.end=document.createComment(""),t.insertBefore(e.start,n),t.insertBefore(e.end,n.nextSibling),Oi(n,e.start),t.removeChild(n),e.text=null}function Ro(e,n){if(lt(n)){let o=ft(n);if(e.text){e.text.data!==o&&(e.text.data=o);return}ut(e.start,e.end),o!==""&&e.end.parentNode.insertBefore(document.createTextNode(o),e.end);return}Pi(e),ut(e.start,e.end);let t=document.createDocumentFragment();xe(t,n),e.end.parentNode.insertBefore(t,e.end)}function Hi(e,n,t){let o={text:null,start:null,end:null},r=!0,i=y(()=>{let s=n();if(!r){Ro(o,s);return}if(r=!1,lt(s)){o.text=document.createTextNode(ft(s)),e.insertBefore(o.text,t);return}o.start=document.createComment(""),o.end=document.createComment(""),e.insertBefore(o.start,t);let c=document.createDocumentFragment();xe(c,s),e.insertBefore(c,t),e.insertBefore(o.end,t)});A(o.text||o.start,i)}function No(e){for(;e.next&&e.next.nodeType===8;)e.next=e.next.nextSibling}function ie(e,n){e.parent.insertBefore(n,e.next)}function _o(e,n){No(e);let t=e.next;if(n!==""&&t&&t.nodeType===3){let r=t;return r.data.length>n.length&&r.data.startsWith(n)?r.splitText(n.length):r.data!==n&&(r.data=n),e.next=r.nextSibling,r}let o=document.createTextNode(n);return ie(e,o),o}function Oo(e,n){let t=e.next;for(;t&&t!==n;){let o=t.nextSibling;se(t),e.parent.removeChild(t),t=o}e.next=n}function Mi(e,n){No(n);let t=n.next;if(t&&t.nodeType===1&&t.localName.toLowerCase()===e.tag.toLowerCase()){n.next=t.nextSibling;let o=t;ko(e,o),To(e.o,()=>{if(e.props&&vo(o,e.props),!e.props||!e.props.dangerouslySetInnerHTML){let r={parent:o,next:o.firstChild};for(let i of e.children)rn(i,r);Oo(r,null)}});return}ie(n,Ao(e))}function Li(e,n){let t={text:null,start:null,end:null},o=!0,r=y(()=>{if(!o){Ro(t,e());return}o=!1;let i=xo(e);if(lt(i)){t.text=_o(n,ft(i));return}t.start=document.createComment(""),ie(n,t.start),rn(i,n),t.end=document.createComment(""),ie(n,t.end)});A(t.text||t.start,r)}function rn(e,n){if(!(e==null||typeof e=="boolean")){if(Array.isArray(e)){for(let t of e)rn(t,n);return}if(typeof e=="function"){Li(e,n);return}if(at(e)){Mi(e,n);return}if(Eo(e)){e.adopt(n);return}if(e instanceof Node){ie(n,e);return}_o(n,String(e))}}function Fi(e,n,...t){if(typeof e=="function"){let o=n||{};(t.length>0||!("children"in o))&&(o.children=t);let{value:r,owner:i}=Vn(()=>e(o));return mo(r,i),r}return B>0?{__kv:1,tag:e,props:n,children:t,o:J()}:Co(e,n,t)}function Po(e){if(typeof e=="string"){let n=document.querySelector(e);if(!n)throw new Error(`Container "${e}" not found`);return n}return e}function Ki(e,n){let t=Po(n),o=!1;y(()=>{o||(o=!0,t.appendChild(e()))})}function Di(e,n){let t=Po(n);if(t.childNodes.length===0){t.appendChild(e());return}let o=e();o&&se(o)}function Ho(){return globalThis.__krateSuspenseHook}function Ii(e,n){let[t,o]=v(void 0),[r,i]=v(!0),[s,c]=v(void 0),[u,a]=v("unresolved"),[f,p]=v(0),R,l=Ho()?.current()??null,g=null,ue=null,be=()=>typeof e=="function"?e():e,Lo=()=>{let T=Fo();return g=T,T.then(()=>{g===T&&(g=null)}),T},Fo=async()=>{R&&R.abort(),R=new AbortController;let T=R,Ko=be();a(f()>0?"refreshing":"loading"),i(!0),c(void 0);try{let Ee=await n(Ko,{signal:T.signal});T.signal.aborted||(o(()=>Ee),a("ready"))}catch(Ee){Ee?.name!=="AbortError"&&!T.signal.aborted&&(c(Ee),a("error"))}finally{T.signal.aborted||i(!1)}};y(()=>{typeof e=="function"&&e.length===0&&e(),f(),Lo(),I(()=>{R&&(R.abort(),R=void 0)})});let dt=function(){return l&&g&&ue!==g&&(ue=g,Ho()?.suspend(l,g)),t()};return Object.defineProperties(dt,{loading:{get:()=>r()},error:{get:()=>s()},state:{get:()=>u()}}),[dt,{mutate:T=>{o(T)},refetch:()=>{p(T=>T+1)}}]}function ji(e){return Ke(e)?e():e}var ce=null,qi=0,Mo=typeof TextEncoder<"u"?new TextEncoder:null;function zi(e){return e.replace(/[^A-Za-z0-9_.:$-]/gu,n=>(Mo?Array.from(Mo.encode(n)):[n.charCodeAt(0)&255]).map(o=>"%"+o.toString(16).toUpperCase().padStart(2,"0")).join(""))}function Vi(e,n){if(!e)return n();let t=ce;ce={prefix:zi(e),n:0};try{return n()}finally{ce=t}}function Bi(){return ce?"krate-"+ce.prefix+"-u"+ce.n++:"krate_u"+qi++}function sn(e){return!!document.head.querySelector(e)}function cn(e,n,t){if(typeof document>"u"||!n)return;let o='link[rel="'+e+'"][href="'+(window.CSS&&CSS.escape?CSS.escape(n):n)+'"]';if(sn(o))return;let r=document.createElement("link");r.rel=e,r.href=n,t&&(t.as&&(r.as=t.as),t.crossOrigin!==void 0&&(r.crossOrigin=t.crossOrigin),t.integrity&&(r.integrity=t.integrity),t.type&&(r.type=t.type),t.media&&(r.media=t.media),t.nonce&&(r.nonce=t.nonce),t.fetchPriority&&r.setAttribute("fetchpriority",t.fetchPriority),t.referrerPolicy&&(r.referrerPolicy=t.referrerPolicy),t.imageSrcSet&&r.setAttribute("imagesrcset",t.imageSrcSet),t.imageSizes&&r.setAttribute("imagesizes",t.imageSizes)),document.head.appendChild(r)}function Ui(e,n){cn("preload",e,n)}function Wi(e,n){cn("modulepreload",e,n)}function Gi(e,n){cn("preconnect",e,n)}function $i(e){cn("dns-prefetch",e)}function Xi(e,n){if(typeof document>"u"||!e)return;if(n&&n.as==="script"){if(sn('script[src="'+e+'"]'))return;let o=document.createElement("script");o.src=e,o.async=!0,n.crossOrigin!==void 0&&(o.crossOrigin=n.crossOrigin),n.integrity&&(o.integrity=n.integrity),n.nonce&&(o.nonce=n.nonce),document.head.appendChild(o);return}if(sn('link[rel="stylesheet"][href="'+e+'"]'))return;let t=document.createElement("link");t.rel="stylesheet",t.href=e,n&&n.crossOrigin!==void 0&&(t.crossOrigin=n.crossOrigin),n&&n.integrity&&(t.integrity=n.integrity),n&&n.media&&(t.media=n.media),document.head.appendChild(t)}function Qi(e,n){if(typeof document>"u"||!e||sn('script[type="module"][src="'+e+'"]'))return;let t=document.createElement("script");t.type="module",t.src=e,n&&n.crossOrigin!==void 0&&(t.crossOrigin=n.crossOrigin),n&&n.integrity&&(t.integrity=n.integrity),document.head.appendChild(t)}return Vo(Ji);})();
|
|
2
2
|
for (const k in __krate_exports) { window[k] = __krate_exports[k]; }
|
package/dist/krate-dev.js
CHANGED
|
@@ -438,26 +438,34 @@ var __krate_exports = (() => {
|
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
440
|
captureRuntimeErrors() {
|
|
441
|
-
window.addEventListener("error", (e) =>
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
441
|
+
window.addEventListener("error", (e) => this.onError(e));
|
|
442
|
+
window.addEventListener("unhandledrejection", (e) => this.onRejection(e));
|
|
443
|
+
const early = window.__KRATE_EARLY_ERRORS__;
|
|
444
|
+
window.__KRATE_EARLY_ERRORS__ = void 0;
|
|
445
|
+
for (const e of early ?? []) {
|
|
446
|
+
if (e.type === "error") this.onError(e);
|
|
447
|
+
else this.onRejection(e);
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
onError(e) {
|
|
451
|
+
const stack = e.error?.stack || "";
|
|
452
|
+
const message = e.message || "Unknown error";
|
|
453
|
+
this.report({
|
|
454
|
+
message,
|
|
455
|
+
stack,
|
|
456
|
+
url: e.filename,
|
|
457
|
+
line: e.lineno,
|
|
458
|
+
col: e.colno,
|
|
459
|
+
kind: "error"
|
|
460
460
|
});
|
|
461
|
+
this.addRuntime("Runtime Error", message, stack);
|
|
462
|
+
}
|
|
463
|
+
onRejection(e) {
|
|
464
|
+
const reason = e.reason;
|
|
465
|
+
const message = reason instanceof Error ? reason.message : String(reason);
|
|
466
|
+
const stack = reason instanceof Error ? reason.stack : "";
|
|
467
|
+
this.report({ message, stack, url: location.href, kind: "unhandledrejection" });
|
|
468
|
+
this.addRuntime("Unhandled Promise Rejection", message, stack);
|
|
461
469
|
}
|
|
462
470
|
report(payload) {
|
|
463
471
|
const key = payload.message + "|" + (payload.stack || "");
|
package/dist/krate-f-list.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var __krate_exports=(()=>{var C=Object.defineProperty;var $=Object.getOwnPropertyDescriptor;var z=Object.getOwnPropertyNames;var J=Object.prototype.hasOwnProperty;var Q=(e,t)=>{for(var r in t)C(e,r,{get:t[r],enumerable:!0})},X=(e,t,r,
|
|
1
|
+
var __krate_exports=(()=>{var C=Object.defineProperty;var $=Object.getOwnPropertyDescriptor;var z=Object.getOwnPropertyNames;var J=Object.prototype.hasOwnProperty;var Q=(e,t)=>{for(var r in t)C(e,r,{get:t[r],enumerable:!0})},X=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of z(t))!J.call(e,i)&&i!==r&&C(e,i,{get:()=>t[i],enumerable:!(n=$(t,i))||n.enumerable});return e};var Y=e=>X(C({},"__esModule",{value:!0}),e);var le={};Q(le,{krateBindList:()=>de,krateList:()=>we,longestIncreasingSubsequence:()=>q});var I=window.createEffect;var A=window.createRoot,v=window.createSignal;var D=window.onCleanup;var M=window.untrack;var L=window.krateUnmount,V=window.krateWithOwner;var _=window.adoptValue,T=window.appendChild;var m=window.disposeNode;var K=window.insertAt;var H=window.removeRest,R=window.trackEffect,S=window.withDOM,B=window.withVNodes;var b=window.krateMuteEvents;var P=window.krateWithIdScope;function Z(e,t,r){if(!e)return String(r);let n=e(t,r);return n==null?String(r):"$"+String(n)}function ee(e){try{return decodeURIComponent(e)}catch{return e}}function te(e){let t=e.map(r=>r.charAt(0)==="$"?r.slice(1):r);console.error("Encountered two children with the same key, `"+t.join("`, `")+"`. Keys should be unique so that components maintain their identity across updates. Krate keeps the first occurrence on its existing row and renders each duplicate as its own row.")}function ne(){return[document.createComment(""),document.createComment("")]}function G(e,t,r,n,i){A(a=>{R(t.start,a);let s=(e.start.nodeValue||"").slice(2),{value:d,owner:l}=V(()=>P(s?s+":"+t.key:"",()=>{if(!e.accessor)return e.render(r,n);let[u,k]=v(r),[f,w]=v(n);return t.setItem=k,t.setIndex=w,e.render(u,f)}));D(()=>L(l)),i(d)})}function U(e,t,r,n){let[i,a]=ne(),s={key:t,item:r,index:n,start:i,end:a,setItem:null,setIndex:null,live:!0},d=document.createDocumentFragment();return d.appendChild(i),S(()=>G(e,s,r,n,l=>T(d,l))),d.appendChild(a),d.__row=s,d}function oe(e,t,r,n){t.item=r,t.index=n,t.live=!0;let i=t.start.parentNode;try{B(()=>G(e,t,r,n,a=>{let s={parent:i,next:t.start.nextSibling};S(()=>_(a,s)),H(s,t.end)}))}catch(a){console.error(a),W(t.start,t.end,!1),m(t.start);let s=U(e,t.key,r,n),d=s.__row;i.insertBefore(s,t.start),i.removeChild(t.start),i.removeChild(t.end),Object.assign(t,d)}}function W(e,t,r){let n=e.parentNode;if(!n)return;let i=e.nextSibling;for(;i&&i!==t;){let a=i.nextSibling;m(i),n.removeChild(i),i=a}r&&(m(e),n.removeChild(e),t.parentNode===n&&n.removeChild(t))}function j(e){W(e.start,e.end,!0)}function re(e,t){let r=t.parentNode;if(e.end.nextSibling===t)return;let n=e.start;for(;n;){let i=n===e.end?null:n.nextSibling;r.insertBefore(n,t),n=i}}function q(e){let t=e.length,r=new Int32Array(t),n=[];for(let s=0;s<t;s++){let d=e[s];if(d<0)continue;let l=0,u=n.length;for(;l<u;){let k=l+u>>1;e[n[k]]<d?l=k+1:u=k}r[s]=l>0?n[l-1]:-1,n[l]=s}let i=new Array(n.length),a=n.length?n[n.length-1]:-1;for(let s=n.length-1;s>=0;s--)i[s]=a,a=r[a];return i}function se(e){return e==null?[]:Array.isArray(e)?e:typeof e[Symbol.iterator]=="function"?Array.from(e):[]}function ie(e){if(typeof document>"u")return null;let t=document.activeElement;if(!t||t===document.body||!e||!e.contains(t))return null;let r=null;try{let n=t;typeof n.selectionStart=="number"&&(r=[n.selectionStart,n.selectionEnd,n.selectionDirection])}catch{r=null}return()=>{if(!(document.activeElement===t||!t.isConnected)&&(t.focus({preventScroll:!0}),r))try{t.setSelectionRange(r[0],r[1],r[2]||void 0)}catch{}}}function ae(e,t){let{end:r,keyFn:n}=e,i=r.parentNode,a=e.rows,s=t.length,d=new Array(s),l=new Map,u=null;for(let o=0;o<s;o++){let c=Z(n,t[o],o),p=l.get(c);p!==void 0?((u||(u=[])).push(c),l.set(c,p+1),c=c+"\0"+p):l.set(c,1),d[o]=c}u&&te(u);let k=new Map;for(let o=0;o<a.length;o++)k.set(a[o].key,o);for(let o=0;o<s&&o<a.length;o++){let c=a[o];!c.live&&!l.has(c.key)&&!k.has(d[o])&&(k.delete(c.key),c.key=d[o],k.set(c.key,o))}let f=ie(i),w=new Array(s),g=new Int32Array(s).fill(-1),F=new Uint8Array(a.length);for(let o=0;o<s;o++){let c=k.get(d[o]);if(c===void 0)continue;let p=a[c],h=t[o];p.live&&!e.accessor&&(p.item!==h||e.usesIndex&&p.index!==o)||(F[c]=1,g[o]=c,w[o]=p)}b(()=>{for(let o=0;o<a.length;o++)F[o]||j(a[o])});for(let o=0;o<s;o++){let c=w[o];if(!c)continue;let p=t[o];if(!c.live){oe(e,c,p,o);continue}c.item!==p&&(c.item=p,c.setItem&&c.setItem(()=>p)),c.index!==o&&(c.index=o,c.setIndex&&c.setIndex(o))}let y=new Array(s),x=null;for(let o=0;o<s;o++){if(w[o]){x=null;continue}let c=U(e,d[o],t[o],o);w[o]=c.__row,x?(x.appendChild(c),y[o-1]=null):x=c,y[o]=x}let N=new Uint8Array(s);for(let o of q(g))N[o]=1;b(()=>{let o=r;for(let c=s-1;c>=0;c--){let p=w[c],h=y[c];h?i.insertBefore(h,o):g[c]>=0&&!N[c]&&re(p,o),o=p.start}e.rows=w,f&&f()})}function ce(e){let{start:t,end:r}=e,n=t.parentNode,i=(t.nodeValue||"").slice(2),a="k:"+i+":",s=[],d=t.nextSibling;for(;d&&d!==r;){let u=d.nodeType===8&&d.nodeValue||"";if(i&&u.indexOf(a)===0){let f="/"+u,w=d.nextSibling;for(;w&&w!==r&&!(w.nodeType===8&&w.nodeValue===f);)w=w.nextSibling;if(w&&w!==r){s.push({key:ee(u.slice(a.length)),item:void 0,index:s.length,start:d,end:w,setItem:null,setIndex:null,live:!1}),d=w.nextSibling;continue}}let k=d.nextSibling;m(d),n.removeChild(d),d=k}let l=new Set;e.rows=s.filter(u=>l.has(u.key)?(j(u),!1):(l.add(u.key),!0))}function O(e,t,r){let n=!0,i=I(()=>{let a=se(t());M(()=>{n&&(n=!1,r&&ce(e)),ae(e,a)})});R(e.start,i)}function E(e,t,r,n,i){return{start:e,end:t,rows:[],keyFn:r,render:n,accessor:i===1,usesIndex:n.length>1}}function de(e,t,r,n,i){let a="/"+(e.nodeValue||""),s=e.nextSibling;for(;s&&!(s.nodeType===8&&s.nodeValue===a);)s=s.nextSibling;s||(s=document.createComment(a),e.parentNode.insertBefore(s,e.nextSibling)),O(E(e,s,r,n,i),t,!0)}function we(e,t,r,n){return{__ka:1,mount(){let i=document.createDocumentFragment(),a=document.createComment(""),s=document.createComment("");return i.appendChild(a),i.appendChild(s),O(E(a,s,t,r,n),e,!1),i},adopt(i){let a=i.next;for(;a&&a.nodeType===8&&(a.nodeValue||"").indexOf("/k:")===0;)a=a.nextSibling;if(a&&a.nodeType===8&&(a.nodeValue||"").indexOf("k:")===0){let s="/"+a.nodeValue,d=a.nextSibling;for(;d&&!(d.nodeType===8&&d.nodeValue===s);)d=d.nextSibling;if(d){i.next=d.nextSibling,S(()=>O(E(a,d,t,r,n),e,!0));return}}K(i,S(()=>this.mount()))}}}return Y(le);})();
|
|
2
2
|
for (const k in __krate_exports) { window[k] = __krate_exports[k]; }
|
package/dist/krate-f-router.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var __krate_exports=(()=>{var ce=Object.defineProperty;var at=Object.getOwnPropertyDescriptor;var ct=Object.getOwnPropertyNames;var lt=Object.prototype.hasOwnProperty;var ut=(e,t)=>{for(var n in t)ce(e,n,{get:t[n],enumerable:!0})},ft=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ct(t))!lt.call(e,o)&&o!==n&&ce(e,o,{get:()=>t[o],enumerable:!(r=at(t,o))||r.enumerable});return e};var dt=e=>ft(ce({},"__esModule",{value:!0}),e);var Xt={};ut(Xt,{compareRouteSpecificity:()=>Ve,destroyRouter:()=>Yt,getHistoryState:()=>bt,getNavigationState:()=>He,initRouter:()=>it,invalidatePrefetchCache:()=>ye,krateRouter:()=>Jt,matchRoutePattern:()=>Je,navigate:()=>Vt,pageAssetURLs:()=>Ne,reinitRouter:()=>zt,subscribeNavigation:()=>De});var pe=/\/chunks\/runtime\.[^/]+\.js$/;function te(){return globalThis.__KRATE_CFG__||{}}function me(){let e=te().basePath||"";return!e||e==="/"?"":"/"+e.replace(/^\/+|\/+$/g,"")}function U(e){let t=me();if(t&&(e===t||e.startsWith(t+"/"))){let n=e.slice(t.length);return n===""?"/":n}return e}function fe(e){return e.length>1&&e.endsWith("/")?e.slice(0,-1):e}function K(e){if(te().dev)try{console.warn("[krate router] "+e)}catch{}}function Ce(e,t){if(/^(https?:)?\/\//.test(e)||e.startsWith("/"))return new URL(e,t).href;let n=t;if(!n.endsWith("/")){let r=n.lastIndexOf("/");n=r>0?n.slice(0,r+1):"/"}return new URL(e,n).href}function Ne(e,t,n){let r=new DOMParser().parseFromString(e,"text/html"),o=[],i=new Set,s=c=>{if(!c)return;let a;try{a=Ce(c,t)}catch{return}i.has(a)||n.has(a)||pe.test(a)||(i.add(a),o.push(a))};return r.querySelectorAll("script[src]").forEach(c=>s(c.getAttribute("src"))),r.querySelectorAll('link[rel="modulepreload"][href], link[rel="preload"][as="script"][href]').forEach(c=>s(c.getAttribute("href"))),o}var R=!1,T=0,E,Ae=0,m="",L="",G="idle",F=new Set,S=new Map,O=new Map,ht=30,pt=3e4,A=new Map,mt=50,le=new Set,gt=128,X=new Map,B=new Map,N=null,W=[],yt="_krate/i",vt=150,kt=200;function de(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}function M(){return Ae++,Date.now().toString(36)+"-"+Ae.toString(36)}function ne(e){try{let t=new URL(e,location.href);return t.hash="",t.href}catch{return e}}function _(e){let t=new URL(e,location.href);return fe(t.pathname)+t.search}function $(e,t=!1){let n=globalThis.__krateHardNavigate;if(typeof n=="function"){n(e,t);return}t?location.replace(e):location.assign(e)}function j(e,t){return{__krate:e,state:t===void 0?null:t}}function Q(e){if(e&&typeof e=="object"&&typeof e.__krate=="string")return e.__krate}function bt(){if(typeof history>"u")return null;let e=history.state;return Q(e)!==void 0?e.state:e}function Me(){let e=new URL(location.href);return{url:e.href,pathname:U(e.pathname),search:e.search,hash:e.hash,status:G}}function He(){return typeof location>"u"?{url:"",pathname:"/",search:"",hash:"",status:"idle"}:Me()}function re(){if(F.size===0)return;let e=Me();for(let t of Array.from(F))try{t(e)}catch(n){console.error(n)}}function H(e){G!==e&&(G=e,re())}function De(e){return F.add(e),()=>{F.delete(e)}}function k(e,t,n=!1){try{let r=new CustomEvent(e,{detail:t,cancelable:n});return window.dispatchEvent(r),!r.defaultPrevented}catch{return!0}}function ge(e){try{let t=globalThis.__krate_onNavigation;typeof t=="function"&&t(e)}catch{}}function V(e){if(e){if(A.delete(e),A.size>=mt){let t=A.keys().next().value;t!==void 0&&A.delete(t)}A.set(e,window.scrollY||0)}}function Ue(){let e=te().prefetchTTL;return typeof e=="number"&&e>=0?e:pt}function wt(e,t){for(S.delete(e);S.size>=ht;){let n=S.keys().next().value;if(n===void 0)break;S.delete(n)}S.set(e,t)}function Et(e){let t=S.get(e);if(t&&(S.delete(e),!(de()-t.at>Ue())))return t}function ye(e){if(e===void 0){S.clear();return}S.delete(ne(e))}function ve(e){return/text\/html|application\/xhtml\+xml/i.test(e)}function J(e){return/^\s*(<!doctype html|<html|<head|<body)/i.test(e)}function St(e){if(le.has(e)||le.size>=gt)return;le.add(e);let t=document.createElement("link");t.rel="prefetch",t.as="script",t.href=e,document.head.appendChild(t)}function ke(e){let t=ne(e),n=S.get(t);if(n&&de()-n.at<=Ue())return Promise.resolve();let r=O.get(t);if(r)return r;let o=fetch(t,{headers:{Accept:"text/html"},credentials:"same-origin"}).then(async i=>{if(!i.ok)return;let s=i.headers.get("content-type")||"",c=i.url||t;if(new URL(c,location.href).origin!==location.origin)return;let a=await i.text();if(!(ve(s)||s===""&&J(a)))return;wt(t,{html:a,url:c,status:i.status,at:de()});let u=new Set;document.querySelectorAll("script[src]").forEach(l=>u.add(l.src));for(let l of Ne(a,c,u))St(l)}).catch(()=>{}).finally(()=>{O.delete(t)});return O.set(t,o),o}function be(e){if(e.hasAttribute("data-krate-external")||e.hasAttribute("download"))return!1;let t=e.getAttribute("href");if(!t||t.startsWith("javascript:"))return!1;let n;try{n=new URL(t,location.href)}catch{return!1}if(n.origin!==location.origin)return!1;let r=e.getAttribute("target");return!(r&&r!=="_self")}function we(e){let t=e.getAttribute("data-prefetch");return e.hasAttribute("data-prefetch")&&t!=="false"&&t!=="0"}function Lt(e){let t=window.requestIdleCallback;typeof t=="function"?t(e,{timeout:1e3}):setTimeout(e,50)}function Z(e){let t=e.target;if(!t||typeof t.closest!="function")return;let n=t.closest("a[data-prefetch]");if(!n||!we(n)||!be(n))return;let r=n.getAttribute("href");if(!r)return;let o=new URL(r,location.href).href;if(_(o)===L)return;let i=B.get(n);i&&clearTimeout(i);let s=setTimeout(()=>{B.delete(n),ke(o)},kt);B.set(n,s)}function Ie(){N&&document.querySelectorAll("a[data-prefetch]").forEach(e=>{we(e)&&N.observe(e)})}function At(){document.addEventListener("mouseover",Z),document.addEventListener("focusin",Z),typeof IntersectionObserver<"u"&&(N=new IntersectionObserver(e=>{for(let t of e){if(!t.isIntersecting)continue;let n=t.target,r=n.getAttribute("href");if(r&&be(n)&&we(n)){let o=new URL(r,location.href).href;_(o)!==L&&Lt(()=>{ke(o)})}N.unobserve(t.target)}},{rootMargin:"200px"}),Ie())}function Tt(){let e=typeof HTMLScriptElement<"u"?HTMLScriptElement.supports:void 0;if(!(typeof e!="function"||!e("speculationrules"))&&!document.querySelector('meta[http-equiv="Content-Security-Policy" i]'))try{let t=document.createElement("script");t.type="speculationrules",t.textContent=JSON.stringify({prefetch:[{where:{and:[{href_matches:"/*"},{not:{href_matches:"/__krate/*"}},{not:{href_matches:"/api/*"}}]},eagerness:"moderate"}]}),document.head.appendChild(t)}catch{}}function Ke(){if(typeof window<"u"&&window.matchMedia)try{return window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{}return!1}function Oe(){return te().viewTransitions===!1||Ke()?!1:typeof document.startViewTransition=="function"}function b(e){return e.getElementById("root")||e.body}function Rt(){let e=document.querySelector("template[data-krate-loading]");if(e&&e.content&&W.length===0){let t=e.content.cloneNode(!0);W=Array.from(t.childNodes),document.body.appendChild(t)}if(!Oe()&&!Ke()){let t=b(document);t.style.transition=`opacity ${vt}ms ease`,t.style.opacity="0"}}function Be(){for(let t of W)t.parentNode&&t.parentNode.removeChild(t);W=[];let e=b(document);e.style.opacity==="0"&&(e.style.opacity="")}function Fe(e){e.querySelectorAll("[data-view-transition]").forEach(t=>{let n=t.getAttribute("data-view-transition");n&&(t.style.viewTransitionName=n);let r=t.getAttribute("data-view-transition-class");r&&t.style.setProperty("view-transition-class",r)})}var _t=3e3;function xt(e,t){let n=[];e.querySelectorAll('link[rel="stylesheet"]').forEach(u=>{let l=u.getAttribute("href");if(!l)return;let p=new URL(l,t).href;n.includes(p)||n.push(p)});let r=new Map,o=[];document.querySelectorAll('link[rel="stylesheet"]').forEach(u=>{let l=u;l.href&&(n.includes(l.href)&&!r.has(l.href)?r.set(l.href,l):o.push(l))});let i=[],s=[],c=null;n.forEach((u,l)=>{let p=r.get(u)||null;if(!p){let h=document.createElement("link");if(h.rel="stylesheet",h.href=u,s.push(new Promise(g=>{let f=()=>{h.removeEventListener("load",f),h.removeEventListener("error",f),g()};h.addEventListener("load",f),h.addEventListener("error",f)})),i.push({link:h,media:h.getAttribute("media")}),h.media="not all",c)c.after(h);else{let g=n.slice(l+1).map(f=>r.get(f)).find(f=>!!f);g?g.before(h):document.head.appendChild(h)}p=h}c=p});let a=Promise.resolve();if(s.length>0){let u,l=new Promise(p=>{u=setTimeout(p,_t)});a=Promise.race([Promise.all(s).then(()=>{}),l]).then(()=>clearTimeout(u))}return{ready:a,commit(){for(let{link:u,media:l}of i)l===null?u.removeAttribute("media"):u.setAttribute("media",l);o.forEach(u=>u.remove())},abort(){i.forEach(({link:u})=>u.remove())}}}var Te='meta[name="description"], meta[name="robots"], meta[property^="og:"], meta[name^="twitter:"], link[rel="canonical"], script[type="application/ld+json"]';function Pt(e){document.head.querySelectorAll(Te).forEach(t=>t.remove()),e.head.querySelectorAll(Te).forEach(t=>{document.head.appendChild(document.importNode(t,!0))})}function We(e,t){let n=new Set;document.querySelectorAll("script[src]:not([data-krate-spa])").forEach(i=>n.add(i.src));let r=[],o=new Set;return e.querySelectorAll("script[src]").forEach(i=>{let s=i.getAttribute("src");if(!s)return;let c=(i.getAttribute("type")||"").toLowerCase();if(c&&c!=="module"&&c!=="text/javascript"&&c!=="application/javascript")return;let a=Ce(s,t);!n.has(a)&&!o.has(a)&&(o.add(a),r.push({src:a,module:c==="module"}))}),r}function $e(e){return new Promise(t=>{let n=document.createElement("script");n.src=e.src,e.module&&(n.type="module"),pe.test(e.src)||n.setAttribute("data-krate-spa",""),n.onload=()=>t(!0),n.onerror=()=>t(!1),document.body.appendChild(n)})}function Ct(e){if(!e||e==="#")return null;let t=e.slice(1);try{t=decodeURIComponent(t)}catch{}return document.getElementById(t)||document.getElementsByName(t)[0]||null}function Ee(e){let t=Ct(e);if(!t)return!1;try{t.scrollIntoView({block:"start"})}catch{}return!0}function Nt(e,t){if(t.kind==="pop"){let r=t.restoreKey?A.get(t.restoreKey):void 0;if(r!==void 0){window.scrollTo(0,r);return}}let n=new URL(e,location.href).hash;Ee(n)||t.scroll&&t.kind!=="refresh"&&window.scrollTo(0,0)}var Y=null;function Mt(){let e=document.activeElement;if(e&&e!==document.body&&e.isConnected&&e!==Y)return;let t=b(document);t.hasAttribute("tabindex")||(t.setAttribute("tabindex","-1"),Y=t,t.addEventListener("blur",()=>{Y===t&&(t.removeAttribute("tabindex"),Y=null)},{once:!0}));try{t.focus({preventScroll:!0})}catch{}}var Re="__krate-route-announcer";function Ht(){let e=document.getElementById(Re);e||(e=document.createElement("div"),e.id=Re,e.setAttribute("aria-live","assertive"),e.setAttribute("aria-atomic","true"),e.setAttribute("role","status"),e.setAttribute("style","position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0"),document.body.appendChild(e));let t=b(document).querySelector("h1"),n=document.title||(t&&t.textContent?t.textContent.trim():"")||U(location.pathname);e.textContent=n}function oe(){let e=fe(U(location.pathname));document.querySelectorAll("a[data-krate-link]").forEach(t=>{let n=t.getAttribute("href"),r="";try{r=n?fe(U(new URL(n,location.href).pathname)):""}catch{r=""}let o="";r&&r===e?o="exact":r&&r!=="/"&&e.startsWith(r+"/")&&(o="segment"),o==="exact"?t.setAttribute("aria-current","page"):t.removeAttribute("aria-current"),o?t.setAttribute("data-krate-active",o):t.removeAttribute("data-krate-active")})}function _e(e){let t=me()+e;return X.has(t)?Promise.resolve(X.get(t)??null):fetch(t,{headers:{Accept:"text/html"},credentials:"same-origin"}).then(async n=>{let r=n.ok?await n.text():null,o=r&&J(r)?r:null;return X.set(t,o),o}).catch(()=>null)}async function Dt(e,t){let n=ne(e.url);if(!e.bypassCache){let p=O.get(n);if(p&&await p,t.aborted)return{ok:!1,aborted:!0};let h=Et(n);if(h){let g=new URL(e.url,location.href).hash,f=g&&!new URL(h.url,location.href).hash?h.url+g:h.url;return{ok:!0,doc:{html:h.html,url:f,status:h.status}}}}let r;try{r=await fetch(n,{headers:{Accept:"text/html"},credentials:"same-origin",signal:t,cache:e.bypassCache?"no-cache":"default"})}catch(p){return p?.name==="AbortError"||t.aborted?{ok:!1,aborted:!0}:k("krate:navigate-error",{url:e.url,status:0,error:p},!0)?{ok:!1,hard:e.url}:{ok:!1,aborted:!0}}let o=r.url||n;if(new URL(o,location.href).origin!==location.origin)return{ok:!1,hard:o};let i=r.headers.get("content-type")||"",s="";try{s=await r.text()}catch(p){if(p?.name==="AbortError"||t.aborted)return{ok:!1,aborted:!0};s=""}if(t.aborted)return{ok:!1,aborted:!0};let c=ve(i)||i===""&&J(s),a=new URL(e.url,location.href).hash,u=a&&!new URL(o).hash?o+a:o;if(r.ok)return c?{ok:!0,doc:{html:s,url:u,status:r.status}}:{ok:!1,hard:u};if(k("krate:navigate-error",{url:e.url,status:r.status}),c&&J(s))return{ok:!0,doc:{html:s,url:u,status:r.status}};let l=null;return r.status===404||r.status===410?l=await _e("/404.html"):r.status>=500&&(l=await _e("/500.html")),t.aborted?{ok:!1,aborted:!0}:l?{ok:!0,doc:{html:l,url:u,status:r.status}}:{ok:!1,hard:u}}async function ie(e){let t=location.href;if(e.kind!=="pop"){if(!k("krate:navigate-start",{url:e.url,from:t,kind:e.kind},!0))return}else k("krate:navigate-start",{url:e.url,from:t,kind:e.kind});let n=++T;E&&E.abort();let r=new AbortController;E=r,H("loading"),!e.bypassCache&&S.has(ne(e.url))||Rt();let i;try{i=await Dt(e,r.signal)}finally{E===r&&(E=void 0)}if(n===T){if(!i.ok){Be(),H("idle"),"hard"in i&&$(i.hard,e.kind==="replace"||e.kind==="refresh");return}await Ut(i.doc,e,n)}}async function Ut(e,t,n){let r=new DOMParser().parseFromString(e.html,"text/html"),o=e.url,i=b(r),s=b(document);t.kind==="push"&&V(m);let c=je(r),a=Bt(P,c,location.href,o,r),u=xt(r,o);if(await u.ready,n!==T){u.abort();return}if(await It(()=>{let g=r.querySelector("title");g&&(document.title=g.textContent||"");let f=globalThis;if(a.keep.length>0&&typeof f.krateDisposeExcept=="function"?f.krateDisposeExcept(a.keep):typeof f.disposeAll=="function"&&f.disposeAll(),a.region){let{live:v,next:d}=a.region;q(v[0],v[1]);let w=D(d[0],d[1]).map(y=>document.importNode(y,!0));for(let y of w)v[1].parentNode.insertBefore(y,v[1]);for(let y of a.slots){q(y.live[0],y.live[1]);for(let I of D(y.next[0],y.next[1]))y.live[1].parentNode.insertBefore(document.importNode(I,!0),y.live[1])}Kt(s,i)}else{let v=Array.from(i.childNodes).map(d=>document.importNode(d,!0));s.replaceChildren(...v)}P=a.chain,z.clear(),u.commit(),Pt(r),Fe(document)}),n!==T)return;Be(),t.kind==="push"?(m=M(),history.pushState(j(m,t.state),"",o)):t.kind==="replace"?(A.delete(m),m=M(),history.replaceState(j(m,t.state),"",o)):t.kind==="refresh"?o!==location.href&&history.replaceState(history.state,"",o):t.restoreKey&&(m=t.restoreKey),L=_(location.href),C=L,Ye(r),Ft(r),Nt(o,t),t.kind!=="pop"&&t.kind!=="refresh"&&Mt(),t.kind!=="refresh"&&Ht(),oe(),k("krate:navigate",{url:location.href,status:e.status}),ge(location.href),H("idle"),document.querySelectorAll("script[data-krate-spa]").forEach(g=>g.remove());let p=We(r,o);Pe(a.skip);let h=await Promise.all(p.map($e));if(Pe([]),n===T){if(h.some(g=>!g)){k("krate:navigate-error",{url:location.href,status:e.status,error:"script-load"}),$(location.href,!0);return}ee(),k("krate:navigate-end",{url:location.href,status:e.status})}}function It(e){if(!Oe())return e(),Promise.resolve();let t=!1,n=()=>{t||(t=!0,e())};try{let r=document.startViewTransition(n);r&&r.finished&&typeof r.finished.catch=="function"&&r.finished.catch(()=>{});let o=r&&r.updateCallbackDone;if(o&&typeof o.then=="function")return o.then(()=>n(),()=>n())}catch{}return n(),Promise.resolve()}var P=[];function je(e){let t=e.getElementById("__krate_route");if(!t)return[];try{let n=JSON.parse(t.textContent||"{}");return Array.isArray(n.chain)?n.chain:[]}catch{return K("unreadable #__krate_route route info; layouts will be remounted"),[]}}function xe(e,t){let n=U(new URL(e,location.href).pathname).split("/").filter(Boolean);return(t<0?n:n.slice(0,t)).join("/")}function x(e,t,n="kl:"){let o=(e.ownerDocument||e).createTreeWalker(e,128),i=n+t,s="/"+n+t;for(;o.nextNode();){let c=o.currentNode;if(c.nodeValue===i){for(let a=c.nextSibling;a;a=a.nextSibling)if(a.nodeType===8&&a.nodeValue===s)return[c,a];return null}}return null}function D(e,t){let n=[];for(let r=e.nextSibling;r&&r!==t;r=r.nextSibling)n.push(r);return n}function q(e,t){let n=globalThis.disposeNode;for(let r of D(e,t))r.parentNode.removeChild(r),typeof n=="function"&&n(r)}function Kt(e,t){let n=":scope > template[data-krate-loading]";e.querySelectorAll(n).forEach(r=>r.remove()),t.querySelectorAll(n).forEach(r=>e.appendChild(document.importNode(r,!0)))}function Pe(e){let t=globalThis.krateKeepScopes;typeof t=="function"&&t(e)}function Ot(e){let t=globalThis.krateScopeFailed;return typeof t=="function"&&!!t(e)}function Bt(e,t,n,r,o){let i={keep:[],skip:[],region:null,slots:[],chain:t},s=0;for(;s<e.length&&s<t.length;){let f=e[s],v=t[s];if(f.id!==v.id||f.k!==v.k||f.k!=="layout"&&f.k!=="error"||xe(n,f.d)!==xe(r,v.d)||f.k==="error"&&Ot(f.id))break;if(!f.p||!v.p){K(`layout ${v.f||v.id} is remounted on this navigation: ${v.why||f.why||"not persistable"}`);break}s++}if(s===0)return i;if(typeof globalThis.krateDisposeExcept!="function")return K("the runtime has no krateDisposeExcept; layouts are remounted"),i;let c=t[s-1].id,a=x(b(document),c),u=x(b(o),c);if(!a||!u)return K(`layout ${t[s-1].f||c} boundary markers are missing; the whole page is swapped`),i;let l=e.slice(0,s).map(f=>f.id),p=l.slice(),h=[],g=t.slice();for(let f=0;f<s;f++){let v=e[f].s||[],d=[];for(let w of t[f].s||[]){let y=v.find(st=>st.key===w.key),I=x(b(document),w.key,"ks:"),ae=x(b(o),w.key,"ks:");if(y&&I&&(w.src!=="page"||!ae)){l.push(y.scope),p.push(y.scope,w.scope),d.push({...w,scope:y.scope,src:y.src});continue}if(I&&ae){h.push({live:I,next:ae}),d.push(w);continue}return K(`slot @${w.n} markers are missing; the whole page is swapped`),i}g[f]={...t[f],s:d}}return{keep:l,skip:p,region:{live:a,next:u},slots:h,chain:g}}var z=new Map,C="";function he(e){let t=e.replace(/^\/+|\/+$/g,"");return t?t.split("/").map(n=>n.startsWith("[[...")&&n.endsWith("]]")?{kind:3,text:n.slice(5,-2)}:n.startsWith("[...")&&n.endsWith("]")?{kind:2,text:n.slice(4,-1)}:n.startsWith("[")&&n.endsWith("]")?{kind:1,text:n.slice(1,-1)}:{kind:0,text:n}):[]}function Je(e,t){let n=he(t),r=e.replace(/^\/+|\/+$/g,""),o=r?r.split("/"):[],i={};for(let s=0;s<n.length;s++){let c=n[s];if(c.kind>=2){if(s!==n.length-1)return null;let a=o.slice(s);return c.kind===2&&a.length===0||a.some(u=>u==="")?null:(i[c.text]=a.map(ue).join("/"),i)}if(s>=o.length)return null;if(c.kind===1){if(!o[s])return null;i[c.text]=ue(o[s])}else if(ue(o[s])!==c.text)return null}return o.length===n.length?i:null}function ue(e){try{return decodeURIComponent(e)}catch{return e}}function Ve(e,t){let n=he(e),r=he(t);for(let o=0;o<n.length&&o<r.length;o++){if(n[o].kind!==r[o].kind)return n[o].kind-r[o].kind;if(n[o].kind===0&&n[o].text!==r[o].text)return n[o].text<r[o].text?-1:1}return n.length!==r.length?r.length-n.length:e<t?-1:e>t?1:0}function Se(e){let t=U(new URL(e,location.href).pathname).replace(/^\/+|\/+$/g,""),n=null;for(let r of P)for(let o of r.s||[])for(let i of o.i||[])Je(t,i)&&(!n||Ve(i,n.pattern)<0)&&(n={hit:{entry:r,slot:o,path:t},pattern:i});return n&&!x(b(document),n.hit.slot.key,"ks:")?null:n?n.hit:null}function ze(e,t){P=P.map(n=>n.s&&n.s.some(r=>r.key===e)?{...n,s:n.s.map(r=>r.key===e?t:r)}:n)}function Ye(e){let t="",n=e.getElementById("__krate_page");if(n)try{let r=JSON.parse(n.textContent||"{}");typeof r.r=="string"&&(t=r.r)}catch{}globalThis.__KRATE_ROUTE__=t;for(let r of Array.from(e.querySelectorAll("script:not([src])"))){let o=/window\.__KRATE_PARAMS__\s*=\s*(\{[\s\S]*?\})\s*;?\s*$/.exec(r.textContent||"");if(o){try{globalThis.__KRATE_PARAMS__=JSON.parse(o[1])}catch{}return}}delete globalThis.__KRATE_PARAMS__}function Ft(e){let t=e.getElementById("__krate_error"),n=document.getElementById("__krate_error");if(!t){n&&n.remove();return}let r=document.importNode(t,!0);n?n.replaceWith(r):document.head.appendChild(r)}function Xe(e){let t=globalThis.krateDisposeScopes;typeof t=="function"&&t(e)}async function Le(e,t){let n=location.href;if(e.kind!=="pop"&&!k("krate:navigate-start",{url:e.url,from:n,kind:e.kind,intercept:t.slot.n},!0))return;let r=++T;E&&E.abort();let o=new AbortController;E=o,H("loading");let i=location.origin+me()+"/"+yt+"/"+t.slot.key+(t.path?"/"+t.path:""),s="",c=!1;try{let d=await fetch(i,{headers:{Accept:"text/html"},credentials:"same-origin",signal:o.signal,cache:e.bypassCache?"no-cache":"default"});s=await d.text(),c=d.ok&&(ve(d.headers.get("content-type")||"")||J(s)),c||k("krate:navigate-error",{url:e.url,status:d.status,intercept:t.slot.n})}catch(d){if(d?.name==="AbortError"||o.signal.aborted)return;k("krate:navigate-error",{url:e.url,status:0,error:d,intercept:t.slot.n})}finally{E===o&&(E=void 0)}if(r!==T)return;let a=c?new DOMParser().parseFromString(s,"text/html"):null,u=a?x(b(a),t.slot.key,"ks:"):null,l=x(b(document),t.slot.key,"ks:"),p=null;try{let d=a&&a.getElementById("__krate_route");p=d&&JSON.parse(d.textContent||"{}").frag||null}catch{p=null}if(!a||!u||!l||!p||p.key!==t.slot.key||!p.scope){try{console.warn(`[krate router] intercepting route for ${e.url} (slot @${t.slot.n}) could not be loaded; navigating to the page`)}catch{}return H("idle"),ie({...e})}if(e.kind==="push"&&V(m),t.slot.src!=="intercept"){z.set(m,{key:t.slot.key,nodes:D(l[0],l[1]),slot:t.slot,path:C});for(let d of D(l[0],l[1]))d.parentNode.removeChild(d)}else Xe([t.slot.scope]),q(l[0],l[1]);for(let d of D(u[0],u[1]))l[1].parentNode.insertBefore(document.importNode(d,!0),l[1]);let h=new Set;document.querySelectorAll('link[rel="stylesheet"]').forEach(d=>h.add(d.href)),a.querySelectorAll('link[rel="stylesheet"][href]').forEach(d=>{let w=new URL(d.getAttribute("href"),i).href;if(h.has(w))return;let y=document.createElement("link");y.rel="stylesheet",y.href=w,document.head.appendChild(y)}),ze(t.slot.key,{...t.slot,scope:p.scope,src:"intercept"});let g={__krate:"",state:e.state===void 0?null:e.state,__kint:{key:t.slot.key,base:C}};e.kind==="push"?(m=M(),g.__krate=m,history.pushState(g,"",e.url)):e.kind==="replace"?(m=M(),g.__krate=m,history.replaceState(g,"",e.url)):e.kind==="pop"&&e.restoreKey&&(m=e.restoreKey),L=_(location.href),Ye(a),oe(),k("krate:navigate",{url:location.href,status:200,intercept:t.slot.n}),ge(location.href),H("idle");let f=We(a,i),v=await Promise.all(f.map($e));if(r===T){if(v.some(d=>!d)){k("krate:navigate-error",{url:location.href,status:200,error:"script-load",intercept:t.slot.n}),$(location.href,!0);return}ee(),k("krate:navigate-end",{url:location.href,status:200,intercept:t.slot.n})}}function Wt(e,t){let n=x(b(document),e.key,"ks:"),r=P.flatMap(i=>i.s||[]).find(i=>i.key===e.key);if(!n||!r||r.src!=="intercept")return!1;Xe([r.scope]),q(n[0],n[1]);for(let i of e.nodes)n[1].parentNode.insertBefore(i,n[1]);ze(e.key,e.slot),z.delete(t),m=t,L=_(location.href);let o=A.get(t);return o!==void 0&&window.scrollTo(0,o),oe(),k("krate:navigate",{url:location.href,status:200}),ge(location.href),re(),!0}function $t(e){return _(e)===L}function jt(e,t){V(m),(e!==location.href||t.state!==void 0)&&(t.kind==="replace"?history.replaceState(j(m||M(),t.state),"",e):(m=M(),history.pushState(j(m,t.state),"",e)));let n=new URL(e).hash;!Ee(n)&&t.scroll&&!n&&window.scrollTo(0,0),re()}function se(e){let t;try{t=new URL(e.url,location.href)}catch{return $(e.url),Promise.resolve()}if(t.origin!==location.origin)return $(t.href,e.kind==="replace"),Promise.resolve();if(e.url=t.href,(e.kind==="push"||e.kind==="replace")&&$t(t.href)&&(t.hash||t.href===location.href))return jt(t.href,e),Promise.resolve();if(e.kind==="push"||e.kind==="replace"){let n=Se(t.href);if(n)return Le(e,n)}return ie(e)}function Ge(e){if(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=e.target;if(!t||typeof t.closest!="function")return;let n=t.closest("a[data-krate-link]");if(!n||!be(n))return;let r=n.getAttribute("href");r&&(e.preventDefault(),se({url:new URL(r,location.href).href,kind:n.hasAttribute("data-krate-replace")?"replace":"push",scroll:n.getAttribute("data-krate-scroll")!=="false"}))}function Qe(e){if(e.defaultPrevented)return;let t=e.target;if(!t||t.tagName!=="FORM"||t.hasAttribute("data-krate-reload"))return;let n=e.submitter||null;if((n&&n.getAttribute("formmethod")||t.getAttribute("method")||"get").toLowerCase()!=="get")return;let o=n&&n.getAttribute("formtarget")||t.getAttribute("target");if(o&&o!=="_self")return;let i=n&&n.getAttribute("formaction")||t.getAttribute("action")||"",s;try{s=new URL(i||location.href,location.href)}catch{return}if(s.origin!==location.origin||s.protocol.indexOf("http")!==0)return;let c;try{c=n?new FormData(t,n):new FormData(t)}catch{c=new FormData(t),n&&n.name&&c.append(n.name,n.value)}let a=new URLSearchParams;for(let[u,l]of c.entries()){if(typeof l!="string")return;a.append(u,l)}e.preventDefault(),s.search=a.toString(),s.hash="",se({url:s.href,kind:"push",scroll:!0})}function Ze(e){V(m);let t=Q(e.state),n=location.href;if(_(n)===L){m=t||m;let i=t?A.get(t):void 0;i!==void 0?window.scrollTo(0,i):Ee(location.hash),re();return}let r=t?z.get(t):void 0;if(r&&t&&r.path===_(n)&&r.path===C&&Wt(r,t))return;let o=e.state&&typeof e.state=="object"?e.state.__kint:null;if(o&&o.base===C){let i=Se(n);if(i&&i.slot.key===o.key){Le({url:n,kind:"pop",scroll:!1,restoreKey:t},i);return}}ie({url:n,kind:"pop",scroll:!0,restoreKey:t})}function qe(){ye(),nt()}function et(){V(m);try{history.scrollRestoration="auto"}catch{}}function tt(){try{history.scrollRestoration="manual"}catch{}}function ee(){Ie(),oe(),Fe(document),document.querySelectorAll("script[src]").forEach(e=>{pe.test(e.src)||e.setAttribute("data-krate-spa","")})}function nt(){if(!R||typeof location>"u")return typeof location<"u"&&location.reload(),Promise.resolve();if(L!==C){let e=Se(location.href);if(e&&e.slot.src==="intercept")return Le({url:location.href,kind:"refresh",scroll:!1,bypassCache:!0},e)}return ie({url:location.href,kind:"refresh",scroll:!1,bypassCache:!0})}function rt(e,t={}){return R?se({url:e,kind:"push",scroll:t.scroll!==!1,state:t.state}):(typeof location<"u"&&location.assign(e),Promise.resolve())}function ot(e,t={}){return R?se({url:e,kind:"replace",scroll:t.scroll!==!1,state:t.state}):(typeof location<"u"&&location.replace(e),Promise.resolve())}var Jt={push:rt,replace:ot,back(){typeof history<"u"&&history.back()},forward(){typeof history<"u"&&history.forward()},refresh:nt,prefetch(e){if(!R||typeof location>"u")return Promise.resolve();let t;try{t=new URL(e,location.href)}catch{return Promise.resolve()}return t.origin!==location.origin?Promise.resolve():ke(t.href)},subscribe:De,getState:He,invalidate:ye};function Vt(e,t={}){return R?(t.replace?ot(e,t):rt(e,t),!1):(typeof location<"u"&&(t.replace?location.replace(e):location.assign(e)),!0)}function it(){if(!(typeof document>"u")){if(R){ee();return}if(R=!0,L=_(location.href),P=je(document),C=L,m=Q(history.state)||M(),Q(history.state)===void 0)try{history.replaceState(j(m,history.state),"",location.href)}catch{}try{history.scrollRestoration="manual"}catch{}document.addEventListener("click",Ge),document.addEventListener("submit",Qe),window.addEventListener("popstate",Ze),window.addEventListener("krate:revalidate",qe),window.addEventListener("pagehide",et),window.addEventListener("pageshow",tt),At(),Tt(),ee()}}function zt(){it()}function Yt(){if(R){R=!1,document.removeEventListener("click",Ge),document.removeEventListener("submit",Qe),window.removeEventListener("popstate",Ze),window.removeEventListener("krate:revalidate",qe),window.removeEventListener("pagehide",et),window.removeEventListener("pageshow",tt),document.removeEventListener("mouseover",Z),document.removeEventListener("focusin",Z);for(let e of B.values())clearTimeout(e);B=new Map,N&&(N.disconnect(),N=null),E&&E.abort(),E=void 0,T++,S.clear(),O.clear(),A.clear(),X.clear(),F.clear(),G="idle",W=[],P=[],z.clear(),C=""}}return dt(Xt);})();
|
|
1
|
+
var __krate_exports=(()=>{var le=Object.defineProperty;var ut=Object.getOwnPropertyDescriptor;var ft=Object.getOwnPropertyNames;var dt=Object.prototype.hasOwnProperty;var ht=(e,t)=>{for(var n in t)le(e,n,{get:t[n],enumerable:!0})},pt=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ft(t))!dt.call(e,o)&&o!==n&&le(e,o,{get:()=>t[o],enumerable:!(r=ut(t,o))||r.enumerable});return e};var mt=e=>pt(le({},"__esModule",{value:!0}),e);var Zt={};ht(Zt,{compareRouteSpecificity:()=>Ye,destroyRouter:()=>Qt,getHistoryState:()=>St,getNavigationState:()=>Ue,initRouter:()=>ct,invalidatePrefetchCache:()=>ve,krateRouter:()=>Yt,matchRoutePattern:()=>ze,navigate:()=>Xt,pageAssetURLs:()=>He,reinitRouter:()=>Gt,subscribeNavigation:()=>Ie});var me=/\/chunks\/runtime\.[^/]+\.js$/;function ne(){return globalThis.__KRATE_CFG__||{}}function ge(){let e=ne().basePath||"";return!e||e==="/"?"":"/"+e.replace(/^\/+|\/+$/g,"")}function I(e){let t=ge();if(t&&(e===t||e.startsWith(t+"/"))){let n=e.slice(t.length);return n===""?"/":n}return e}function de(e){return e.length>1&&e.endsWith("/")?e.slice(0,-1):e}function O(e){if(ne().dev)try{console.warn("[krate router] "+e)}catch{}}function Me(e,t){if(/^(https?:)?\/\//.test(e)||e.startsWith("/"))return new URL(e,t).href;let n=t;if(!n.endsWith("/")){let r=n.lastIndexOf("/");n=r>0?n.slice(0,r+1):"/"}return new URL(e,n).href}function He(e,t,n){let r=new DOMParser().parseFromString(e,"text/html"),o=[],i=new Set,s=c=>{if(!c)return;let a;try{a=Me(c,t)}catch{return}i.has(a)||n.has(a)||me.test(a)||(i.add(a),o.push(a))};return r.querySelectorAll("script[src]").forEach(c=>s(c.getAttribute("src"))),r.querySelectorAll('link[rel="modulepreload"][href], link[rel="preload"][as="script"][href]').forEach(c=>s(c.getAttribute("href"))),o}var _=!1,T=0,k,Re=0,m="",A="",F="idle",W=new Set,S=new Map,R=new Map,gt=30,yt=3e4,L=new Map,vt=50,ue=new Set,kt=128,G=new Map,B=new Map,M=null,$=[],bt="_krate/i",wt=150,Et=200;function he(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}function D(){return Re++,Date.now().toString(36)+"-"+Re.toString(36)}function re(e){try{let t=new URL(e,location.href);return t.hash="",t.href}catch{return e}}function x(e){let t=new URL(e,location.href);return de(t.pathname)+t.search}function j(e,t=!1){let n=globalThis.__krateHardNavigate;if(typeof n=="function"){n(e,t);return}t?location.replace(e):location.assign(e)}function J(e,t){return{__krate:e,state:t===void 0?null:t}}function Q(e){if(e&&typeof e=="object"&&typeof e.__krate=="string")return e.__krate}function St(){if(typeof history>"u")return null;let e=history.state;return Q(e)!==void 0?e.state:e}function De(){let e=new URL(location.href);return{url:e.href,pathname:I(e.pathname),search:e.search,hash:e.hash,status:F}}function Ue(){return typeof location>"u"?{url:"",pathname:"/",search:"",hash:"",status:"idle"}:De()}function oe(){if(W.size===0)return;let e=De();for(let t of Array.from(W))try{t(e)}catch(n){console.error(n)}}function H(e){F!==e&&(F=e,oe())}function Ie(e){return W.add(e),()=>{W.delete(e)}}function b(e,t,n=!1){try{let r=new CustomEvent(e,{detail:t,cancelable:n});return window.dispatchEvent(r),!r.defaultPrevented}catch{return!0}}function ye(e){try{let t=globalThis.__krate_onNavigation;typeof t=="function"&&t(e)}catch{}}function z(e){if(e){if(L.delete(e),L.size>=vt){let t=L.keys().next().value;t!==void 0&&L.delete(t)}L.set(e,window.scrollY||0)}}function Ke(){let e=ne().prefetchTTL;return typeof e=="number"&&e>=0?e:yt}function At(e,t){for(S.delete(e);S.size>=gt;){let n=S.keys().next().value;if(n===void 0)break;S.delete(n)}S.set(e,t)}function Lt(e){let t=S.get(e);if(t&&(S.delete(e),!(he()-t.at>Ke())))return t}function ve(e){if(e===void 0){S.clear(),R.clear();return}let t=re(e);S.delete(t),R.delete(t)}function ke(e){return/text\/html|application\/xhtml\+xml/i.test(e)}function V(e){return/^\s*(<!doctype html|<html|<head|<body)/i.test(e)}function Tt(e){if(ue.has(e)||ue.size>=kt)return;ue.add(e);let t=document.createElement("link");t.rel="prefetch",t.as="script",t.href=e,document.head.appendChild(t)}function be(e){let t=re(e),n=S.get(t);if(n&&he()-n.at<=Ke())return Promise.resolve();let r=R.get(t);if(r)return r;let o=fetch(t,{headers:{Accept:"text/html"},credentials:"same-origin"}).then(async i=>{if(!i.ok)return;let s=i.headers.get("content-type")||"",c=i.url||t;if(new URL(c,location.href).origin!==location.origin)return;let a=await i.text();if(!(ke(s)||s===""&&V(a))||R.get(t)!==o)return;At(t,{html:a,url:c,status:i.status,at:he()});let u=new Set;document.querySelectorAll("script[src]").forEach(l=>u.add(l.src));for(let l of He(a,c,u))Tt(l)}).catch(()=>{}).finally(()=>{R.get(t)===o&&R.delete(t)});return R.set(t,o),o}function we(e){if(e.hasAttribute("data-krate-external")||e.hasAttribute("download"))return!1;let t=e.getAttribute("href");if(!t||t.startsWith("javascript:"))return!1;let n;try{n=new URL(t,location.href)}catch{return!1}if(n.origin!==location.origin)return!1;let r=e.getAttribute("target");return!(r&&r!=="_self")}function Ee(e){let t=e.getAttribute("data-prefetch");return e.hasAttribute("data-prefetch")&&t!=="false"&&t!=="0"}function Rt(e){let t=window.requestIdleCallback;typeof t=="function"?t(e,{timeout:1e3}):setTimeout(e,50)}function Z(e){let t=e.target;if(!t||typeof t.closest!="function")return;let n=t.closest("a[data-prefetch]");if(!n||!Ee(n)||!we(n))return;let r=n.getAttribute("href");if(!r)return;let o=new URL(r,location.href).href;if(x(o)===A)return;let i=B.get(n);i&&clearTimeout(i);let s=setTimeout(()=>{B.delete(n),be(o)},Et);B.set(n,s)}function Oe(){M&&document.querySelectorAll("a[data-prefetch]").forEach(e=>{Ee(e)&&M.observe(e)})}function _t(){document.addEventListener("mouseover",Z),document.addEventListener("focusin",Z),typeof IntersectionObserver<"u"&&(M=new IntersectionObserver(e=>{for(let t of e){if(!t.isIntersecting)continue;let n=t.target,r=n.getAttribute("href");if(r&&we(n)&&Ee(n)){let o=new URL(r,location.href).href;x(o)!==A&&Rt(()=>{be(o)})}M.unobserve(t.target)}},{rootMargin:"200px"}),Oe())}function xt(){let e=typeof HTMLScriptElement<"u"?HTMLScriptElement.supports:void 0;if(!(typeof e!="function"||!e("speculationrules"))&&!document.querySelector('meta[http-equiv="Content-Security-Policy" i]'))try{let t=document.createElement("script");t.type="speculationrules",t.textContent=JSON.stringify({prefetch:[{where:{and:[{href_matches:"/*"},{not:{href_matches:"/__krate/*"}},{not:{href_matches:"/api/*"}}]},eagerness:"moderate"}]}),document.head.appendChild(t)}catch{}}function Be(){if(typeof window<"u"&&window.matchMedia)try{return window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{}return!1}function Fe(){return ne().viewTransitions===!1||Be()?!1:typeof document.startViewTransition=="function"}function w(e){return e.getElementById("root")||e.body}function Pt(){let e=document.querySelector("template[data-krate-loading]");if(e&&e.content&&$.length===0){let t=e.content.cloneNode(!0);$=Array.from(t.childNodes),document.body.appendChild(t)}if(!Fe()&&!Be()){let t=w(document);t.style.transition=`opacity ${wt}ms ease`,t.style.opacity="0"}}function Se(){for(let t of $)t.parentNode&&t.parentNode.removeChild(t);$=[];let e=w(document);e.style.opacity==="0"&&(e.style.opacity="")}function We(e){e.querySelectorAll("[data-view-transition]").forEach(t=>{let n=t.getAttribute("data-view-transition");n&&(t.style.viewTransitionName=n);let r=t.getAttribute("data-view-transition-class");r&&t.style.setProperty("view-transition-class",r)})}var Ct=3e3;function Nt(e,t){let n=[];e.querySelectorAll('link[rel="stylesheet"]').forEach(u=>{let l=u.getAttribute("href");if(!l)return;let p=new URL(l,t).href;n.includes(p)||n.push(p)});let r=new Map,o=[];document.querySelectorAll('link[rel="stylesheet"]').forEach(u=>{let l=u;l.href&&(n.includes(l.href)&&!r.has(l.href)?r.set(l.href,l):o.push(l))});let i=[],s=[],c=null;n.forEach((u,l)=>{let p=r.get(u)||null;if(!p){let h=document.createElement("link");if(h.rel="stylesheet",h.href=u,s.push(new Promise(g=>{let f=()=>{h.removeEventListener("load",f),h.removeEventListener("error",f),g()};h.addEventListener("load",f),h.addEventListener("error",f)})),i.push({link:h,media:h.getAttribute("media")}),h.media="not all",c)c.after(h);else{let g=n.slice(l+1).map(f=>r.get(f)).find(f=>!!f);g?g.before(h):document.head.appendChild(h)}p=h}c=p});let a=Promise.resolve();if(s.length>0){let u,l=new Promise(p=>{u=setTimeout(p,Ct)});a=Promise.race([Promise.all(s).then(()=>{}),l]).then(()=>clearTimeout(u))}return{ready:a,commit(){for(let{link:u,media:l}of i)l===null?u.removeAttribute("media"):u.setAttribute("media",l);o.forEach(u=>u.remove())},abort(){i.forEach(({link:u})=>u.remove())}}}var _e='meta[name="description"], meta[name="robots"], meta[property^="og:"], meta[name^="twitter:"], link[rel="canonical"], script[type="application/ld+json"]';function Mt(e){document.head.querySelectorAll(_e).forEach(t=>t.remove()),e.head.querySelectorAll(_e).forEach(t=>{document.head.appendChild(document.importNode(t,!0))})}function $e(e,t){let n=new Set;document.querySelectorAll("script[src]:not([data-krate-spa])").forEach(i=>n.add(i.src));let r=[],o=new Set;return e.querySelectorAll("script[src]").forEach(i=>{let s=i.getAttribute("src");if(!s)return;let c=(i.getAttribute("type")||"").toLowerCase();if(c&&c!=="module"&&c!=="text/javascript"&&c!=="application/javascript")return;let a=Me(s,t);!n.has(a)&&!o.has(a)&&(o.add(a),r.push({src:a,module:c==="module"}))}),r}function je(e){return new Promise(t=>{let n=document.createElement("script");n.src=e.src,e.module&&(n.type="module"),me.test(e.src)||n.setAttribute("data-krate-spa",""),n.onload=()=>t(!0),n.onerror=()=>t(!1),document.body.appendChild(n)})}var q=new Set;function Je(e){e.querySelectorAll("script[data-krate-boot]").forEach(t=>{let n=t.textContent||"";if(!n||q.has(n))return;q.add(n);let r=document.createElement("script");r.text=n,document.head.appendChild(r),r.remove()})}function Ht(e){if(!e||e==="#")return null;let t=e.slice(1);try{t=decodeURIComponent(t)}catch{}return document.getElementById(t)||document.getElementsByName(t)[0]||null}function Ae(e){let t=Ht(e);if(!t)return!1;try{t.scrollIntoView({block:"start"})}catch{}return!0}function Dt(e,t){if(t.kind==="pop"){let r=t.restoreKey?L.get(t.restoreKey):void 0;if(r!==void 0){window.scrollTo(0,r);return}}let n=new URL(e,location.href).hash;Ae(n)||t.scroll&&t.kind!=="refresh"&&window.scrollTo(0,0)}var X=null;function Ut(){let e=document.activeElement;if(e&&e!==document.body&&e.isConnected&&e!==X)return;let t=w(document);t.hasAttribute("tabindex")||(t.setAttribute("tabindex","-1"),X=t,t.addEventListener("blur",()=>{X===t&&(t.removeAttribute("tabindex"),X=null)},{once:!0}));try{t.focus({preventScroll:!0})}catch{}}var xe="__krate-route-announcer";function It(){let e=document.getElementById(xe);e||(e=document.createElement("div"),e.id=xe,e.setAttribute("aria-live","assertive"),e.setAttribute("aria-atomic","true"),e.setAttribute("role","status"),e.setAttribute("style","position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0"),document.body.appendChild(e));let t=w(document).querySelector("h1"),n=document.title||(t&&t.textContent?t.textContent.trim():"")||I(location.pathname);e.textContent=n}function ie(){let e=de(I(location.pathname));document.querySelectorAll("a[data-krate-link]").forEach(t=>{let n=t.getAttribute("href"),r="";try{r=n?de(I(new URL(n,location.href).pathname)):""}catch{r=""}let o="";r&&r===e?o="exact":r&&r!=="/"&&e.startsWith(r+"/")&&(o="segment"),o==="exact"?t.setAttribute("aria-current","page"):t.removeAttribute("aria-current"),o?t.setAttribute("data-krate-active",o):t.removeAttribute("data-krate-active")})}function Pe(e){let t=ge()+e;return G.has(t)?Promise.resolve(G.get(t)??null):fetch(t,{headers:{Accept:"text/html"},credentials:"same-origin"}).then(async n=>{let r=n.ok?await n.text():null,o=r&&V(r)?r:null;return G.set(t,o),o}).catch(()=>null)}async function Kt(e,t){let n=re(e.url);if(!e.bypassCache){let p=R.get(n);if(p&&await p,t.aborted)return{ok:!1,aborted:!0};let h=Lt(n);if(h){let g=new URL(e.url,location.href).hash,f=g&&!new URL(h.url,location.href).hash?h.url+g:h.url;return{ok:!0,doc:{html:h.html,url:f,status:h.status}}}}let r;try{r=await fetch(n,{headers:{Accept:"text/html"},credentials:"same-origin",signal:t,cache:e.bypassCache?"no-cache":"default"})}catch(p){return p?.name==="AbortError"||t.aborted?{ok:!1,aborted:!0}:b("krate:navigate-error",{url:e.url,status:0,error:p},!0)?{ok:!1,hard:e.url}:{ok:!1,aborted:!0}}let o=r.url||n;if(new URL(o,location.href).origin!==location.origin)return{ok:!1,hard:o};let i=r.headers.get("content-type")||"",s="";try{s=await r.text()}catch(p){if(p?.name==="AbortError"||t.aborted)return{ok:!1,aborted:!0};s=""}if(t.aborted)return{ok:!1,aborted:!0};let c=ke(i)||i===""&&V(s),a=new URL(e.url,location.href).hash,u=a&&!new URL(o).hash?o+a:o;if(r.ok)return c?{ok:!0,doc:{html:s,url:u,status:r.status}}:{ok:!1,hard:u};if(b("krate:navigate-error",{url:e.url,status:r.status}),c&&V(s))return{ok:!0,doc:{html:s,url:u,status:r.status}};let l=null;return r.status===404||r.status===410?l=await Pe("/404.html"):r.status>=500&&(l=await Pe("/500.html")),t.aborted?{ok:!1,aborted:!0}:l?{ok:!0,doc:{html:l,url:u,status:r.status}}:{ok:!1,hard:u}}async function se(e){let t=location.href;if(e.kind!=="pop"){if(!b("krate:navigate-start",{url:e.url,from:t,kind:e.kind},!0))return}else b("krate:navigate-start",{url:e.url,from:t,kind:e.kind});let n=++T;k&&k.abort();let r=new AbortController;k=r,H("loading"),!e.bypassCache&&S.has(re(e.url))||Pt();let i;try{i=await Kt(e,r.signal)}finally{k===r&&(k=void 0)}if(n===T){if(!i.ok){Se(),H("idle"),"hard"in i&&j(i.hard,e.kind==="replace"||e.kind==="refresh");return}await Ot(i.doc,e,n)}}async function Ot(e,t,n){let r=new DOMParser().parseFromString(e.html,"text/html"),o=e.url,i=w(r),s=w(document);t.kind==="push"&&z(m);let c=Ve(r),a=$t(C,c,location.href,o,r),u=Nt(r,o);if(await u.ready,n!==T){u.abort();return}if(await Bt(()=>{let g=r.querySelector("title");g&&(document.title=g.textContent||"");let f=globalThis;if(a.keep.length>0&&typeof f.krateDisposeExcept=="function"?f.krateDisposeExcept(a.keep):typeof f.disposeAll=="function"&&f.disposeAll(),a.region){let{live:v,next:d}=a.region;ee(v[0],v[1]);let E=U(d[0],d[1]).map(y=>document.importNode(y,!0));for(let y of E)v[1].parentNode.insertBefore(y,v[1]);for(let y of a.slots){ee(y.live[0],y.live[1]);for(let K of U(y.next[0],y.next[1]))y.live[1].parentNode.insertBefore(document.importNode(K,!0),y.live[1])}Ft(s,i)}else{let v=Array.from(i.childNodes).map(d=>document.importNode(d,!0));s.replaceChildren(...v)}C=a.chain,Y.clear(),u.commit(),Mt(r),We(document)}),n!==T)return;Se(),t.kind==="push"?(m=D(),history.pushState(J(m,t.state),"",o)):t.kind==="replace"?(L.delete(m),m=D(),history.replaceState(J(m,t.state),"",o)):t.kind==="refresh"?o!==location.href&&history.replaceState(history.state,"",o):t.restoreKey&&(m=t.restoreKey),A=x(location.href),N=A,Ge(r),jt(r),Dt(o,t),t.kind!=="pop"&&t.kind!=="refresh"&&Ut(),t.kind!=="refresh"&&It(),ie(),b("krate:navigate",{url:location.href,status:e.status}),ye(location.href),H("idle"),document.querySelectorAll("script[data-krate-spa]").forEach(g=>g.remove()),Je(r);let p=$e(r,o);Ne(a.skip);let h=await Promise.all(p.map(je));if(Ne([]),n===T){if(h.some(g=>!g)){b("krate:navigate-error",{url:location.href,status:e.status,error:"script-load"}),j(location.href,!0);return}te(),b("krate:navigate-end",{url:location.href,status:e.status})}}function Bt(e){if(!Fe())return e(),Promise.resolve();let t=!1,n=()=>{t||(t=!0,e())};try{let r=document.startViewTransition(n);r&&r.finished&&typeof r.finished.catch=="function"&&r.finished.catch(()=>{});let o=r&&r.updateCallbackDone;if(o&&typeof o.then=="function")return o.then(()=>n(),()=>n())}catch{}return n(),Promise.resolve()}var C=[];function Ve(e){let t=e.getElementById("__krate_route");if(!t)return[];try{let n=JSON.parse(t.textContent||"{}");return Array.isArray(n.chain)?n.chain:[]}catch{return O("unreadable #__krate_route route info; layouts will be remounted"),[]}}function Ce(e,t){let n=I(new URL(e,location.href).pathname).split("/").filter(Boolean);return(t<0?n:n.slice(0,t)).join("/")}function P(e,t,n="kl:"){let o=(e.ownerDocument||e).createTreeWalker(e,128),i=n+t,s="/"+n+t;for(;o.nextNode();){let c=o.currentNode;if(c.nodeValue===i){for(let a=c.nextSibling;a;a=a.nextSibling)if(a.nodeType===8&&a.nodeValue===s)return[c,a];return null}}return null}function U(e,t){let n=[];for(let r=e.nextSibling;r&&r!==t;r=r.nextSibling)n.push(r);return n}function ee(e,t){let n=globalThis.disposeNode;for(let r of U(e,t))r.parentNode.removeChild(r),typeof n=="function"&&n(r)}function Ft(e,t){let n=":scope > template[data-krate-loading]";e.querySelectorAll(n).forEach(r=>r.remove()),t.querySelectorAll(n).forEach(r=>e.appendChild(document.importNode(r,!0)))}function Ne(e){let t=globalThis.krateKeepScopes;typeof t=="function"&&t(e)}function Wt(e){let t=globalThis.krateScopeFailed;return typeof t=="function"&&!!t(e)}function $t(e,t,n,r,o){let i={keep:[],skip:[],region:null,slots:[],chain:t},s=0;for(;s<e.length&&s<t.length;){let f=e[s],v=t[s];if(f.id!==v.id||f.k!==v.k||f.k!=="layout"&&f.k!=="error"||Ce(n,f.d)!==Ce(r,v.d)||f.k==="error"&&Wt(f.id))break;if(!f.p||!v.p){O(`layout ${v.f||v.id} is remounted on this navigation: ${v.why||f.why||"not persistable"}`);break}s++}if(s===0)return i;if(typeof globalThis.krateDisposeExcept!="function")return O("the runtime has no krateDisposeExcept; layouts are remounted"),i;let c=t[s-1].id,a=P(w(document),c),u=P(w(o),c);if(!a||!u)return O(`layout ${t[s-1].f||c} boundary markers are missing; the whole page is swapped`),i;let l=e.slice(0,s).map(f=>f.id),p=l.slice(),h=[],g=t.slice();for(let f=0;f<s;f++){let v=e[f].s||[],d=[];for(let E of t[f].s||[]){let y=v.find(lt=>lt.key===E.key),K=P(w(document),E.key,"ks:"),ce=P(w(o),E.key,"ks:");if(y&&K&&(E.src!=="page"||!ce)){l.push(y.scope),p.push(y.scope,E.scope),d.push({...E,scope:y.scope,src:y.src});continue}if(K&&ce){h.push({live:K,next:ce}),d.push(E);continue}return O(`slot @${E.n} markers are missing; the whole page is swapped`),i}g[f]={...t[f],s:d}}return{keep:l,skip:p,region:{live:a,next:u},slots:h,chain:g}}var Y=new Map,N="";function pe(e){let t=e.replace(/^\/+|\/+$/g,"");return t?t.split("/").map(n=>n.startsWith("[[...")&&n.endsWith("]]")?{kind:3,text:n.slice(5,-2)}:n.startsWith("[...")&&n.endsWith("]")?{kind:2,text:n.slice(4,-1)}:n.startsWith("[")&&n.endsWith("]")?{kind:1,text:n.slice(1,-1)}:{kind:0,text:n}):[]}function ze(e,t){let n=pe(t),r=e.replace(/^\/+|\/+$/g,""),o=r?r.split("/"):[],i={};for(let s=0;s<n.length;s++){let c=n[s];if(c.kind>=2){if(s!==n.length-1)return null;let a=o.slice(s);return c.kind===2&&a.length===0||a.some(u=>u==="")?null:(i[c.text]=a.map(fe).join("/"),i)}if(s>=o.length)return null;if(c.kind===1){if(!o[s])return null;i[c.text]=fe(o[s])}else if(fe(o[s])!==c.text)return null}return o.length===n.length?i:null}function fe(e){try{return decodeURIComponent(e)}catch{return e}}function Ye(e,t){let n=pe(e),r=pe(t);for(let o=0;o<n.length&&o<r.length;o++){if(n[o].kind!==r[o].kind)return n[o].kind-r[o].kind;if(n[o].kind===0&&n[o].text!==r[o].text)return n[o].text<r[o].text?-1:1}return n.length!==r.length?r.length-n.length:e<t?-1:e>t?1:0}function Le(e){let t=I(new URL(e,location.href).pathname).replace(/^\/+|\/+$/g,""),n=null;for(let r of C)for(let o of r.s||[])for(let i of o.i||[])ze(t,i)&&(!n||Ye(i,n.pattern)<0)&&(n={hit:{entry:r,slot:o,path:t},pattern:i});return n&&!P(w(document),n.hit.slot.key,"ks:")?null:n?n.hit:null}function Xe(e,t){C=C.map(n=>n.s&&n.s.some(r=>r.key===e)?{...n,s:n.s.map(r=>r.key===e?t:r)}:n)}function Ge(e){let t="",n=e.getElementById("__krate_page");if(n)try{let r=JSON.parse(n.textContent||"{}");typeof r.r=="string"&&(t=r.r)}catch{}globalThis.__KRATE_ROUTE__=t;for(let r of Array.from(e.querySelectorAll("script:not([src])"))){let o=/window\.__KRATE_PARAMS__\s*=\s*(\{[\s\S]*?\})\s*;?\s*$/.exec(r.textContent||"");if(o){try{globalThis.__KRATE_PARAMS__=JSON.parse(o[1])}catch{}return}}delete globalThis.__KRATE_PARAMS__}function jt(e){let t=e.getElementById("__krate_error"),n=document.getElementById("__krate_error");if(!t){n&&n.remove();return}let r=document.importNode(t,!0);n?n.replaceWith(r):document.head.appendChild(r)}function Qe(e){let t=globalThis.krateDisposeScopes;typeof t=="function"&&t(e)}async function Te(e,t){let n=location.href;if(e.kind!=="pop"&&!b("krate:navigate-start",{url:e.url,from:n,kind:e.kind,intercept:t.slot.n},!0))return;let r=++T;k&&k.abort();let o=new AbortController;k=o,H("loading");let i=location.origin+ge()+"/"+bt+"/"+t.slot.key+(t.path?"/"+t.path:""),s="",c=!1;try{let d=await fetch(i,{headers:{Accept:"text/html"},credentials:"same-origin",signal:o.signal,cache:e.bypassCache?"no-cache":"default"});s=await d.text(),c=d.ok&&(ke(d.headers.get("content-type")||"")||V(s)),c||b("krate:navigate-error",{url:e.url,status:d.status,intercept:t.slot.n})}catch(d){if(d?.name==="AbortError"||o.signal.aborted)return;b("krate:navigate-error",{url:e.url,status:0,error:d,intercept:t.slot.n})}finally{k===o&&(k=void 0)}if(r!==T)return;let a=c?new DOMParser().parseFromString(s,"text/html"):null,u=a?P(w(a),t.slot.key,"ks:"):null,l=P(w(document),t.slot.key,"ks:"),p=null;try{let d=a&&a.getElementById("__krate_route");p=d&&JSON.parse(d.textContent||"{}").frag||null}catch{p=null}if(!a||!u||!l||!p||p.key!==t.slot.key||!p.scope){try{console.warn(`[krate router] intercepting route for ${e.url} (slot @${t.slot.n}) could not be loaded; navigating to the page`)}catch{}return H("idle"),se({...e})}if(e.kind==="push"&&z(m),t.slot.src!=="intercept"){Y.set(m,{key:t.slot.key,nodes:U(l[0],l[1]),slot:t.slot,path:N});for(let d of U(l[0],l[1]))d.parentNode.removeChild(d)}else Qe([t.slot.scope]),ee(l[0],l[1]);for(let d of U(u[0],u[1]))l[1].parentNode.insertBefore(document.importNode(d,!0),l[1]);let h=new Set;document.querySelectorAll('link[rel="stylesheet"]').forEach(d=>h.add(d.href)),a.querySelectorAll('link[rel="stylesheet"][href]').forEach(d=>{let E=new URL(d.getAttribute("href"),i).href;if(h.has(E))return;let y=document.createElement("link");y.rel="stylesheet",y.href=E,document.head.appendChild(y)}),Xe(t.slot.key,{...t.slot,scope:p.scope,src:"intercept"}),Je(a);let g={__krate:"",state:e.state===void 0?null:e.state,__kint:{key:t.slot.key,base:N}};e.kind==="push"?(m=D(),g.__krate=m,history.pushState(g,"",e.url)):e.kind==="replace"?(m=D(),g.__krate=m,history.replaceState(g,"",e.url)):e.kind==="pop"&&e.restoreKey&&(m=e.restoreKey),A=x(location.href),Ge(a),ie(),b("krate:navigate",{url:location.href,status:200,intercept:t.slot.n}),ye(location.href),H("idle");let f=$e(a,i),v=await Promise.all(f.map(je));if(r===T){if(v.some(d=>!d)){b("krate:navigate-error",{url:location.href,status:200,error:"script-load",intercept:t.slot.n}),j(location.href,!0);return}te(),b("krate:navigate-end",{url:location.href,status:200,intercept:t.slot.n})}}function Jt(e,t){let n=P(w(document),e.key,"ks:"),r=C.flatMap(i=>i.s||[]).find(i=>i.key===e.key);if(!n||!r||r.src!=="intercept")return!1;Qe([r.scope]),ee(n[0],n[1]);for(let i of e.nodes)n[1].parentNode.insertBefore(i,n[1]);Xe(e.key,e.slot),Y.delete(t),m=t,A=x(location.href);let o=L.get(t);return o!==void 0&&window.scrollTo(0,o),ie(),b("krate:navigate",{url:location.href,status:200}),ye(location.href),oe(),!0}function Vt(e){return x(e)===A}function Ze(){F==="loading"&&(T++,k&&k.abort(),k=void 0,Se(),H("idle"))}function zt(e,t){Ze(),z(m),(e!==location.href||t.state!==void 0)&&(t.kind==="replace"?history.replaceState(J(m||D(),t.state),"",e):(m=D(),history.pushState(J(m,t.state),"",e)));let n=new URL(e).hash;!Ae(n)&&t.scroll&&!n&&window.scrollTo(0,0),oe()}function ae(e){let t;try{t=new URL(e.url,location.href)}catch{return j(e.url),Promise.resolve()}if(t.origin!==location.origin)return j(t.href,e.kind==="replace"),Promise.resolve();if(e.url=t.href,(e.kind==="push"||e.kind==="replace")&&Vt(t.href)&&(t.hash||t.href===location.href))return zt(t.href,e),Promise.resolve();if(e.kind==="push"||e.kind==="replace"){let n=Le(t.href);if(n)return Te(e,n)}return se(e)}function qe(e){if(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=e.target;if(!t||typeof t.closest!="function")return;let n=t.closest("a[data-krate-link]");if(!n||!we(n))return;let r=n.getAttribute("href");r&&(e.preventDefault(),ae({url:new URL(r,location.href).href,kind:n.hasAttribute("data-krate-replace")?"replace":"push",scroll:n.getAttribute("data-krate-scroll")!=="false"}))}function et(e){if(e.defaultPrevented)return;let t=e.target;if(!t||t.tagName!=="FORM"||t.hasAttribute("data-krate-reload"))return;let n=e.submitter||null;if((n&&n.getAttribute("formmethod")||t.getAttribute("method")||"get").toLowerCase()!=="get")return;let o=n&&n.getAttribute("formtarget")||t.getAttribute("target");if(o&&o!=="_self")return;let i=n&&n.getAttribute("formaction")||t.getAttribute("action")||"",s;try{s=new URL(i||location.href,location.href)}catch{return}if(s.origin!==location.origin||s.protocol.indexOf("http")!==0)return;let c;try{c=n?new FormData(t,n):new FormData(t)}catch{c=new FormData(t),n&&n.name&&c.append(n.name,n.value)}let a=new URLSearchParams;for(let[u,l]of c.entries()){if(typeof l!="string")return;a.append(u,l)}e.preventDefault(),s.search=a.toString(),s.hash="",ae({url:s.href,kind:"push",scroll:!0})}function tt(e){z(m);let t=Q(e.state),n=location.href;if(x(n)===A){Ze(),m=t||m;let i=t?L.get(t):void 0;i!==void 0?window.scrollTo(0,i):Ae(location.hash),oe();return}let r=t?Y.get(t):void 0;if(r&&t&&r.path===x(n)&&r.path===N&&Jt(r,t))return;let o=e.state&&typeof e.state=="object"?e.state.__kint:null;if(o&&o.base===N){let i=Le(n);if(i&&i.slot.key===o.key){Te({url:n,kind:"pop",scroll:!1,restoreKey:t},i);return}}se({url:n,kind:"pop",scroll:!0,restoreKey:t})}function nt(){ve(),it()}function rt(){z(m);try{history.scrollRestoration="auto"}catch{}}function ot(){try{history.scrollRestoration="manual"}catch{}}function te(){Oe(),ie(),We(document),document.querySelectorAll("script[src]").forEach(e=>{me.test(e.src)||e.setAttribute("data-krate-spa","")})}function it(){if(!_||typeof location>"u")return typeof location<"u"&&location.reload(),Promise.resolve();if(A!==N){let e=Le(location.href);if(e&&e.slot.src==="intercept")return Te({url:location.href,kind:"refresh",scroll:!1,bypassCache:!0},e)}return se({url:location.href,kind:"refresh",scroll:!1,bypassCache:!0})}function st(e,t={}){return _?ae({url:e,kind:"push",scroll:t.scroll!==!1,state:t.state}):(typeof location<"u"&&location.assign(e),Promise.resolve())}function at(e,t={}){return _?ae({url:e,kind:"replace",scroll:t.scroll!==!1,state:t.state}):(typeof location<"u"&&location.replace(e),Promise.resolve())}var Yt={push:st,replace:at,back(){typeof history<"u"&&history.back()},forward(){typeof history<"u"&&history.forward()},refresh:it,prefetch(e){if(!_||typeof location>"u")return Promise.resolve();let t;try{t=new URL(e,location.href)}catch{return Promise.resolve()}return t.origin!==location.origin?Promise.resolve():be(t.href)},subscribe:Ie,getState:Ue,invalidate:ve};function Xt(e,t={}){return _?(t.replace?at(e,t):st(e,t),!1):(typeof location<"u"&&(t.replace?location.replace(e):location.assign(e)),!0)}function ct(){if(!(typeof document>"u")){if(_){te();return}if(_=!0,document.querySelectorAll("script[data-krate-boot]").forEach(e=>q.add(e.textContent||"")),A=x(location.href),C=Ve(document),N=A,m=Q(history.state)||D(),Q(history.state)===void 0)try{history.replaceState(J(m,history.state),"",location.href)}catch{}try{history.scrollRestoration="manual"}catch{}document.addEventListener("click",qe),document.addEventListener("submit",et),window.addEventListener("popstate",tt),window.addEventListener("krate:revalidate",nt),window.addEventListener("pagehide",rt),window.addEventListener("pageshow",ot),_t(),xt(),te()}}function Gt(){ct()}function Qt(){if(_){_=!1,document.removeEventListener("click",qe),document.removeEventListener("submit",et),window.removeEventListener("popstate",tt),window.removeEventListener("krate:revalidate",nt),window.removeEventListener("pagehide",rt),window.removeEventListener("pageshow",ot),document.removeEventListener("mouseover",Z),document.removeEventListener("focusin",Z);for(let e of B.values())clearTimeout(e);B=new Map,M&&(M.disconnect(),M=null),k&&k.abort(),k=void 0,T++,S.clear(),R.clear(),L.clear(),G.clear(),q.clear(),W.clear(),F="idle",$=[],C=[],Y.clear(),N=""}}return mt(Zt);})();
|
|
2
2
|
for (const k in __krate_exports) { window[k] = __krate_exports[k]; }
|