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