@krate/runtime 0.5.0-rc.1 → 0.5.0-rc.2

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/actions.js CHANGED
@@ -21,6 +21,7 @@
21
21
  * "revalidated":true?,"revalidation":{"paths":[...],"tags":[...]}?}
22
22
  * {"ok":false,"error":{"message":M,"digest":D}}
23
23
  */
24
+ import { basePath, withBase } from './base-path.js';
24
25
  import { createEffect, onCleanup, krateRunEvent, krateTransitionWrites } from './signal.js';
25
26
  /** Field and query parameter carrying the JSON leading arguments of a form call. */
26
27
  export const ACTION_ARGS_FIELD = '__krate_args';
@@ -34,10 +35,6 @@ export class ServerActionError extends Error {
34
35
  this.digest = digest;
35
36
  }
36
37
  }
37
- function basePath() {
38
- const cfg = globalThis.__KRATE_CFG__;
39
- return cfg && cfg.basePath ? cfg.basePath : '';
40
- }
41
38
  /** True for a server action proxy created by `__krateAction`. */
42
39
  export function isServerAction(value) {
43
40
  return typeof value === 'function' && typeof value.$$krateAction === 'string';
@@ -53,7 +50,7 @@ function navigateTo(url) {
53
50
  if (typeof nav === 'function')
54
51
  nav(safe);
55
52
  else if (typeof location !== 'undefined')
56
- location.assign(safe);
53
+ location.assign(withBase(safe));
57
54
  }
58
55
  /** Only same-origin absolute paths are followed after an action. */
59
56
  function safeRedirect(url) {
@@ -0,0 +1,7 @@
1
+ /** The configured base path as "" or "/prefix" (no trailing slash). */
2
+ export declare function basePath(): string;
3
+ /**
4
+ * Prefixes a root-relative URL with the base path. Relative URLs, fragments,
5
+ * queries, absolute URLs and protocol-relative URLs are returned unchanged.
6
+ */
7
+ export declare function withBase(url: string): string;
@@ -0,0 +1,19 @@
1
+ // The site base path, shared by the router, actions and link rendering. The
2
+ // compiler sets `__KRATE_CFG__` in the page head; server bundles set it on
3
+ // globalThis so server-rendered links get the same prefix.
4
+ /** The configured base path as "" or "/prefix" (no trailing slash). */
5
+ export function basePath() {
6
+ const cfg = globalThis.__KRATE_CFG__;
7
+ const bp = (cfg && cfg.basePath) || '';
8
+ if (!bp || bp === '/')
9
+ return '';
10
+ return '/' + bp.replace(/^\/+|\/+$/g, '');
11
+ }
12
+ /**
13
+ * Prefixes a root-relative URL with the base path. Relative URLs, fragments,
14
+ * queries, absolute URLs and protocol-relative URLs are returned unchanged.
15
+ */
16
+ export function withBase(url) {
17
+ const bp = basePath();
18
+ return bp && url.charCodeAt(0) === 47 && url.charCodeAt(1) !== 47 ? bp + url : url;
19
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,88 @@
1
+ import { describe, it, expect, afterEach, vi } from 'vitest';
2
+ import { basePath, withBase } from './base-path';
3
+ import { h } from './dom';
4
+ import { Link, renderToString, jsx } from './server';
5
+ import { initRouter, destroyRouter, navigate, krateRouter } from './router';
6
+ function setBase(bp) {
7
+ globalThis.__KRATE_CFG__ = bp === undefined ? undefined : { basePath: bp, viewTransitions: false };
8
+ }
9
+ describe('base path helpers', () => {
10
+ afterEach(() => setBase(undefined));
11
+ it('normalizes the configured value', () => {
12
+ setBase(undefined);
13
+ expect(basePath()).toBe('');
14
+ setBase('/');
15
+ expect(basePath()).toBe('');
16
+ setBase('repo/');
17
+ expect(basePath()).toBe('/repo');
18
+ });
19
+ it('prefixes only root-relative URLs', () => {
20
+ setBase('/repo');
21
+ expect(withBase('/a?x=1#y')).toBe('/repo/a?x=1#y');
22
+ for (const u of ['//cdn.test/a', 'https://e.test/a', 'rel', '#top', '?q=1', '', 'mailto:a@b.c']) {
23
+ expect(withBase(u)).toBe(u);
24
+ }
25
+ });
26
+ it('leaves URLs alone at the root', () => {
27
+ setBase('');
28
+ expect(withBase('/a')).toBe('/a');
29
+ });
30
+ });
31
+ describe('<Link> rendering under a base path', () => {
32
+ afterEach(() => setBase(undefined));
33
+ it('prefixes a client-created link', () => {
34
+ setBase('/repo');
35
+ const a = h('a', { href: '/about', 'data-krate-link': true });
36
+ expect(a.getAttribute('href')).toBe('/repo/about');
37
+ });
38
+ it('prefixes a reactive href each time', () => {
39
+ setBase('/repo');
40
+ const a = h('a', { href: () => '/x', 'data-krate-link': true });
41
+ expect(a.getAttribute('href')).toBe('/repo/x');
42
+ });
43
+ it('leaves a plain anchor as written', () => {
44
+ setBase('/repo');
45
+ const a = h('a', { href: '/about' });
46
+ expect(a.getAttribute('href')).toBe('/about');
47
+ });
48
+ it('prefixes a server-rendered link and leaves external ones', async () => {
49
+ setBase('/repo');
50
+ expect(await renderToString(jsx(Link, { href: '/about', children: 'a' }))).toContain('href="/repo/about"');
51
+ expect(await renderToString(jsx(Link, { href: 'https://e.test/', children: 'a' }))).toContain('href="https://e.test/"');
52
+ });
53
+ });
54
+ describe('navigation under a base path', () => {
55
+ afterEach(() => {
56
+ destroyRouter();
57
+ setBase(undefined);
58
+ vi.unstubAllGlobals();
59
+ });
60
+ it('prefixes a navigation that falls back to a document load', () => {
61
+ destroyRouter();
62
+ setBase('/repo');
63
+ const assign = vi.fn();
64
+ const replace = vi.fn();
65
+ vi.stubGlobal('location', { assign, replace, href: 'http://x.test/repo/' });
66
+ expect(navigate('/about')).toBe(true);
67
+ expect(assign).toHaveBeenCalledWith('/repo/about');
68
+ navigate('/about', { replace: true });
69
+ expect(replace).toHaveBeenCalledWith('/repo/about');
70
+ void krateRouter.push('/a');
71
+ expect(assign).toHaveBeenCalledWith('/repo/a');
72
+ navigate('https://e.test/');
73
+ expect(assign).toHaveBeenCalledWith('https://e.test/');
74
+ });
75
+ it('scopes the speculation rules to the base path', () => {
76
+ HTMLScriptElement.supports = (t) => t === 'speculationrules';
77
+ setBase('/repo');
78
+ document.head.innerHTML = '<title>x</title>';
79
+ document.body.innerHTML = '<div id="root"></div>';
80
+ initRouter();
81
+ const rules = JSON.parse(document.querySelector('script[type="speculationrules"]').textContent);
82
+ expect(rules.prefetch[0].where.and).toEqual([
83
+ { href_matches: '/repo/*' },
84
+ { not: { href_matches: '/repo/__krate/*' } },
85
+ { not: { href_matches: '/repo/api/*' } },
86
+ ]);
87
+ });
88
+ });
package/dist/dom.js CHANGED
@@ -3,6 +3,7 @@ import { krateWithOwner, krateUnmount } from './effects.js';
3
3
  import { krateSanitizeAttr } from './slots.js';
4
4
  import { krateOn, krateControl, krateSetControl } from './events.js';
5
5
  import { krateAttachRef } from './refs.js';
6
+ import { withBase } from './base-path.js';
6
7
  export { krateOn, krateControl, krateSetControl, krateSynthetic, krateEventRoot, krateEventName, krateMountFields, } from './events.js';
7
8
  export { krateAttachRef, krateSetRef, krateRefsEnter, krateRefsLeave, krateRefsFlush, krateRefsHold } from './refs.js';
8
9
  // per-node effect tracking
@@ -288,9 +289,20 @@ function setAttr(el, key, value) {
288
289
  }
289
290
  }
290
291
  }
292
+ /** A built-in <Link> lowers to these props; plain anchors are left as written. */
293
+ function isLinkProps(props) {
294
+ return 'data-krate-link' in props || 'data-krate-external' in props;
295
+ }
296
+ function linkHref(href) {
297
+ if (typeof href === 'string')
298
+ return withBase(href);
299
+ if (typeof href === 'function')
300
+ return () => linkHref(href());
301
+ return href;
302
+ }
291
303
  function applyProps(el, props) {
292
304
  for (const key in props) {
293
- const value = props[key];
305
+ const value = key === 'href' && isLinkProps(props) ? linkHref(props[key]) : props[key];
294
306
  if (typeof value === 'function' && (key === 'value' || key === 'checked')) {
295
307
  trackEffect(el, krateControl(el, key, value));
296
308
  }
@@ -323,7 +335,8 @@ export function krateSpread(el, get) {
323
335
  if (key === 'children' || key === 'key' || key === 'dangerouslySetInnerHTML')
324
336
  continue;
325
337
  next.add(key);
326
- setAttr(el, key, props[key]);
338
+ const isLink = key === 'href' && (isLinkProps(props) || el.hasAttribute('data-krate-link'));
339
+ setAttr(el, key, isLink ? linkHref(props[key]) : props[key]);
327
340
  }
328
341
  const prev = spreadKeys.get(el);
329
342
  if (prev) {
package/dist/index.d.ts CHANGED
@@ -29,4 +29,9 @@ export type { ResourceReturn, ResourceActions } from './resource.js';
29
29
  export type { Component, PropsWithChildren, ComponentProps, RefCallback } from './dom.js';
30
30
  export type { RefObject, Ref, UseRefResult } from './signal.js';
31
31
  import './jsx-types.js';
32
+ export declare const Link: typeof globalThis.Link;
33
+ export declare const Head: typeof globalThis.Head;
34
+ export declare const Icon: typeof globalThis.Icon;
35
+ export declare const Suspense: typeof globalThis.Suspense;
36
+ export declare const SyntaxHighlight: typeof globalThis.SyntaxHighlight;
32
37
  import './css-modules.js';
@@ -1,2 +1,2 @@
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);})();
1
+ var __krate_exports=(()=>{var un=Object.defineProperty;var qo=Object.getOwnPropertyDescriptor;var zo=Object.getOwnPropertyNames;var Bo=Object.prototype.hasOwnProperty;var Vo=(e,n)=>{for(var t in n)un(e,t,{get:n[t],enumerable:!0})},Uo=(e,n,t,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of zo(n))!Bo.call(e,r)&&r!==t&&un(e,r,{get:()=>n[r],enumerable:!(o=qo(n,r))||o.enumerable});return e};var Go=e=>Uo(un({},"__esModule",{value:!0}),e);var ns={};Vo(ns,{BLOCKED_URL:()=>po,KRATE_CONTEXT:()=>gt,__krate_useId:()=>$i,adoptValue:()=>rn,afterFlush:()=>ar,appendChild:()=>xe,clearBetween:()=>ut,clearNodes:()=>So,clearPersisted:()=>Yo,createCSSChoice:()=>gr,createCSSFlags:()=>mr,createCSSGroup:()=>kr,createCSSRange:()=>yr,createCSSStack:()=>wr,createCSSToggle:()=>hr,createCallbackDeps:()=>Wr,createContext:()=>ln,createEffect:()=>y,createEffectDeps:()=>qr,createEffectEvent:()=>Gr,createMemo:()=>Nr,createMemoDeps:()=>Ut,createReducer:()=>_r,createResource:()=>Bi,createRoot:()=>Cr,createScope:()=>$o,createScopeFlags:()=>Xo,createSignal:()=>v,disposeAll:()=>bt,disposeNode:()=>se,flushPassive:()=>te,forwardRef:()=>Pr,h:()=>ji,hydrate:()=>zi,insert:()=>Ai,insertAt:()=>ie,isDerivedGetter:()=>Ke,isSignalGetter:()=>Tr,krateApplyStyle:()=>vo,krateAttachRef:()=>Se,krateBindRef:()=>Ei,krateCommitSnapshot:()=>wt,krateCommitting:()=>Q,krateCondActivity:()=>jr,krateCondDetached:()=>wi,krateCondReset:()=>Si,krateCondSwap:()=>vi,krateContextRows:()=>Qo,krateControl:()=>Je,krateCurrentScope:()=>F,krateCustomProp:()=>To,krateDepsOf:()=>$r,krateDerived:()=>Sr,krateDisposeExcept:()=>dr,krateDisposeOwner:()=>me,krateDisposeScopes:()=>pr,krateEnterScope:()=>tr,krateEpoch:()=>He,krateEventName:()=>Zn,krateEventRoot:()=>Xe,krateFlushSync:()=>De,krateForgetOwner:()=>Kr,krateGetOwner:()=>J,krateHintPreconnect:()=>Ji,krateHintPrefetchDNS:()=>Yi,krateHintPreinit:()=>Zi,krateHintPreinitModule:()=>es,krateHintPreload:()=>Xi,krateHintPreloadModule:()=>Qi,krateHook:()=>vr,krateHookState:()=>er,krateIsDiscrete:()=>ur,krateKeepScopes:()=>rr,krateLeaveScope:()=>or,krateMount:()=>Dr,krateMountFields:()=>Qe,krateMountPortals:()=>mi,krateMuteEvents:()=>si,krateOn:()=>ve,krateOnAfterFlush:()=>Nn,krateOnBeforeFlush:()=>Rn,krateOnDispose:()=>_n,krateOnHookError:()=>zr,krateOnLayoutCommit:()=>Vr,krateOnSettle:()=>br,krateOnUnmount:()=>Lr,krateOwner:()=>Fr,krateOwnerId:()=>Mr,krateParam:()=>Vi,kratePendingFlush:()=>On,kratePortalFind:()=>ki,kratePortalMount:()=>nt,kratePortalReset:()=>yi,kratePortalScan:()=>ao,kratePortalTarget:()=>pi,kratePortalUnmount:()=>en,kratePortalsEnter:()=>rt,kratePortalsIn:()=>ot,kratePortalsLeave:()=>it,kratePruneSnapshots:()=>xn,krateReadAt:()=>Le,krateRefsEnter:()=>Ue,krateRefsFlush:()=>Gn,krateRefsHold:()=>$t,krateRefsLeave:()=>Ve,krateRenderPhase:()=>ir,krateRequestFlush:()=>Er,krateRunEvent:()=>Me,krateSanitizeAttr:()=>st,krateScopeOfId:()=>Ln,krateSetControl:()=>B,krateSetOwner:()=>b,krateSetRef:()=>Wt,krateSlotReplaced:()=>Ir,krateSpread:()=>Oi,krateSynthetic:()=>$e,krateTagOwner:()=>he,krateTakeSyncLane:()=>Cn,krateTrackNode:()=>nn,krateTransitionWrites:()=>cr,krateUnmount:()=>z,krateWithIdScope:()=>Wi,krateWithOwner:()=>Bn,mount:()=>qi,onCleanup:()=>I,onMount:()=>Ar,readDurableState:()=>gn,readPersisted:()=>hn,removeRest:()=>Lo,resetContexts:()=>Ce,resolvePersist:()=>pn,runAfterFlush:()=>ke,sameValue:()=>fr,setOwnerHooks:()=>nr,subscribePersist:()=>kn,trackEffect:()=>A,untrack:()=>E,useRef:()=>Or,withDOM:()=>Ao,withVNodes:()=>Co,writePersisted:()=>mn});var Wo=0,gt=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 $o(){return ln({})}function Xo(){return ln({})}function ln(e){let n=Wo++;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=gt,s.id=n,s.defaultValue=e,s.Provider=r,s.Consumer=i,s.useContext=t,s.use=t,s.useContextLive=o,s}function Qo(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 Jo(){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=Jo();function mt(){return typeof window<"u"}function dn(e){if(e&&typeof e=="object")return e;if(!mt())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 Yo(e){let n=dn(e.store);try{n.removeItem(e.key)}catch{}}var Ae=new Map,ht=!1;function Zo(){ht||!mt()||(ht=!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),Zo(),()=>{t.delete(n),t.size===0&&Ae.delete(e.key)}}var er={react:!0},d=[],kt=[],wn=!1,m=null;function nr(e){m=e}var _e=[],x=new Set,le=[],U=null,yt=new Set,M=new Map;function tr(e){return yt.has(e)?!1:(U=e,h=null,!0)}function or(){U=null,h=null}function F(){let e=d[d.length-1];return e?e.scope:U!==null?U:h!==null&&M.has(h)?M.get(h)??null:null}function rr(e){yt=new Set(e)}function he(e,n){e!==null&&!M.has(e)&&M.set(e,n)}var w=[],fe=!1;function G(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,W=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=W.get(e);if(W.delete(e),M.delete(e),t)for(let o of t)try{o()}catch{}}var D=0,S=null,Re=0,$=new Set,de=new Set;function ir(e){D++;let n=S;S=null;try{return e()}finally{S=n,D--}}function wt(){Re++;for(let e of $)e.commit(Re);return $.clear(),Re}function He(){return Re}function Le(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 sr(){if(Ne>0)return!0;let e=typeof window<"u"?window.event:void 0;return!!e&&bn.has(e.type)}var Oe=0;function cr(e){Oe++;try{return e()}finally{Oe--}}function ur(e){return bn.has(e)}function Me(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 St(){return d[d.length-1]||null}var h=null;function J(){return h}function b(e){let n=h;return h=e,n}var vt=[],Tt=[],An=[];function Rn(e){vt.push(e)}function Nn(e){Tt.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 ar(e){_e.push(e),Fn()}function lr(){if(_e.length===0)return;let e=_e.splice(0);for(let n of e)n()}function fr(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 dr(e){if(e.length===0){bt();return}let n=new Set(e);xt(t=>!(t!=null&&n.has(t)),!0)}function pr(e){if(e.length===0)return;let n=new Set(e);xt(t=>t!=null&&n.has(t),!1)}function Ln(e){if(e.charCodeAt(0)!==95)return null;let n=e.indexOf("_",1);return n>0?e.slice(0,n+1):null}function xt(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([...W.keys(),...K.keys()]);for(let s of o)e(M.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 bt(){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(W.keys()))me(t);K.clear(),M.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 gr(e,n){return Fe(v(e))}function hr(e,n){return Fe(v(e))}function mr(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 kr(e,n){return Fe(v(e))}function yr(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 wr(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)=>Et(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 Mn.add(f),[f,R]}function Et(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 Ct=new WeakSet;function Sr(e,n){let t,o=!0,r=new Set,i=G(()=>{});i.mark=u=>{o||(o=!0,Et(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)}),Ct.add(s),Mn.add(s),s}function Ke(e){return typeof e=="function"&&Ct.has(e)}function vr(e){return Ke(e)?e:()=>e}var Mn=new WeakSet;function Tr(e){return typeof e=="function"&&Mn.has(e)}var P=0,X=0;function Fn(e=!1){let n=Oe===0&&sr();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{xr()}finally{Sn--}}function xr(){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 vt)r();let o=0;for(;w.length>0&&o<At;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 Rt)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 At=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 Rt=[],yn=0;function br(e){Rt.push(e)}function Er(){Fn()}function ke(){$.size>0&&wt(),typeof document<"u"&&document.activeElement;for(let e of Tt)e();lr()}function De(){if(w.length===0){ke();return}let e=0;for(;w.length>0;)e++>=At&&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=G(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=St();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=W.get(h);o||W.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 Cr(e){let n=G(()=>{});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 Ar(e){kt.push({fn:e,owner:d[d.length-1],boundary:m?m.current():null}),wn||(wn=!0,queueMicrotask(Rr))}function Rr(){wn=!1;let e=kt.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=G(()=>{});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 Nr(e){let[n,t]=v(void 0),o=!0,r=G(()=>{});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=G(()=>{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=St(),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 _r(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 Or(e){return{current:e}}function Pr(e){return n=>e(n,n.ref||(()=>{}))}var k=je(null,null),C=new Map,N=new Map,q=new Set,_=new Set,Hr=0,Ie=!1,H=null,L=[],j=[],Y=[],Z=new Map,Ot=[];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 Lr(e){Ot.push(e)}function Mr(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 Pt(e){for(let[n,t]of e.conds){let o=N.get(n);if(o!==void 0&&o!==t)return!1}return!0}function Fr(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=Pt(r),o&&(r.slot=o,q.has(o)&&(r.disposed=!0))}b(r)}function Bn(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&&(L.push(...o),Vn())}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 Ot)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 Kr(e){let n=C.get(e);n&&(z(n),C.delete(e))}function Dr(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)&&Lt(i)}function Ht(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 Ht(e)!==null}function Lt(e){let n=Ht(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 Ir(e){if(!q.has(e)){q.add(e);for(let n of Array.from(C.values()))n.slot===e&&z(n)}}function jr(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)&&Lt(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=Pt(r);if(i===r.shown)continue;let s=ee(r);r.shown=i;let c=ee(r);s&&!c?Mt(r,o):!s&&c&&Ft(r)}o.length&&(L.push(...o),o=[],Vn()),jt()}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 Ft(e){for(let n of e.hooks)It(n);for(let n of e.children)n.shown&&!n.disposed&&Ft(n)}function Kt(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 Dt(e){if(e!=null)return Array.isArray(e)?e:Array.from(e)}function It(e){e.dirty=!0,_.add(e),jt()}function jt(){Ie||(Ie=!0,queueMicrotask(()=>{On()||(te(),ke())}))}function qr(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:Hr++,stop:()=>{},scope:o===k?F():o.scope};o.hooks.push(r),!o.disposed&&(r.stop=y(()=>{let i=r.deps?Dt(r.deps()):[];r.hasPrev&&Kt(r.prev,i)||(r.prev=i,r.hasPrev=!0,ee(r.owner)&&It(r))}))}function jn(e,n){if(e.owner.disposed)return;let t;try{t=Le(n,()=>E(e.fn))}catch(o){qt(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 zr(e){qn=e}function qt(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 zt(e,n){try{E(e)}catch(t){qt(t,n)}}function Bt(e){if(!e.mounted)return null;e.mounted=!1;let n=e.epoch,t=e.cleanup;return e.cleanup=null,t?()=>{try{Le(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=Bt(e);n&&zt(n,e.owner)}function ye(e){let n=Bt(e);return n?()=>zt(n,e.owner):null}function Nt(){let e=He();for(let n of Z.keys())n<e&&(e=n);xn(e)}function Br(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 Vr(e){Vt.push(e)}function _t(){for(let e of Vt)e()}function Ur(){Ie=!1;let e=He(),n=Cn();if(_.size===0){_t(),n&&te(),Nt();return}let t=Br(_).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);_t();let r=!1;for(let i of t){if(i.phase!=="passive")continue;let s=ye(i);s&&L.push(s),j.push([i,e]),r=!0}r&&Vn(),n&&te()}finally{Q(!1)}Nt()}function Vn(){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(;L.length||j.length;){let o=L,r=j;L=[],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 Ut(e,n){let t,o=!1,r;return()=>{let i=Dt(n())||[];return(!o||!Kt(t,i))&&(t=i,o=!0,r=E(e)),r}}function Gr(e){return function(...t){return E(()=>e.apply(this,t))}}function Wr(e,n){let t=!0;return Ut(()=>{if(t)return t=!1,e;let o=e;return function(...r){return o.apply(this,r)}},n)}function $r(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 Xr(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(Ln(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 Qr(e){if(e){Xr(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=L.concat(n);L=[],H!==null&&(clearTimeout(H),H=null);for(let o of t)try{E(o)}catch{}Ie=!1,b(null)}Rn(te);Nn(Ur);_n(Qr);var we=new Set;function Gt(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;Gt(()=>{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&&Gt(n)}function Wt(e,n){let t={el:n,ref:e,on:!1,undo:null};return Be(t),()=>Un(t)}var oe=null;function $t(){oe||(oe=[],queueMicrotask(Gn))}function Gn(){let e=oe;if(oe=null,!!e)for(let n of e)we.has(n)&&n.el.isConnected&&Be(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)&&Be(r),()=>{we.delete(r),Un(r)}}function Ve(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&&Be(e)}var Jr={doubleclick:"dblclick",focus:"focusin",blur:"focusout"},Yr={dblclick:"doubleclick",focusin:"focus",focusout:"blur"},Zr={focusin:"focus",focusout:"blur"},ei=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(" ")),Zt={change:["change","input","click"],beforeinput:["beforeinput","compositionend"]},ni={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}},ti={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(ni),r=t===void 0?e.target:t;return r&&r.nodeType===3&&(r=r.parentNode),o.type=n||Zr[e.type]||e.type,o.target=r,o.currentTarget=null,o.nativeEvent=e,o.defaultPrevented=e.defaultPrevented,new Proxy(o,ti)}var Wn,Ge=!1;function eo(e,n){try{e(n)}catch(t){Ge||(Ge=!0,Wn=t)}}function no(){if(Ge){let e=Wn;throw Ge=!1,Wn=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],eo(u[a+1],c);return c.currentTarget=null,c}var Xt=new WeakMap,$n=new Set,to=new Set;function oi(){return typeof document>"u"?null:document.getElementById("root")||document.body}function Xn(e,n){let t=Xt.get(e);t||(t=new Set,Xt.set(e,t)),!t.has(n)&&(t.add(n),e.addEventListener(n,ri,!0),e.addEventListener(n,ii,!1))}function Qn(e){to.add(e);let n=oi();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 to)Xn(e,n)}function ri(e){oo(e,!0)}function ii(e){oo(e,!1)}var We=0;function si(e){We++;try{return e()}finally{We--}}function oo(e,n){if(We>0)return;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"&&Yn(e,Yr[r]||r,i,n?1:2),n||(r==="change"||r==="input"||r==="click"?fi(e):(r==="beforeinput"||r==="compositionend")&&di(e))}),no()}function ci(e){ro(this,e,!1)}function ui(e){ro(this,e,!0)}function ro(e,n,t){if(We>0)return;let o=e.__kh,r=o&&o[n.type+(t?"$":"")];if(!r)return;let i=$e(n);i.currentTarget=e,Me(n.type,!0,()=>eo(r,i)),i.currentTarget=null,no()}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,ei.has(o)){let a=i.__kd||(i.__kd={});a[c]||(a[c]=1,e.addEventListener(o,r?ui:ci,r));return}let u=Zt[o];if(u){for(let a of u)Qn(a);o==="change"&&co(e)}else Qn(Jr[o]||o)}function Qe(e){let n=e.querySelectorAll("input[value]");for(let t=0;t<n.length;t++){let o=n[t];if(!io.has(o.type||"text")||!o.value||o.ownerDocument.activeElement===o)continue;let r=o.value;o.value="",o.value=r}}var io=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 so(e){return et(e)?String(e.checked):String(e.value)}function co(e){e.__kv===void 0&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")&&(e.__kv=so(e))}function Jn(e){let n=so(e);return e.__kv===n?!1:(e.__kv=n,!0)}function ai(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 li(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"&&io.has(n.type||"text"))&&t!=="click"&&Jn(n)?n:null}function fi(e){let n=li(e);if(n)if(Yn(e,"change",n,3,"change"),n.type==="radio")for(let t of ai(n))Jn(t),Yt(t);else Yt(n)}function di(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 Qt(e,n){e.__kw||(e.__kw=1,console.error(n))}function Jt(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"){Jt(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"?Jt(o,t,!0):o.defaultValue=t==null?"":String(t);return;case"defaultChecked":o.defaultChecked=!!t;return;default:o[n]=!!t}}function Yt(e){let n=e.__kc;n&&(De(),n.value&&B(e,"value",n.value()),n.checked&&B(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 Zt.change)Qn(c);co(o)}let i,s=!1;return y(()=>{let c=t();if(r){let u=c!=null;c===null&&n==="value"?Qt(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&&Qt(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 uo="template[data-krate-portal]",Ye=new Map,Ze=new Set;function pi(e,n){Ye.set(e,n)}function gi(e){return!!e&&typeof e=="object"&&(e.nodeType===1||e.nodeType===11)}function hi(e){let n=e.getAttribute("data-krate-portal")||"",t=Ye.get(n);if(t){let r=null;try{r=t()}catch{r=null}return gi(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=hi(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?.(uo)&&n.push(e),e.querySelectorAll(uo).forEach(t=>n.push(t)),n}function mi(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 ao(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 ki(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 ao(n,o=>{t||(t=o.querySelector(e))}),t}function yi(){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,fo=new WeakMap;function wi(){return Array.from(re)}function Si(){let e=new Set,n=!0;for(;n;){n=!1;for(let t of re){if(e.has(t))continue;let o=fo.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 lo(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 vi(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:lo(e)},o.__krateCond=i}if(i.shown===r)return;let s=e.parentNode;if(!s)return;(!i.end||i.end.parentNode!==s)&&(i.end=lo(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),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),fo.set(u,e),i.shown=r,Ue(),p&&(p.removeAttribute("autofocus"),p.focus())}var Ti={href:!0,src:!0,action:!0,formaction:!0,"xlink:href":!0},xi=/^[\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,po="javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')";function st(e,n){return Ti[e.toLowerCase()]&&xi.test(n)?po:n}function bi(){let e=globalThis.__KRATE_CFG__,n=e&&e.basePath||"";return!n||n==="/"?"":"/"+n.replace(/^\/+|\/+$/g,"")}function go(e){let n=bi();return n&&e.charCodeAt(0)===47&&e.charCodeAt(1)!==47?n+e:e}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 yo(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)yo(o,n);else lt(e)&&(e.u||(e.u=[])).push(n)}function wo(e,n){if(e.u)for(let t of e.u)A(n,()=>z(t))}function Ei(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 Ci(e){let n=e.nextSibling;for(;n;){if(n.nodeType===8&&n.nodeValue==="k")return n;n=n.nextSibling}return null}function So(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 Ai(e,n,t){let o=Ci(t);o?(So(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 Ri={htmlFor:"for"},Ni=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 _i(e){if(e.startsWith("--"))return e;let n=e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase());return n.startsWith("ms-")?"-"+n:n}var ho=new WeakMap;function vo(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=_i(i),u=c.replace(/^-(webkit|moz|ms|o)-/,""),a=typeof s=="number"&&s!==0&&!c.startsWith("--")&&!Ni.has(u)?s+"px":String(s);t.setProperty(c,a),o.add(c)}let r=ho.get(e);if(r)for(let i of r)o.has(i)||t.removeProperty(i);ho.set(e,o)}function To(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")&&To(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"?vo(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=Se(e,t,void 0,"now");A(e,o),I(o)}else if(!(n==="key"||n==="children"||n==="dangerouslySetInnerHTML")){let o=Ri[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 xo(e){return"data-krate-link"in e||"data-krate-external"in e}function at(e){return typeof e=="string"?go(e):typeof e=="function"?()=>at(e()):e}function bo(e,n){for(let o in n){let r=o==="href"&&xo(n)?at(n[o]):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 mo=new WeakMap;function Oi(e,n){A(e,y(()=>{let t=n()||{},o=new Set;for(let i of Object.keys(t)){if(i==="children"||i==="key"||i==="dangerouslySetInnerHTML")continue;o.add(i);let s=i==="href"&&(xo(t)||e.hasAttribute("data-krate-link"));tn(e,i,s?at(t[i]):t[i])}let r=mo.get(e);if(r)for(let i of r)o.has(i)||(i.startsWith("on")?ve(e,i,null):tn(e,i,void 0));mo.set(e,o)}))}function Eo(e,n){if(e===void 0)return n();let t=b(e);try{return n()}finally{b(t)}}var V=0;function Co(e){let n=V;V=n+1;try{return e()}finally{V=n}}function Ao(e){let n=V;V=0;try{return e()}finally{V=n}}function lt(e){return!!e&&typeof e=="object"&&e.__kv===1}function Ro(e){return!!e&&typeof e=="object"&&e.__ka===1}var on="http://www.w3.org/2000/svg",Pi=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 Hi(e){return Pi.has(e)?document.createElementNS(on,e):document.createElement(e)}function Li(e){let n=e;return n.namespaceURI===on&&n.localName!=="foreignObject"}function ko(e,n){let t=n;if(t.nodeType!==1||t.namespaceURI===on||!Li(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 No(e,n,t){let o=Hi(e);if(n&&bo(o,n),!n||!n.dangerouslySetInnerHTML)for(let r of t)xe(o,r);return o}function _o(e){let n=Eo(e.o,()=>Ao(()=>No(e.tag,e.props,e.children)));return wo(e,n),n}function ft(e){return e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="bigint"}function dt(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"){Ki(e,n,null);return}if(lt(n)){e.appendChild(ko(e,_o(n)));return}if(Ro(n)){e.appendChild(n.mount());return}e.appendChild(n instanceof Node?ko(e,n):document.createTextNode(String(n)))}}function Mi(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 Fi(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),Mi(n,e.start),t.removeChild(n),e.text=null}function Oo(e,n){if(ft(n)){let o=dt(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}Fi(e),ut(e.start,e.end);let t=document.createDocumentFragment();xe(t,n),e.end.parentNode.insertBefore(t,e.end)}function Ki(e,n,t){let o={text:null,start:null,end:null},r=!0,i=y(()=>{let s=n();if(!r){Oo(o,s);return}if(r=!1,ft(s)){o.text=document.createTextNode(dt(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 Po(e){for(;e.next&&e.next.nodeType===8;)e.next=e.next.nextSibling}function ie(e,n){e.parent.insertBefore(n,e.next)}function Ho(e,n){Po(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 Lo(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 Di(e,n){Po(n);let t=n.next;if(t&&t.nodeType===1&&t.localName.toLowerCase()===e.tag.toLowerCase()){n.next=t.nextSibling;let o=t;wo(e,o),Eo(e.o,()=>{if(e.props&&bo(o,e.props),!e.props||!e.props.dangerouslySetInnerHTML){let r={parent:o,next:o.firstChild};for(let i of e.children)rn(i,r);Lo(r,null)}});return}ie(n,_o(e))}function Ii(e,n){let t={text:null,start:null,end:null},o=!0,r=y(()=>{if(!o){Oo(t,e());return}o=!1;let i=Co(e);if(ft(i)){t.text=Ho(n,dt(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"){Ii(e,n);return}if(lt(e)){Di(e,n);return}if(Ro(e)){e.adopt(n);return}if(e instanceof Node){ie(n,e);return}Ho(n,String(e))}}function ji(e,n,...t){if(typeof e=="function"){let o=n||{};(t.length>0||!("children"in o))&&(o.children=t);let{value:r,owner:i}=Bn(()=>e(o));return yo(r,i),r}return V>0?{__kv:1,tag:e,props:n,children:t,o:J()}:No(e,n,t)}function Mo(e){if(typeof e=="string"){let n=document.querySelector(e);if(!n)throw new Error(`Container "${e}" not found`);return n}return e}function qi(e,n){let t=Mo(n),o=!1;y(()=>{o||(o=!0,t.appendChild(e()))})}function zi(e,n){let t=Mo(n);if(t.childNodes.length===0){t.appendChild(e());return}let o=e();o&&se(o)}function Fo(){return globalThis.__krateSuspenseHook}function Bi(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=Fo()?.current()??null,g=null,ue=null,be=()=>typeof e=="function"?e():e,Do=()=>{let T=Io();return g=T,T.then(()=>{g===T&&(g=null)}),T},Io=async()=>{R&&R.abort(),R=new AbortController;let T=R,jo=be();a(f()>0?"refreshing":"loading"),i(!0),c(void 0);try{let Ee=await n(jo,{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(),Do(),I(()=>{R&&(R.abort(),R=void 0)})});let pt=function(){return l&&g&&ue!==g&&(ue=g,Fo()?.suspend(l,g)),t()};return Object.defineProperties(pt,{loading:{get:()=>r()},error:{get:()=>s()},state:{get:()=>u()}}),[pt,{mutate:T=>{o(T)},refetch:()=>{p(T=>T+1)}}]}function Vi(e){return Ke(e)?e():e}var ce=null,Ui=0,Ko=typeof TextEncoder<"u"?new TextEncoder:null;function Gi(e){return e.replace(/[^A-Za-z0-9_.:$-]/gu,n=>(Ko?Array.from(Ko.encode(n)):[n.charCodeAt(0)&255]).map(o=>"%"+o.toString(16).toUpperCase().padStart(2,"0")).join(""))}function Wi(e,n){if(!e)return n();let t=ce;ce={prefix:Gi(e),n:0};try{return n()}finally{ce=t}}function $i(){return ce?"krate-"+ce.prefix+"-u"+ce.n++:"krate_u"+Ui++}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 Xi(e,n){cn("preload",e,n)}function Qi(e,n){cn("modulepreload",e,n)}function Ji(e,n){cn("preconnect",e,n)}function Yi(e){cn("dns-prefetch",e)}function Zi(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 es(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 Go(ns);})();
2
2
  for (const k in __krate_exports) { window[k] = __krate_exports[k]; }
@@ -1,2 +1,2 @@
1
- var __krate_exports=(()=>{var g=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var W=Object.getOwnPropertyNames;var J=Object.prototype.hasOwnProperty;var K=(t,e)=>{for(var n in e)g(t,n,{get:e[n],enumerable:!0})},U=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of W(e))!J.call(t,r)&&r!==n&&g(t,r,{get:()=>e[r],enumerable:!(o=N(e,r))||o.enumerable});return t};var Q=t=>U(g({},"__esModule",{value:!0}),t);var wt={};K(wt,{ACTION_ARGS_FIELD:()=>v,ServerActionError:()=>p,__krateAction:()=>tt,__krateActionState:()=>ft,__krateAssignRef:()=>rt,__krateBeginAction:()=>y,__krateBindFormAction:()=>st,__krateFormStatusMount:()=>ot,__krateOptimistic:()=>pt,callServerAction:()=>A,getFormStatus:()=>at,installActionForms:()=>j,isActionPending:()=>et,isServerAction:()=>D,reportActionError:()=>T,requestFormReset:()=>it,runActionTransition:()=>F,setActionTransitionRunner:()=>nt,submitFormAction:()=>$,takeFlash:()=>I});var _=window.createEffect;var R=window.krateRunEvent;var d=window.krateTransitionWrites,P=window.onCleanup;var v="__krate_args",p=class extends Error{constructor(e,n,o){super(e),this.name="ServerActionError",this.status=n,o&&(this.digest=o)}};function V(){let t=globalThis.__KRATE_CFG__;return t&&t.basePath?t.basePath:""}function D(t){return typeof t=="function"&&typeof t.$$krateAction=="string"}var S=0;function z(t){let e=X(t);if(!e)return;let n=globalThis.navigate;typeof n=="function"?n(e):typeof location<"u"&&location.assign(e)}function X(t){return!t||!t.startsWith("/")||t.startsWith("//")||t.includes("\\")||/[\u0000-\u001f\u007f]/.test(t)?"":t}function Y(t){if(typeof window>"u"||typeof CustomEvent>"u")return;let e={paths:t&&Array.isArray(t.paths)?t.paths:[],tags:t&&Array.isArray(t.tags)?t.tags:[]};window.dispatchEvent(new CustomEvent("krate:revalidate",{detail:e}))}function Z(t,e,n){let o=t?t.error:void 0;if(o&&typeof o=="object")return new p(o.message||"Server action failed",e,o.digest);let r=t&&(t.details||(typeof o=="string"?o:""))||n||"Server action failed";return new p(r,e)}async function A(t,e){let n={accept:"application/json","x-krate-action":"fetch"};typeof location<"u"&&(n["x-krate-return"]=location.pathname+location.search);let o,r=e[e.length-1];if(typeof FormData<"u"&&r instanceof FormData){let s=new FormData;r.forEach((u,l)=>{l!==v&&s.append(l,u)});let c=e.slice(0,-1);c.length>0&&s.set(v,JSON.stringify(c)),o=s}else n["content-type"]="application/json",o=JSON.stringify({args:e});let a=await fetch(t,{method:"POST",credentials:"same-origin",headers:n,body:o}),i=null;try{i=await a.json()}catch{i=null}if(!a.ok||!i||i.ok===!1)throw Z(i,a.status,a.statusText);return i.revalidated&&Y(i.revalidation),typeof i.redirect=="string"&&i.redirect&&(S++,z(i.redirect)),i.result}function L(t,e){let n=V()+"/__krate/action/"+t,o=function(...r){return A(n,e.concat(r))};return Object.defineProperty(o,"actionUrl",{value:n}),Object.defineProperty(o,"$$krateAction",{value:t}),Object.defineProperty(o,"$$krateBound",{value:e}),Object.defineProperty(o,"bind",{value:(r,...a)=>L(t,e.concat(a))}),o.toString=()=>n,o}function tt(t){return L(t,[])}var f=0,h=new Set;function y(){f++;let t=!1;return()=>{t||(t=!0,f--,f===0&&d(()=>{for(let e of Array.from(h))e()}))}}function et(){return f>0}var H=t=>{let e=y(),n;try{n=t()}catch(o){return e(),Promise.reject(o)}return Promise.resolve(n).finally(e)},G=H;function nt(t){G=t||H}function F(t){return G(t)}function T(t,e){let n=globalThis;if(typeof n.__krateActionError=="function")try{if(n.__krateActionError(t,e)===!0)return}catch{}let o=e||(typeof document<"u"?document:null),r=!1;if(o&&typeof CustomEvent<"u"){let a=new CustomEvent("krate:action-error",{bubbles:!0,cancelable:!0,detail:{error:t}});r=!o.dispatchEvent(a)}r||console.error("krate server action:",t)}var b=Object.freeze({pending:!1,data:null,method:null,action:null}),w=new WeakMap;function q(t){let e=w.get(t);return e||(e={status:b,subs:new Set,running:0,resetRequested:!1},w.set(t,e)),e}function O(t,e){t.status=e;for(let n of Array.from(t.subs))n(e)}function ot(t,e){let n=null;for(let a=t?t.parentElement:null;a;a=a.parentElement)if(a.tagName==="FORM"){n=a;break}if(!n)return()=>{};let o=q(n),r=a=>{e.status&&e.status(a),e.pending&&e.pending(a.pending),e.data&&e.data(a.data),e.method&&e.method(a.method),e.action&&e.action(a.action)};return o.subs.add(r),r(o.status),()=>{o.subs.delete(r)}}function rt(t,e){typeof t=="function"?t(e):t&&typeof t=="object"&&(t.current=e)}function at(t){return w.get(t)?.status||b}function B(t){let e=Array.from(t.querySelectorAll("[data-kattr-value],[data-kattr-checked]")).map(n=>({el:n,value:n.value,checked:n.checked}));t.reset();for(let n of e)n.el.hasAttribute("data-kattr-value")&&(n.el.value=n.value),n.el.hasAttribute("data-kattr-checked")&&(n.el.checked=n.checked)}function it(t){let e=w.get(t);if(e&&e.running>0){e.resetRequested=!0;return}B(t)}function st(t,e){t&&(t.__krateFormAction=e,t.tagName==="FORM"?(t.removeAttribute("action"),t.removeAttribute("method")):(t.removeAttribute("formaction"),t.removeAttribute("formmethod")),t.removeAttribute("data-krate-action"))}function C(t){if(!t)return null;let e=t.__krateFormAction;if(typeof e!="function")return null;try{return e()}catch{return null}}function ct(t,e){if(e&&e!==t){let o=C(e);if(typeof o=="function")return{fn:o};if(e.hasAttribute("data-krate-action"))return{url:e.formAction||t.action};if(e.hasAttribute("formaction"))return null}let n=C(t);return typeof n=="function"?{fn:n}:t.hasAttribute("data-krate-action")?{url:t.action}:null}function ut(t,e){let n;try{n=e?new FormData(t,e):new FormData(t)}catch{n=new FormData(t);let o=e;o&&o.name&&n.append(o.name,o.value)}return n}function lt(t){let e=t.indexOf("?");return e<0?t:t.slice(0,e)}async function $(t,e,n,o=null,r){let a=q(t),i=(o&&o.getAttribute("formmethod")||t.getAttribute("method")||"get").toLowerCase();a.running++,O(a,{pending:!0,data:n,method:i,action:e||r||null}),t.setAttribute("data-krate-action-pending","1");let s=!1;try{await F(async()=>{let c=e;if(c&&typeof c.__krateRun=="function"){s=await c.__krateRun(n);return}typeof c=="function"?await c(n):r&&await A(lt(r),[n]),s=!0})}catch(c){T(c,t)}finally{a.running--,a.running===0&&(t.removeAttribute("data-krate-action-pending"),d(()=>O(a,b)),(s||a.resetRequested)&&(a.resetRequested=!1,s&&t.hasAttribute("data-krate-reload")?location.reload():B(t)))}return s}function dt(t){let e=t.target;if(!e||e.tagName!=="FORM"||t.defaultPrevented)return;let n=t.submitter||null,o=ct(e,n);if(!o)return;t.preventDefault();let r=ut(e,n);R("submit",!0,()=>{$(e,o.fn,r,n,o.url)})}function j(t=typeof document<"u"?document:void 0){if(!t)return;let e=t.defaultView;!e||e.__krateActionBound||(e.__krateActionBound=!0,t.addEventListener("submit",dt,!1))}function x(t){try{let e=t.split(".")[0].replace(/-/g,"+").replace(/_/g,"/"),n=atob(e+"=".repeat((4-e.length%4)%4));return JSON.parse(decodeURIComponent(escape(n)))}catch{return null}}function I(t){if(typeof document>"u")return{found:!1};let e=/(?:^|;\s*)krate_flash=([^;]*)/.exec(document.cookie||"");if(e){let o=x(e[1]);return o&&o.a===t?(document.cookie="krate_flash=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 GMT; SameSite=Lax",M(t),{found:!0,value:o.r}):{found:!1}}let n=document.querySelectorAll("[data-krate-flash]");for(let o=0;o<n.length;o++){let r=x(n[o].getAttribute("data-krate-flash")||"");if(r&&r.a===t)return M(t),{found:!0,value:r.r}}return{found:!1}}function M(t){let e=document.querySelectorAll("[data-krate-flash]");for(let n=0;n<e.length;n++){let o=x(e[n].getAttribute("data-krate-flash")||"");o&&o.a===t&&e[n].parentNode?.removeChild(e[n])}}function ft(t,e,n,o){let r=[],a=!1;if(D(t)){let u=I(t.$$krateAction);u.found&&n(u.value)}let i=async()=>{for(a=!0;r.length>0;){let u=r.shift(),l=!1;try{let k=S,m=await F(()=>t(e(),u.payload));S===k&&d(()=>n(m)),l=!0}catch(k){let m=r.splice(0);for(let E of m)E.end(),E.done(!1);T(k)}finally{d(()=>{u.end(),u.done(l)})}}a=!1,d(()=>o(!1))},s=u=>new Promise(l=>{r.push({payload:u,end:y(),done:l}),o(!0),a||i()}),c=(u=>{s(u)});return c.__krateRun=s,c}function pt(t,e,n){let o=[],r=i=>{let s=i;for(let c of o)s=n?n(s,c):c;return s};_(()=>{e(r(t()))});let a=()=>{o.length!==0&&(o=[],e(t()))};return h.add(a),P(()=>{h.delete(a)}),i=>{o.push(i),e(r(t())),f===0&&queueMicrotask(()=>{f===0&&a()})}}typeof document<"u"&&j(document);return Q(wt);})();
1
+ var __krate_exports=(()=>{var g=Object.defineProperty;var J=Object.getOwnPropertyDescriptor;var K=Object.getOwnPropertyNames;var U=Object.prototype.hasOwnProperty;var Q=(t,e)=>{for(var n in e)g(t,n,{get:e[n],enumerable:!0})},V=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of K(e))!U.call(t,r)&&r!==n&&g(t,r,{get:()=>e[r],enumerable:!(o=J(e,r))||o.enumerable});return t};var z=t=>V(g({},"__esModule",{value:!0}),t);var kt={};Q(kt,{ACTION_ARGS_FIELD:()=>h,ServerActionError:()=>p,__krateAction:()=>et,__krateActionState:()=>pt,__krateAssignRef:()=>at,__krateBeginAction:()=>F,__krateBindFormAction:()=>ct,__krateFormStatusMount:()=>rt,__krateOptimistic:()=>wt,callServerAction:()=>y,getFormStatus:()=>it,installActionForms:()=>N,isActionPending:()=>nt,isServerAction:()=>H,reportActionError:()=>T,requestFormReset:()=>st,runActionTransition:()=>b,setActionTransitionRunner:()=>ot,submitFormAction:()=>I,takeFlash:()=>W});function v(){let t=globalThis.__KRATE_CFG__,e=t&&t.basePath||"";return!e||e==="/"?"":"/"+e.replace(/^\/+|\/+$/g,"")}function R(t){let e=v();return e&&t.charCodeAt(0)===47&&t.charCodeAt(1)!==47?e+t:t}var P=window.createEffect;var C=window.krateRunEvent;var d=window.krateTransitionWrites,O=window.onCleanup;var h="__krate_args",p=class extends Error{constructor(e,n,o){super(e),this.name="ServerActionError",this.status=n,o&&(this.digest=o)}};function H(t){return typeof t=="function"&&typeof t.$$krateAction=="string"}var S=0;function X(t){let e=Y(t);if(!e)return;let n=globalThis.navigate;typeof n=="function"?n(e):typeof location<"u"&&location.assign(R(e))}function Y(t){return!t||!t.startsWith("/")||t.startsWith("//")||t.includes("\\")||/[\u0000-\u001f\u007f]/.test(t)?"":t}function Z(t){if(typeof window>"u"||typeof CustomEvent>"u")return;let e={paths:t&&Array.isArray(t.paths)?t.paths:[],tags:t&&Array.isArray(t.tags)?t.tags:[]};window.dispatchEvent(new CustomEvent("krate:revalidate",{detail:e}))}function tt(t,e,n){let o=t?t.error:void 0;if(o&&typeof o=="object")return new p(o.message||"Server action failed",e,o.digest);let r=t&&(t.details||(typeof o=="string"?o:""))||n||"Server action failed";return new p(r,e)}async function y(t,e){let n={accept:"application/json","x-krate-action":"fetch"};typeof location<"u"&&(n["x-krate-return"]=location.pathname+location.search);let o,r=e[e.length-1];if(typeof FormData<"u"&&r instanceof FormData){let s=new FormData;r.forEach((u,l)=>{l!==h&&s.append(l,u)});let c=e.slice(0,-1);c.length>0&&s.set(h,JSON.stringify(c)),o=s}else n["content-type"]="application/json",o=JSON.stringify({args:e});let a=await fetch(t,{method:"POST",credentials:"same-origin",headers:n,body:o}),i=null;try{i=await a.json()}catch{i=null}if(!a.ok||!i||i.ok===!1)throw tt(i,a.status,a.statusText);return i.revalidated&&Z(i.revalidation),typeof i.redirect=="string"&&i.redirect&&(S++,X(i.redirect)),i.result}function G(t,e){let n=v()+"/__krate/action/"+t,o=function(...r){return y(n,e.concat(r))};return Object.defineProperty(o,"actionUrl",{value:n}),Object.defineProperty(o,"$$krateAction",{value:t}),Object.defineProperty(o,"$$krateBound",{value:e}),Object.defineProperty(o,"bind",{value:(r,...a)=>G(t,e.concat(a))}),o.toString=()=>n,o}function et(t){return G(t,[])}var f=0,x=new Set;function F(){f++;let t=!1;return()=>{t||(t=!0,f--,f===0&&d(()=>{for(let e of Array.from(x))e()}))}}function nt(){return f>0}var B=t=>{let e=F(),n;try{n=t()}catch(o){return e(),Promise.reject(o)}return Promise.resolve(n).finally(e)},q=B;function ot(t){q=t||B}function b(t){return q(t)}function T(t,e){let n=globalThis;if(typeof n.__krateActionError=="function")try{if(n.__krateActionError(t,e)===!0)return}catch{}let o=e||(typeof document<"u"?document:null),r=!1;if(o&&typeof CustomEvent<"u"){let a=new CustomEvent("krate:action-error",{bubbles:!0,cancelable:!0,detail:{error:t}});r=!o.dispatchEvent(a)}r||console.error("krate server action:",t)}var E=Object.freeze({pending:!1,data:null,method:null,action:null}),w=new WeakMap;function $(t){let e=w.get(t);return e||(e={status:E,subs:new Set,running:0,resetRequested:!1},w.set(t,e)),e}function M(t,e){t.status=e;for(let n of Array.from(t.subs))n(e)}function rt(t,e){let n=null;for(let a=t?t.parentElement:null;a;a=a.parentElement)if(a.tagName==="FORM"){n=a;break}if(!n)return()=>{};let o=$(n),r=a=>{e.status&&e.status(a),e.pending&&e.pending(a.pending),e.data&&e.data(a.data),e.method&&e.method(a.method),e.action&&e.action(a.action)};return o.subs.add(r),r(o.status),()=>{o.subs.delete(r)}}function at(t,e){typeof t=="function"?t(e):t&&typeof t=="object"&&(t.current=e)}function it(t){return w.get(t)?.status||E}function j(t){let e=Array.from(t.querySelectorAll("[data-kattr-value],[data-kattr-checked]")).map(n=>({el:n,value:n.value,checked:n.checked}));t.reset();for(let n of e)n.el.hasAttribute("data-kattr-value")&&(n.el.value=n.value),n.el.hasAttribute("data-kattr-checked")&&(n.el.checked=n.checked)}function st(t){let e=w.get(t);if(e&&e.running>0){e.resetRequested=!0;return}j(t)}function ct(t,e){t&&(t.__krateFormAction=e,t.tagName==="FORM"?(t.removeAttribute("action"),t.removeAttribute("method")):(t.removeAttribute("formaction"),t.removeAttribute("formmethod")),t.removeAttribute("data-krate-action"))}function D(t){if(!t)return null;let e=t.__krateFormAction;if(typeof e!="function")return null;try{return e()}catch{return null}}function ut(t,e){if(e&&e!==t){let o=D(e);if(typeof o=="function")return{fn:o};if(e.hasAttribute("data-krate-action"))return{url:e.formAction||t.action};if(e.hasAttribute("formaction"))return null}let n=D(t);return typeof n=="function"?{fn:n}:t.hasAttribute("data-krate-action")?{url:t.action}:null}function lt(t,e){let n;try{n=e?new FormData(t,e):new FormData(t)}catch{n=new FormData(t);let o=e;o&&o.name&&n.append(o.name,o.value)}return n}function dt(t){let e=t.indexOf("?");return e<0?t:t.slice(0,e)}async function I(t,e,n,o=null,r){let a=$(t),i=(o&&o.getAttribute("formmethod")||t.getAttribute("method")||"get").toLowerCase();a.running++,M(a,{pending:!0,data:n,method:i,action:e||r||null}),t.setAttribute("data-krate-action-pending","1");let s=!1;try{await b(async()=>{let c=e;if(c&&typeof c.__krateRun=="function"){s=await c.__krateRun(n);return}typeof c=="function"?await c(n):r&&await y(dt(r),[n]),s=!0})}catch(c){T(c,t)}finally{a.running--,a.running===0&&(t.removeAttribute("data-krate-action-pending"),d(()=>M(a,E)),(s||a.resetRequested)&&(a.resetRequested=!1,s&&t.hasAttribute("data-krate-reload")?location.reload():j(t)))}return s}function ft(t){let e=t.target;if(!e||e.tagName!=="FORM"||t.defaultPrevented)return;let n=t.submitter||null,o=ut(e,n);if(!o)return;t.preventDefault();let r=lt(e,n);C("submit",!0,()=>{I(e,o.fn,r,n,o.url)})}function N(t=typeof document<"u"?document:void 0){if(!t)return;let e=t.defaultView;!e||e.__krateActionBound||(e.__krateActionBound=!0,t.addEventListener("submit",ft,!1))}function A(t){try{let e=t.split(".")[0].replace(/-/g,"+").replace(/_/g,"/"),n=atob(e+"=".repeat((4-e.length%4)%4));return JSON.parse(decodeURIComponent(escape(n)))}catch{return null}}function W(t){if(typeof document>"u")return{found:!1};let e=/(?:^|;\s*)krate_flash=([^;]*)/.exec(document.cookie||"");if(e){let o=A(e[1]);return o&&o.a===t?(document.cookie="krate_flash=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 GMT; SameSite=Lax",L(t),{found:!0,value:o.r}):{found:!1}}let n=document.querySelectorAll("[data-krate-flash]");for(let o=0;o<n.length;o++){let r=A(n[o].getAttribute("data-krate-flash")||"");if(r&&r.a===t)return L(t),{found:!0,value:r.r}}return{found:!1}}function L(t){let e=document.querySelectorAll("[data-krate-flash]");for(let n=0;n<e.length;n++){let o=A(e[n].getAttribute("data-krate-flash")||"");o&&o.a===t&&e[n].parentNode?.removeChild(e[n])}}function pt(t,e,n,o){let r=[],a=!1;if(H(t)){let u=W(t.$$krateAction);u.found&&n(u.value)}let i=async()=>{for(a=!0;r.length>0;){let u=r.shift(),l=!1;try{let k=S,m=await b(()=>t(e(),u.payload));S===k&&d(()=>n(m)),l=!0}catch(k){let m=r.splice(0);for(let _ of m)_.end(),_.done(!1);T(k)}finally{d(()=>{u.end(),u.done(l)})}}a=!1,d(()=>o(!1))},s=u=>new Promise(l=>{r.push({payload:u,end:F(),done:l}),o(!0),a||i()}),c=(u=>{s(u)});return c.__krateRun=s,c}function wt(t,e,n){let o=[],r=i=>{let s=i;for(let c of o)s=n?n(s,c):c;return s};P(()=>{e(r(t()))});let a=()=>{o.length!==0&&(o=[],e(t()))};return x.add(a),O(()=>{x.delete(a)}),i=>{o.push(i),e(r(t())),f===0&&queueMicrotask(()=>{f===0&&a()})}}typeof document<"u"&&N(document);return z(kt);})();
2
2
  for (const k in __krate_exports) { window[k] = __krate_exports[k]; }
@@ -1,2 +1,2 @@
1
- var __krate_exports=(()=>{var o=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var h=(t,e)=>{for(var n in e)o(t,n,{get:e[n],enumerable:!0})},p=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of l(e))!f.call(t,i)&&i!==n&&o(t,i,{get:()=>e[i],enumerable:!(s=c(e,i))||s.enumerable});return t};var v=t=>p(o({},"__esModule",{value:!0}),t);var P={};h(P,{destroyRouter:()=>w,getHistoryState:()=>y,getNavigationState:()=>a,initRouter:()=>b,invalidatePrefetchCache:()=>u,krateRouter:()=>x,navigate:()=>r,reinitRouter:()=>m,subscribeNavigation:()=>d});function g(){let t=globalThis.__KRATE_CFG__,e=t&&t.basePath||"";return!e||e==="/"?"":"/"+e.replace(/^\/+|\/+$/g,"")}function a(){if(typeof location>"u")return{url:"",pathname:"/",search:"",hash:"",status:"idle"};let t=g(),e=location.pathname;return t&&(e===t||e.startsWith(t+"/"))&&(e=e.slice(t.length)||"/"),{url:location.href,pathname:e,search:location.search,hash:location.hash,status:"idle"}}function d(t){if(typeof window>"u")return()=>{};let e=()=>t(a());return window.addEventListener("hashchange",e),()=>{window.removeEventListener("hashchange",e)}}function y(){return typeof history>"u"?null:history.state}function u(t){}function b(){}function m(){}function w(){}function r(t,e={}){return typeof location>"u"||(e.replace?location.replace(t):location.assign(t)),!0}var x={push(t,e={}){return r(t,{...e,replace:!1}),Promise.resolve()},replace(t,e={}){return r(t,{...e,replace:!0}),Promise.resolve()},back(){typeof history<"u"&&history.back()},forward(){typeof history<"u"&&history.forward()},refresh(){return typeof location<"u"&&location.reload(),Promise.resolve()},prefetch(t){return Promise.resolve()},subscribe:d,getState:a,invalidate:u};typeof window<"u"&&window.addEventListener("krate:revalidate",()=>{typeof location<"u"&&location.reload()});return v(P);})();
1
+ var __krate_exports=(()=>{var n=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var g=(e,t)=>{for(var i in t)n(e,i,{get:t[i],enumerable:!0})},v=(e,t,i,d)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of h(t))!p.call(e,o)&&o!==i&&n(e,o,{get:()=>t[o],enumerable:!(d=l(t,o))||d.enumerable});return e};var b=e=>v(n({},"__esModule",{value:!0}),e);var _={};g(_,{destroyRouter:()=>x,getHistoryState:()=>y,getNavigationState:()=>c,initRouter:()=>m,invalidatePrefetchCache:()=>u,krateRouter:()=>P,navigate:()=>s,reinitRouter:()=>w,subscribeNavigation:()=>f});function r(){let e=globalThis.__KRATE_CFG__,t=e&&e.basePath||"";return!t||t==="/"?"":"/"+t.replace(/^\/+|\/+$/g,"")}function a(e){let t=r();return t&&e.charCodeAt(0)===47&&e.charCodeAt(1)!==47?t+e:e}function c(){if(typeof location>"u")return{url:"",pathname:"/",search:"",hash:"",status:"idle"};let e=r(),t=location.pathname;return e&&(t===e||t.startsWith(e+"/"))&&(t=t.slice(e.length)||"/"),{url:location.href,pathname:t,search:location.search,hash:location.hash,status:"idle"}}function f(e){if(typeof window>"u")return()=>{};let t=()=>e(c());return window.addEventListener("hashchange",t),()=>{window.removeEventListener("hashchange",t)}}function y(){return typeof history>"u"?null:history.state}function u(e){}function m(){}function w(){}function x(){}function s(e,t={}){return typeof location>"u"||(t.replace?location.replace(a(e)):location.assign(a(e))),!0}var P={push(e,t={}){return s(e,{...t,replace:!1}),Promise.resolve()},replace(e,t={}){return s(e,{...t,replace:!0}),Promise.resolve()},back(){typeof history<"u"&&history.back()},forward(){typeof history<"u"&&history.forward()},refresh(){return typeof location<"u"&&location.reload(),Promise.resolve()},prefetch(e){return Promise.resolve()},subscribe:f,getState:c,invalidate:u};typeof window<"u"&&window.addEventListener("krate:revalidate",()=>{typeof location<"u"&&location.reload()});return b(_);})();
2
2
  for (const k in __krate_exports) { window[k] = __krate_exports[k]; }