@krate/runtime 0.5.0-beta.3 → 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.
Files changed (43) hide show
  1. package/dist/actions.js +2 -5
  2. package/dist/base-path.d.ts +7 -0
  3. package/dist/base-path.js +19 -0
  4. package/dist/base-path.test.d.ts +1 -0
  5. package/dist/base-path.test.js +88 -0
  6. package/dist/dev-overlay.js +31 -19
  7. package/dist/dev-overlay.test.js +14 -1
  8. package/dist/dom.d.ts +4 -0
  9. package/dist/dom.js +59 -15
  10. package/dist/dom.test.js +8 -0
  11. package/dist/effect-errors.test.js +37 -1
  12. package/dist/effects.js +41 -8
  13. package/dist/events.d.ts +2 -0
  14. package/dist/events.js +18 -0
  15. package/dist/index.d.ts +5 -0
  16. package/dist/krate-core.js +1 -1
  17. package/dist/krate-dev.js +27 -19
  18. package/dist/krate-f-actions.js +1 -1
  19. package/dist/krate-f-list.js +1 -1
  20. package/dist/krate-f-router-lite.js +1 -1
  21. package/dist/krate-f-router.js +1 -1
  22. package/dist/krate-features.json +1 -0
  23. package/dist/krate-hydrate-lite.js +5 -5
  24. package/dist/krate-hydrate.js +5 -5
  25. package/dist/krate-runtime.js +5 -5
  26. package/dist/krate-suspense.js +1 -1
  27. package/dist/list.js +26 -18
  28. package/dist/list.test.js +91 -0
  29. package/dist/metadata.js +3 -0
  30. package/dist/patterns.test.js +27 -0
  31. package/dist/react-effects.test.js +37 -0
  32. package/dist/router-lite.js +3 -9
  33. package/dist/router-nav.test.js +95 -0
  34. package/dist/router.js +59 -19
  35. package/dist/server-handler.d.ts +1 -0
  36. package/dist/server-handler.js +39 -5
  37. package/dist/server-handler.test.js +46 -0
  38. package/dist/server.js +2 -1
  39. package/dist/signal.js +47 -14
  40. package/dist/slots.test.js +18 -0
  41. package/dist/suspense.js +34 -2
  42. package/dist/suspense.test.js +39 -1
  43. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- var __krate_exports=(()=>{var ce=Object.defineProperty;var at=Object.getOwnPropertyDescriptor;var ct=Object.getOwnPropertyNames;var lt=Object.prototype.hasOwnProperty;var ut=(e,t)=>{for(var n in t)ce(e,n,{get:t[n],enumerable:!0})},ft=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ct(t))!lt.call(e,o)&&o!==n&&ce(e,o,{get:()=>t[o],enumerable:!(r=at(t,o))||r.enumerable});return e};var dt=e=>ft(ce({},"__esModule",{value:!0}),e);var Xt={};ut(Xt,{compareRouteSpecificity:()=>Ve,destroyRouter:()=>Yt,getHistoryState:()=>bt,getNavigationState:()=>He,initRouter:()=>it,invalidatePrefetchCache:()=>ye,krateRouter:()=>Jt,matchRoutePattern:()=>Je,navigate:()=>Vt,pageAssetURLs:()=>Ne,reinitRouter:()=>zt,subscribeNavigation:()=>De});var pe=/\/chunks\/runtime\.[^/]+\.js$/;function te(){return globalThis.__KRATE_CFG__||{}}function me(){let e=te().basePath||"";return!e||e==="/"?"":"/"+e.replace(/^\/+|\/+$/g,"")}function U(e){let t=me();if(t&&(e===t||e.startsWith(t+"/"))){let n=e.slice(t.length);return n===""?"/":n}return e}function fe(e){return e.length>1&&e.endsWith("/")?e.slice(0,-1):e}function K(e){if(te().dev)try{console.warn("[krate router] "+e)}catch{}}function Ce(e,t){if(/^(https?:)?\/\//.test(e)||e.startsWith("/"))return new URL(e,t).href;let n=t;if(!n.endsWith("/")){let r=n.lastIndexOf("/");n=r>0?n.slice(0,r+1):"/"}return new URL(e,n).href}function Ne(e,t,n){let r=new DOMParser().parseFromString(e,"text/html"),o=[],i=new Set,s=c=>{if(!c)return;let a;try{a=Ce(c,t)}catch{return}i.has(a)||n.has(a)||pe.test(a)||(i.add(a),o.push(a))};return r.querySelectorAll("script[src]").forEach(c=>s(c.getAttribute("src"))),r.querySelectorAll('link[rel="modulepreload"][href], link[rel="preload"][as="script"][href]').forEach(c=>s(c.getAttribute("href"))),o}var R=!1,T=0,E,Ae=0,m="",L="",G="idle",F=new Set,S=new Map,O=new Map,ht=30,pt=3e4,A=new Map,mt=50,le=new Set,gt=128,X=new Map,B=new Map,N=null,W=[],yt="_krate/i",vt=150,kt=200;function de(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}function M(){return Ae++,Date.now().toString(36)+"-"+Ae.toString(36)}function ne(e){try{let t=new URL(e,location.href);return t.hash="",t.href}catch{return e}}function _(e){let t=new URL(e,location.href);return fe(t.pathname)+t.search}function $(e,t=!1){let n=globalThis.__krateHardNavigate;if(typeof n=="function"){n(e,t);return}t?location.replace(e):location.assign(e)}function j(e,t){return{__krate:e,state:t===void 0?null:t}}function Q(e){if(e&&typeof e=="object"&&typeof e.__krate=="string")return e.__krate}function bt(){if(typeof history>"u")return null;let e=history.state;return Q(e)!==void 0?e.state:e}function Me(){let e=new URL(location.href);return{url:e.href,pathname:U(e.pathname),search:e.search,hash:e.hash,status:G}}function He(){return typeof location>"u"?{url:"",pathname:"/",search:"",hash:"",status:"idle"}:Me()}function re(){if(F.size===0)return;let e=Me();for(let t of Array.from(F))try{t(e)}catch(n){console.error(n)}}function H(e){G!==e&&(G=e,re())}function De(e){return F.add(e),()=>{F.delete(e)}}function k(e,t,n=!1){try{let r=new CustomEvent(e,{detail:t,cancelable:n});return window.dispatchEvent(r),!r.defaultPrevented}catch{return!0}}function ge(e){try{let t=globalThis.__krate_onNavigation;typeof t=="function"&&t(e)}catch{}}function V(e){if(e){if(A.delete(e),A.size>=mt){let t=A.keys().next().value;t!==void 0&&A.delete(t)}A.set(e,window.scrollY||0)}}function Ue(){let e=te().prefetchTTL;return typeof e=="number"&&e>=0?e:pt}function wt(e,t){for(S.delete(e);S.size>=ht;){let n=S.keys().next().value;if(n===void 0)break;S.delete(n)}S.set(e,t)}function Et(e){let t=S.get(e);if(t&&(S.delete(e),!(de()-t.at>Ue())))return t}function ye(e){if(e===void 0){S.clear();return}S.delete(ne(e))}function ve(e){return/text\/html|application\/xhtml\+xml/i.test(e)}function J(e){return/^\s*(<!doctype html|<html|<head|<body)/i.test(e)}function St(e){if(le.has(e)||le.size>=gt)return;le.add(e);let t=document.createElement("link");t.rel="prefetch",t.as="script",t.href=e,document.head.appendChild(t)}function ke(e){let t=ne(e),n=S.get(t);if(n&&de()-n.at<=Ue())return Promise.resolve();let r=O.get(t);if(r)return r;let o=fetch(t,{headers:{Accept:"text/html"},credentials:"same-origin"}).then(async i=>{if(!i.ok)return;let s=i.headers.get("content-type")||"",c=i.url||t;if(new URL(c,location.href).origin!==location.origin)return;let a=await i.text();if(!(ve(s)||s===""&&J(a)))return;wt(t,{html:a,url:c,status:i.status,at:de()});let u=new Set;document.querySelectorAll("script[src]").forEach(l=>u.add(l.src));for(let l of Ne(a,c,u))St(l)}).catch(()=>{}).finally(()=>{O.delete(t)});return O.set(t,o),o}function be(e){if(e.hasAttribute("data-krate-external")||e.hasAttribute("download"))return!1;let t=e.getAttribute("href");if(!t||t.startsWith("javascript:"))return!1;let n;try{n=new URL(t,location.href)}catch{return!1}if(n.origin!==location.origin)return!1;let r=e.getAttribute("target");return!(r&&r!=="_self")}function we(e){let t=e.getAttribute("data-prefetch");return e.hasAttribute("data-prefetch")&&t!=="false"&&t!=="0"}function Lt(e){let t=window.requestIdleCallback;typeof t=="function"?t(e,{timeout:1e3}):setTimeout(e,50)}function Z(e){let t=e.target;if(!t||typeof t.closest!="function")return;let n=t.closest("a[data-prefetch]");if(!n||!we(n)||!be(n))return;let r=n.getAttribute("href");if(!r)return;let o=new URL(r,location.href).href;if(_(o)===L)return;let i=B.get(n);i&&clearTimeout(i);let s=setTimeout(()=>{B.delete(n),ke(o)},kt);B.set(n,s)}function Ie(){N&&document.querySelectorAll("a[data-prefetch]").forEach(e=>{we(e)&&N.observe(e)})}function At(){document.addEventListener("mouseover",Z),document.addEventListener("focusin",Z),typeof IntersectionObserver<"u"&&(N=new IntersectionObserver(e=>{for(let t of e){if(!t.isIntersecting)continue;let n=t.target,r=n.getAttribute("href");if(r&&be(n)&&we(n)){let o=new URL(r,location.href).href;_(o)!==L&&Lt(()=>{ke(o)})}N.unobserve(t.target)}},{rootMargin:"200px"}),Ie())}function Tt(){let e=typeof HTMLScriptElement<"u"?HTMLScriptElement.supports:void 0;if(!(typeof e!="function"||!e("speculationrules"))&&!document.querySelector('meta[http-equiv="Content-Security-Policy" i]'))try{let t=document.createElement("script");t.type="speculationrules",t.textContent=JSON.stringify({prefetch:[{where:{and:[{href_matches:"/*"},{not:{href_matches:"/__krate/*"}},{not:{href_matches:"/api/*"}}]},eagerness:"moderate"}]}),document.head.appendChild(t)}catch{}}function Ke(){if(typeof window<"u"&&window.matchMedia)try{return window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{}return!1}function Oe(){return te().viewTransitions===!1||Ke()?!1:typeof document.startViewTransition=="function"}function b(e){return e.getElementById("root")||e.body}function Rt(){let e=document.querySelector("template[data-krate-loading]");if(e&&e.content&&W.length===0){let t=e.content.cloneNode(!0);W=Array.from(t.childNodes),document.body.appendChild(t)}if(!Oe()&&!Ke()){let t=b(document);t.style.transition=`opacity ${vt}ms ease`,t.style.opacity="0"}}function Be(){for(let t of W)t.parentNode&&t.parentNode.removeChild(t);W=[];let e=b(document);e.style.opacity==="0"&&(e.style.opacity="")}function Fe(e){e.querySelectorAll("[data-view-transition]").forEach(t=>{let n=t.getAttribute("data-view-transition");n&&(t.style.viewTransitionName=n);let r=t.getAttribute("data-view-transition-class");r&&t.style.setProperty("view-transition-class",r)})}var _t=3e3;function xt(e,t){let n=[];e.querySelectorAll('link[rel="stylesheet"]').forEach(u=>{let l=u.getAttribute("href");if(!l)return;let p=new URL(l,t).href;n.includes(p)||n.push(p)});let r=new Map,o=[];document.querySelectorAll('link[rel="stylesheet"]').forEach(u=>{let l=u;l.href&&(n.includes(l.href)&&!r.has(l.href)?r.set(l.href,l):o.push(l))});let i=[],s=[],c=null;n.forEach((u,l)=>{let p=r.get(u)||null;if(!p){let h=document.createElement("link");if(h.rel="stylesheet",h.href=u,s.push(new Promise(g=>{let f=()=>{h.removeEventListener("load",f),h.removeEventListener("error",f),g()};h.addEventListener("load",f),h.addEventListener("error",f)})),i.push({link:h,media:h.getAttribute("media")}),h.media="not all",c)c.after(h);else{let g=n.slice(l+1).map(f=>r.get(f)).find(f=>!!f);g?g.before(h):document.head.appendChild(h)}p=h}c=p});let a=Promise.resolve();if(s.length>0){let u,l=new Promise(p=>{u=setTimeout(p,_t)});a=Promise.race([Promise.all(s).then(()=>{}),l]).then(()=>clearTimeout(u))}return{ready:a,commit(){for(let{link:u,media:l}of i)l===null?u.removeAttribute("media"):u.setAttribute("media",l);o.forEach(u=>u.remove())},abort(){i.forEach(({link:u})=>u.remove())}}}var Te='meta[name="description"], meta[name="robots"], meta[property^="og:"], meta[name^="twitter:"], link[rel="canonical"], script[type="application/ld+json"]';function Pt(e){document.head.querySelectorAll(Te).forEach(t=>t.remove()),e.head.querySelectorAll(Te).forEach(t=>{document.head.appendChild(document.importNode(t,!0))})}function We(e,t){let n=new Set;document.querySelectorAll("script[src]:not([data-krate-spa])").forEach(i=>n.add(i.src));let r=[],o=new Set;return e.querySelectorAll("script[src]").forEach(i=>{let s=i.getAttribute("src");if(!s)return;let c=(i.getAttribute("type")||"").toLowerCase();if(c&&c!=="module"&&c!=="text/javascript"&&c!=="application/javascript")return;let a=Ce(s,t);!n.has(a)&&!o.has(a)&&(o.add(a),r.push({src:a,module:c==="module"}))}),r}function $e(e){return new Promise(t=>{let n=document.createElement("script");n.src=e.src,e.module&&(n.type="module"),pe.test(e.src)||n.setAttribute("data-krate-spa",""),n.onload=()=>t(!0),n.onerror=()=>t(!1),document.body.appendChild(n)})}function Ct(e){if(!e||e==="#")return null;let t=e.slice(1);try{t=decodeURIComponent(t)}catch{}return document.getElementById(t)||document.getElementsByName(t)[0]||null}function Ee(e){let t=Ct(e);if(!t)return!1;try{t.scrollIntoView({block:"start"})}catch{}return!0}function Nt(e,t){if(t.kind==="pop"){let r=t.restoreKey?A.get(t.restoreKey):void 0;if(r!==void 0){window.scrollTo(0,r);return}}let n=new URL(e,location.href).hash;Ee(n)||t.scroll&&t.kind!=="refresh"&&window.scrollTo(0,0)}var Y=null;function Mt(){let e=document.activeElement;if(e&&e!==document.body&&e.isConnected&&e!==Y)return;let t=b(document);t.hasAttribute("tabindex")||(t.setAttribute("tabindex","-1"),Y=t,t.addEventListener("blur",()=>{Y===t&&(t.removeAttribute("tabindex"),Y=null)},{once:!0}));try{t.focus({preventScroll:!0})}catch{}}var Re="__krate-route-announcer";function Ht(){let e=document.getElementById(Re);e||(e=document.createElement("div"),e.id=Re,e.setAttribute("aria-live","assertive"),e.setAttribute("aria-atomic","true"),e.setAttribute("role","status"),e.setAttribute("style","position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0"),document.body.appendChild(e));let t=b(document).querySelector("h1"),n=document.title||(t&&t.textContent?t.textContent.trim():"")||U(location.pathname);e.textContent=n}function oe(){let e=fe(U(location.pathname));document.querySelectorAll("a[data-krate-link]").forEach(t=>{let n=t.getAttribute("href"),r="";try{r=n?fe(U(new URL(n,location.href).pathname)):""}catch{r=""}let o="";r&&r===e?o="exact":r&&r!=="/"&&e.startsWith(r+"/")&&(o="segment"),o==="exact"?t.setAttribute("aria-current","page"):t.removeAttribute("aria-current"),o?t.setAttribute("data-krate-active",o):t.removeAttribute("data-krate-active")})}function _e(e){let t=me()+e;return X.has(t)?Promise.resolve(X.get(t)??null):fetch(t,{headers:{Accept:"text/html"},credentials:"same-origin"}).then(async n=>{let r=n.ok?await n.text():null,o=r&&J(r)?r:null;return X.set(t,o),o}).catch(()=>null)}async function Dt(e,t){let n=ne(e.url);if(!e.bypassCache){let p=O.get(n);if(p&&await p,t.aborted)return{ok:!1,aborted:!0};let h=Et(n);if(h){let g=new URL(e.url,location.href).hash,f=g&&!new URL(h.url,location.href).hash?h.url+g:h.url;return{ok:!0,doc:{html:h.html,url:f,status:h.status}}}}let r;try{r=await fetch(n,{headers:{Accept:"text/html"},credentials:"same-origin",signal:t,cache:e.bypassCache?"no-cache":"default"})}catch(p){return p?.name==="AbortError"||t.aborted?{ok:!1,aborted:!0}:k("krate:navigate-error",{url:e.url,status:0,error:p},!0)?{ok:!1,hard:e.url}:{ok:!1,aborted:!0}}let o=r.url||n;if(new URL(o,location.href).origin!==location.origin)return{ok:!1,hard:o};let i=r.headers.get("content-type")||"",s="";try{s=await r.text()}catch(p){if(p?.name==="AbortError"||t.aborted)return{ok:!1,aborted:!0};s=""}if(t.aborted)return{ok:!1,aborted:!0};let c=ve(i)||i===""&&J(s),a=new URL(e.url,location.href).hash,u=a&&!new URL(o).hash?o+a:o;if(r.ok)return c?{ok:!0,doc:{html:s,url:u,status:r.status}}:{ok:!1,hard:u};if(k("krate:navigate-error",{url:e.url,status:r.status}),c&&J(s))return{ok:!0,doc:{html:s,url:u,status:r.status}};let l=null;return r.status===404||r.status===410?l=await _e("/404.html"):r.status>=500&&(l=await _e("/500.html")),t.aborted?{ok:!1,aborted:!0}:l?{ok:!0,doc:{html:l,url:u,status:r.status}}:{ok:!1,hard:u}}async function ie(e){let t=location.href;if(e.kind!=="pop"){if(!k("krate:navigate-start",{url:e.url,from:t,kind:e.kind},!0))return}else k("krate:navigate-start",{url:e.url,from:t,kind:e.kind});let n=++T;E&&E.abort();let r=new AbortController;E=r,H("loading"),!e.bypassCache&&S.has(ne(e.url))||Rt();let i;try{i=await Dt(e,r.signal)}finally{E===r&&(E=void 0)}if(n===T){if(!i.ok){Be(),H("idle"),"hard"in i&&$(i.hard,e.kind==="replace"||e.kind==="refresh");return}await Ut(i.doc,e,n)}}async function Ut(e,t,n){let r=new DOMParser().parseFromString(e.html,"text/html"),o=e.url,i=b(r),s=b(document);t.kind==="push"&&V(m);let c=je(r),a=Bt(P,c,location.href,o,r),u=xt(r,o);if(await u.ready,n!==T){u.abort();return}if(await It(()=>{let g=r.querySelector("title");g&&(document.title=g.textContent||"");let f=globalThis;if(a.keep.length>0&&typeof f.krateDisposeExcept=="function"?f.krateDisposeExcept(a.keep):typeof f.disposeAll=="function"&&f.disposeAll(),a.region){let{live:v,next:d}=a.region;q(v[0],v[1]);let w=D(d[0],d[1]).map(y=>document.importNode(y,!0));for(let y of w)v[1].parentNode.insertBefore(y,v[1]);for(let y of a.slots){q(y.live[0],y.live[1]);for(let I of D(y.next[0],y.next[1]))y.live[1].parentNode.insertBefore(document.importNode(I,!0),y.live[1])}Kt(s,i)}else{let v=Array.from(i.childNodes).map(d=>document.importNode(d,!0));s.replaceChildren(...v)}P=a.chain,z.clear(),u.commit(),Pt(r),Fe(document)}),n!==T)return;Be(),t.kind==="push"?(m=M(),history.pushState(j(m,t.state),"",o)):t.kind==="replace"?(A.delete(m),m=M(),history.replaceState(j(m,t.state),"",o)):t.kind==="refresh"?o!==location.href&&history.replaceState(history.state,"",o):t.restoreKey&&(m=t.restoreKey),L=_(location.href),C=L,Ye(r),Ft(r),Nt(o,t),t.kind!=="pop"&&t.kind!=="refresh"&&Mt(),t.kind!=="refresh"&&Ht(),oe(),k("krate:navigate",{url:location.href,status:e.status}),ge(location.href),H("idle"),document.querySelectorAll("script[data-krate-spa]").forEach(g=>g.remove());let p=We(r,o);Pe(a.skip);let h=await Promise.all(p.map($e));if(Pe([]),n===T){if(h.some(g=>!g)){k("krate:navigate-error",{url:location.href,status:e.status,error:"script-load"}),$(location.href,!0);return}ee(),k("krate:navigate-end",{url:location.href,status:e.status})}}function It(e){if(!Oe())return e(),Promise.resolve();let t=!1,n=()=>{t||(t=!0,e())};try{let r=document.startViewTransition(n);r&&r.finished&&typeof r.finished.catch=="function"&&r.finished.catch(()=>{});let o=r&&r.updateCallbackDone;if(o&&typeof o.then=="function")return o.then(()=>n(),()=>n())}catch{}return n(),Promise.resolve()}var P=[];function je(e){let t=e.getElementById("__krate_route");if(!t)return[];try{let n=JSON.parse(t.textContent||"{}");return Array.isArray(n.chain)?n.chain:[]}catch{return K("unreadable #__krate_route route info; layouts will be remounted"),[]}}function xe(e,t){let n=U(new URL(e,location.href).pathname).split("/").filter(Boolean);return(t<0?n:n.slice(0,t)).join("/")}function x(e,t,n="kl:"){let o=(e.ownerDocument||e).createTreeWalker(e,128),i=n+t,s="/"+n+t;for(;o.nextNode();){let c=o.currentNode;if(c.nodeValue===i){for(let a=c.nextSibling;a;a=a.nextSibling)if(a.nodeType===8&&a.nodeValue===s)return[c,a];return null}}return null}function D(e,t){let n=[];for(let r=e.nextSibling;r&&r!==t;r=r.nextSibling)n.push(r);return n}function q(e,t){let n=globalThis.disposeNode;for(let r of D(e,t))r.parentNode.removeChild(r),typeof n=="function"&&n(r)}function Kt(e,t){let n=":scope > template[data-krate-loading]";e.querySelectorAll(n).forEach(r=>r.remove()),t.querySelectorAll(n).forEach(r=>e.appendChild(document.importNode(r,!0)))}function Pe(e){let t=globalThis.krateKeepScopes;typeof t=="function"&&t(e)}function Ot(e){let t=globalThis.krateScopeFailed;return typeof t=="function"&&!!t(e)}function Bt(e,t,n,r,o){let i={keep:[],skip:[],region:null,slots:[],chain:t},s=0;for(;s<e.length&&s<t.length;){let f=e[s],v=t[s];if(f.id!==v.id||f.k!==v.k||f.k!=="layout"&&f.k!=="error"||xe(n,f.d)!==xe(r,v.d)||f.k==="error"&&Ot(f.id))break;if(!f.p||!v.p){K(`layout ${v.f||v.id} is remounted on this navigation: ${v.why||f.why||"not persistable"}`);break}s++}if(s===0)return i;if(typeof globalThis.krateDisposeExcept!="function")return K("the runtime has no krateDisposeExcept; layouts are remounted"),i;let c=t[s-1].id,a=x(b(document),c),u=x(b(o),c);if(!a||!u)return K(`layout ${t[s-1].f||c} boundary markers are missing; the whole page is swapped`),i;let l=e.slice(0,s).map(f=>f.id),p=l.slice(),h=[],g=t.slice();for(let f=0;f<s;f++){let v=e[f].s||[],d=[];for(let w of t[f].s||[]){let y=v.find(st=>st.key===w.key),I=x(b(document),w.key,"ks:"),ae=x(b(o),w.key,"ks:");if(y&&I&&(w.src!=="page"||!ae)){l.push(y.scope),p.push(y.scope,w.scope),d.push({...w,scope:y.scope,src:y.src});continue}if(I&&ae){h.push({live:I,next:ae}),d.push(w);continue}return K(`slot @${w.n} markers are missing; the whole page is swapped`),i}g[f]={...t[f],s:d}}return{keep:l,skip:p,region:{live:a,next:u},slots:h,chain:g}}var z=new Map,C="";function he(e){let t=e.replace(/^\/+|\/+$/g,"");return t?t.split("/").map(n=>n.startsWith("[[...")&&n.endsWith("]]")?{kind:3,text:n.slice(5,-2)}:n.startsWith("[...")&&n.endsWith("]")?{kind:2,text:n.slice(4,-1)}:n.startsWith("[")&&n.endsWith("]")?{kind:1,text:n.slice(1,-1)}:{kind:0,text:n}):[]}function Je(e,t){let n=he(t),r=e.replace(/^\/+|\/+$/g,""),o=r?r.split("/"):[],i={};for(let s=0;s<n.length;s++){let c=n[s];if(c.kind>=2){if(s!==n.length-1)return null;let a=o.slice(s);return c.kind===2&&a.length===0||a.some(u=>u==="")?null:(i[c.text]=a.map(ue).join("/"),i)}if(s>=o.length)return null;if(c.kind===1){if(!o[s])return null;i[c.text]=ue(o[s])}else if(ue(o[s])!==c.text)return null}return o.length===n.length?i:null}function ue(e){try{return decodeURIComponent(e)}catch{return e}}function Ve(e,t){let n=he(e),r=he(t);for(let o=0;o<n.length&&o<r.length;o++){if(n[o].kind!==r[o].kind)return n[o].kind-r[o].kind;if(n[o].kind===0&&n[o].text!==r[o].text)return n[o].text<r[o].text?-1:1}return n.length!==r.length?r.length-n.length:e<t?-1:e>t?1:0}function Se(e){let t=U(new URL(e,location.href).pathname).replace(/^\/+|\/+$/g,""),n=null;for(let r of P)for(let o of r.s||[])for(let i of o.i||[])Je(t,i)&&(!n||Ve(i,n.pattern)<0)&&(n={hit:{entry:r,slot:o,path:t},pattern:i});return n&&!x(b(document),n.hit.slot.key,"ks:")?null:n?n.hit:null}function ze(e,t){P=P.map(n=>n.s&&n.s.some(r=>r.key===e)?{...n,s:n.s.map(r=>r.key===e?t:r)}:n)}function Ye(e){let t="",n=e.getElementById("__krate_page");if(n)try{let r=JSON.parse(n.textContent||"{}");typeof r.r=="string"&&(t=r.r)}catch{}globalThis.__KRATE_ROUTE__=t;for(let r of Array.from(e.querySelectorAll("script:not([src])"))){let o=/window\.__KRATE_PARAMS__\s*=\s*(\{[\s\S]*?\})\s*;?\s*$/.exec(r.textContent||"");if(o){try{globalThis.__KRATE_PARAMS__=JSON.parse(o[1])}catch{}return}}delete globalThis.__KRATE_PARAMS__}function Ft(e){let t=e.getElementById("__krate_error"),n=document.getElementById("__krate_error");if(!t){n&&n.remove();return}let r=document.importNode(t,!0);n?n.replaceWith(r):document.head.appendChild(r)}function Xe(e){let t=globalThis.krateDisposeScopes;typeof t=="function"&&t(e)}async function Le(e,t){let n=location.href;if(e.kind!=="pop"&&!k("krate:navigate-start",{url:e.url,from:n,kind:e.kind,intercept:t.slot.n},!0))return;let r=++T;E&&E.abort();let o=new AbortController;E=o,H("loading");let i=location.origin+me()+"/"+yt+"/"+t.slot.key+(t.path?"/"+t.path:""),s="",c=!1;try{let d=await fetch(i,{headers:{Accept:"text/html"},credentials:"same-origin",signal:o.signal,cache:e.bypassCache?"no-cache":"default"});s=await d.text(),c=d.ok&&(ve(d.headers.get("content-type")||"")||J(s)),c||k("krate:navigate-error",{url:e.url,status:d.status,intercept:t.slot.n})}catch(d){if(d?.name==="AbortError"||o.signal.aborted)return;k("krate:navigate-error",{url:e.url,status:0,error:d,intercept:t.slot.n})}finally{E===o&&(E=void 0)}if(r!==T)return;let a=c?new DOMParser().parseFromString(s,"text/html"):null,u=a?x(b(a),t.slot.key,"ks:"):null,l=x(b(document),t.slot.key,"ks:"),p=null;try{let d=a&&a.getElementById("__krate_route");p=d&&JSON.parse(d.textContent||"{}").frag||null}catch{p=null}if(!a||!u||!l||!p||p.key!==t.slot.key||!p.scope){try{console.warn(`[krate router] intercepting route for ${e.url} (slot @${t.slot.n}) could not be loaded; navigating to the page`)}catch{}return H("idle"),ie({...e})}if(e.kind==="push"&&V(m),t.slot.src!=="intercept"){z.set(m,{key:t.slot.key,nodes:D(l[0],l[1]),slot:t.slot,path:C});for(let d of D(l[0],l[1]))d.parentNode.removeChild(d)}else Xe([t.slot.scope]),q(l[0],l[1]);for(let d of D(u[0],u[1]))l[1].parentNode.insertBefore(document.importNode(d,!0),l[1]);let h=new Set;document.querySelectorAll('link[rel="stylesheet"]').forEach(d=>h.add(d.href)),a.querySelectorAll('link[rel="stylesheet"][href]').forEach(d=>{let w=new URL(d.getAttribute("href"),i).href;if(h.has(w))return;let y=document.createElement("link");y.rel="stylesheet",y.href=w,document.head.appendChild(y)}),ze(t.slot.key,{...t.slot,scope:p.scope,src:"intercept"});let g={__krate:"",state:e.state===void 0?null:e.state,__kint:{key:t.slot.key,base:C}};e.kind==="push"?(m=M(),g.__krate=m,history.pushState(g,"",e.url)):e.kind==="replace"?(m=M(),g.__krate=m,history.replaceState(g,"",e.url)):e.kind==="pop"&&e.restoreKey&&(m=e.restoreKey),L=_(location.href),Ye(a),oe(),k("krate:navigate",{url:location.href,status:200,intercept:t.slot.n}),ge(location.href),H("idle");let f=We(a,i),v=await Promise.all(f.map($e));if(r===T){if(v.some(d=>!d)){k("krate:navigate-error",{url:location.href,status:200,error:"script-load",intercept:t.slot.n}),$(location.href,!0);return}ee(),k("krate:navigate-end",{url:location.href,status:200,intercept:t.slot.n})}}function Wt(e,t){let n=x(b(document),e.key,"ks:"),r=P.flatMap(i=>i.s||[]).find(i=>i.key===e.key);if(!n||!r||r.src!=="intercept")return!1;Xe([r.scope]),q(n[0],n[1]);for(let i of e.nodes)n[1].parentNode.insertBefore(i,n[1]);ze(e.key,e.slot),z.delete(t),m=t,L=_(location.href);let o=A.get(t);return o!==void 0&&window.scrollTo(0,o),oe(),k("krate:navigate",{url:location.href,status:200}),ge(location.href),re(),!0}function $t(e){return _(e)===L}function jt(e,t){V(m),(e!==location.href||t.state!==void 0)&&(t.kind==="replace"?history.replaceState(j(m||M(),t.state),"",e):(m=M(),history.pushState(j(m,t.state),"",e)));let n=new URL(e).hash;!Ee(n)&&t.scroll&&!n&&window.scrollTo(0,0),re()}function se(e){let t;try{t=new URL(e.url,location.href)}catch{return $(e.url),Promise.resolve()}if(t.origin!==location.origin)return $(t.href,e.kind==="replace"),Promise.resolve();if(e.url=t.href,(e.kind==="push"||e.kind==="replace")&&$t(t.href)&&(t.hash||t.href===location.href))return jt(t.href,e),Promise.resolve();if(e.kind==="push"||e.kind==="replace"){let n=Se(t.href);if(n)return Le(e,n)}return ie(e)}function Ge(e){if(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=e.target;if(!t||typeof t.closest!="function")return;let n=t.closest("a[data-krate-link]");if(!n||!be(n))return;let r=n.getAttribute("href");r&&(e.preventDefault(),se({url:new URL(r,location.href).href,kind:n.hasAttribute("data-krate-replace")?"replace":"push",scroll:n.getAttribute("data-krate-scroll")!=="false"}))}function Qe(e){if(e.defaultPrevented)return;let t=e.target;if(!t||t.tagName!=="FORM"||t.hasAttribute("data-krate-reload"))return;let n=e.submitter||null;if((n&&n.getAttribute("formmethod")||t.getAttribute("method")||"get").toLowerCase()!=="get")return;let o=n&&n.getAttribute("formtarget")||t.getAttribute("target");if(o&&o!=="_self")return;let i=n&&n.getAttribute("formaction")||t.getAttribute("action")||"",s;try{s=new URL(i||location.href,location.href)}catch{return}if(s.origin!==location.origin||s.protocol.indexOf("http")!==0)return;let c;try{c=n?new FormData(t,n):new FormData(t)}catch{c=new FormData(t),n&&n.name&&c.append(n.name,n.value)}let a=new URLSearchParams;for(let[u,l]of c.entries()){if(typeof l!="string")return;a.append(u,l)}e.preventDefault(),s.search=a.toString(),s.hash="",se({url:s.href,kind:"push",scroll:!0})}function Ze(e){V(m);let t=Q(e.state),n=location.href;if(_(n)===L){m=t||m;let i=t?A.get(t):void 0;i!==void 0?window.scrollTo(0,i):Ee(location.hash),re();return}let r=t?z.get(t):void 0;if(r&&t&&r.path===_(n)&&r.path===C&&Wt(r,t))return;let o=e.state&&typeof e.state=="object"?e.state.__kint:null;if(o&&o.base===C){let i=Se(n);if(i&&i.slot.key===o.key){Le({url:n,kind:"pop",scroll:!1,restoreKey:t},i);return}}ie({url:n,kind:"pop",scroll:!0,restoreKey:t})}function qe(){ye(),nt()}function et(){V(m);try{history.scrollRestoration="auto"}catch{}}function tt(){try{history.scrollRestoration="manual"}catch{}}function ee(){Ie(),oe(),Fe(document),document.querySelectorAll("script[src]").forEach(e=>{pe.test(e.src)||e.setAttribute("data-krate-spa","")})}function nt(){if(!R||typeof location>"u")return typeof location<"u"&&location.reload(),Promise.resolve();if(L!==C){let e=Se(location.href);if(e&&e.slot.src==="intercept")return Le({url:location.href,kind:"refresh",scroll:!1,bypassCache:!0},e)}return ie({url:location.href,kind:"refresh",scroll:!1,bypassCache:!0})}function rt(e,t={}){return R?se({url:e,kind:"push",scroll:t.scroll!==!1,state:t.state}):(typeof location<"u"&&location.assign(e),Promise.resolve())}function ot(e,t={}){return R?se({url:e,kind:"replace",scroll:t.scroll!==!1,state:t.state}):(typeof location<"u"&&location.replace(e),Promise.resolve())}var Jt={push:rt,replace:ot,back(){typeof history<"u"&&history.back()},forward(){typeof history<"u"&&history.forward()},refresh:nt,prefetch(e){if(!R||typeof location>"u")return Promise.resolve();let t;try{t=new URL(e,location.href)}catch{return Promise.resolve()}return t.origin!==location.origin?Promise.resolve():ke(t.href)},subscribe:De,getState:He,invalidate:ye};function Vt(e,t={}){return R?(t.replace?ot(e,t):rt(e,t),!1):(typeof location<"u"&&(t.replace?location.replace(e):location.assign(e)),!0)}function it(){if(!(typeof document>"u")){if(R){ee();return}if(R=!0,L=_(location.href),P=je(document),C=L,m=Q(history.state)||M(),Q(history.state)===void 0)try{history.replaceState(j(m,history.state),"",location.href)}catch{}try{history.scrollRestoration="manual"}catch{}document.addEventListener("click",Ge),document.addEventListener("submit",Qe),window.addEventListener("popstate",Ze),window.addEventListener("krate:revalidate",qe),window.addEventListener("pagehide",et),window.addEventListener("pageshow",tt),At(),Tt(),ee()}}function zt(){it()}function Yt(){if(R){R=!1,document.removeEventListener("click",Ge),document.removeEventListener("submit",Qe),window.removeEventListener("popstate",Ze),window.removeEventListener("krate:revalidate",qe),window.removeEventListener("pagehide",et),window.removeEventListener("pageshow",tt),document.removeEventListener("mouseover",Z),document.removeEventListener("focusin",Z);for(let e of B.values())clearTimeout(e);B=new Map,N&&(N.disconnect(),N=null),E&&E.abort(),E=void 0,T++,S.clear(),O.clear(),A.clear(),X.clear(),F.clear(),G="idle",W=[],P=[],z.clear(),C=""}}return dt(Xt);})();
1
+ var __krate_exports=(()=>{var ut=Object.defineProperty;var fe=Object.getOwnPropertyDescriptor;var de=Object.getOwnPropertyNames;var he=Object.prototype.hasOwnProperty;var pe=(t,e)=>{for(var n in e)ut(t,n,{get:e[n],enumerable:!0})},me=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of de(e))!he.call(t,o)&&o!==n&&ut(t,o,{get:()=>e[o],enumerable:!(r=fe(e,o))||r.enumerable});return t};var ge=t=>me(ut({},"__esModule",{value:!0}),t);var qe={};pe(qe,{compareRouteSpecificity:()=>Xt,destroyRouter:()=>Ze,getHistoryState:()=>Ae,getNavigationState:()=>It,initRouter:()=>le,invalidatePrefetchCache:()=>kt,krateRouter:()=>Xe,matchRoutePattern:()=>Yt,navigate:()=>Ge,pageAssetURLs:()=>Dt,reinitRouter:()=>Qe,subscribeNavigation:()=>Kt});function I(){let t=globalThis.__KRATE_CFG__,e=t&&t.basePath||"";return!e||e==="/"?"":"/"+e.replace(/^\/+|\/+$/g,"")}function P(t){let e=I();return e&&t.charCodeAt(0)===47&&t.charCodeAt(1)!==47?e+t:t}var gt=/\/chunks\/runtime\.[^/]+\.js$/;function yt(){return globalThis.__KRATE_CFG__||{}}function O(t){let e=I();if(e&&(t===e||t.startsWith(e+"/"))){let n=t.slice(e.length);return n===""?"/":n}return t}function ht(t){return t.length>1&&t.endsWith("/")?t.slice(0,-1):t}function F(t){if(yt().dev)try{console.warn("[krate router] "+t)}catch{}}function Ht(t,e){if(/^(https?:)?\/\//.test(t)||t.startsWith("/"))return new URL(t,e).href;let n=e;if(!n.endsWith("/")){let r=n.lastIndexOf("/");n=r>0?n.slice(0,r+1):"/"}return new URL(t,n).href}function Dt(t,e,n){let r=new DOMParser().parseFromString(t,"text/html"),o=[],i=new Set,s=c=>{if(!c)return;let a;try{a=Ht(c,e)}catch{return}i.has(a)||n.has(a)||gt.test(a)||(i.add(a),o.push(a))};return r.querySelectorAll("script[src]").forEach(c=>s(c.getAttribute("src"))),r.querySelectorAll('link[rel="modulepreload"][href], link[rel="preload"][as="script"][href]').forEach(c=>s(c.getAttribute("href"))),o}var R=!1,T=0,k,Rt=0,m="",A="",$="idle",j=new Set,S=new Map,_=new Map,ye=30,ve=3e4,L=new Map,ke=50,ft=new Set,be=128,Z=new Map,W=new Map,H=null,J=[],we="_krate/i",Ee=150,Se=200;function pt(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}function U(){return Rt++,Date.now().toString(36)+"-"+Rt.toString(36)}function ot(t){try{let e=new URL(t,location.href);return e.hash="",e.href}catch{return t}}function x(t){let e=new URL(t,location.href);return ht(e.pathname)+e.search}function V(t,e=!1){let n=globalThis.__krateHardNavigate;if(typeof n=="function"){n(t,e);return}e?location.replace(t):location.assign(t)}function z(t,e){return{__krate:t,state:e===void 0?null:e}}function q(t){if(t&&typeof t=="object"&&typeof t.__krate=="string")return t.__krate}function Ae(){if(typeof history>"u")return null;let t=history.state;return q(t)!==void 0?t.state:t}function Ut(){let t=new URL(location.href);return{url:t.href,pathname:O(t.pathname),search:t.search,hash:t.hash,status:$}}function It(){return typeof location>"u"?{url:"",pathname:"/",search:"",hash:"",status:"idle"}:Ut()}function it(){if(j.size===0)return;let t=Ut();for(let e of Array.from(j))try{e(t)}catch(n){console.error(n)}}function D(t){$!==t&&($=t,it())}function Kt(t){return j.add(t),()=>{j.delete(t)}}function b(t,e,n=!1){try{let r=new CustomEvent(t,{detail:e,cancelable:n});return window.dispatchEvent(r),!r.defaultPrevented}catch{return!0}}function vt(t){try{let e=globalThis.__krate_onNavigation;typeof e=="function"&&e(t)}catch{}}function X(t){if(t){if(L.delete(t),L.size>=ke){let e=L.keys().next().value;e!==void 0&&L.delete(e)}L.set(t,window.scrollY||0)}}function Ot(){let t=yt().prefetchTTL;return typeof t=="number"&&t>=0?t:ve}function Le(t,e){for(S.delete(t);S.size>=ye;){let n=S.keys().next().value;if(n===void 0)break;S.delete(n)}S.set(t,e)}function Te(t){let e=S.get(t);if(e&&(S.delete(t),!(pt()-e.at>Ot())))return e}function kt(t){if(t===void 0){S.clear(),_.clear();return}let e=ot(t);S.delete(e),_.delete(e)}function bt(t){return/text\/html|application\/xhtml\+xml/i.test(t)}function Y(t){return/^\s*(<!doctype html|<html|<head|<body)/i.test(t)}function _e(t){if(ft.has(t)||ft.size>=be)return;ft.add(t);let e=document.createElement("link");e.rel="prefetch",e.as="script",e.href=t,document.head.appendChild(e)}function wt(t){let e=ot(t),n=S.get(e);if(n&&pt()-n.at<=Ot())return Promise.resolve();let r=_.get(e);if(r)return r;let o=fetch(e,{headers:{Accept:"text/html"},credentials:"same-origin"}).then(async i=>{if(!i.ok)return;let s=i.headers.get("content-type")||"",c=i.url||e;if(new URL(c,location.href).origin!==location.origin)return;let a=await i.text();if(!(bt(s)||s===""&&Y(a))||_.get(e)!==o)return;Le(e,{html:a,url:c,status:i.status,at:pt()});let u=new Set;document.querySelectorAll("script[src]").forEach(l=>u.add(l.src));for(let l of Dt(a,c,u))_e(l)}).catch(()=>{}).finally(()=>{_.get(e)===o&&_.delete(e)});return _.set(e,o),o}function Et(t){if(t.hasAttribute("data-krate-external")||t.hasAttribute("download"))return!1;let e=t.getAttribute("href");if(!e||e.startsWith("javascript:"))return!1;let n;try{n=new URL(e,location.href)}catch{return!1}if(n.origin!==location.origin)return!1;let r=t.getAttribute("target");return!(r&&r!=="_self")}function St(t){let e=t.getAttribute("data-prefetch");return t.hasAttribute("data-prefetch")&&e!=="false"&&e!=="0"}function Re(t){let e=window.requestIdleCallback;typeof e=="function"?e(t,{timeout:1e3}):setTimeout(t,50)}function tt(t){let e=t.target;if(!e||typeof e.closest!="function")return;let n=e.closest("a[data-prefetch]");if(!n||!St(n)||!Et(n))return;let r=n.getAttribute("href");if(!r)return;let o=new URL(r,location.href).href;if(x(o)===A)return;let i=W.get(n);i&&clearTimeout(i);let s=setTimeout(()=>{W.delete(n),wt(o)},Se);W.set(n,s)}function Bt(){H&&document.querySelectorAll("a[data-prefetch]").forEach(t=>{St(t)&&H.observe(t)})}function xe(){document.addEventListener("mouseover",tt),document.addEventListener("focusin",tt),typeof IntersectionObserver<"u"&&(H=new IntersectionObserver(t=>{for(let e of t){if(!e.isIntersecting)continue;let n=e.target,r=n.getAttribute("href");if(r&&Et(n)&&St(n)){let o=new URL(r,location.href).href;x(o)!==A&&Re(()=>{wt(o)})}H.unobserve(e.target)}},{rootMargin:"200px"}),Bt())}function Pe(){let t=typeof HTMLScriptElement<"u"?HTMLScriptElement.supports:void 0;if(!(typeof t!="function"||!t("speculationrules"))&&!document.querySelector('meta[http-equiv="Content-Security-Policy" i]'))try{let e=document.createElement("script");e.type="speculationrules";let n=I();e.textContent=JSON.stringify({prefetch:[{where:{and:[{href_matches:n+"/*"},{not:{href_matches:n+"/__krate/*"}},{not:{href_matches:n+"/api/*"}}]},eagerness:"moderate"}]}),document.head.appendChild(e)}catch{}}function Ft(){if(typeof window<"u"&&window.matchMedia)try{return window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{}return!1}function Wt(){return yt().viewTransitions===!1||Ft()?!1:typeof document.startViewTransition=="function"}function w(t){return t.getElementById("root")||t.body}function Ce(){let t=document.querySelector("template[data-krate-loading]");if(t&&t.content&&J.length===0){let e=t.content.cloneNode(!0);J=Array.from(e.childNodes),document.body.appendChild(e)}if(!Wt()&&!Ft()){let e=w(document);e.style.transition=`opacity ${Ee}ms ease`,e.style.opacity="0"}}function At(){for(let e of J)e.parentNode&&e.parentNode.removeChild(e);J=[];let t=w(document);t.style.opacity==="0"&&(t.style.opacity="")}function $t(t){t.querySelectorAll("[data-view-transition]").forEach(e=>{let n=e.getAttribute("data-view-transition");n&&(e.style.viewTransitionName=n);let r=e.getAttribute("data-view-transition-class");r&&e.style.setProperty("view-transition-class",r)})}var Ne=3e3;function Me(t,e){let n=[];t.querySelectorAll('link[rel="stylesheet"]').forEach(u=>{let l=u.getAttribute("href");if(!l)return;let p=new URL(l,e).href;n.includes(p)||n.push(p)});let r=new Map,o=[];document.querySelectorAll('link[rel="stylesheet"]').forEach(u=>{let l=u;l.href&&(n.includes(l.href)&&!r.has(l.href)?r.set(l.href,l):o.push(l))});let i=[],s=[],c=null;n.forEach((u,l)=>{let p=r.get(u)||null;if(!p){let h=document.createElement("link");if(h.rel="stylesheet",h.href=u,s.push(new Promise(g=>{let f=()=>{h.removeEventListener("load",f),h.removeEventListener("error",f),g()};h.addEventListener("load",f),h.addEventListener("error",f)})),i.push({link:h,media:h.getAttribute("media")}),h.media="not all",c)c.after(h);else{let g=n.slice(l+1).map(f=>r.get(f)).find(f=>!!f);g?g.before(h):document.head.appendChild(h)}p=h}c=p});let a=Promise.resolve();if(s.length>0){let u,l=new Promise(p=>{u=setTimeout(p,Ne)});a=Promise.race([Promise.all(s).then(()=>{}),l]).then(()=>clearTimeout(u))}return{ready:a,commit(){for(let{link:u,media:l}of i)l===null?u.removeAttribute("media"):u.setAttribute("media",l);o.forEach(u=>u.remove())},abort(){i.forEach(({link:u})=>u.remove())}}}var xt='meta[name="description"], meta[name="robots"], meta[property^="og:"], meta[name^="twitter:"], link[rel="canonical"], script[type="application/ld+json"]';function He(t){document.head.querySelectorAll(xt).forEach(e=>e.remove()),t.head.querySelectorAll(xt).forEach(e=>{document.head.appendChild(document.importNode(e,!0))})}function jt(t,e){let n=new Set;document.querySelectorAll("script[src]:not([data-krate-spa])").forEach(i=>n.add(i.src));let r=[],o=new Set;return t.querySelectorAll("script[src]").forEach(i=>{let s=i.getAttribute("src");if(!s)return;let c=(i.getAttribute("type")||"").toLowerCase();if(c&&c!=="module"&&c!=="text/javascript"&&c!=="application/javascript")return;let a=Ht(s,e);!n.has(a)&&!o.has(a)&&(o.add(a),r.push({src:a,module:c==="module"}))}),r}function Jt(t){return new Promise(e=>{let n=document.createElement("script");n.src=t.src,t.module&&(n.type="module"),gt.test(t.src)||n.setAttribute("data-krate-spa",""),n.onload=()=>e(!0),n.onerror=()=>e(!1),document.body.appendChild(n)})}var et=new Set;function Vt(t){t.querySelectorAll("script[data-krate-boot]").forEach(e=>{let n=e.textContent||"";if(!n||et.has(n))return;et.add(n);let r=document.createElement("script");r.text=n,document.head.appendChild(r),r.remove()})}function De(t){if(!t||t==="#")return null;let e=t.slice(1);try{e=decodeURIComponent(e)}catch{}return document.getElementById(e)||document.getElementsByName(e)[0]||null}function Lt(t){let e=De(t);if(!e)return!1;try{e.scrollIntoView({block:"start"})}catch{}return!0}function Ue(t,e){if(e.kind==="pop"){let r=e.restoreKey?L.get(e.restoreKey):void 0;if(r!==void 0){window.scrollTo(0,r);return}}let n=new URL(t,location.href).hash;Lt(n)||e.scroll&&e.kind!=="refresh"&&window.scrollTo(0,0)}var Q=null;function Ie(){let t=document.activeElement;if(t&&t!==document.body&&t.isConnected&&t!==Q)return;let e=w(document);e.hasAttribute("tabindex")||(e.setAttribute("tabindex","-1"),Q=e,e.addEventListener("blur",()=>{Q===e&&(e.removeAttribute("tabindex"),Q=null)},{once:!0}));try{e.focus({preventScroll:!0})}catch{}}var Pt="__krate-route-announcer";function Ke(){let t=document.getElementById(Pt);t||(t=document.createElement("div"),t.id=Pt,t.setAttribute("aria-live","assertive"),t.setAttribute("aria-atomic","true"),t.setAttribute("role","status"),t.setAttribute("style","position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0"),document.body.appendChild(t));let e=w(document).querySelector("h1"),n=document.title||(e&&e.textContent?e.textContent.trim():"")||O(location.pathname);t.textContent=n}function st(){let t=ht(O(location.pathname));document.querySelectorAll("a[data-krate-link]").forEach(e=>{let n=e.getAttribute("href"),r="";try{r=n?ht(O(new URL(n,location.href).pathname)):""}catch{r=""}let o="";r&&r===t?o="exact":r&&r!=="/"&&t.startsWith(r+"/")&&(o="segment"),o==="exact"?e.setAttribute("aria-current","page"):e.removeAttribute("aria-current"),o?e.setAttribute("data-krate-active",o):e.removeAttribute("data-krate-active")})}function Ct(t){let e=I()+t;return Z.has(e)?Promise.resolve(Z.get(e)??null):fetch(e,{headers:{Accept:"text/html"},credentials:"same-origin"}).then(async n=>{let r=n.ok?await n.text():null,o=r&&Y(r)?r:null;return Z.set(e,o),o}).catch(()=>null)}async function Oe(t,e){let n=ot(t.url);if(!t.bypassCache){let p=_.get(n);if(p&&await p,e.aborted)return{ok:!1,aborted:!0};let h=Te(n);if(h){let g=new URL(t.url,location.href).hash,f=g&&!new URL(h.url,location.href).hash?h.url+g:h.url;return{ok:!0,doc:{html:h.html,url:f,status:h.status}}}}let r;try{r=await fetch(n,{headers:{Accept:"text/html"},credentials:"same-origin",signal:e,cache:t.bypassCache?"no-cache":"default"})}catch(p){return p?.name==="AbortError"||e.aborted?{ok:!1,aborted:!0}:b("krate:navigate-error",{url:t.url,status:0,error:p},!0)?{ok:!1,hard:t.url}:{ok:!1,aborted:!0}}let o=r.url||n;if(new URL(o,location.href).origin!==location.origin)return{ok:!1,hard:o};let i=r.headers.get("content-type")||"",s="";try{s=await r.text()}catch(p){if(p?.name==="AbortError"||e.aborted)return{ok:!1,aborted:!0};s=""}if(e.aborted)return{ok:!1,aborted:!0};let c=bt(i)||i===""&&Y(s),a=new URL(t.url,location.href).hash,u=a&&!new URL(o).hash?o+a:o;if(r.ok)return c?{ok:!0,doc:{html:s,url:u,status:r.status}}:{ok:!1,hard:u};if(b("krate:navigate-error",{url:t.url,status:r.status}),c&&Y(s))return{ok:!0,doc:{html:s,url:u,status:r.status}};let l=null;return r.status===404||r.status===410?l=await Ct("/404.html"):r.status>=500&&(l=await Ct("/500.html")),e.aborted?{ok:!1,aborted:!0}:l?{ok:!0,doc:{html:l,url:u,status:r.status}}:{ok:!1,hard:u}}async function at(t){let e=location.href;if(t.kind!=="pop"){if(!b("krate:navigate-start",{url:t.url,from:e,kind:t.kind},!0))return}else b("krate:navigate-start",{url:t.url,from:e,kind:t.kind});let n=++T;k&&k.abort();let r=new AbortController;k=r,D("loading"),!t.bypassCache&&S.has(ot(t.url))||Ce();let i;try{i=await Oe(t,r.signal)}finally{k===r&&(k=void 0)}if(n===T){if(!i.ok){At(),D("idle"),"hard"in i&&V(i.hard,t.kind==="replace"||t.kind==="refresh");return}await Be(i.doc,t,n)}}async function Be(t,e,n){let r=new DOMParser().parseFromString(t.html,"text/html"),o=t.url,i=w(r),s=w(document);e.kind==="push"&&X(m);let c=zt(r),a=je(N,c,location.href,o,r),u=Me(r,o);if(await u.ready,n!==T){u.abort();return}if(await Fe(()=>{let g=r.querySelector("title");g&&(document.title=g.textContent||"");let f=globalThis;if(a.keep.length>0&&typeof f.krateDisposeExcept=="function"?f.krateDisposeExcept(a.keep):typeof f.disposeAll=="function"&&f.disposeAll(),a.region){let{live:v,next:d}=a.region;nt(v[0],v[1]);let E=K(d[0],d[1]).map(y=>document.importNode(y,!0));for(let y of E)v[1].parentNode.insertBefore(y,v[1]);for(let y of a.slots){nt(y.live[0],y.live[1]);for(let B of K(y.next[0],y.next[1]))y.live[1].parentNode.insertBefore(document.importNode(B,!0),y.live[1])}We(s,i)}else{let v=Array.from(i.childNodes).map(d=>document.importNode(d,!0));s.replaceChildren(...v)}N=a.chain,G.clear(),u.commit(),He(r),$t(document)}),n!==T)return;At(),e.kind==="push"?(m=U(),history.pushState(z(m,e.state),"",o)):e.kind==="replace"?(L.delete(m),m=U(),history.replaceState(z(m,e.state),"",o)):e.kind==="refresh"?o!==location.href&&history.replaceState(history.state,"",o):e.restoreKey&&(m=e.restoreKey),A=x(location.href),M=A,Qt(r),Je(r),Ue(o,e),e.kind!=="pop"&&e.kind!=="refresh"&&Ie(),e.kind!=="refresh"&&Ke(),st(),b("krate:navigate",{url:location.href,status:t.status}),vt(location.href),D("idle"),document.querySelectorAll("script[data-krate-spa]").forEach(g=>g.remove()),Vt(r);let p=jt(r,o);Mt(a.skip);let h=await Promise.all(p.map(Jt));if(Mt([]),n===T){if(h.some(g=>!g)){b("krate:navigate-error",{url:location.href,status:t.status,error:"script-load"}),V(location.href,!0);return}rt(),b("krate:navigate-end",{url:location.href,status:t.status})}}function Fe(t){if(!Wt())return t(),Promise.resolve();let e=!1,n=()=>{e||(e=!0,t())};try{let r=document.startViewTransition(n);r&&r.finished&&typeof r.finished.catch=="function"&&r.finished.catch(()=>{});let o=r&&r.updateCallbackDone;if(o&&typeof o.then=="function")return o.then(()=>n(),()=>n())}catch{}return n(),Promise.resolve()}var N=[];function zt(t){let e=t.getElementById("__krate_route");if(!e)return[];try{let n=JSON.parse(e.textContent||"{}");return Array.isArray(n.chain)?n.chain:[]}catch{return F("unreadable #__krate_route route info; layouts will be remounted"),[]}}function Nt(t,e){let n=O(new URL(t,location.href).pathname).split("/").filter(Boolean);return(e<0?n:n.slice(0,e)).join("/")}function C(t,e,n="kl:"){let o=(t.ownerDocument||t).createTreeWalker(t,128),i=n+e,s="/"+n+e;for(;o.nextNode();){let c=o.currentNode;if(c.nodeValue===i){for(let a=c.nextSibling;a;a=a.nextSibling)if(a.nodeType===8&&a.nodeValue===s)return[c,a];return null}}return null}function K(t,e){let n=[];for(let r=t.nextSibling;r&&r!==e;r=r.nextSibling)n.push(r);return n}function nt(t,e){let n=globalThis.disposeNode;for(let r of K(t,e))r.parentNode.removeChild(r),typeof n=="function"&&n(r)}function We(t,e){let n=":scope > template[data-krate-loading]";t.querySelectorAll(n).forEach(r=>r.remove()),e.querySelectorAll(n).forEach(r=>t.appendChild(document.importNode(r,!0)))}function Mt(t){let e=globalThis.krateKeepScopes;typeof e=="function"&&e(t)}function $e(t){let e=globalThis.krateScopeFailed;return typeof e=="function"&&!!e(t)}function je(t,e,n,r,o){let i={keep:[],skip:[],region:null,slots:[],chain:e},s=0;for(;s<t.length&&s<e.length;){let f=t[s],v=e[s];if(f.id!==v.id||f.k!==v.k||f.k!=="layout"&&f.k!=="error"||Nt(n,f.d)!==Nt(r,v.d)||f.k==="error"&&$e(f.id))break;if(!f.p||!v.p){F(`layout ${v.f||v.id} is remounted on this navigation: ${v.why||f.why||"not persistable"}`);break}s++}if(s===0)return i;if(typeof globalThis.krateDisposeExcept!="function")return F("the runtime has no krateDisposeExcept; layouts are remounted"),i;let c=e[s-1].id,a=C(w(document),c),u=C(w(o),c);if(!a||!u)return F(`layout ${e[s-1].f||c} boundary markers are missing; the whole page is swapped`),i;let l=t.slice(0,s).map(f=>f.id),p=l.slice(),h=[],g=e.slice();for(let f=0;f<s;f++){let v=t[f].s||[],d=[];for(let E of e[f].s||[]){let y=v.find(ue=>ue.key===E.key),B=C(w(document),E.key,"ks:"),lt=C(w(o),E.key,"ks:");if(y&&B&&(E.src!=="page"||!lt)){l.push(y.scope),p.push(y.scope,E.scope),d.push({...E,scope:y.scope,src:y.src});continue}if(B&&lt){h.push({live:B,next:lt}),d.push(E);continue}return F(`slot @${E.n} markers are missing; the whole page is swapped`),i}g[f]={...e[f],s:d}}return{keep:l,skip:p,region:{live:a,next:u},slots:h,chain:g}}var G=new Map,M="";function mt(t){let e=t.replace(/^\/+|\/+$/g,"");return e?e.split("/").map(n=>n.startsWith("[[...")&&n.endsWith("]]")?{kind:3,text:n.slice(5,-2)}:n.startsWith("[...")&&n.endsWith("]")?{kind:2,text:n.slice(4,-1)}:n.startsWith("[")&&n.endsWith("]")?{kind:1,text:n.slice(1,-1)}:{kind:0,text:n}):[]}function Yt(t,e){let n=mt(e),r=t.replace(/^\/+|\/+$/g,""),o=r?r.split("/"):[],i={};for(let s=0;s<n.length;s++){let c=n[s];if(c.kind>=2){if(s!==n.length-1)return null;let a=o.slice(s);return c.kind===2&&a.length===0||a.some(u=>u==="")?null:(i[c.text]=a.map(dt).join("/"),i)}if(s>=o.length)return null;if(c.kind===1){if(!o[s])return null;i[c.text]=dt(o[s])}else if(dt(o[s])!==c.text)return null}return o.length===n.length?i:null}function dt(t){try{return decodeURIComponent(t)}catch{return t}}function Xt(t,e){let n=mt(t),r=mt(e);for(let o=0;o<n.length&&o<r.length;o++){if(n[o].kind!==r[o].kind)return n[o].kind-r[o].kind;if(n[o].kind===0&&n[o].text!==r[o].text)return n[o].text<r[o].text?-1:1}return n.length!==r.length?r.length-n.length:t<e?-1:t>e?1:0}function Tt(t){let e=O(new URL(t,location.href).pathname).replace(/^\/+|\/+$/g,""),n=null;for(let r of N)for(let o of r.s||[])for(let i of o.i||[])Yt(e,i)&&(!n||Xt(i,n.pattern)<0)&&(n={hit:{entry:r,slot:o,path:e},pattern:i});return n&&!C(w(document),n.hit.slot.key,"ks:")?null:n?n.hit:null}function Gt(t,e){N=N.map(n=>n.s&&n.s.some(r=>r.key===t)?{...n,s:n.s.map(r=>r.key===t?e:r)}:n)}function Qt(t){let e="",n=t.getElementById("__krate_page");if(n)try{let r=JSON.parse(n.textContent||"{}");typeof r.r=="string"&&(e=r.r)}catch{}globalThis.__KRATE_ROUTE__=e;for(let r of Array.from(t.querySelectorAll("script:not([src])"))){let o=/window\.__KRATE_PARAMS__\s*=\s*(\{[\s\S]*?\})\s*;?\s*$/.exec(r.textContent||"");if(o){try{globalThis.__KRATE_PARAMS__=JSON.parse(o[1])}catch{}return}}delete globalThis.__KRATE_PARAMS__}function Je(t){let e=t.getElementById("__krate_error"),n=document.getElementById("__krate_error");if(!e){n&&n.remove();return}let r=document.importNode(e,!0);n?n.replaceWith(r):document.head.appendChild(r)}function Zt(t){let e=globalThis.krateDisposeScopes;typeof e=="function"&&e(t)}async function _t(t,e){let n=location.href;if(t.kind!=="pop"&&!b("krate:navigate-start",{url:t.url,from:n,kind:t.kind,intercept:e.slot.n},!0))return;let r=++T;k&&k.abort();let o=new AbortController;k=o,D("loading");let i=location.origin+I()+"/"+we+"/"+e.slot.key+(e.path?"/"+e.path:""),s="",c=!1;try{let d=await fetch(i,{headers:{Accept:"text/html"},credentials:"same-origin",signal:o.signal,cache:t.bypassCache?"no-cache":"default"});s=await d.text(),c=d.ok&&(bt(d.headers.get("content-type")||"")||Y(s)),c||b("krate:navigate-error",{url:t.url,status:d.status,intercept:e.slot.n})}catch(d){if(d?.name==="AbortError"||o.signal.aborted)return;b("krate:navigate-error",{url:t.url,status:0,error:d,intercept:e.slot.n})}finally{k===o&&(k=void 0)}if(r!==T)return;let a=c?new DOMParser().parseFromString(s,"text/html"):null,u=a?C(w(a),e.slot.key,"ks:"):null,l=C(w(document),e.slot.key,"ks:"),p=null;try{let d=a&&a.getElementById("__krate_route");p=d&&JSON.parse(d.textContent||"{}").frag||null}catch{p=null}if(!a||!u||!l||!p||p.key!==e.slot.key||!p.scope){try{console.warn(`[krate router] intercepting route for ${t.url} (slot @${e.slot.n}) could not be loaded; navigating to the page`)}catch{}return D("idle"),at({...t})}if(t.kind==="push"&&X(m),e.slot.src!=="intercept"){G.set(m,{key:e.slot.key,nodes:K(l[0],l[1]),slot:e.slot,path:M});for(let d of K(l[0],l[1]))d.parentNode.removeChild(d)}else Zt([e.slot.scope]),nt(l[0],l[1]);for(let d of K(u[0],u[1]))l[1].parentNode.insertBefore(document.importNode(d,!0),l[1]);let h=new Set;document.querySelectorAll('link[rel="stylesheet"]').forEach(d=>h.add(d.href)),a.querySelectorAll('link[rel="stylesheet"][href]').forEach(d=>{let E=new URL(d.getAttribute("href"),i).href;if(h.has(E))return;let y=document.createElement("link");y.rel="stylesheet",y.href=E,document.head.appendChild(y)}),Gt(e.slot.key,{...e.slot,scope:p.scope,src:"intercept"}),Vt(a);let g={__krate:"",state:t.state===void 0?null:t.state,__kint:{key:e.slot.key,base:M}};t.kind==="push"?(m=U(),g.__krate=m,history.pushState(g,"",t.url)):t.kind==="replace"?(m=U(),g.__krate=m,history.replaceState(g,"",t.url)):t.kind==="pop"&&t.restoreKey&&(m=t.restoreKey),A=x(location.href),Qt(a),st(),b("krate:navigate",{url:location.href,status:200,intercept:e.slot.n}),vt(location.href),D("idle");let f=jt(a,i),v=await Promise.all(f.map(Jt));if(r===T){if(v.some(d=>!d)){b("krate:navigate-error",{url:location.href,status:200,error:"script-load",intercept:e.slot.n}),V(location.href,!0);return}rt(),b("krate:navigate-end",{url:location.href,status:200,intercept:e.slot.n})}}function Ve(t,e){let n=C(w(document),t.key,"ks:"),r=N.flatMap(i=>i.s||[]).find(i=>i.key===t.key);if(!n||!r||r.src!=="intercept")return!1;Zt([r.scope]),nt(n[0],n[1]);for(let i of t.nodes)n[1].parentNode.insertBefore(i,n[1]);Gt(t.key,t.slot),G.delete(e),m=e,A=x(location.href);let o=L.get(e);return o!==void 0&&window.scrollTo(0,o),st(),b("krate:navigate",{url:location.href,status:200}),vt(location.href),it(),!0}function ze(t){return x(t)===A}function qt(){$==="loading"&&(T++,k&&k.abort(),k=void 0,At(),D("idle"))}function Ye(t,e){qt(),X(m),(t!==location.href||e.state!==void 0)&&(e.kind==="replace"?history.replaceState(z(m||U(),e.state),"",t):(m=U(),history.pushState(z(m,e.state),"",t)));let n=new URL(t).hash;!Lt(n)&&e.scroll&&!n&&window.scrollTo(0,0),it()}function ct(t){let e;try{e=new URL(t.url,location.href)}catch{return V(t.url),Promise.resolve()}if(e.origin!==location.origin)return V(e.href,t.kind==="replace"),Promise.resolve();if(t.url=e.href,(t.kind==="push"||t.kind==="replace")&&ze(e.href)&&(e.hash||e.href===location.href))return Ye(e.href,t),Promise.resolve();if(t.kind==="push"||t.kind==="replace"){let n=Tt(e.href);if(n)return _t(t,n)}return at(t)}function te(t){if(t.defaultPrevented||t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey)return;let e=t.target;if(!e||typeof e.closest!="function")return;let n=e.closest("a[data-krate-link]");if(!n||!Et(n))return;let r=n.getAttribute("href");r&&(t.preventDefault(),ct({url:new URL(r,location.href).href,kind:n.hasAttribute("data-krate-replace")?"replace":"push",scroll:n.getAttribute("data-krate-scroll")!=="false"}))}function ee(t){if(t.defaultPrevented)return;let e=t.target;if(!e||e.tagName!=="FORM"||e.hasAttribute("data-krate-reload"))return;let n=t.submitter||null;if((n&&n.getAttribute("formmethod")||e.getAttribute("method")||"get").toLowerCase()!=="get")return;let o=n&&n.getAttribute("formtarget")||e.getAttribute("target");if(o&&o!=="_self")return;let i=n&&n.getAttribute("formaction")||e.getAttribute("action")||"",s;try{s=new URL(i||location.href,location.href)}catch{return}if(s.origin!==location.origin||s.protocol.indexOf("http")!==0)return;let c;try{c=n?new FormData(e,n):new FormData(e)}catch{c=new FormData(e),n&&n.name&&c.append(n.name,n.value)}let a=new URLSearchParams;for(let[u,l]of c.entries()){if(typeof l!="string")return;a.append(u,l)}t.preventDefault(),s.search=a.toString(),s.hash="",ct({url:s.href,kind:"push",scroll:!0})}function ne(t){X(m);let e=q(t.state),n=location.href;if(x(n)===A){qt(),m=e||m;let i=e?L.get(e):void 0;i!==void 0?window.scrollTo(0,i):Lt(location.hash),it();return}let r=e?G.get(e):void 0;if(r&&e&&r.path===x(n)&&r.path===M&&Ve(r,e))return;let o=t.state&&typeof t.state=="object"?t.state.__kint:null;if(o&&o.base===M){let i=Tt(n);if(i&&i.slot.key===o.key){_t({url:n,kind:"pop",scroll:!1,restoreKey:e},i);return}}at({url:n,kind:"pop",scroll:!0,restoreKey:e})}function re(){kt(),se()}function oe(){X(m);try{history.scrollRestoration="auto"}catch{}}function ie(){try{history.scrollRestoration="manual"}catch{}}function rt(){Bt(),st(),$t(document),document.querySelectorAll("script[src]").forEach(t=>{gt.test(t.src)||t.setAttribute("data-krate-spa","")})}function se(){if(!R||typeof location>"u")return typeof location<"u"&&location.reload(),Promise.resolve();if(A!==M){let t=Tt(location.href);if(t&&t.slot.src==="intercept")return _t({url:location.href,kind:"refresh",scroll:!1,bypassCache:!0},t)}return at({url:location.href,kind:"refresh",scroll:!1,bypassCache:!0})}function ae(t,e={}){return R?ct({url:P(t),kind:"push",scroll:e.scroll!==!1,state:e.state}):(typeof location<"u"&&location.assign(P(t)),Promise.resolve())}function ce(t,e={}){return R?ct({url:P(t),kind:"replace",scroll:e.scroll!==!1,state:e.state}):(typeof location<"u"&&location.replace(P(t)),Promise.resolve())}var Xe={push:ae,replace:ce,back(){typeof history<"u"&&history.back()},forward(){typeof history<"u"&&history.forward()},refresh:se,prefetch(t){if(!R||typeof location>"u")return Promise.resolve();let e;try{e=new URL(P(t),location.href)}catch{return Promise.resolve()}return e.origin!==location.origin?Promise.resolve():wt(e.href)},subscribe:Kt,getState:It,invalidate:kt};function Ge(t,e={}){return R?(e.replace?ce(t,e):ae(t,e),!1):(typeof location<"u"&&(e.replace?location.replace(P(t)):location.assign(P(t))),!0)}function le(){if(!(typeof document>"u")){if(R){rt();return}if(R=!0,document.querySelectorAll("script[data-krate-boot]").forEach(t=>et.add(t.textContent||"")),A=x(location.href),N=zt(document),M=A,m=q(history.state)||U(),q(history.state)===void 0)try{history.replaceState(z(m,history.state),"",location.href)}catch{}try{history.scrollRestoration="manual"}catch{}document.addEventListener("click",te),document.addEventListener("submit",ee),window.addEventListener("popstate",ne),window.addEventListener("krate:revalidate",re),window.addEventListener("pagehide",oe),window.addEventListener("pageshow",ie),xe(),Pe(),rt()}}function Qe(){le()}function Ze(){if(R){R=!1,document.removeEventListener("click",te),document.removeEventListener("submit",ee),window.removeEventListener("popstate",ne),window.removeEventListener("krate:revalidate",re),window.removeEventListener("pagehide",oe),window.removeEventListener("pageshow",ie),document.removeEventListener("mouseover",tt),document.removeEventListener("focusin",tt);for(let t of W.values())clearTimeout(t);W=new Map,H&&(H.disconnect(),H=null),k&&k.abort(),k=void 0,T++,S.clear(),_.clear(),L.clear(),Z.clear(),et.clear(),j.clear(),$="idle",J=[],N=[],G.clear(),M=""}}return ge(qe);})();
2
2
  for (const k in __krate_exports) { window[k] = __krate_exports[k]; }
@@ -80,6 +80,7 @@
80
80
  "krateMount",
81
81
  "krateMountFields",
82
82
  "krateMountPortals",
83
+ "krateMuteEvents",
83
84
  "krateOn",
84
85
  "krateOnAfterFlush",
85
86
  "krateOnBeforeFlush",