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