2 lines
22 KiB
JavaScript
2 lines
22 KiB
JavaScript
var et=Object.defineProperty,tt=Object.defineProperties;var nt=Object.getOwnPropertyDescriptors;var le=Object.getOwnPropertySymbols;var qe=Object.prototype.hasOwnProperty,ze=Object.prototype.propertyIsEnumerable;var Ve=(r,e,t)=>e in r?et(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,A=(r,e)=>{for(var t in e||(e={}))qe.call(e,t)&&Ve(r,t,e[t]);if(le)for(var t of le(e))ze.call(e,t)&&Ve(r,t,e[t]);return r},ne=(r,e)=>tt(r,nt(e));var Je=(r,e)=>{var t={};for(var s in r)qe.call(r,s)&&e.indexOf(s)<0&&(t[s]=r[s]);if(r!=null&&le)for(var s of le(r))e.indexOf(s)<0&&ze.call(r,s)&&(t[s]=r[s]);return t};import{S as rt,i as st,s as at,e as it,c as ot,a as ct,d as I,b as we,f as K,g as D,t as lt,h as ft,j as ut,k as dt,l as P,m as pt,n as Y,o as x,p as M,q as C,r as _t,u as ht,v as $e,w as V,x as se,y as q,z as ae,A as ie,B as z,C as oe,D as Ke}from"./chunks/index-68fa7044.js";import{s as mt,w as fe,a as gt}from"./chunks/paths-5d155410.js";function wt(r){let e,t,s;const l=[r[1]||{}];var o=r[0][0];function f(n){let a={};for(let i=0;i<l.length;i+=1)a=oe(a,l[i]);return{props:a}}return o&&(e=new o(f())),{c(){e&&V(e.$$.fragment),t=P()},l(n){e&&se(e.$$.fragment,n),t=P()},m(n,a){e&&q(e,n,a),D(n,t,a),s=!0},p(n,a){const i=a&2?ae(l,[ie(n[1]||{})]):{};if(o!==(o=n[0][0])){if(e){Y();const d=e;x(d.$$.fragment,1,0,()=>{z(d,1)}),M()}o?(e=new o(f()),V(e.$$.fragment),C(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else o&&e.$set(i)},i(n){s||(e&&C(e.$$.fragment,n),s=!0)},o(n){e&&x(e.$$.fragment,n),s=!1},d(n){n&&I(t),e&&z(e,n)}}}function bt(r){let e,t,s;const l=[r[1]||{}];var o=r[0][0];function f(n){let a={$$slots:{default:[kt]},$$scope:{ctx:n}};for(let i=0;i<l.length;i+=1)a=oe(a,l[i]);return{props:a}}return o&&(e=new o(f(r))),{c(){e&&V(e.$$.fragment),t=P()},l(n){e&&se(e.$$.fragment,n),t=P()},m(n,a){e&&q(e,n,a),D(n,t,a),s=!0},p(n,a){const i=a&2?ae(l,[ie(n[1]||{})]):{};if(a&525&&(i.$$scope={dirty:a,ctx:n}),o!==(o=n[0][0])){if(e){Y();const d=e;x(d.$$.fragment,1,0,()=>{z(d,1)}),M()}o?(e=new o(f(n)),V(e.$$.fragment),C(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else o&&e.$set(i)},i(n){s||(e&&C(e.$$.fragment,n),s=!0)},o(n){e&&x(e.$$.fragment,n),s=!1},d(n){n&&I(t),e&&z(e,n)}}}function yt(r){let e,t,s;const l=[r[2]||{}];var o=r[0][1];function f(n){let a={};for(let i=0;i<l.length;i+=1)a=oe(a,l[i]);return{props:a}}return o&&(e=new o(f())),{c(){e&&V(e.$$.fragment),t=P()},l(n){e&&se(e.$$.fragment,n),t=P()},m(n,a){e&&q(e,n,a),D(n,t,a),s=!0},p(n,a){const i=a&4?ae(l,[ie(n[2]||{})]):{};if(o!==(o=n[0][1])){if(e){Y();const d=e;x(d.$$.fragment,1,0,()=>{z(d,1)}),M()}o?(e=new o(f()),V(e.$$.fragment),C(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else o&&e.$set(i)},i(n){s||(e&&C(e.$$.fragment,n),s=!0)},o(n){e&&x(e.$$.fragment,n),s=!1},d(n){n&&I(t),e&&z(e,n)}}}function vt(r){let e,t,s;const l=[r[2]||{}];var o=r[0][1];function f(n){let a={$$slots:{default:[$t]},$$scope:{ctx:n}};for(let i=0;i<l.length;i+=1)a=oe(a,l[i]);return{props:a}}return o&&(e=new o(f(r))),{c(){e&&V(e.$$.fragment),t=P()},l(n){e&&se(e.$$.fragment,n),t=P()},m(n,a){e&&q(e,n,a),D(n,t,a),s=!0},p(n,a){const i=a&4?ae(l,[ie(n[2]||{})]):{};if(a&521&&(i.$$scope={dirty:a,ctx:n}),o!==(o=n[0][1])){if(e){Y();const d=e;x(d.$$.fragment,1,0,()=>{z(d,1)}),M()}o?(e=new o(f(n)),V(e.$$.fragment),C(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else o&&e.$set(i)},i(n){s||(e&&C(e.$$.fragment,n),s=!0)},o(n){e&&x(e.$$.fragment,n),s=!1},d(n){n&&I(t),e&&z(e,n)}}}function $t(r){let e,t,s;const l=[r[3]||{}];var o=r[0][2];function f(n){let a={};for(let i=0;i<l.length;i+=1)a=oe(a,l[i]);return{props:a}}return o&&(e=new o(f())),{c(){e&&V(e.$$.fragment),t=P()},l(n){e&&se(e.$$.fragment,n),t=P()},m(n,a){e&&q(e,n,a),D(n,t,a),s=!0},p(n,a){const i=a&8?ae(l,[ie(n[3]||{})]):{};if(o!==(o=n[0][2])){if(e){Y();const d=e;x(d.$$.fragment,1,0,()=>{z(d,1)}),M()}o?(e=new o(f()),V(e.$$.fragment),C(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else o&&e.$set(i)},i(n){s||(e&&C(e.$$.fragment,n),s=!0)},o(n){e&&x(e.$$.fragment,n),s=!1},d(n){n&&I(t),e&&z(e,n)}}}function kt(r){let e,t,s,l;const o=[vt,yt],f=[];function n(a,i){return a[0][2]?0:1}return e=n(r),t=f[e]=o[e](r),{c(){t.c(),s=P()},l(a){t.l(a),s=P()},m(a,i){f[e].m(a,i),D(a,s,i),l=!0},p(a,i){let d=e;e=n(a),e===d?f[e].p(a,i):(Y(),x(f[d],1,1,()=>{f[d]=null}),M(),t=f[e],t?t.p(a,i):(t=f[e]=o[e](a),t.c()),C(t,1),t.m(s.parentNode,s))},i(a){l||(C(t),l=!0)},o(a){x(t),l=!1},d(a){f[e].d(a),a&&I(s)}}}function Be(r){let e,t=r[5]&&We(r);return{c(){e=it("div"),t&&t.c(),this.h()},l(s){e=ot(s,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var l=ct(e);t&&t.l(l),l.forEach(I),this.h()},h(){we(e,"id","svelte-announcer"),we(e,"aria-live","assertive"),we(e,"aria-atomic","true"),K(e,"position","absolute"),K(e,"left","0"),K(e,"top","0"),K(e,"clip","rect(0 0 0 0)"),K(e,"clip-path","inset(50%)"),K(e,"overflow","hidden"),K(e,"white-space","nowrap"),K(e,"width","1px"),K(e,"height","1px")},m(s,l){D(s,e,l),t&&t.m(e,null)},p(s,l){s[5]?t?t.p(s,l):(t=We(s),t.c(),t.m(e,null)):t&&(t.d(1),t=null)},d(s){s&&I(e),t&&t.d()}}}function We(r){let e;return{c(){e=lt(r[6])},l(t){e=ft(t,r[6])},m(t,s){D(t,e,s)},p(t,s){s&64&&ut(e,t[6])},d(t){t&&I(e)}}}function Et(r){let e,t,s,l,o;const f=[bt,wt],n=[];function a(d,R){return d[0][1]?0:1}e=a(r),t=n[e]=f[e](r);let i=r[4]&&Be(r);return{c(){t.c(),s=dt(),i&&i.c(),l=P()},l(d){t.l(d),s=pt(d),i&&i.l(d),l=P()},m(d,R){n[e].m(d,R),D(d,s,R),i&&i.m(d,R),D(d,l,R),o=!0},p(d,[R]){let v=e;e=a(d),e===v?n[e].p(d,R):(Y(),x(n[v],1,1,()=>{n[v]=null}),M(),t=n[e],t?t.p(d,R):(t=n[e]=f[e](d),t.c()),C(t,1),t.m(s.parentNode,s)),d[4]?i?i.p(d,R):(i=Be(d),i.c(),i.m(l.parentNode,l)):i&&(i.d(1),i=null)},i(d){o||(C(t),o=!0)},o(d){x(t),o=!1},d(d){n[e].d(d),d&&I(s),i&&i.d(d),d&&I(l)}}}function Rt(r,e,t){let{stores:s}=e,{page:l}=e,{components:o}=e,{props_0:f=null}=e,{props_1:n=null}=e,{props_2:a=null}=e;_t("__svelte__",s),ht(s.page.notify);let i=!1,d=!1,R=null;return $e(()=>{const v=s.page.subscribe(()=>{i&&(t(5,d=!0),t(6,R=document.title||"untitled page"))});return t(4,i=!0),v}),r.$$set=v=>{"stores"in v&&t(7,s=v.stores),"page"in v&&t(8,l=v.page),"components"in v&&t(0,o=v.components),"props_0"in v&&t(1,f=v.props_0),"props_1"in v&&t(2,n=v.props_1),"props_2"in v&&t(3,a=v.props_2)},r.$$.update=()=>{r.$$.dirty&384&&s.page.set(l)},[o,f,n,a,i,d,R,s,l]}class St extends rt{constructor(e){super();st(this,e,Rt,Et,at,{stores:7,page:8,components:0,props_0:1,props_1:2,props_2:3})}}const Lt="modulepreload",Ye={},Ut="/aotds-docks/_app/",be=function(e,t){return!t||t.length===0?e():Promise.all(t.map(s=>{if(s=`${Ut}${s}`,s in Ye)return;Ye[s]=!0;const l=s.endsWith(".css"),o=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${s}"]${o}`))return;const f=document.createElement("link");if(f.rel=l?"stylesheet":Lt,l||(f.as="script",f.crossOrigin=""),f.href=s,document.head.appendChild(f),l)return new Promise((n,a)=>{f.addEventListener("load",n),f.addEventListener("error",()=>a(new Error(`Unable to preload CSS for ${s}`)))})})).then(()=>e())},Nt={},Ee=[()=>be(()=>import("./layout.svelte-a7c34f1e.js"),["layout.svelte-a7c34f1e.js","chunks/index-68fa7044.js"]),()=>be(()=>import("./error.svelte-7544dc29.js"),["error.svelte-7544dc29.js","chunks/index-68fa7044.js"]),()=>be(()=>import("./pages/index.svelte-bdd7f07b.js"),["pages/index.svelte-bdd7f07b.js","assets/pages/index.svelte-3edfd478.css","chunks/index-68fa7044.js","chunks/paths-5d155410.js"])],Ot={"":[[0,2],[1]]};function Me(r){return r instanceof Error||r&&r.name&&r.message?r:new Error(JSON.stringify(r))}function Fe(r){const e=r.status&&r.status>=400&&r.status<=599&&!r.redirect;if(r.error||e){const t=r.status;if(!r.error&&e)return{status:t||500,error:new Error};const s=typeof r.error=="string"?new Error(r.error):r.error;return s instanceof Error?!t||t<400||t>599?(console.warn('"error" returned from load() without a valid status code \u2014 defaulting to 500'),{status:500,error:s}):{status:t,error:s}:{status:500,error:new Error(`"error" property returned from load() must be a string or instance of Error, received type "${typeof s}"`)}}if(r.redirect){if(!r.status||Math.floor(r.status/100)!==3)return{status:500,error:new Error('"redirect" property returned from load() must be accompanied by a 3xx status code')};if(typeof r.redirect!="string")return{status:500,error:new Error('"redirect" property returned from load() must be a string')}}if(r.context)throw new Error('You are returning "context" from a load function. "context" was renamed to "stuff", please adjust your code accordingly.');return r}function At(r,e){return r==="/"||e==="ignore"?r:e==="never"?r.endsWith("/")?r.slice(0,-1):r:e==="always"&&/\/[^./]+$/.test(r)?r+"/":r}function Pt(r){let e=5381,t=r.length;if(typeof r=="string")for(;t;)e=e*33^r.charCodeAt(--t);else for(;t;)e=e*33^r[--t];return(e>>>0).toString(36)}function Ge(r){let e=r.baseURI;if(!e){const t=r.getElementsByTagName("base");e=t.length?t[0].href:r.URL}return e}function ke(){return{x:pageXOffset,y:pageYOffset}}function Xe(r){return r.composedPath().find(t=>t instanceof Node&&t.nodeName.toUpperCase()==="A")}function He(r){return r instanceof SVGAElement?new URL(r.href.baseVal,document.baseURI):new URL(r.href)}function Qe(r){const e=fe(r);let t=!0;function s(){t=!0,e.update(f=>f)}function l(f){t=!1,e.set(f)}function o(f){let n;return e.subscribe(a=>{(n===void 0||t&&a!==n)&&f(n=a)})}return{notify:s,set:l,subscribe:o}}function xt(){const{set:r,subscribe:e}=fe(!1),t="1649256192683";let s;async function l(){clearTimeout(s);const f=await fetch(`${gt}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(f.ok){const{version:n}=await f.json(),a=n!==t;return a&&(r(!0),clearTimeout(s)),a}else throw new Error(`Version check failed: ${f.status}`)}return{subscribe:e,check:l}}function Ct(r,e){let s=`script[sveltekit\\:data-type="data"][sveltekit\\:data-url=${JSON.stringify(typeof r=="string"?r:r.url)}]`;e&&typeof e.body=="string"&&(s+=`[sveltekit\\:data-body="${Pt(e.body)}"]`);const l=document.querySelector(s);if(l&&l.textContent){const o=JSON.parse(l.textContent),{body:f}=o,n=Je(o,["body"]);return Promise.resolve(new Response(f,n))}return fetch(r,e)}const jt=/^(\.\.\.)?(\w+)(?:=(\w+))?$/;function It(r){const e=[],t=[];let s=!0;return{pattern:r===""?/^\/$/:new RegExp(`^${decodeURIComponent(r).split("/").map((o,f,n)=>{const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(o);if(a)return e.push(a[1]),t.push(a[2]),"(?:/(.*))?";const i=f===n.length-1;return"/"+o.split(/\[(.+?)\]/).map((d,R)=>{if(R%2){const[,v,H,F]=jt.exec(d);return e.push(H),t.push(F),v?"(.*?)":"([^/]+?)"}return i&&d.includes(".")&&(s=!1),d.normalize().replace(/%5[Bb]/g,"[").replace(/%5[Dd]/g,"]").replace(/#/g,"%23").replace(/\?/g,"%3F").replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}).join("")}).join("")}${s?"/?":""}$`),names:e,types:t}}function Tt(r,e,t,s){const l={};for(let o=0;o<e.length;o+=1){const f=e[o],n=t[o],a=r[o+1]||"";if(n){const i=s[n];if(!i)throw new Error(`Missing "${n}" param matcher`);if(!i(a))return}l[f]=a}return l}function Dt(r,e,t){return Object.entries(e).map(([l,[o,f,n]])=>{const{pattern:a,names:i,types:d}=It(l);return{id:l,exec:R=>{const v=a.exec(R);if(v)return Tt(v,i,d,t)},a:o.map(R=>r[R]),b:f.map(R=>r[R]),has_shadow:!!n}})}const Ze="sveltekit:scroll",B="sveltekit:index",ye=Dt(Ee,Ot,Nt),Vt=Ee[0](),qt=Ee[1]();let re={};try{re=JSON.parse(sessionStorage[Ze])}catch{}function ve(r){re[r]=ke()}function zt({target:r,session:e,base:t,trailing_slash:s}){var je,Ie;const l=new Map,o=new Set,f={url:Qe({}),page:Qe({}),navigating:fe(null),session:fe(e),updated:xt()},n={id:null,promise:null},a={before_navigate:[],after_navigate:[]};let i={url:null,session_id:0,branch:[]},d=!1,R=!0,v=!1,H=1,F=null,Re,Se,Le=!1;f.session.subscribe(async c=>{Se=c,Le&&(H+=1,he(new URL(location.href),[],!0))}),Le=!0;let ue=0,G=!0,T=(Ie=(je=history.state)==null?void 0:je[B])!=null?Ie:0;T===0&&history.replaceState(ne(A({},history.state),{[B]:0}),"",location.href);const de=re[T];de&&scrollTo(de.x,de.y);let pe=!1,_e,Ue,Ne;async function Oe(c,{noscroll:_=!1,replaceState:b=!1,keepfocus:u=!1,state:h={}},w){const m=new URL(c,Ge(document));if(G)return ge({url:m,scroll:_?ke():null,keepfocus:u,redirect_chain:w,details:{state:h,replaceState:b},accepted:()=>{},blocked:()=>{}});await ee(m)}async function Ae(c){const _=Ce(c);if(!_)throw new Error("Attempted to prefetch a URL that does not belong to this app");return n.promise=xe(_,!1),n.id=_.id,n.promise}async function he(c,_,b,u){var g,k,S;const h=Ce(c),w=Ue={};let m=h&&await xe(h,b);if(!m&&c.origin===location.origin&&c.pathname===location.pathname&&(m=await Z({status:404,error:new Error(`Not found: ${c.pathname}`),url:c,routeId:null})),!m){await ee(c);return}if(Ue!==w)return;if(o.clear(),m.redirect)if(_.length>10||_.includes(c.pathname))m=await Z({status:500,error:new Error("Redirect loop"),url:c,routeId:null});else{G?Oe(new URL(m.redirect,c).href,{},[..._,c.pathname]):await ee(new URL(m.redirect,location.href));return}else((k=(g=m.props)==null?void 0:g.page)==null?void 0:k.status)>=400&&await f.updated.check()&&await ee(c);if(v=!0,u&&u.details){const{details:y}=u,L=y.replaceState?0:1;y.state[B]=T+=L,history[y.replaceState?"replaceState":"pushState"](y.state,"",c)}if(d?(i=m.state,Re.$set(m.props)):Pe(m),u){const{scroll:y,keepfocus:L}=u;if(!L){const p=document.body,E=p.getAttribute("tabindex");(S=getSelection())==null||S.removeAllRanges(),p.tabIndex=-1,p.focus(),E!==null?p.setAttribute("tabindex",E):p.removeAttribute("tabindex")}if(await Ke(),R){const p=c.hash&&document.getElementById(c.hash.slice(1));y?scrollTo(y.x,y.y):p?p.scrollIntoView():scrollTo(0,0)}}else await Ke();n.promise=null,n.id=null,R=!0,v=!1,m.props.page&&(_e=m.props.page);const $=m.state.branch[m.state.branch.length-1];G=($==null?void 0:$.module.router)!==!1}function Pe(c){i=c.state;const _=document.querySelector("style[data-svelte]");if(_&&_.remove(),_e=c.props.page,Re=new St({target:r,props:ne(A({},c.props),{stores:f}),hydrate:!0}),d=!0,G){const b={from:null,to:new URL(location.href)};a.after_navigate.forEach(u=>u(b))}}async function me({url:c,params:_,stuff:b,branch:u,status:h,error:w,routeId:m}){var L;const $=u.filter(Boolean),g=$.find(p=>{var E;return(E=p.loaded)==null?void 0:E.redirect}),k={redirect:(L=g==null?void 0:g.loaded)==null?void 0:L.redirect,state:{url:c,params:_,branch:u,session_id:H},props:{components:$.map(p=>p.module.default)}};for(let p=0;p<$.length;p+=1){const E=$[p].loaded;k.props[`props_${p}`]=E?await E.props:null}if(!i.url||c.href!==i.url.href){k.props.page={error:w,params:_,routeId:m,status:h,stuff:b,url:c};const p=(E,J)=>{Object.defineProperty(k.props.page,E,{get:()=>{throw new Error(`$page.${E} has been replaced by $page.url.${J}`)}})};p("origin","origin"),p("path","pathname"),p("query","searchParams")}const S=$[$.length-1],y=S.loaded&&S.loaded.maxage;if(y){const p=c.pathname+c.search;let E=!1;const J=()=>{l.get(p)===k&&l.delete(p),U(),clearTimeout(X)},X=setTimeout(J,y*1e3),U=f.session.subscribe(()=>{E&&J()});E=!0,l.set(p,k)}return k}async function Q({status:c,error:_,module:b,url:u,params:h,stuff:w,props:m,routeId:$}){const g={module:b,uses:{params:new Set,url:!1,session:!1,stuff:!1,dependencies:new Set},loaded:null,stuff:w};m&&g.uses.dependencies.add(u.href);const k={};for(const y in h)Object.defineProperty(k,y,{get(){return g.uses.params.add(y),h[y]},enumerable:!0});const S=Se;if(b.load){const y={routeId:$,params:k,props:m||{},get url(){return g.uses.url=!0,u},get session(){return g.uses.session=!0,S},get stuff(){return g.uses.stuff=!0,A({},w)},fetch(p,E){const J=typeof p=="string"?p:p.url,{href:X}=new URL(J,u);return g.uses.dependencies.add(X),d?fetch(p,E):Ct(p,E)}};_&&(y.status=c,y.error=_);const L=await b.load.call(null,y);if(!L)throw new Error("load function must return a value");g.loaded=Fe(L),g.loaded.stuff&&(g.stuff=g.loaded.stuff)}else m&&(g.loaded=Fe({props:m}));return g}async function xe({id:c,url:_,params:b,route:u},h){var E,J,X;if(n.id===c&&n.promise)return n.promise;if(!h){const U=l.get(c);if(U)return U}const{a:w,b:m,has_shadow:$}=u,g=i.url&&{url:c!==i.url.pathname+i.url.search,params:Object.keys(b).filter(U=>i.params[U]!==b[U]),session:H!==i.session_id};let k=[],S={},y=!1,L=200,p;w.forEach(U=>U());e:for(let U=0;U<w.length;U+=1){let N;try{if(!w[U])continue;const O=await w[U](),j=i.branch[U];if(!j||O!==j.module||g.url&&j.uses.url||g.params.some(W=>j.uses.params.has(W))||g.session&&j.uses.session||Array.from(j.uses.dependencies).some(W=>o.has(W))||y&&j.uses.stuff){let W={};const Te=$&&U===w.length-1;if(Te){const te=await fetch(`${_.pathname}${_.pathname.endsWith("/")?"":"/"}__data.json${_.search}`,{headers:{"x-sveltekit-load":"true"}});if(te.ok){const De=te.headers.get("x-sveltekit-location");if(De)return{redirect:De,props:{},state:i};W=te.status===204?{}:await te.json()}else L=te.status,p=new Error("Failed to load data")}if(p||(N=await Q({module:O,url:_,params:b,props:W,stuff:S,routeId:u.id})),N&&(Te&&(N.uses.url=!0),N.loaded)){if(N.loaded.fallthrough)throw new Error("fallthrough is no longer supported. Use matchers instead: https://kit.svelte.dev/docs/routing#advanced-routing-matching");if(N.loaded.error&&(L=N.loaded.status,p=N.loaded.error),N.loaded.redirect)return{redirect:N.loaded.redirect,props:{},state:i};N.loaded.stuff&&(y=!0)}}else N=j}catch(O){L=500,p=Me(O)}if(p){for(;U--;)if(m[U]){let O,j,ce=U;for(;!(j=k[ce]);)ce-=1;try{if(O=await Q({status:L,error:p,module:await m[U](),url:_,params:b,stuff:j.stuff,routeId:u.id}),(E=O==null?void 0:O.loaded)!=null&&E.error)continue;(J=O==null?void 0:O.loaded)!=null&&J.stuff&&(S=A(A({},S),O.loaded.stuff)),k=k.slice(0,ce+1).concat(O);break e}catch{continue}}return await Z({status:L,error:p,url:_,routeId:u.id})}else(X=N==null?void 0:N.loaded)!=null&&X.stuff&&(S=A(A({},S),N.loaded.stuff)),k.push(N)}return await me({url:_,params:b,stuff:S,branch:k,status:L,error:p,routeId:u.id})}async function Z({status:c,error:_,url:b,routeId:u}){var $,g;const h={},w=await Q({module:await Vt,url:b,params:h,stuff:{},routeId:u}),m=await Q({status:c,error:_,module:await qt,url:b,params:h,stuff:w&&w.loaded&&w.loaded.stuff||{},routeId:u});return await me({url:b,params:h,stuff:A(A({},($=w==null?void 0:w.loaded)==null?void 0:$.stuff),(g=m==null?void 0:m.loaded)==null?void 0:g.stuff),branch:[w,m],status:c,error:_,routeId:u})}function Ce(c){if(c.origin!==location.origin||!c.pathname.startsWith(t))return;const _=decodeURI(c.pathname.slice(t.length)||"/");for(const b of ye){const u=b.exec(_);if(u)return{id:c.pathname+c.search,route:b,params:u,url:c}}}async function ge({url:c,scroll:_,keepfocus:b,redirect_chain:u,details:h,accepted:w,blocked:m}){const $=i.url;let g=!1;const k={from:$,to:c,cancel:()=>g=!0};if(a.before_navigate.forEach(p=>p(k)),g){m();return}const S=At(c.pathname,s),y=new URL(c.origin+S+c.search+c.hash);ve(T),w(),ue++;const L=Ne={};if(d&&f.navigating.set({from:i.url,to:y}),await he(y,u,!1,{scroll:_,keepfocus:b,details:h}),ue--,Ne===L&&!ue){const p={from:$,to:y};a.after_navigate.forEach(E=>E(p)),f.navigating.set(null)}}function ee(c){return location.href=c.href,new Promise(()=>{})}return{after_navigate:c=>{$e(()=>(a.after_navigate.push(c),()=>{const _=a.after_navigate.indexOf(c);a.after_navigate.splice(_,1)}))},before_navigate:c=>{$e(()=>(a.before_navigate.push(c),()=>{const _=a.before_navigate.indexOf(c);a.before_navigate.splice(_,1)}))},disable_scroll_handling:()=>{(v||!d)&&(R=!1)},goto:(c,_={})=>Oe(c,_,[]),invalidate:c=>{const{href:_}=new URL(c,location.href);return o.add(_),F||(F=Promise.resolve().then(async()=>{await he(new URL(location.href),[],!0),F=null})),F},prefetch:async c=>{const _=new URL(c,Ge(document));await Ae(_)},prefetch_routes:async c=>{const b=(c?ye.filter(u=>c.some(h=>u.exec(h))):ye).map(u=>Promise.all(u.a.map(h=>h())));await Promise.all(b)},_start_router:()=>{history.scrollRestoration="manual",addEventListener("beforeunload",u=>{let h=!1;const w={from:i.url,to:null,cancel:()=>h=!0};a.before_navigate.forEach(m=>m(w)),h?(u.preventDefault(),u.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden"){ve(T);try{sessionStorage[Ze]=JSON.stringify(re)}catch{}}});const c=u=>{const h=Xe(u);h&&h.href&&h.hasAttribute("sveltekit:prefetch")&&Ae(He(h))};let _;const b=u=>{clearTimeout(_),_=setTimeout(()=>{var h;(h=u.target)==null||h.dispatchEvent(new CustomEvent("sveltekit:trigger_prefetch",{bubbles:!0}))},20)};addEventListener("touchstart",c),addEventListener("mousemove",b),addEventListener("sveltekit:trigger_prefetch",c),addEventListener("click",u=>{if(!G||u.button||u.which!==1||u.metaKey||u.ctrlKey||u.shiftKey||u.altKey||u.defaultPrevented)return;const h=Xe(u);if(!h||!h.href)return;const w=h instanceof SVGAElement,m=He(h);if(!w&&m.origin==="null")return;const $=(h.getAttribute("rel")||"").split(/\s+/);if(h.hasAttribute("download")||$.includes("external")||(w?h.target.baseVal:h.target))return;if(m.href===location.href){location.hash||u.preventDefault();return}const[g,k]=m.href.split("#");if(k!==void 0&&g===location.href.split("#")[0]){pe=!0,ve(T),f.page.set(ne(A({},_e),{url:m})),f.page.notify();return}ge({url:m,scroll:h.hasAttribute("sveltekit:noscroll")?ke():null,keepfocus:!1,redirect_chain:[],details:{state:{},replaceState:!1},accepted:()=>u.preventDefault(),blocked:()=>u.preventDefault()})}),addEventListener("popstate",u=>{if(u.state&&G){if(u.state[B]===T)return;ge({url:new URL(location.href),scroll:re[u.state[B]],keepfocus:!1,redirect_chain:[],details:null,accepted:()=>{T=u.state[B]},blocked:()=>{const h=T-u.state[B];history.go(h)}})}}),addEventListener("hashchange",()=>{pe&&(pe=!1,history.replaceState(ne(A({},history.state),{[B]:++T}),"",location.href))})},_hydrate:async({status:c,error:_,nodes:b,params:u,routeId:h})=>{const w=new URL(location.href),m=[];let $={},g,k;try{for(let S=0;S<b.length;S+=1){const y=S===b.length-1;let L;if(y){const E=document.querySelector('script[sveltekit\\:data-type="props"]');E&&(L=JSON.parse(E.textContent))}const p=await Q({module:await b[S],url:w,params:u,stuff:$,status:y?c:void 0,error:y?_:void 0,props:L,routeId:h});if(L&&(p.uses.dependencies.add(w.href),p.uses.url=!0),m.push(p),p&&p.loaded)if(p.loaded.error){if(_)throw p.loaded.error;k={status:p.loaded.status,error:p.loaded.error,url:w,routeId:h}}else p.loaded.stuff&&($=A(A({},$),p.loaded.stuff))}g=k?await Z(k):await me({url:w,params:u,stuff:$,branch:m,status:c,error:_,routeId:h})}catch(S){if(_)throw S;g=await Z({status:500,error:Me(S),url:w,routeId:h})}g.redirect&&await ee(new URL(g.redirect,location.href)),Pe(g)}}}async function Wt({paths:r,target:e,session:t,route:s,spa:l,trailing_slash:o,hydrate:f}){const n=zt({target:e,session:t,base:r.base,trailing_slash:o});mt(r),f&&await n._hydrate(f),s&&(l&&n.goto(location.href,{replaceState:!0}),n._start_router()),dispatchEvent(new CustomEvent("sveltekit:start"))}export{Wt as start};
|