text: var tt=Object.defineProperty,nt=Object.defineProperties;var rt=Object.getOwnPropertyDescriptors;var ue=Object.getOwnPropertySymbols;var De=Object.prototype.hasOwnProperty,Ve=Object.prototype.propertyIsEnumerable;var je=(n,e,t)=>e in n?tt(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,x=(n,e)=>{for(var t in e||(e={}))De.call(e,t)&&je(n,t,e[t]);if(ue)for(var t of ue(e))Ve.call(e,t)&&je(n,t,e[t]);return n},ne=(n,e)=>nt(n,rt(e));var ze=(n,e)=>{var t={};for(var s in n)De.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&ue)for(var s of ue(n))e.indexOf(s)<0&&Ve.call(n,s)&&(t[s]=n[s]);return t};import{S as st,i as it,s as at,e as ot,c as lt,a as ct,d as V,b as be,f as B,g as z,t as ft,h as ut,j as dt,k as pt,l as T,m as ht,n as G,o as C,p as M,q as I,r as _t,u as mt,v as $e,w as q,x as ie,y as J,z as ae,A as oe,B as K,C as le,D as qe}from"./chunks/index-9fe72fd8.js";import{w as de}from"./chunks/index-92d65ea7.js";import{i as gt}from"./chunks/singletons-d1fb5791.js";let Je="",Qe="";function wt(n){Je=n.base,Qe=n.assets||Je}function bt(n){let e,t,s;const c=[n[1]||{}];var l=n[0][0];function f(r){let i={};for(let a=0;a<c.length;a+=1)i=le(i,c[a]);return{props:i}}return l&&(e=new l(f())),{c(){e&&q(e.$$.fragment),t=T()},l(r){e&&ie(e.$$.fragment,r),t=T()},m(r,i){e&&J(e,r,i),z(r,t,i),s=!0},p(r,i){const a=i&2?ae(c,[oe(r[1]||{})]):{};if(l!==(l=r[0][0])){if(e){G();const d=e;C(d.$$.fragment,1,0,()=>{K(d,1)}),M()}l?(e=new l(f()),q(e.$$.fragment),I(e.$$.fragment,1),J(e,t.parentNode,t)):e=null}else l&&e.$set(a)},i(r){s||(e&&I(e.$$.fragment,r),s=!0)},o(r){e&&C(e.$$.fragment,r),s=!1},d(r){r&&V(t),e&&K(e,r)}}}function yt(n){let e,t,s;const c=[n[1]||{}];var l=n[0][0];function f(r){let i={$$slots:{default:[Et]},$$scope:{ctx:r}};for(let a=0;a<c.length;a+=1)i=le(i,c[a]);return{props:i}}return l&&(e=new l(f(n))),{c(){e&&q(e.$$.fragment),t=T()},l(r){e&&ie(e.$$.fragment,r),t=T()},m(r,i){e&&J(e,r,i),z(r,t,i),s=!0},p(r,i){const a=i&2?ae(c,[oe(r[1]||{})]):{};if(i&525&&(a.$$scope={dirty:i,ctx:r}),l!==(l=r[0][0])){if(e){G();const d=e;C(d.$$.fragment,1,0,()=>{K(d,1)}),M()}l?(e=new l(f(r)),q(e.$$.fragment),I(e.$$.fragment,1),J(e,t.parentNode,t)):e=null}else l&&e.$set(a)},i(r){s||(e&&I(e.$$.fragment,r),s=!0)},o(r){e&&C(e.$$.fragment,r),s=!1},d(r){r&&V(t),e&&K(e,r)}}}function vt(n){let e,t,s;const c=[n[2]||{}];var l=n[0][1];function f(r){let i={};for(let a=0;a<c.length;a+=1)i=le(i,c[a]);return{props:i}}return l&&(e=new l(f())),{c(){e&&q(e.$$.fragment),t=T()},l(r){e&&ie(e.$$.fragment,r),t=T()},m(r,i){e&&J(e,r,i),z(r,t,i),s=!0},p(r,i){const a=i&4?ae(c,[oe(r[2]||{})]):{};if(l!==(l=r[0][1])){if(e){G();const d=e;C(d.$$.fragment,1,0,()=>{K(d,1)}),M()}l?(e=new l(f()),q(e.$$.fragment),I(e.$$.fragment,1),J(e,t.parentNode,t)):e=null}else l&&e.$set(a)},i(r){s||(e&&I(e.$$.fragment,r),s=!0)},o(r){e&&C(e.$$.fragment,r),s=!1},d(r){r&&V(t),e&&K(e,r)}}}function $t(n){let e,t,s;const c=[n[2]||{}];var l=n[0][1];function f(r){let i={$$slots:{default:[kt]},$$scope:{ctx:r}};for(let a=0;a<c.length;a+=1)i=le(i,c[a]);return{props:i}}return l&&(e=new l(f(n))),{c(){e&&q(e.$$.fragment),t=T()},l(r){e&&ie(e.$$.fragment,r),t=T()},m(r,i){e&&J(e,r,i),z(r,t,i),s=!0},p(r,i){const a=i&4?ae(c,[oe(r[2]||{})]):{};if(i&521&&(a.$$scope={dirty:i,ctx:r}),l!==(l=r[0][1])){if(e){G();const d=e;C(d.$$.fragment,1,0,()=>{K(d,1)}),M()}l?(e=new l(f(r)),q(e.$$.fragment),I(e.$$.fragment,1),J(e,t.parentNode,t)):e=null}else l&&e.$set(a)},i(r){s||(e&&I(e.$$.fragment,r),s=!0)},o(r){e&&C(e.$$.fragment,r),s=!1},d(r){r&&V(t),e&&K(e,r)}}}function kt(n){let e,t,s;const c=[n[3]||{}];var l=n[0][2];function f(r){let i={};for(let a=0;a<c.length;a+=1)i=le(i,c[a]);return{props:i}}return l&&(e=new l(f())),{c(){e&&q(e.$$.fragment),t=T()},l(r){e&&ie(e.$$.fragment,r),t=T()},m(r,i){e&&J(e,r,i),z(r,t,i),s=!0},p(r,i){const a=i&8?ae(c,[oe(r[3]||{})]):{};if(l!==(l=r[0][2])){if(e){G();const d=e;C(d.$$.fragment,1,0,()=>{K(d,1)}),M()}l?(e=new l(f()),q(e.$$.fragment),I(e.$$.fragment,1),J(e,t.parentNode,t)):e=null}else l&&e.$set(a)},i(r){s||(e&&I(e.$$.fragment,r),s=!0)},o(r){e&&C(e.$$.fragment,r),s=!1},d(r){r&&V(t),e&&K(e,r)}}}function Et(n){let e,t,s,c;const l=[$t,vt],f=[];function r(i,a){return i[0][2]?0:1}return e=r(n),t=f[e]=l[e](n),{c(){t.c(),s=T()},l(i){t.l(i),s=T()},m(i,a){f[e].m(i,a),z(i,s,a),c=!0},p(i,a){let d=e;e=r(i),e===d?f[e].p(i,a):(G(),C(f[d],1,1,()=>{f[d]=null}),M(),t=f[e],t?t.p(i,a):(t=f[e]=l[e](i),t.c()),I(t,1),t.m(s.parentNode,s))},i(i){c||(I(t),c=!0)},o(i){C(t),c=!1},d(i){f[e].d(i),i&&V(s)}}}function Ke(n){let e,t=n[5]&&Be(n);return{c(){e=ot("div"),t&&t.c(),this.h()},l(s){e=lt(s,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var c=ct(e);t&&t.l(c),c.forEach(V),this.h()},h(){be(e,"id","svelte-announcer"),be(e,"aria-live","assertive"),be(e,"aria-atomic","true"),B(e,"position","absolute"),B(e,"left","0"),B(e,"top","0"),B(e,"clip","rect(0 0 0 0)"),B(e,"clip-path","inset(50%)"),B(e,"overflow","hidden"),B(e,"white-space","nowrap"),B(e,"width","1px"),B(e,"height","1px")},m(s,c){z(s,e,c),t&&t.m(e,null)},p(s,c){s[5]?t?t.p(s,c):(t=Be(s),t.c(),t.m(e,null)):t&&(t.d(1),t=null)},d(s){s&&V(e),t&&t.d()}}}function Be(n){let e;return{c(){e=ft(n[6])},l(t){e=ut(t,n[6])},m(t,s){z(t,e,s)},p(t,s){s&64&&dt(e,t[6])},d(t){t&&V(e)}}}function Rt(n){let e,t,s,c,l;const f=[yt,bt],r=[];function i(d,S){return d[0][1]?0:1}e=i(n),t=r[e]=f[e](n);let a=n[4]&&Ke(n);return{c(){t.c(),s=pt(),a&&a.c(),c=T()},l(d){t.l(d),s=ht(d),a&&a.l(d),c=T()},m(d,S){r[e].m(d,S),z(d,s,S),a&&a.m(d,S),z(d,c,S),l=!0},p(d,[S]){let E=e;e=i(d),e===E?r[e].p(d,S):(G(),C(r[E],1,1,()=>{r[E]=null}),M(),t=r[e],t?t.p(d,S):(t=r[e]=f[e](d),t.c()),I(t,1),t.m(s.parentNode,s)),d[4]?a?a.p(d,S):(a=Ke(d),a.c(),a.m(c.parentNode,c)):a&&(a.d(1),a=null)},i(d){l||(I(t),l=!0)},o(d){C(t),l=!1},d(d){r[e].d(d),d&&V(s),a&&a.d(d),d&&V(c)}}}function Lt(n,e,t){let{stores:s}=e,{page:c}=e,{components:l}=e,{props_0:f=null}=e,{props_1:r=null}=e,{props_2:i=null}=e;_t("__svelte__",s),mt(s.page.notify);let a=!1,d=!1,S=null;return $e(()=>{const E=s.page.subscribe(()=>{a&&(t(5,d=!0),t(6,S=document.title||"untitled page"))});return t(4,a=!0),E}),n.$$set=E=>{"stores"in E&&t(7,s=E.stores),"page"in E&&t(8,c=E.page),"components"in E&&t(0,l=E.components),"props_0"in E&&t(1,f=E.props_0),"props_1"in E&&t(2,r=E.props_1),"props_2"in E&&t(3,i=E.props_2)},n.$$.update=()=>{n.$$.dirty&384&&s.page.set(c)},[l,f,r,i,a,d,S,s,c]}class St extends st{constructor(e){super(),it(this,e,Lt,Rt,at,{stores:7,page:8,components:0,props_0:1,props_1:2,props_2:3})}}const Ut="modulepreload",We={},At="/_app/",re=function(e,t){return!t||t.length===0?e():Promise.all(t.map(s=>{if(s=`${At}${s}`,s in We)return;We[s]=!0;const c=s.endsWith(".css"),l=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${s}"]${l}`))return;const f=document.createElement("link");if(f.rel=c?"stylesheet":Ut,c||(f.as="script",f.crossOrigin=""),f.href=s,document.head.appendChild(f),c)return new Promise((r,i)=>{f.addEventListener("load",r),f.addEventListener("error",()=>i(new Error(`Unable to preload CSS for ${s}`)))})})).then(()=>e())},Ot={},Re=[()=>re(()=>import("./pages/__layout.svelte-530009b1.js"),["pages/__layout.svelte-530009b1.js","assets/pages/__layout.svelte-7eba6042.css","chunks/index-9fe72fd8.js"]),()=>re(()=>import("./error.svelte-c8df2b3e.js"),["error.svelte-c8df2b3e.js","chunks/index-9fe72fd8.js"]),()=>re(()=>import("./pages/about.svelte-83f3fd46.js"),["pages/about.svelte-83f3fd46.js","assets/pages/about.svelte-846f56b5.css","chunks/index-9fe72fd8.js"]),()=>re(()=>import("./pages/index.svelte-964b51f2.js"),["pages/index.svelte-964b51f2.js","assets/pages/index.svelte-72b9ed75.css","chunks/index-9fe72fd8.js","chunks/index-92d65ea7.js"]),()=>re(()=>import("./pages/todos/index.svelte-f0948115.js"),["pages/todos/index.svelte-f0948115.js","assets/pages/todos/index.svelte-785505fa.css","chunks/index-9fe72fd8.js","chunks/singletons-d1fb5791.js"])],Pt={"":[[0,3],[1]],about:[[0,2],[1]],todos:[[0,4],[1],1]};function Ye(n){return n instanceof Error||n&&n.name&&n.message?n:new Error(JSON.stringify(n))}function Ge(n){if(n.fallthrough)throw new Error("fallthrough is no longer supported. Use matchers instead: https://kit.svelte.dev/docs/routing#advanced-routing-matching");if("maxage"in n)throw new Error("maxage should be replaced with cache: { maxage }");const e=n.status&&n.status>=400&&n.status<=599&&!n.redirect;if(n.error||e){const t=n.status;if(!n.error&&e)return{status:t||500,error:new Error};const s=typeof n.error=="string"?new Error(n.error):n.error;return s instanceof Error?!t||t<400||t>599?(console.warn('"error" returned from load() without a valid status code \u2014 defaulting to 500'),{status:500,error:s}):{status:t,error:s}:{status:500,error:new Error(`"error" property returned from load() must be a string or instance of Error, received type "${typeof s}"`)}}if(n.redirect){if(!n.status||Math.floor(n.status/100)!==3)throw new Error('"redirect" property returned from load() must be accompanied by a 3xx status code');if(typeof n.redirect!="string")throw new Error('"redirect" property returned from load() must be a string')}if(n.dependencies&&(!Array.isArray(n.dependencies)||n.dependencies.some(t=>typeof t!="string")))throw new Error('"dependencies" property returned from load() must be of type string[]');if(n.context)throw new Error('You are returning "context" from a load function. "context" was renamed to "stuff", please adjust your code accordingly.');return n}function Nt(n,e){return n==="/"||e==="ignore"?n:e==="never"?n.endsWith("/")?n.slice(0,-1):n:e==="always"&&!n.endsWith("/")?n+"/":n}function Me(n){let e=n.baseURI;if(!e){const t=n.getElementsByTagName("base");e=t.length?t[0].href:n.URL}return e}function ke(){return{x:pageXOffset,y:pageYOffset}}function Fe(n){return n.composedPath().find(t=>t instanceof Node&&t.nodeName.toUpperCase()==="A")}function Xe(n){return n instanceof SVGAElement?new URL(n.href.baseVal,document.baseURI):new URL(n.href)}function He(n){const e=de(n);let t=!0;function s(){t=!0,e.update(f=>f)}function c(f){t=!1,e.set(f)}function l(f){let r;return e.subscribe(i=>{(r===void 0||t&&i!==r)&&f(r=i)})}return{notify:s,set:c,subscribe:l}}function xt(){const{set:n,subscribe:e}=de(!1),t="1653404054379";let s;async function c(){clearTimeout(s);const f=await fetch(`${Qe}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(f.ok){const{version:r}=await f.json(),i=r!==t;return i&&(n(!0),clearTimeout(s)),i}else throw new Error(`Version check failed: ${f.status}`)}return{subscribe:e,check:c}}function Tt(n){let e=5381,t=n.length;if(typeof n=="string")for(;t;)e=e*33^n.charCodeAt(--t);else for(;t;)e=e*33^n[--t];return(e>>>0).toString(36)}const Ee=window.fetch;function Ct(n,e){let s=`script[sveltekit\\:data-type="data"][sveltekit\\:data-url=${JSON.stringify(typeof n=="string"?n:n.url)}]`;e&&typeof e.body=="string"&&(s+=`[sveltekit\\:data-body="${Tt(e.body)}"]`);const c=document.querySelector(s);if(c&&c.textContent){const l=JSON.parse(c.textContent),{body:f}=l,r=ze(l,["body"]);return Promise.resolve(new Response(f,r))}return Ee(n,e)}const It=/^(\.\.\.)?(\w+)(?:=(\w+))?$/;function jt(n){const e=[],t=[];let s=!0;return{pattern:n===""?/^\/$/:new RegExp(`^${decodeURIComponent(n).split(/(?:@[a-zA-Z0-9_-]+)?(?:\/|$)/).map((l,f,r)=>{const i=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(l);if(i)return e.push(i[1]),t.push(i[2]),"(?:/(.*))?";const a=f===r.length-1;return l&&"/"+l.split(/\[(.+?)\]/).map((d,S)=>{if(S%2){const[,E,H,F]=It.exec(d);return e.push(H),t.push(F),E?"(.*?)":"([^/]+?)"}return a&&d.includes(".")&&(s=!1),d.normalize().replace(/%5[Bb]/g,"[").replace(/%5[Dd]/g,"]").replace(/#/g,"%23").replace(/\?/g,"%3F").replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}).join("")}).join("")}${s?"/?":""}$`),names:e,types:t}}function Dt(n,e,t,s){const c={};for(let l=0;l<e.length;l+=1){const f=e[l],r=t[l],i=n[l+1]||"";if(r){const a=s[r];if(!a)throw new Error(`Missing "${r}" param matcher`);if(!a(i))return}c[f]=i}return c}function Vt(n,e,t){return Object.entries(e).map(([c,[l,f,r]])=>{const{pattern:i,names:a,types:d}=jt(c);return{id:c,exec:S=>{const E=i.exec(S);if(E)return Dt(E,a,d,t)},a:l.map(S=>n[S]),b:f.map(S=>n[S]),has_shadow:!!r}})}const et="sveltekit:scroll",W="sveltekit:index",ye=Vt(Re,Pt,Ot),zt=Re[0](),qt=Re[1](),Ze={};let se={};try{se=JSON.parse(sessionStorage[et])}catch{}function ve(n){se[n]=ke()}function Jt({target:n,session:e,base:t,trailing_slash:s}){var Ce;const c=new Map,l=[],f={url:He({}),page:He({}),navigating:de(null),session:de(e),updated:xt()},r={id:null,promise:null},i={before_navigate:[],after_navigate:[]};let a={branch:[],error:null,session_id:0,stuff:Ze,url:null},d=!1,S=!0,E=!1,H=1,F=null,Le,Se,Ue=!1;f.session.subscribe(async o=>{Se=o,Ue&&(H+=1,me(new URL(location.href),[],!0))}),Ue=!0;let X=!0,j=(Ce=history.state)==null?void 0:Ce[W];j||(j=Date.now(),history.replaceState(ne(x({},history.state),{[W]:j}),"",location.href));const pe=se[j];pe&&(history.scrollRestoration="manual",scrollTo(pe.x,pe.y));let he=!1,_e,Ae;async function Oe(o,{noscroll:p=!1,replaceState:g=!1,keepfocus:u=!1,state:h={}},w){const $=new URL(o,Me(document));if(X)return we({url:$,scroll:p?ke():null,keepfocus:u,redirect_chain:w,details:{state:h,replaceState:g},accepted:()=>{},blocked:()=>{}});await ee($)}async function Pe(o){const p=Te(o);if(!p)throw new Error("Attempted to prefetch a URL that does not belong to this app");return r.promise=xe(p,!1),r.id=p.id,r.promise}async function me(o,p,g,u,h){var R,U,A;const w=Te(o),$=Ae={};let _=w&&await xe(w,g);if(!_&&o.origin===location.origin&&o.pathname===location.pathname&&(_=await Q({status:404,error:new Error(`Not found: ${o.pathname}`),url:o,routeId:null})),!_)return await ee(o),!1;if(Ae!==$)return!1;if(l.length=0,_.redirect)if(p.length>10||p.includes(o.pathname))_=await Q({status:500,error:new Error("Redirect loop"),url:o,routeId:null});else return X?Oe(new URL(_.redirect,o).href,{},[...p,o.pathname]):await ee(new URL(_.redirect,location.href)),!1;else((U=(R=_.props)==null?void 0:R.page)==null?void 0:U.status)>=400&&await f.updated.check()&&await ee(o);if(E=!0,u&&u.details){const{details:y}=u,v=y.replaceState?0:1;y.state[W]=j+=v,history[y.replaceState?"replaceState":"pushState"](y.state,"",o)}if(d?(a=_.state,_.props.page&&(_.props.page.url=o),Le.$set(_.props)):Ne(_),u){const{scroll:y,keepfocus:v}=u;if(!v){const b=document.body,k=b.getAttribute("tabindex");(A=getSelection())==null||A.removeAllRanges(),b.tabIndex=-1,b.focus({preventScroll:!0}),k!==null?b.setAttribute("tabindex",k):b.removeAttribute("tabindex")}if(await qe(),S){const b=o.hash&&document.getElementById(o.hash.slice(1));y?scrollTo(y.x,y.y):b?b.scrollIntoView():scrollTo(0,0)}}else await qe();r.promise=null,r.id=null,S=!0,_.props.page&&(_e=_.props.page);const m=_.state.branch[_.state.branch.length-1];X=(m==null?void 0:m.module.router)!==!1,h&&h(),E=!1}function Ne(o){a=o.state;const p=document.querySelector("style[data-sveltekit]");if(p&&p.remove(),_e=o.props.page,Le=new St({target:n,props:ne(x({},o.props),{stores:f}),hydrate:!0}),X){const g={from:null,to:new URL(location.href)};i.after_navigate.forEach(u=>u(g))}d=!0}async function ge({url:o,params:p,stuff:g,branch:u,status:h,error:w,routeId:$}){var v,b;const _=u.filter(Boolean),m=_.find(k=>{var O;return(O=k.loaded)==null?void 0:O.redirect}),R={redirect:(v=m==null?void 0:m.loaded)==null?void 0:v.redirect,state:{url:o,params:p,branch:u,error:w,stuff:g,session_id:H},props:{components:_.map(k=>k.module.default)}};for(let k=0;k<_.length;k+=1){const O=_[k].loaded;R.props[`props_${k}`]=O?await O.props:null}if(!a.url||o.href!==a.url.href||a.error!==w||a.stuff!==g){R.props.page={error:w,params:p,routeId:$,status:h,stuff:g,url:o};const k=(O,L)=>{Object.defineProperty(R.props.page,O,{get:()=>{throw new Error(`$page.${O} has been replaced by $page.url.${L}`)}})};k("origin","origin"),k("path","pathname"),k("query","searchParams")}const A=_[_.length-1],y=(b=A==null?void 0:A.loaded)==null?void 0:b.cache;if(y){const k=o.pathname+o.search;let O=!1;const L=()=>{c.get(k)===R&&c.delete(k),N(),clearTimeout(P)},P=setTimeout(L,y.maxage*1e3),N=f.session.subscribe(()=>{O&&L()});O=!0,c.set(k,R)}return R}async function Z({status:o,error:p,module:g,url:u,params:h,stuff:w,props:$,routeId:_}){const m={module:g,uses:{params:new Set,url:!1,session:!1,stuff:!1,dependencies:new Set},loaded:null,stuff:w};function R(y){const{href:v}=new URL(y,u);m.uses.dependencies.add(v)}$&&m.uses.dependencies.add(u.href);const U={};for(const y in h)Object.defineProperty(U,y,{get(){return m.uses.params.add(y),h[y]},enumerable:!0});const A=Se;if(g.load){const y={routeId:_,params:U,props:$||{},get url(){return m.uses.url=!0,new Proxy(u,{get:(b,k)=>{if(k==="hash")throw new Error("url.hash is inaccessible from load. Consider accessing hash from the page store within the script tag of your component.");return Reflect.get(b,k,b)}})},get session(){return m.uses.session=!0,A},get stuff(){return m.uses.stuff=!0,x({},w)},async fetch(b,k){let O;typeof b=="string"?O=b:(O=b.url,k=x({body:b.method==="GET"||b.method==="HEAD"?void 0:await b.blob(),cache:b.cache,credentials:b.credentials,headers:b.headers,integrity:b.integrity,keepalive:b.keepalive,method:b.method,mode:b.mode,redirect:b.redirect,referrer:b.referrer,referrerPolicy:b.referrerPolicy,signal:b.signal},k));const L=new URL(O,u).href;return R(L),d?Ee(L,k):Ct(O,k)},status:o!=null?o:null,error:p!=null?p:null};let v;if(v=await g.load.call(null,y),!v)throw new Error("load function must return a value");m.loaded=Ge(v),m.loaded.stuff&&(m.stuff=m.loaded.stuff),m.loaded.dependencies&&m.loaded.dependencies.forEach(R)}else $&&(m.loaded=Ge({props:$}));return m}async function xe({id:o,url:p,params:g,route:u},h){var b,k,O;if(r.id===o&&r.promise)return r.promise;if(!h){const L=c.get(o);if(L)return L}const{a:w,b:$,has_shadow:_}=u,m=a.url&&{url:o!==a.url.pathname+a.url.search,params:Object.keys(g).filter(L=>a.params[L]!==g[L]),session:H!==a.session_id};let R=[],U=Ze,A=!1,y=200,v=null;w.forEach(L=>L().catch(()=>{}));e:for(let L=0;L<w.length;L+=1){let P;try{if(!w[L])continue;const N=await w[L](),D=a.branch[L];if(!D||N!==D.module||m.url&&D.uses.url||m.params.some(Y=>D.uses.params.has(Y))||m.session&&D.uses.session||Array.from(D.uses.dependencies).some(Y=>l.some(fe=>fe(Y)))||A&&D.uses.stuff){let Y={};const fe=_&&L===w.length-1;if(fe){const te=await Ee(`${p.pathname}${p.pathname.endsWith("/")?"":"/"}__data.json${p.search}`,{headers:{"x-sveltekit-load":"true"}});if(te.ok){const Ie=te.headers.get("x-sveltekit-location");if(Ie)return{redirect:Ie,props:{},state:a};Y=te.status===204?{}:await te.json()}else y=te.status,v=new Error("Failed to load data")}if(v||(P=await Z({module:N,url:p,params:g,props:Y,stuff:U,routeId:u.id})),P&&(fe&&(P.uses.url=!0),P.loaded)){if(P.loaded.error&&(y=P.loaded.status,v=P.loaded.error),P.loaded.redirect)return{redirect:P.loaded.redirect,props:{},state:a};P.loaded.stuff&&(A=!0)}}else P=D}catch(N){y=500,v=Ye(N)}if(v){for(;L--;)if($[L]){let N,D,ce=L;for(;!(D=R[ce]);)ce-=1;try{if(N=await Z({status:y,error:v,module:await $[L](),url:p,params:g,stuff:D.stuff,routeId:u.id}),(b=N==null?void 0:N.loaded)!=null&&b.error)continue;(k=N==null?void 0:N.loaded)!=null&&k.stuff&&(U=x(x({},U),N.loaded.stuff)),R=R.slice(0,ce+1).concat(N);break e}catch{continue}}return await Q({status:y,error:v,url:p,routeId:u.id})}else(O=P==null?void 0:P.loaded)!=null&&O.stuff&&(U=x(x({},U),P.loaded.stuff)),R.push(P)}return await ge({url:p,params:g,stuff:U,branch:R,status:y,error:v,routeId:u.id})}async function Q({status:o,error:p,url:g,routeId:u}){var _,m;const h={},w=await Z({module:await zt,url:g,params:h,stuff:{},routeId:u}),$=await Z({status:o,error:p,module:await qt,url:g,params:h,stuff:w&&w.loaded&&w.loaded.stuff||{},routeId:u});return await ge({url:g,params:h,stuff:x(x({},(_=w==null?void 0:w.loaded)==null?void 0:_.stuff),(m=$==null?void 0:$.loaded)==null?void 0:m.stuff),branch:[w,$],status:o,error:p,routeId:u})}function Te(o){if(o.origin!==location.origin||!o.pathname.startsWith(t))return;const p=decodeURI(o.pathname.slice(t.length)||"/");for(const g of ye){const u=g.exec(p);if(u)return{id:o.pathname+o.search,route:g,params:u,url:o}}}async function we({url:o,scroll:p,keepfocus:g,redirect_chain:u,details:h,accepted:w,blocked:$}){const _=a.url;let m=!1;const R={from:_,to:o,cancel:()=>m=!0};if(i.before_navigate.forEach(y=>y(R)),m){$();return}const U=Nt(o.pathname,s),A=new URL(o.origin+U+o.search+o.hash);ve(j),w(),d&&f.navigating.set({from:a.url,to:A}),await me(A,u,!1,{scroll:p,keepfocus:g,details:h},()=>{const y={from:_,to:A};i.after_navigate.forEach(v=>v(y)),f.navigating.set(null)})}function ee(o){return location.href=o.href,new Promise(()=>{})}return{after_navigate:o=>{$e(()=>(i.after_navigate.push(o),()=>{const p=i.after_navigate.indexOf(o);i.after_navigate.splice(p,1)}))},before_navigate:o=>{$e(()=>(i.before_navigate.push(o),()=>{const p=i.before_navigate.indexOf(o);i.before_navigate.splice(p,1)}))},disable_scroll_handling:()=>{(E||!d)&&(S=!1)},goto:(o,p={})=>Oe(o,p,[]),invalidate:o=>{if(typeof o=="function")l.push(o);else{const{href:p}=new URL(o,location.href);l.push(g=>g===p)}return F||(F=Promise.resolve().then(async()=>{await me(new URL(location.href),[],!0),F=null})),F},prefetch:async o=>{const p=new URL(o,Me(document));await Pe(p)},prefetch_routes:async o=>{const g=(o?ye.filter(u=>o.some(h=>u.exec(h))):ye).map(u=>Promise.all(u.a.map(h=>h())));await Promise.all(g)},_start_router:()=>{history.scrollRestoration="manual",addEventListener("beforeunload",u=>{let h=!1;const w={from:a.url,to:null,cancel:()=>h=!0};i.before_navigate.forEach($=>$(w)),h?(u.preventDefault(),u.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden"){ve(j);try{sessionStorage[et]=JSON.stringify(se)}catch{}}});const o=u=>{const h=Fe(u);h&&h.href&&h.hasAttribute("sveltekit:prefetch")&&Pe(Xe(h))};let p;const g=u=>{clearTimeout(p),p=setTimeout(()=>{var h;(h=u.target)==null||h.dispatchEvent(new CustomEvent("sveltekit:trigger_prefetch",{bubbles:!0}))},20)};addEventListener("touchstart",o),addEventListener("mousemove",g),addEventListener("sveltekit:trigger_prefetch",o),addEventListener("click",u=>{if(!X||u.button||u.which!==1||u.metaKey||u.ctrlKey||u.shiftKey||u.altKey||u.defaultPrevented)return;const h=Fe(u);if(!h||!h.href)return;const w=h instanceof SVGAElement,$=Xe(h);if(!w&&$.origin==="null")return;const _=(h.getAttribute("rel")||"").split(/\s+/);if(h.hasAttribute("download")||_.includes("external")||h.hasAttribute("sveltekit:reload")||(w?h.target.baseVal:h.target))return;const[m,R]=$.href.split("#");if(R!==void 0&&m===location.href.split("#")[0]){he=!0,ve(j),f.page.set(ne(x({},_e),{url:$})),f.page.notify();return}we({url:$,scroll:h.hasAttribute("sveltekit:noscroll")?ke():null,keepfocus:!1,redirect_chain:[],details:{state:{},replaceState:$.href===location.href},accepted:()=>u.preventDefault(),blocked:()=>u.preventDefault()})}),addEventListener("popstate",u=>{if(u.state&&X){if(u.state[W]===j)return;we({url:new URL(location.href),scroll:se[u.state[W]],keepfocus:!1,redirect_chain:[],details:null,accepted:()=>{j=u.state[W]},blocked:()=>{const h=j-u.state[W];history.go(h)}})}}),addEventListener("hashchange",()=>{he&&(he=!1,history.replaceState(ne(x({},history.state),{[W]:++j}),"",location.href))})},_hydrate:async({status:o,error:p,nodes:g,params:u,routeId:h})=>{const w=new URL(location.href),$=[];let _={},m,R;try{for(let U=0;U<g.length;U+=1){const A=U===g.length-1;let y;if(A){const b=document.querySelector('script[sveltekit\\:data-type="props"]');b&&(y=JSON.parse(b.textContent))}const v=await Z({module:await g[U],url:w,params:u,stuff:_,status:A?o:void 0,error:A?p:void 0,props:y,routeId:h});if(y&&(v.uses.dependencies.add(w.href),v.uses.url=!0),$.push(v),v&&v.loaded)if(v.loaded.error){if(p)throw v.loaded.error;R={status:v.loaded.status,error:v.loaded.error,url:w,routeId:h}}else v.loaded.stuff&&(_=x(x({},_),v.loaded.stuff))}m=R?await Q(R):await ge({url:w,params:u,stuff:_,branch:$,status:o,error:p,routeId:h})}catch(U){if(p)throw U;m=await Q({status:500,error:Ye(U),url:w,routeId:h})}m.redirect&&await ee(new URL(m.redirect,location.href)),Ne(m)}}}async function Gt({paths:n,target:e,session:t,route:s,spa:c,trailing_slash:l,hydrate:f}){const r=Jt({target:e,session:t,base:n.base,trailing_slash:l});gt({client:r}),wt(n),f&&await r._hydrate(f),s&&(c&&r.goto(location.href,{replaceState:!0}),r._start_router()),dispatchEvent(new CustomEvent("sveltekit:start"))}export{Gt as start};
  