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