import{S as et,i as tt,s as nt,a as rt,e as x,c as at,b as W,g as ue,t as V,d as de,f as B,h as F,j as st,o as Re,k as ot,l as it,m as lt,n as ve,p as C,q as ct,r as ft,u as ut,v as H,w as M,x as Ue,y as X,z as Y,A as ie}from"./chunks/index-e5b56f0c.js";import{g as We,f as ze,s as K,a as $e,b as dt,i as ht,c as pt}from"./chunks/singletons-26a71d74.js";import{u as mt}from"./chunks/parse-75f4e1ae.js";function _t(n,e){return n==="/"||e==="ignore"?n:e==="never"?n.endsWith("/")?n.slice(0,-1):n:e==="always"&&!n.endsWith("/")?n+"/":n}function gt(n){return n.split("%25").map(decodeURI).join("%25")}function wt(n){for(const e in n)n[e]=decodeURIComponent(n[e]);return n}const yt=["href","pathname","search","searchParams","toString","toJSON"];function bt(n,e){const t=new URL(n);for(const s of yt){let i=t[s];Object.defineProperty(t,s,{get(){return e(),i},enumerable:!0,configurable:!0})}return vt(t),t}function vt(n){Object.defineProperty(n,"hash",{get(){throw new Error("Cannot access event.url.hash. Consider using `$page.url.hash` inside a component instead")}})}const Et="/__data.json";function kt(n){return n.replace(/\/$/,"")+Et}function St(n){let e=5381;if(typeof n=="string"){let t=n.length;for(;t;)e=e*33^n.charCodeAt(--t)}else if(ArrayBuffer.isView(n)){const t=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let s=t.length;for(;s;)e=e*33^t[--s]}else throw new TypeError("value must be a string or TypedArray");return(e>>>0).toString(36)}const he=window.fetch;window.fetch=(n,e)=>{if((n instanceof Request?n.method:(e==null?void 0:e.method)||"GET")!=="GET"){const s=new URL(n instanceof Request?n.url:n.toString(),document.baseURI).href;ne.delete(s)}return he(n,e)};const ne=new Map;function Rt(n,e){const t=Qe(n,e),s=document.querySelector(t);if(s!=null&&s.textContent){const{body:i,...l}=JSON.parse(s.textContent),a=s.getAttribute("data-ttl");return a&&ne.set(t,{body:i,init:l,ttl:1e3*Number(a)}),Promise.resolve(new Response(i,l))}return he(n,e)}function $t(n,e,t){if(ne.size>0){const s=Qe(n,t),i=ne.get(s);if(i){if(performance.now()<i.ttl)return new Response(i.body,i.init);ne.delete(s)}}return he(e,t)}function Qe(n,e){let s=`script[data-sveltekit-fetched][data-url=${JSON.stringify(n instanceof Request?n.url:n)}]`;return(e==null?void 0:e.body)&&(typeof e.body=="string"||ArrayBuffer.isView(e.body))&&(s+=`[data-hash="${St(e.body)}"]`),s}const Lt=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function Ot(n){const e=[];return{pattern:n==="/"?/^\/$/:new RegExp(`^${Ut(n).map(s=>{const i=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(s);if(i)return e.push({name:i[1],matcher:i[2],optional:!1,rest:!0,chained:!0}),"(?:/(.*))?";const l=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(s);if(l)return e.push({name:l[1],matcher:l[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!s)return;const a=s.split(/\[(.+?)\](?!\])/);return"/"+a.map((w,m)=>{if(m%2){if(w.startsWith("x+"))return Ee(String.fromCharCode(parseInt(w.slice(2),16)));if(w.startsWith("u+"))return Ee(String.fromCharCode(...w.slice(2).split("-").map(q=>parseInt(q,16))));const _=Lt.exec(w);if(!_)throw new Error(`Invalid param: ${w}. Params and matcher names can only have underscores and alphanumeric characters.`);const[,$,k,T,U]=_;return e.push({name:T,matcher:U,optional:!!$,rest:!!k,chained:k?m===1&&a[0]==="":!1}),k?"(.*?)":$?"([^/]*)?":"([^/]+?)"}return Ee(w)}).join("")}).join("")}/?$`),params:e}}function Pt(n){return!/^\([^)]+\)$/.test(n)}function Ut(n){return n.slice(1).split("/").filter(Pt)}function jt(n,e,t){const s={},i=n.slice(1);let l="";for(let a=0;a<e.length;a+=1){const d=e[a];let w=i[a];if(d.chained&&d.rest&&l&&(w=w?l+"/"+w:l),l="",w===void 0)d.rest&&(s[d.name]="");else{if(d.matcher&&!t[d.matcher](w)){if(d.optional&&d.chained){let m=i.indexOf(void 0,a);if(m===-1){const _=e[a+1];if((_==null?void 0:_.rest)&&_.chained)l=w;else return}for(;m>=a;)i[m]=i[m-1],m-=1;continue}return}s[d.name]=w}}if(!l)return s}function Ee(n){return n.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function At(n,e,t,s){const i=new Set(e);return Object.entries(t).map(([d,[w,m,_]])=>{const{pattern:$,params:k}=Ot(d),T={id:d,exec:U=>{const q=$.exec(U);if(q)return jt(q,k,s)},errors:[1,..._||[]].map(U=>n[U]),layouts:[0,...m||[]].map(a),leaf:l(w)};return T.errors.length=T.layouts.length=Math.max(T.errors.length,T.layouts.length),T});function l(d){const w=d<0;return w&&(d=~d),[w,n[d]]}function a(d){return d===void 0?d:[i.has(d),n[d]]}}function It(n){let e,t,s;var i=n[0][0];function l(a){return{props:{data:a[2],form:a[1]}}}return i&&(e=H(i,l(n))),{c(){e&&M(e.$$.fragment),t=x()},l(a){e&&Ue(e.$$.fragment,a),t=x()},m(a,d){e&&X(e,a,d),W(a,t,d),s=!0},p(a,d){const w={};if(d&4&&(w.data=a[2]),d&2&&(w.form=a[1]),i!==(i=a[0][0])){if(e){ue();const m=e;V(m.$$.fragment,1,0,()=>{Y(m,1)}),de()}i?(e=H(i,l(a)),M(e.$$.fragment),B(e.$$.fragment,1),X(e,t.parentNode,t)):e=null}else i&&e.$set(w)},i(a){s||(e&&B(e.$$.fragment,a),s=!0)},o(a){e&&V(e.$$.fragment,a),s=!1},d(a){a&&F(t),e&&Y(e,a)}}}function Tt(n){let e,t,s;var i=n[0][0];function l(a){return{props:{data:a[2],$$slots:{default:[Nt]},$$scope:{ctx:a}}}}return i&&(e=H(i,l(n))),{c(){e&&M(e.$$.fragment),t=x()},l(a){e&&Ue(e.$$.fragment,a),t=x()},m(a,d){e&&X(e,a,d),W(a,t,d),s=!0},p(a,d){const w={};if(d&4&&(w.data=a[2]),d&523&&(w.$$scope={dirty:d,ctx:a}),i!==(i=a[0][0])){if(e){ue();const m=e;V(m.$$.fragment,1,0,()=>{Y(m,1)}),de()}i?(e=H(i,l(a)),M(e.$$.fragment),B(e.$$.fragment,1),X(e,t.parentNode,t)):e=null}else i&&e.$set(w)},i(a){s||(e&&B(e.$$.fragment,a),s=!0)},o(a){e&&V(e.$$.fragment,a),s=!1},d(a){a&&F(t),e&&Y(e,a)}}}function Nt(n){let e,t,s;var i=n[0][1];function l(a){return{props:{data:a[3],form:a[1]}}}return i&&(e=H(i,l(n))),{c(){e&&M(e.$$.fragment),t=x()},l(a){e&&Ue(e.$$.fragment,a),t=x()},m(a,d){e&&X(e,a,d),W(a,t,d),s=!0},p(a,d){const w={};if(d&8&&(w.data=a[3]),d&2&&(w.form=a[1]),i!==(i=a[0][1])){if(e){ue();const m=e;V(m.$$.fragment,1,0,()=>{Y(m,1)}),de()}i?(e=H(i,l(a)),M(e.$$.fragment),B(e.$$.fragment,1),X(e,t.parentNode,t)):e=null}else i&&e.$set(w)},i(a){s||(e&&B(e.$$.fragment,a),s=!0)},o(a){e&&V(e.$$.fragment,a),s=!1},d(a){a&&F(t),e&&Y(e,a)}}}function Ge(n){let e,t=n[5]&&He(n);return{c(){e=ot("div"),t&&t.c(),this.h()},l(s){e=it(s,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var i=lt(e);t&&t.l(i),i.forEach(F),this.h()},h(){ve(e,"id","svelte-announcer"),ve(e,"aria-live","assertive"),ve(e,"aria-atomic","true"),C(e,"position","absolute"),C(e,"left","0"),C(e,"top","0"),C(e,"clip","rect(0 0 0 0)"),C(e,"clip-path","inset(50%)"),C(e,"overflow","hidden"),C(e,"white-space","nowrap"),C(e,"width","1px"),C(e,"height","1px")},m(s,i){W(s,e,i),t&&t.m(e,null)},p(s,i){s[5]?t?t.p(s,i):(t=He(s),t.c(),t.m(e,null)):t&&(t.d(1),t=null)},d(s){s&&F(e),t&&t.d()}}}function He(n){let e;return{c(){e=ct(n[6])},l(t){e=ft(t,n[6])},m(t,s){W(t,e,s)},p(t,s){s&64&&ut(e,t[6])},d(t){t&&F(e)}}}function Ct(n){let e,t,s,i,l;const a=[Tt,It],d=[];function w(_,$){return _[0][1]?0:1}e=w(n),t=d[e]=a[e](n);let m=n[4]&&Ge(n);return{c(){t.c(),s=rt(),m&&m.c(),i=x()},l(_){t.l(_),s=at(_),m&&m.l(_),i=x()},m(_,$){d[e].m(_,$),W(_,s,$),m&&m.m(_,$),W(_,i,$),l=!0},p(_,[$]){let k=e;e=w(_),e===k?d[e].p(_,$):(ue(),V(d[k],1,1,()=>{d[k]=null}),de(),t=d[e],t?t.p(_,$):(t=d[e]=a[e](_),t.c()),B(t,1),t.m(s.parentNode,s)),_[4]?m?m.p(_,$):(m=Ge(_),m.c(),m.m(i.parentNode,i)):m&&(m.d(1),m=null)},i(_){l||(B(t),l=!0)},o(_){V(t),l=!1},d(_){d[e].d(_),_&&F(s),m&&m.d(_),_&&F(i)}}}function Dt(n,e,t){let{stores:s}=e,{page:i}=e,{components:l}=e,{form:a}=e,{data_0:d=null}=e,{data_1:w=null}=e;st(s.page.notify);let m=!1,_=!1,$=null;return Re(()=>{const k=s.page.subscribe(()=>{m&&(t(5,_=!0),t(6,$=document.title||"untitled page"))});return t(4,m=!0),k}),n.$$set=k=>{"stores"in k&&t(7,s=k.stores),"page"in k&&t(8,i=k.page),"components"in k&&t(0,l=k.components),"form"in k&&t(1,a=k.form),"data_0"in k&&t(2,d=k.data_0),"data_1"in k&&t(3,w=k.data_1)},n.$$.update=()=>{n.$$.dirty&384&&s.page.set(i)},[l,a,d,w,m,_,$,s,i]}class qt extends et{constructor(e){super(),tt(this,e,Dt,Ct,nt,{stores:7,page:8,components:0,form:1,data_0:2,data_1:3})}}const xt="modulepreload",Vt=function(n,e){return new URL(n,e).href},Me={},G=function(e,t,s){if(!t||t.length===0)return e();const i=document.getElementsByTagName("link");return Promise.all(t.map(l=>{if(l=Vt(l,s),l in Me)return;Me[l]=!0;const a=l.endsWith(".css"),d=a?'[rel="stylesheet"]':"";if(!!s)for(let _=i.length-1;_>=0;_--){const $=i[_];if($.href===l&&(!a||$.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${l}"]${d}`))return;const m=document.createElement("link");if(m.rel=a?"stylesheet":xt,a||(m.as="script",m.crossOrigin=""),m.href=l,document.head.appendChild(m),a)return new Promise((_,$)=>{m.addEventListener("load",_),m.addEventListener("error",()=>$(new Error(`Unable to preload CSS for ${l}`)))})})).then(()=>e())},Bt={},pe=[()=>G(()=>import("./chunks/0-fc589770.js"),["./chunks/0-fc589770.js","./components/pages/_layout.svelte-7188aa77.js","./chunks/index-e5b56f0c.js","./chunks/stores-64caca7d.js","./chunks/singletons-26a71d74.js","./chunks/index-a01ebb22.js","./assets/_layout-c5c520a0.css"],import.meta.url),()=>G(()=>import("./chunks/1-29c9f4b1.js"),["./chunks/1-29c9f4b1.js","./components/error.svelte-f885d61c.js","./chunks/index-e5b56f0c.js","./chunks/stores-64caca7d.js","./chunks/singletons-26a71d74.js","./chunks/index-a01ebb22.js"],import.meta.url),()=>G(()=>import("./chunks/2-2db0290c.js"),["./chunks/2-2db0290c.js","./chunks/_page-802cc2a3.js","./components/pages/_page.svelte-f814f306.js","./chunks/index-e5b56f0c.js","./chunks/index-a01ebb22.js","./assets/_page-265a38f0.css"],import.meta.url),()=>G(()=>import("./chunks/3-59b9a6a6.js"),["./chunks/3-59b9a6a6.js","./chunks/_page-9b9f8e4e.js","./chunks/environment-820b6ea4.js","./components/pages/about/_page.svelte-db515161.js","./chunks/index-e5b56f0c.js"],import.meta.url),()=>G(()=>import("./chunks/4-50a952e4.js"),["./chunks/4-50a952e4.js","./components/pages/sverdle/_page.svelte-22342654.js","./chunks/index-e5b56f0c.js","./chunks/parse-75f4e1ae.js","./chunks/singletons-26a71d74.js","./chunks/index-a01ebb22.js","./assets/_page-2c27b08c.css"],import.meta.url),()=>G(()=>import("./chunks/5-07c9b990.js"),["./chunks/5-07c9b990.js","./chunks/_page-30d445e4.js","./chunks/environment-820b6ea4.js","./components/pages/sverdle/how-to-play/_page.svelte-0d97f364.js","./chunks/index-e5b56f0c.js","./assets/_page-89a9e780.css"],import.meta.url)],Ft=[],Jt={"/":[2],"/about":[3],"/sverdle":[-5],"/sverdle/how-to-play":[5]},Kt={handleError:({error:n})=>{console.error(n)}};class Le{constructor(e,t){this.status=e,typeof t=="string"?this.body={message:t}:t?this.body=t:this.body={message:`Error: ${e}`}}toString(){return JSON.stringify(this.body)}}class Xe{constructor(e,t){this.status=e,this.location=t}}async function Wt(n){var e;for(const t in n)if(typeof((e=n[t])==null?void 0:e.then)=="function")return Object.fromEntries(await Promise.all(Object.entries(n).map(async([s,i])=>[s,await i])));return n}const Ze="sveltekit:scroll",D="sveltekit:index",le=At(pe,Ft,Jt,Bt),Oe=pe[0],Pe=pe[1];Oe();Pe();let re={};try{re=JSON.parse(sessionStorage[Ze])}catch{}function ke(n){re[n]=$e()}function zt({target:n,base:e}){var Fe;const t=[];let s=null;const i={before_navigate:[],after_navigate:[]};let l={branch:[],error:null,url:null},a=!1,d=!1,w=!0,m=!1,_=!1,$=!1,k=!1,T,U=(Fe=history.state)==null?void 0:Fe[D];U||(U=Date.now(),history.replaceState({...history.state,[D]:U},"",location.href));const q=re[U];q&&(history.scrollRestoration="manual",scrollTo(q.x,q.y));let J,je,ae;async function Ae(){ae=ae||Promise.resolve(),await ae,ae=null;const r=new URL(location.href),c=we(r,!0);s=null,await Te(c,r,[])}async function me(r,{noScroll:c=!1,replaceState:f=!1,keepFocus:o=!1,state:u={},invalidateAll:h=!1},p,v){return typeof r=="string"&&(r=new URL(r,We(document))),ye({url:r,scroll:c?$e():null,keepfocus:o,redirect_chain:p,details:{state:u,replaceState:f},nav_token:v,accepted:()=>{h&&(k=!0)},blocked:()=>{},type:"goto"})}async function Ie(r){const c=we(r,!1);if(!c)throw new Error(`Attempted to prefetch a URL that does not belong to this app: ${r}`);return s={id:c.id,promise:De(c).then(f=>(f.type==="loaded"&&f.state.error&&(s=null),f))},s.promise}async function Te(r,c,f,o,u={},h){var v,E;je=u;let p=r&&await De(r);if(p||(p=await Be(c,{id:null},await te(new Error(`Not found: ${c.pathname}`),{url:c,params:{},route:{id:null}}),404)),c=(r==null?void 0:r.url)||c,je!==u)return!1;if(p.type==="redirect")if(f.length>10||f.includes(c.pathname))p=await se({status:500,error:await te(new Error("Redirect loop"),{url:c,params:{},route:{id:null}}),url:c,route:{id:null}});else return me(new URL(p.location,c).href,{},[...f,c.pathname],u),!1;else((E=(v=p.props)==null?void 0:v.page)==null?void 0:E.status)>=400&&await K.updated.check()&&await oe(c);if(t.length=0,k=!1,m=!0,o&&o.details){const{details:y}=o,b=y.replaceState?0:1;y.state[D]=U+=b,history[y.replaceState?"replaceState":"pushState"](y.state,"",c)}if(s=null,d){l=p.state,p.props.page&&(p.props.page.url=c);const y=fe();T.$set(p.props),y()}else Ne(p);if(o){const{scroll:y,keepfocus:b}=o;if(b||Se(),await ie(),w){const S=c.hash&&document.getElementById(c.hash.slice(1));y?scrollTo(y.x,y.y):S?S.scrollIntoView():scrollTo(0,0)}}else await ie();w=!0,p.props.page&&(J=p.props.page),h&&h(),m=!1}function Ne(r){var u,h;l=r.state;const c=document.querySelector("style[data-sveltekit]");c&&c.remove(),J=r.props.page;const f=fe();T=new qt({target:n,props:{...r.props,stores:K},hydrate:!0}),f();const o={from:null,to:ce("to",{params:l.params,route:{id:(h=(u=l.route)==null?void 0:u.id)!=null?h:null},url:new URL(location.href)}),willUnload:!1,type:"enter"};i.after_navigate.forEach(p=>p(o)),d=!0}async function Q({url:r,params:c,branch:f,status:o,error:u,route:h,form:p}){var A;const v=f.filter(Boolean);let E="never";for(const L of f)(L==null?void 0:L.slash)!==void 0&&(E=L.slash);r.pathname=_t(r.pathname,E),r.search=r.search;const y={type:"loaded",state:{url:r,params:c,branch:f,error:u,route:h},props:{components:v.map(L=>L.node.component)}};p!==void 0&&(y.props.form=p);let b={},S=!J;for(let L=0;L<v.length;L+=1){const j=v[L];b={...b,...j.data},(S||!l.branch.some(N=>N===j))&&(y.props[`data_${L}`]=b,S=S||Object.keys((A=j.data)!=null?A:{}).length>0)}if(S||(S=Object.keys(J.data).length!==Object.keys(b).length),!l.url||r.href!==l.url.href||l.error!==u||p!==void 0||S){y.props.page={error:u,params:c,route:h,status:o,url:r,form:p,data:S?b:J.data},Object.defineProperty(y.props.page,"routeId",{get(){throw new Error("$page.routeId has been replaced by $page.route.id")},enumerable:!1});const L=(j,N)=>{Object.defineProperty(y.props.page,j,{get:()=>{throw new Error(`$page.${j} has been replaced by $page.url.${N}`)}})};L("origin","origin"),L("path","pathname"),L("query","searchParams")}return y}async function _e({loader:r,parent:c,url:f,params:o,route:u,server_data_node:h}){var y,b,S,I,A,L,j;let p=null;const v={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1},E=await r();if((y=E.shared)!=null&&y.load){let N=function(...g){for(const R of g){const{href:O}=new URL(R,f);v.dependencies.add(O)}};const Z={route:{get id(){return v.route=!0,u.id}},params:new Proxy(o,{get:(g,R)=>(v.params.add(R),g[R])}),data:(b=h==null?void 0:h.data)!=null?b:null,url:bt(f,()=>{v.url=!0}),async fetch(g,R){let O;g instanceof Request?(O=g.url,R={body:g.method==="GET"||g.method==="HEAD"?void 0:await g.blob(),cache:g.cache,credentials:g.credentials,headers:g.headers,integrity:g.integrity,keepalive:g.keepalive,method:g.method,mode:g.mode,redirect:g.redirect,referrer:g.referrer,referrerPolicy:g.referrerPolicy,signal:g.signal,...R}):O=g;const P=new URL(O,f).href;return N(P),d?$t(O,P,R):Rt(O,R)},setHeaders:()=>{},depends:N,parent(){return v.parent=!0,c()}};Object.defineProperties(Z,{props:{get(){throw new Error("@migration task: Replace `props` with `data` stuff https://github.com/sveltejs/kit/discussions/5774#discussioncomment-3292693")},enumerable:!1},session:{get(){throw new Error("session is no longer available. See https://github.com/sveltejs/kit/discussions/5883")},enumerable:!1},stuff:{get(){throw new Error("@migration task: Remove stuff https://github.com/sveltejs/kit/discussions/5774#discussioncomment-3292693")},enumerable:!1},routeId:{get(){throw new Error("routeId has been replaced by route.id")},enumerable:!1}}),p=(S=await E.shared.load.call(null,Z))!=null?S:null,p=p?await Wt(p):null}return{node:E,loader:r,server:h,shared:(I=E.shared)!=null&&I.load?{type:"data",data:p,uses:v}:null,data:(A=p!=null?p:h==null?void 0:h.data)!=null?A:null,slash:(j=(L=E.shared)==null?void 0:L.trailingSlash)!=null?j:h==null?void 0:h.slash}}function Ce(r,c,f,o,u){if(k)return!0;if(!o)return!1;if(o.parent&&r||o.route&&c||o.url&&f)return!0;for(const h of o.params)if(u[h]!==l.params[h])return!0;for(const h of o.dependencies)if(t.some(p=>p(new URL(h))))return!0;return!1}function ge(r,c){var f,o;return(r==null?void 0:r.type)==="data"?{type:"data",data:r.data,uses:{dependencies:new Set((f=r.uses.dependencies)!=null?f:[]),params:new Set((o=r.uses.params)!=null?o:[]),parent:!!r.uses.parent,route:!!r.uses.route,url:!!r.uses.url},slash:r.slash}:(r==null?void 0:r.type)==="skip"&&c!=null?c:null}async function De({id:r,invalidating:c,url:f,params:o,route:u}){var Z;if((s==null?void 0:s.id)===r)return s.promise;const{errors:h,layouts:p,leaf:v}=u,E=[...p,v];h.forEach(g=>g==null?void 0:g().catch(()=>{})),E.forEach(g=>g==null?void 0:g[1]().catch(()=>{}));let y=null;const b=l.url?r!==l.url.pathname+l.url.search:!1,S=l.route?r!==l.route.id:!1,I=E.reduce((g,R,O)=>{var ee;const P=l.branch[O],z=!!(R!=null&&R[0])&&((P==null?void 0:P.loader)!==R[1]||Ce(g.some(Boolean),S,b,(ee=P.server)==null?void 0:ee.uses,o));return g.push(z),g},[]);if(I.some(Boolean)){try{y=await Ye(f,I)}catch(g){return se({status:500,error:await te(g,{url:f,params:o,route:{id:u.id}}),url:f,route:u})}if(y.type==="redirect")return y}const A=y==null?void 0:y.nodes;let L=!1;const j=E.map(async(g,R)=>{var ee;if(!g)return;const O=l.branch[R],P=A==null?void 0:A[R];if((!P||P.type==="skip")&&g[1]===(O==null?void 0:O.loader)&&!Ce(L,S,b,(ee=O.shared)==null?void 0:ee.uses,o))return O;if(L=!0,(P==null?void 0:P.type)==="error")throw P;return _e({loader:g[1],url:f,params:o,route:u,parent:async()=>{var Ke;const Je={};for(let be=0;be<R;be+=1)Object.assign(Je,(Ke=await j[be])==null?void 0:Ke.data);return Je},server_data_node:ge(P===void 0&&g[0]?{type:"skip"}:P!=null?P:null,O==null?void 0:O.server)})});for(const g of j)g.catch(()=>{});const N=[];for(let g=0;g<E.length;g+=1)if(E[g])try{N.push(await j[g])}catch(R){if(R instanceof Xe)return{type:"redirect",location:R.location};let O=500,P;A!=null&&A.includes(R)?(O=(Z=R.status)!=null?Z:O,P=R.error):R instanceof Le?(O=R.status,P=R.body):P=await te(R,{params:o,url:f,route:{id:u.id}});const z=await qe(g,N,h);return z?await Q({url:f,params:o,branch:N.slice(0,z.idx).concat(z.node),status:O,error:P,route:u}):await Be(f,{id:u.id},P,O)}else N.push(void 0);return await Q({url:f,params:o,branch:N,status:200,error:null,route:u,form:c?void 0:null})}async function qe(r,c,f){for(;r--;)if(f[r]){let o=r;for(;!c[o];)o-=1;try{return{idx:o+1,node:{node:await f[r](),loader:f[r],data:{},server:null,shared:null}}}catch{continue}}}async function se({status:r,error:c,url:f,route:o}){var y;const u={},h=await Oe();let p=null;if(h.server)try{const b=await Ye(f,[!0]);if(b.type!=="data"||b.nodes[0]&&b.nodes[0].type!=="data")throw 0;p=(y=b.nodes[0])!=null?y:null}catch{(f.origin!==location.origin||f.pathname!==location.pathname||a)&&await oe(f)}const v=await _e({loader:Oe,url:f,params:u,route:o,parent:()=>Promise.resolve({}),server_data_node:ge(p)}),E={node:await Pe(),loader:Pe,shared:null,server:null,data:null};return await Q({url:f,params:u,branch:[v,E],status:r,error:c,route:null})}function we(r,c){if(xe(r))return;const f=gt(r.pathname.slice(e.length)||"/");for(const o of le){const u=o.exec(f);if(u)return{id:r.pathname+r.search,invalidating:c,route:o,params:wt(u),url:r}}}function xe(r){return r.origin!==location.origin||!r.pathname.startsWith(e)}function Ve({url:r,type:c,intent:f,delta:o}){var v,E,y,b,S;let u=!1;const h={from:ce("from",{params:l.params,route:{id:(E=(v=l.route)==null?void 0:v.id)!=null?E:null},url:l.url}),to:ce("to",{params:(y=f==null?void 0:f.params)!=null?y:null,route:{id:(S=(b=f==null?void 0:f.route)==null?void 0:b.id)!=null?S:null},url:r}),willUnload:!f,type:c};o!==void 0&&(h.delta=o);const p={...h,cancel:()=>{u=!0}};return _||i.before_navigate.forEach(I=>I(p)),u?null:h}async function ye({url:r,scroll:c,keepfocus:f,redirect_chain:o,details:u,type:h,delta:p,nav_token:v,accepted:E,blocked:y}){const b=we(r,!1),S=Ve({url:r,type:h,delta:p,intent:b});if(!S){y();return}ke(U),E(),_=!0,d&&K.navigating.set(S),await Te(b,r,o,{scroll:c,keepfocus:f,details:u},v,()=>{_=!1,i.after_navigate.forEach(I=>I(S)),K.navigating.set(null)})}async function Be(r,c,f,o){return r.origin===location.origin&&r.pathname===location.pathname&&!a?await se({status:o,error:f,url:r,route:c}):await oe(r)}function oe(r){return location.href=r.href,new Promise(()=>{})}return{after_navigate:r=>{Re(()=>(i.after_navigate.push(r),()=>{const c=i.after_navigate.indexOf(r);i.after_navigate.splice(c,1)}))},before_navigate:r=>{Re(()=>(i.before_navigate.push(r),()=>{const c=i.before_navigate.indexOf(r);i.before_navigate.splice(c,1)}))},disable_scroll_handling:()=>{(m||!d)&&(w=!1)},goto:(r,c={})=>{if("keepfocus"in c&&!("keepFocus"in c))throw new Error("`keepfocus` has been renamed to `keepFocus` (note the difference in casing)");if("noscroll"in c&&!("noScroll"in c))throw new Error("`noscroll` has been renamed to `noScroll` (note the difference in casing)");return me(r,c,[])},invalidate:r=>{if(r===void 0)throw new Error("`invalidate()` (with no arguments) has been replaced by `invalidateAll()`");if(typeof r=="function")t.push(r);else{const{href:c}=new URL(r,location.href);t.push(f=>f.href===c)}return Ae()},invalidateAll:()=>(k=!0,Ae()),prefetch:async r=>{const c=new URL(r,We(document));await Ie(c)},prefetch_routes:async r=>{const f=(r?le.filter(o=>r.some(u=>o.exec(u))):le).map(o=>Promise.all([...o.layouts,o.leaf].map(u=>u==null?void 0:u[1]())));await Promise.all(f)},apply_action:async r=>{if(r.type==="error"){const c=new URL(location.href),{branch:f,route:o}=l;if(!o)return;const u=await qe(l.branch.length,f,o.errors);if(u){const h=await Q({url:c,params:l.params,branch:f.slice(0,u.idx).concat(u.node),status:500,error:r.error,route:o});l=h.state;const p=fe();T.$set(h.props),p(),ie().then(Se)}}else if(r.type==="redirect")me(r.location,{invalidateAll:!0},[]);else{const c={form:r.data,page:{...J,form:r.data,status:r.status}},f=fe();T.$set(c),f(),r.type==="success"&&ie().then(Se)}},_start_router:()=>{history.scrollRestoration="manual",addEventListener("beforeunload",o=>{var h,p;let u=!1;if(!_){const v={from:ce("from",{params:l.params,route:{id:(p=(h=l.route)==null?void 0:h.id)!=null?p:null},url:l.url}),to:null,willUnload:!0,type:"leave",cancel:()=>u=!0};i.before_navigate.forEach(E=>E(v))}u?(o.preventDefault(),o.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden"){ke(U);try{sessionStorage[Ze]=JSON.stringify(re)}catch{}}});const r=o=>{const{url:u,options:h,has:p}=ze(o);if(u&&h.prefetch&&!xe(u)){if(h.reload||p.rel_external||p.target||p.download)return;Ie(u)}};let c;const f=o=>{clearTimeout(c),c=setTimeout(()=>{var u;(u=o.target)==null||u.dispatchEvent(new CustomEvent("sveltekit:trigger_prefetch",{bubbles:!0}))},20)};n.addEventListener("touchstart",r,{passive:!0}),n.addEventListener("mousemove",f),n.addEventListener("sveltekit:trigger_prefetch",r),n.addEventListener("click",o=>{if(o.button||o.which!==1||o.metaKey||o.ctrlKey||o.shiftKey||o.altKey||o.defaultPrevented)return;const{a:u,url:h,options:p,has:v}=ze(o);if(!u||!h||!(u instanceof SVGAElement)&&h.protocol!==location.protocol&&!(h.protocol==="https:"||h.protocol==="http:")||v.download)return;if(p.reload||v.rel_external||v.target){Ve({url:h,type:"link"})||o.preventDefault(),_=!0;return}const[y,b]=h.href.split("#");if(b!==void 0&&y===location.href.split("#")[0]){$=!0,ke(U),l.url=h,K.page.set({...J,url:h}),K.page.notify();return}ye({url:h,scroll:p.noscroll?$e():null,keepfocus:!1,redirect_chain:[],details:{state:{},replaceState:h.href===location.href},accepted:()=>o.preventDefault(),blocked:()=>o.preventDefault(),type:"link"})}),addEventListener("popstate",o=>{var u;if((u=o.state)!=null&&u[D]){if(o.state[D]===U)return;const h=o.state[D]-U;ye({url:new URL(location.href),scroll:re[o.state[D]],keepfocus:!1,redirect_chain:[],details:null,accepted:()=>{U=o.state[D]},blocked:()=>{history.go(-h)},type:"popstate",delta:h})}}),addEventListener("hashchange",()=>{$&&($=!1,history.replaceState({...history.state,[D]:++U},"",location.href))});for(const o of document.querySelectorAll("link"))o.rel==="icon"&&(o.href=o.href);addEventListener("pageshow",o=>{o.persisted&&K.navigating.set(null)})},_hydrate:async({status:r,error:c,node_ids:f,params:o,route:u,data:h,form:p})=>{var y;a=!0;const v=new URL(location.href);let E;try{const b=f.map(async(S,I)=>{const A=h[I];return _e({loader:pe[S],url:v,params:o,route:u,parent:async()=>{const L={};for(let j=0;j<I;j+=1)Object.assign(L,(await b[j]).data);return L},server_data_node:ge(A)})});E=await Q({url:v,params:o,branch:await Promise.all(b),status:r,error:c,form:p,route:(y=le.find(({id:S})=>S===u.id))!=null?y:null})}catch(b){if(b instanceof Xe){await oe(new URL(b.location,location.href));return}E=await se({status:b instanceof Le?b.status:500,error:await te(b,{url:v,params:o,route:u}),url:v,route:u})}Ne(E)}}}async function Ye(n,e){var l;const t=new URL(n);t.pathname=kt(n.pathname);const s=await he(t.href,{headers:{"x-sveltekit-invalidated":e.map(a=>a?"1":"").join(",")}}),i=await s.json();if(!s.ok)throw new Error(i);return(l=i.nodes)==null||l.forEach(a=>{var d,w;(a==null?void 0:a.type)==="data"&&(a.data=mt(a.data),a.uses={dependencies:new Set((d=a.uses.dependencies)!=null?d:[]),params:new Set((w=a.uses.params)!=null?w:[]),parent:!!a.uses.parent,route:!!a.uses.route,url:!!a.uses.url})}),i}function te(n,e){var t;return n instanceof Le?n.body:(t=Kt.handleError({error:n,event:e}))!=null?t:{message:e.route.id!=null?"Internal Error":"Not Found"}}const Gt=["hash","href","host","hostname","origin","pathname","port","protocol","search","searchParams","toString","toJSON"];function ce(n,e){for(const t of Gt)Object.defineProperty(e,t,{get(){throw new Error(`The navigation shape changed - ${n}.${t} should now be ${n}.url.${t}`)},enumerable:!1});return Object.defineProperty(e,"routeId",{get(){throw new Error(`The navigation shape changed - ${n}.routeId should now be ${n}.route.id`)},enumerable:!1}),e}function fe(){return()=>{}}function Se(){const n=document.querySelector("[autofocus]");if(n)n.focus();else{const e=document.body,t=e.getAttribute("tabindex");e.tabIndex=-1,e.focus({preventScroll:!0}),setTimeout(()=>{var s;(s=getSelection())==null||s.removeAllRanges()}),t!==null?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}}async function Yt({env:n,hydrate:e,paths:t,target:s,version:i}){dt(t),pt(i);const l=zt({target:s,base:t.base});ht({client:l}),e?await l._hydrate(e):l.goto(location.href,{replaceState:!0}),l._start_router()}export{Yt as start};
