import{z as B,ag as ge,X as me,s as _e,Y as ye,P as wt}from"./scheduler.C39PMv9a.js";new URL("sveltekit-internal://");function we(t,n){return t==="/"||n==="ignore"?t:n==="never"?t.endsWith("/")?t.slice(0,-1):t:n==="always"&&!t.endsWith("/")?t+"/":t}function ve(t){return t.split("%25").map(decodeURI).join("%25")}function be(t){for(const n in t)t[n]=decodeURIComponent(t[n]);return t}function gt({href:t}){return t.split("#")[0]}const ke=["href","pathname","search","toString","toJSON"];function Ee(t,n,e){const r=new URL(t);Object.defineProperty(r,"searchParams",{value:new Proxy(r.searchParams,{get(a,o){if(o==="get"||o==="getAll"||o==="has")return s=>(e(s),a[o](s));n();const i=Reflect.get(a,o);return typeof i=="function"?i.bind(a):i}}),enumerable:!0,configurable:!0});for(const a of ke)Object.defineProperty(r,a,{get(){return n(),t[a]},enumerable:!0,configurable:!0});return r}const Ae="/__data.json",Se=".html__data.json";function Re(t){return t.endsWith(".html")?t.replace(/\.html$/,Se):t.replace(/\/$/,"")+Ae}function Ie(...t){let n=5381;for(const e of t)if(typeof e=="string"){let r=e.length;for(;r;)n=n*33^e.charCodeAt(--r)}else if(ArrayBuffer.isView(e)){const r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);let a=r.length;for(;a;)n=n*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(n>>>0).toString(36)}function Le(t){const n=atob(t),e=new Uint8Array(n.length);for(let r=0;r((t instanceof Request?t.method:(n==null?void 0:n.method)||"GET")!=="GET"&&H.delete(At(t)),Bt(t,n));const H=new Map;function Pe(t,n){const e=At(t,n),r=document.querySelector(e);if(r!=null&&r.textContent){let{body:a,...o}=JSON.parse(r.textContent);const i=r.getAttribute("data-ttl");return i&&H.set(e,{body:a,init:o,ttl:1e3*Number(i)}),r.getAttribute("data-b64")!==null&&(a=Le(a)),Promise.resolve(new Response(a,o))}return window.fetch(t,n)}function Ue(t,n,e){if(H.size>0){const r=At(t,e),a=H.get(r);if(a){if(performance.now(){const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return n.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/(.*))?";const o=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(o)return n.push({name:o[1],matcher:o[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const i=r.split(/\[(.+?)\](?!\])/);return"/"+i.map((c,l)=>{if(l%2){if(c.startsWith("x+"))return mt(String.fromCharCode(parseInt(c.slice(2),16)));if(c.startsWith("u+"))return mt(String.fromCharCode(...c.slice(2).split("-").map(f=>parseInt(f,16))));const u=xe.exec(c),[,h,p,d,g]=u;return n.push({name:d,matcher:g,optional:!!h,rest:!!p,chained:p?l===1&&i[0]==="":!1}),p?"(.*?)":h?"([^/]*)?":"([^/]+?)"}return mt(c)}).join("")}).join("")}/?$`),params:n}}function Ne(t){return!/^\([^)]+\)$/.test(t)}function Oe(t){return t.slice(1).split("/").filter(Ne)}function je(t,n,e){const r={},a=t.slice(1),o=a.filter(s=>s!==void 0);let i=0;for(let s=0;su).join("/"),i=0),l===void 0){c.rest&&(r[c.name]="");continue}if(!c.matcher||e[c.matcher](l)){r[c.name]=l;const u=n[s+1],h=a[s+1];u&&!u.rest&&u.optional&&h&&c.chained&&(i=0),!u&&!h&&Object.keys(r).length===o.length&&(i=0);continue}if(c.optional&&c.chained){i++;continue}return}if(!i)return r}function mt(t){return t.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function $e({nodes:t,server_loads:n,dictionary:e,matchers:r}){const a=new Set(n);return Object.entries(e).map(([s,[c,l,u]])=>{const{pattern:h,params:p}=Te(s),d={id:s,exec:g=>{const f=h.exec(g);if(f)return je(f,p,r)},errors:[1,...u||[]].map(g=>t[g]),layouts:[0,...l||[]].map(i),leaf:o(c)};return d.errors.length=d.layouts.length=Math.max(d.errors.length,d.layouts.length),d});function o(s){const c=s<0;return c&&(s=~s),[c,t[s]]}function i(s){return s===void 0?s:[a.has(s),t[s]]}}function Ht(t,n=JSON.parse){try{return n(sessionStorage[t])}catch{}}function Ot(t,n,e=JSON.stringify){const r=e(n);try{sessionStorage[t]=r}catch{}}const j=[];function De(t,n){return{subscribe:ot(t,n).subscribe}}function ot(t,n=B){let e;const r=new Set;function a(s){if(_e(t,s)&&(t=s,e)){const c=!j.length;for(const l of r)l[1](),j.push(l,t);if(c){for(let l=0;l{r.delete(l),r.size===0&&e&&(e(),e=null)}}return{set:a,update:o,subscribe:i}}function fn(t,n,e){const r=!Array.isArray(t),a=r?[t]:t;if(!a.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const o=n.length<2;return De(e,(i,s)=>{let c=!1;const l=[];let u=0,h=B;const p=()=>{if(u)return;h();const g=n(r?l[0]:l,i,s);o?i(g):h=ye(g)?g:B},d=a.map((g,f)=>ge(g,_=>{l[f]=_,u&=~(1<{u|=1<i)}function a(i){e=!1,n.set(i)}function o(i){let s;return n.subscribe(c=>{(s===void 0||e&&c!==s)&&i(s=c)})}return{notify:r,set:a,subscribe:o}}function qe(){const{set:t,subscribe:n}=ot(!1);let e;async function r(){clearTimeout(e);try{const a=await fetch(`${Ce}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const i=(await a.json()).version!==Ve;return i&&(t(!0),clearTimeout(e)),i}catch{return!1}}return{subscribe:n,check:r}}function st(t,n){return t.origin!==X||!t.pathname.startsWith(n)}const Ge=-1,Me=-2,Be=-3,He=-4,ze=-5,Ke=-6;function dn(t,n){return Zt(JSON.parse(t),n)}function Zt(t,n){if(typeof t=="number")return a(t,!0);if(!Array.isArray(t)||t.length===0)throw new Error("Invalid input");const e=t,r=Array(e.length);function a(o,i=!1){if(o===Ge)return;if(o===Be)return NaN;if(o===He)return 1/0;if(o===ze)return-1/0;if(o===Ke)return-0;if(i)throw new Error("Invalid input");if(o in r)return r[o];const s=e[o];if(!s||typeof s!="object")r[o]=s;else if(Array.isArray(s))if(typeof s[0]=="string"){const c=s[0],l=n==null?void 0:n[c];if(l)return r[o]=l(a(s[1]));switch(c){case"Date":r[o]=new Date(s[1]);break;case"Set":const u=new Set;r[o]=u;for(let d=1;dn!=null)}class it{constructor(n,e){this.status=n,typeof e=="string"?this.body={message:e}:e?this.body=e:this.body={message:`Error: ${n}`}}toString(){return JSON.stringify(this.body)}}class te{constructor(n,e){this.status=n,this.location=e}}class Rt extends Error{constructor(n,e,r){super(r),this.status=n,this.text=e}}const We="x-sveltekit-invalidated",Xe="x-sveltekit-trailing-slash";function et(t){return t instanceof it||t instanceof Rt?t.status:500}function Ze(t){return t instanceof Rt?t.text:"Internal Error"}const O=Ht(Kt)??{},Y=Ht(zt)??{},x={url:$t({}),page:$t({}),navigating:ot(null),updated:qe()};function It(t){O[t]=St()}function Qe(t,n){let e=t+1;for(;O[e];)delete O[e],e+=1;for(e=n+1;Y[e];)delete Y[e],e+=1}function F(t){return location.href=t.href,new Promise(()=>{})}function Dt(){}let ct,bt,nt,U,kt,G;const ee=[],rt=[];let I=null;const ne=[],tn=[];let D=[],y={branch:[],error:null,url:null},Lt=!1,at=!1,Ct=!0,J=!1,M=!1,re=!1,lt=!1,N,A,L,S,q;const z=new Set;let _t;async function hn(t,n,e){var a,o;document.URL!==location.href&&(location.href=location.href),G=t,ct=$e(t),U=document.documentElement,kt=n,bt=t.nodes[0],nt=t.nodes[1],bt(),nt(),A=(a=history.state)==null?void 0:a[C],L=(o=history.state)==null?void 0:o[K],A||(A=L=Date.now(),history.replaceState({...history.state,[C]:A,[K]:L},""));const r=O[A];r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y)),e?await cn(kt,e):on(location.href,{replaceState:!0}),sn()}async function en(){if(await(_t||(_t=Promise.resolve())),!_t)return;_t=null;const t=dt(y.url,!0);I=null;const n=q={},e=t&&await xt(t);if(!(!e||n!==q)){if(e.type==="redirect")return ft(new URL(e.location,y.url).href,{},1,n);e.props.page&&(S=e.props.page),y=e.state,ae(),N.$set(e.props)}}function ae(){ee.length=0,lt=!1}function oe(t){rt.some(n=>n==null?void 0:n.snapshot)&&(Y[t]=rt.map(n=>{var e;return(e=n==null?void 0:n.snapshot)==null?void 0:e.capture()}))}function se(t){var n;(n=Y[t])==null||n.forEach((e,r)=>{var a,o;(o=(a=rt[r])==null?void 0:a.snapshot)==null||o.restore(e)})}function Vt(){It(A),Ot(Kt,O),oe(L),Ot(zt,Y)}async function ft(t,n,e,r){return Z({type:"goto",url:Jt(t),keepfocus:n.keepFocus,noscroll:n.noScroll,replace_state:n.replaceState,state:n.state,redirect_count:e,nav_token:r,accept:()=>{n.invalidateAll&&(lt=!0)}})}async function nn(t){if(t.id!==(I==null?void 0:I.id)){const n={};z.add(n),I={id:t.id,token:n,promise:xt({...t,preload:n}).then(e=>(z.delete(n),e.type==="loaded"&&e.state.error&&(I=null),e))}}return I.promise}async function yt(t){const n=ct.find(e=>e.exec(le(t)));n&&await Promise.all([...n.layouts,n.leaf].map(e=>e==null?void 0:e[1]()))}function ie(t,n){var a;y=t.state;const e=document.querySelector("style[data-sveltekit]");e&&e.remove(),S=t.props.page,N=new G.root({target:n,props:{...t.props,stores:x,components:rt},hydrate:!0}),se(L);const r={from:null,to:{params:y.params,route:{id:((a=y.route)==null?void 0:a.id)??null},url:new URL(location.href)},willUnload:!1,type:"enter",complete:Promise.resolve()};D.forEach(o=>o(r)),at=!0}async function W({url:t,params:n,branch:e,status:r,error:a,route:o,form:i}){let s="never";if(P&&(t.pathname===P||t.pathname===P+"/"))s="always";else for(const d of e)(d==null?void 0:d.slash)!==void 0&&(s=d.slash);t.pathname=we(t.pathname,s),t.search=t.search;const c={type:"loaded",state:{url:t,params:n,branch:e,error:a,route:o},props:{constructors:Je(e).map(d=>d.node.component),page:S}};i!==void 0&&(c.props.form=i);let l={},u=!S,h=0;for(let d=0;d(s&&(c.route=!0),f[_])}),params:new Proxy(r,{get:(f,_)=>(s&&c.params.add(_),f[_])}),data:(o==null?void 0:o.data)??null,url:Ee(e,()=>{s&&(c.url=!0)},f=>{s&&c.search_params.add(f)}),async fetch(f,_){let b;f instanceof Request?(b=f.url,_={body:f.method==="GET"||f.method==="HEAD"?void 0:await f.blob(),cache:f.cache,credentials:f.credentials,headers:f.headers,integrity:f.integrity,keepalive:f.keepalive,method:f.method,mode:f.mode,redirect:f.redirect,referrer:f.referrer,referrerPolicy:f.referrerPolicy,signal:f.signal,..._}):b=f;const R=new URL(b,e);return s&&d(R.href),R.origin===e.origin&&(b=R.href.slice(e.origin.length)),at?Ue(b,R.href,_):Pe(b,_)},setHeaders:()=>{},depends:d,parent(){return s&&(c.parent=!0),n()},untrack(f){s=!1;try{return f()}finally{s=!0}}};i=await l.universal.load.call(null,g)??null}return{node:l,loader:t,server:o,universal:(h=l.universal)!=null&&h.load?{type:"data",data:i,uses:c}:null,data:i??(o==null?void 0:o.data)??null,slash:((p=l.universal)==null?void 0:p.trailingSlash)??(o==null?void 0:o.slash)}}function Ft(t,n,e,r,a,o){if(lt)return!0;if(!a)return!1;if(a.parent&&t||a.route&&n||a.url&&e)return!0;for(const i of a.search_params)if(r.has(i))return!0;for(const i of a.params)if(o[i]!==y.params[i])return!0;for(const i of a.dependencies)if(ee.some(s=>s(new URL(i))))return!0;return!1}function Ut(t,n){return(t==null?void 0:t.type)==="data"?t:(t==null?void 0:t.type)==="skip"?n??null:null}function rn(t,n){if(!t)return new Set(n.searchParams.keys());const e=new Set([...t.searchParams.keys(),...n.searchParams.keys()]);for(const r of e){const a=t.searchParams.getAll(r),o=n.searchParams.getAll(r);a.every(i=>o.includes(i))&&o.every(i=>a.includes(i))&&e.delete(r)}return e}function qt({error:t,url:n,route:e,params:r}){return{type:"loaded",state:{error:t,url:n,route:e,params:r,branch:[]},props:{page:S,constructors:[]}}}async function xt({id:t,invalidating:n,url:e,params:r,route:a,preload:o}){if((I==null?void 0:I.id)===t)return z.delete(I.token),I.promise;const{errors:i,layouts:s,leaf:c}=a,l=[...s,c];i.forEach(m=>m==null?void 0:m().catch(()=>{})),l.forEach(m=>m==null?void 0:m[1]().catch(()=>{}));let u=null;const h=y.url?t!==y.url.pathname+y.url.search:!1,p=y.route?a.id!==y.route.id:!1,d=rn(y.url,e);let g=!1;const f=l.map((m,v)=>{var T;const k=y.branch[v],E=!!(m!=null&&m[0])&&((k==null?void 0:k.loader)!==m[1]||Ft(g,p,h,d,(T=k.server)==null?void 0:T.uses,r));return E&&(g=!0),E});if(f.some(Boolean)){try{u=await de(e,f)}catch(m){const v=await V(m,{url:e,params:r,route:{id:t}});return z.has(o)?qt({error:v,url:e,params:r,route:a}):ut({status:et(m),error:v,url:e,route:a})}if(u.type==="redirect")return u}const _=u==null?void 0:u.nodes;let b=!1;const R=l.map(async(m,v)=>{var ht;if(!m)return;const k=y.branch[v],E=_==null?void 0:_[v];if((!E||E.type==="skip")&&m[1]===(k==null?void 0:k.loader)&&!Ft(b,p,h,d,(ht=k.universal)==null?void 0:ht.uses,r))return k;if(b=!0,(E==null?void 0:E.type)==="error")throw E;return Pt({loader:m[1],url:e,params:r,route:a,parent:async()=>{var Nt;const Tt={};for(let pt=0;pt{});const w=[];for(let m=0;mPromise.resolve({}),server_data_node:Ut(o)}),c={node:await nt(),loader:nt,universal:null,server:null,data:null};return await W({url:e,params:a,branch:[s,c],status:t,error:n,route:null})}function dt(t,n){if(!t||st(t,P))return;let e;try{e=G.hooks.reroute({url:new URL(t)})??t.pathname}catch{return}const r=le(e);for(const a of ct){const o=a.exec(r);if(o)return{id:t.pathname+t.search,invalidating:n,route:a,params:be(o),url:t}}}function le(t){return ve(t.slice(P.length)||"/")}function fe({url:t,type:n,intent:e,delta:r}){let a=!1;const o=pe(y,e,t,n);r!==void 0&&(o.navigation.delta=r);const i={...o.navigation,cancel:()=>{a=!0,o.reject(new Error("navigation cancelled"))}};return J||ne.forEach(s=>s(i)),a?null:o}async function Z({type:t,url:n,popped:e,keepfocus:r,noscroll:a,replace_state:o,state:i={},redirect_count:s=0,nav_token:c={},accept:l=Dt,block:u=Dt}){const h=dt(n,!1),p=fe({url:n,type:t,delta:e==null?void 0:e.delta,intent:h});if(!p){u();return}const d=A,g=L;l(),J=!0,at&&x.navigating.set(p.navigation),q=c;let f=h&&await xt(h);if(!f){if(st(n,P))return await F(n);f=await ue(n,{id:null},await V(new Rt(404,"Not Found",`Not found: ${n.pathname}`),{url:n,params:{},route:{id:null}}),404)}if(n=(h==null?void 0:h.url)||n,q!==c)return p.reject(new Error("navigation aborted")),!1;if(f.type==="redirect")if(s>=20)f=await ut({status:500,error:await V(new Error("Redirect loop"),{url:n,params:{},route:{id:null}}),url:n,route:{id:null}});else return ft(new URL(f.location,n).href,{},s+1,c),!1;else f.props.page.status>=400&&await x.updated.check()&&await F(n);if(ae(),It(d),oe(g),f.props.page.url.pathname!==n.pathname&&(n.pathname=f.props.page.url.pathname),i=e?e.state:i,!e){const w=o?0:1,m={[C]:A+=w,[K]:L+=w,[Yt]:i};(o?history.replaceState:history.pushState).call(history,m,"",n),o||Qe(A,L)}if(I=null,f.props.page.state=i,at){y=f.state,f.props.page&&(f.props.page.url=n);const w=(await Promise.all(tn.map(m=>m(p.navigation)))).filter(m=>typeof m=="function");if(w.length>0){let m=function(){D=D.filter(v=>!w.includes(v))};w.push(m),D.push(...w)}N.$set(f.props),re=!0}else ie(f,kt);const{activeElement:_}=document;await wt();const b=e?e.scroll:a?St():null;if(Ct){const w=n.hash&&document.getElementById(decodeURIComponent(n.hash.slice(1)));b?scrollTo(b.x,b.y):w?w.scrollIntoView():scrollTo(0,0)}const R=document.activeElement!==_&&document.activeElement!==document.body;!r&&!R&&Et(),Ct=!0,f.props.page&&(S=f.props.page),J=!1,t==="popstate"&&se(L),p.fulfil(void 0),D.forEach(w=>w(p.navigation)),x.navigating.set(null)}async function ue(t,n,e,r){return t.origin===X&&t.pathname===location.pathname&&!Lt?await ut({status:r,error:e,url:t,route:n}):await F(t)}function an(){let t;U.addEventListener("mousemove",o=>{const i=o.target;clearTimeout(t),t=setTimeout(()=>{r(i,2)},20)});function n(o){r(o.composedPath()[0],1)}U.addEventListener("mousedown",n),U.addEventListener("touchstart",n,{passive:!0});const e=new IntersectionObserver(o=>{for(const i of o)i.isIntersecting&&(yt(i.target.href),e.unobserve(i.target))},{threshold:0});function r(o,i){const s=Xt(o,U);if(!s)return;const{url:c,external:l,download:u}=vt(s,P);if(l||u)return;const h=tt(s);if(!h.reload)if(i<=h.preload_data){const p=dt(c,!1);p&&nn(p)}else i<=h.preload_code&&yt(c.pathname)}function a(){e.disconnect();for(const o of U.querySelectorAll("a")){const{url:i,external:s,download:c}=vt(o,P);if(s||c)continue;const l=tt(o);l.reload||(l.preload_code===Q.viewport&&e.observe(o),l.preload_code===Q.eager&&yt(i.pathname))}}D.push(a),a()}function V(t,n){if(t instanceof it)return t.body;const e=et(t),r=Ze(t);return G.hooks.handleError({error:t,event:n,status:e,message:r})??{message:r}}function on(t,n={}){return t=Jt(t),t.origin!==X?Promise.reject(new Error("goto: invalid URL")):ft(t,n,0)}function pn(){return lt=!0,en()}async function gn(t){if(t.type==="error"){const n=new URL(location.href),{branch:e,route:r}=y;if(!r)return;const a=await ce(y.branch.length,e,r.errors);if(a){const o=await W({url:n,params:y.params,branch:e.slice(0,a.idx).concat(a.node),status:t.status??500,error:t.error,route:r});y=o.state,N.$set(o.props),wt().then(Et)}}else t.type==="redirect"?ft(t.location,{invalidateAll:!0},0):(N.$set({form:null,page:{...S,form:t.data,status:t.status}}),await wt(),N.$set({form:t.data}),t.type==="success"&&Et())}function sn(){var n;history.scrollRestoration="manual",addEventListener("beforeunload",e=>{let r=!1;if(Vt(),!J){const a=pe(y,void 0,null,"leave"),o={...a.navigation,cancel:()=>{r=!0,a.reject(new Error("navigation cancelled"))}};ne.forEach(i=>i(o))}r?(e.preventDefault(),e.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Vt()}),(n=navigator.connection)!=null&&n.saveData||an(),U.addEventListener("click",e=>{var p;if(e.button||e.which!==1||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.defaultPrevented)return;const r=Xt(e.composedPath()[0],U);if(!r)return;const{url:a,external:o,target:i,download:s}=vt(r,P);if(!a)return;if(i==="_parent"||i==="_top"){if(window.parent!==window)return}else if(i&&i!=="_self")return;const c=tt(r);if(!(r instanceof SVGAElement)&&a.protocol!==location.protocol&&!(a.protocol==="https:"||a.protocol==="http:")||s)return;if(o||c.reload){fe({url:a,type:"link"})?J=!0:e.preventDefault();return}const[u,h]=a.href.split("#");if(h!==void 0&&u===gt(location)){const[,d]=y.url.href.split("#");if(d===h){e.preventDefault(),h===""||h==="top"&&r.ownerDocument.getElementById("top")===null?window.scrollTo({top:0}):(p=r.ownerDocument.getElementById(h))==null||p.scrollIntoView();return}if(M=!0,It(A),t(a),!c.replace_state)return;M=!1}e.preventDefault(),Z({type:"link",url:a,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??a.href===location.href})}),U.addEventListener("submit",e=>{if(e.defaultPrevented)return;const r=HTMLFormElement.prototype.cloneNode.call(e.target),a=e.submitter;if(((a==null?void 0:a.formMethod)||r.method)!=="get")return;const i=new URL((a==null?void 0:a.hasAttribute("formaction"))&&(a==null?void 0:a.formAction)||r.action);if(st(i,P))return;const s=e.target,c=tt(s);if(c.reload)return;e.preventDefault(),e.stopPropagation();const l=new FormData(s),u=a==null?void 0:a.getAttribute("name");u&&l.append(u,(a==null?void 0:a.getAttribute("value"))??""),i.search=new URLSearchParams(l).toString(),Z({type:"form",url:i,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??i.href===location.href})}),addEventListener("popstate",async e=>{var r;if((r=e.state)!=null&&r[C]){const a=e.state[C];if(q={},a===A)return;const o=O[a],i=e.state[Yt]??{},s=new URL(e.state[Fe]??location.href),c=e.state[K],l=gt(location)===gt(y.url);if(c===L&&(re||l)){t(s),O[A]=St(),o&&scrollTo(o.x,o.y),i!==S.state&&(S={...S,state:i},N.$set({page:S})),A=a;return}const h=a-A;await Z({type:"popstate",url:s,popped:{state:i,scroll:o,delta:h},accept:()=>{A=a,L=c},block:()=>{history.go(-h)},nav_token:q})}else if(!M){const a=new URL(location.href);t(a)}}),addEventListener("hashchange",()=>{M&&(M=!1,history.replaceState({...history.state,[C]:++A,[K]:L},"",location.href))});for(const e of document.querySelectorAll("link"))e.rel==="icon"&&(e.href=e.href);addEventListener("pageshow",e=>{e.persisted&&x.navigating.set(null)});function t(e){y.url=e,x.page.set({...S,url:e}),x.page.notify()}}async function cn(t,{status:n=200,error:e,node_ids:r,params:a,route:o,data:i,form:s}){Lt=!0;const c=new URL(location.href);({params:a={},route:o={id:null}}=dt(c,!1)||{});let l;try{const u=r.map(async(d,g)=>{const f=i[g];return f!=null&&f.uses&&(f.uses=he(f.uses)),Pt({loader:G.nodes[d],url:c,params:a,route:o,parent:async()=>{const _={};for(let b=0;bd===o.id);if(p){const d=p.layouts;for(let g=0;go?"1":"0").join(""));const r=await Bt(e.href);if(!r.ok){let o;throw(a=r.headers.get("content-type"))!=null&&a.includes("application/json")?o=await r.json():r.status===404?o="Not Found":r.status===500&&(o="Internal Error"),new it(r.status,o)}return new Promise(async o=>{var h;const i=new Map,s=r.body.getReader(),c=new TextDecoder;function l(p){return Zt(p,{Promise:d=>new Promise((g,f)=>{i.set(d,{fulfil:g,reject:f})})})}let u="";for(;;){const{done:p,value:d}=await s.read();if(p&&!u)break;for(u+=!d&&u?` `:c.decode(d,{stream:!0});;){const g=u.indexOf(` `);if(g===-1)break;const f=JSON.parse(u.slice(0,g));if(u=u.slice(g+1),f.type==="redirect")return o(f);if(f.type==="data")(h=f.nodes)==null||h.forEach(_=>{(_==null?void 0:_.type)==="data"&&(_.uses=he(_.uses),_.data=l(_.data))}),o(f);else if(f.type==="chunk"){const{id:_,data:b,error:R}=f,w=i.get(_);i.delete(_),R?w.reject(l(R)):w.fulfil(l(b))}}}})}function he(t){return{dependencies:new Set((t==null?void 0:t.dependencies)??[]),params:new Set((t==null?void 0:t.params)??[]),parent:!!(t!=null&&t.parent),route:!!(t!=null&&t.route),url:!!(t!=null&&t.url),search_params:new Set((t==null?void 0:t.search_params)??[])}}function Et(){const t=document.querySelector("[autofocus]");if(t)t.focus();else{const n=document.body,e=n.getAttribute("tabindex");n.tabIndex=-1,n.focus({preventScroll:!0,focusVisible:!1}),e!==null?n.setAttribute("tabindex",e):n.removeAttribute("tabindex");const r=getSelection();if(r&&r.type!=="None"){const a=[];for(let o=0;o{if(r.rangeCount===a.length){for(let o=0;o{a=u,o=h});return i.catch(()=>{}),{navigation:{from:{params:t.params,route:{id:((c=t.route)==null?void 0:c.id)??null},url:t.url},to:e&&{params:(n==null?void 0:n.params)??null,route:{id:((l=n==null?void 0:n.route)==null?void 0:l.id)??null},url:e},willUnload:!n,type:r,complete:i},fulfil:a,reject:o}}export{gn as a,De as b,hn as c,fn as d,pn as i,dn as p,un as r,x as s,ot as w};