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