var re=Object.defineProperty,ie=Object.defineProperties;var ne=Object.getOwnPropertyDescriptors;var B=Object.getOwnPropertySymbols;var J=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable;var M=(i,e,t)=>e in i?re(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,A=(i,e)=>{for(var t in e||(e={}))J.call(e,t)&&M(i,t,e[t]);if(B)for(var t of B(e))G.call(e,t)&&M(i,t,e[t]);return i},Y=(i,e)=>ie(i,ne(e));var X=(i,e)=>{var t={};for(var r in i)J.call(i,r)&&e.indexOf(r)<0&&(t[r]=i[r]);if(i!=null&&B)for(var r of B(i))e.indexOf(r)<0&&G.call(i,r)&&(t[r]=i[r]);return t};import{S as ae,i as oe,s as le,e as ce,c as fe,a as ue,d as y,b as K,f as k,t as he,g as de,h as _e,j as pe,k as m,l as me,m as P,n as g,o as T,p as w,q as ge,r as we,u as be,v as E,w as O,x as R,y as C,z as I,A as L,B as V,C as W}from"./chunks/vendor-92f01141.js";function ve(i){let e,t,r;const l=[i[1]||{}];var n=i[0][0];function a(s){let o={};for(let c=0;c{L(f,1)}),T()}n?(e=new n(a()),E(e.$$.fragment),w(e.$$.fragment,1),R(e,t.parentNode,t)):e=null}else n&&e.$set(c)},i(s){r||(e&&w(e.$$.fragment,s),r=!0)},o(s){e&&g(e.$$.fragment,s),r=!1},d(s){s&&y(t),e&&L(e,s)}}}function ye(i){let e,t,r;const l=[i[1]||{}];var n=i[0][0];function a(s){let o={$$slots:{default:[Re]},$$scope:{ctx:s}};for(let c=0;c{L(f,1)}),T()}n?(e=new n(a(s)),E(e.$$.fragment),w(e.$$.fragment,1),R(e,t.parentNode,t)):e=null}else n&&e.$set(c)},i(s){r||(e&&w(e.$$.fragment,s),r=!0)},o(s){e&&g(e.$$.fragment,s),r=!1},d(s){s&&y(t),e&&L(e,s)}}}function $e(i){let e,t,r;const l=[i[2]||{}];var n=i[0][1];function a(s){let o={};for(let c=0;c{L(f,1)}),T()}n?(e=new n(a()),E(e.$$.fragment),w(e.$$.fragment,1),R(e,t.parentNode,t)):e=null}else n&&e.$set(c)},i(s){r||(e&&w(e.$$.fragment,s),r=!0)},o(s){e&&g(e.$$.fragment,s),r=!1},d(s){s&&y(t),e&&L(e,s)}}}function ke(i){let e,t,r;const l=[i[2]||{}];var n=i[0][1];function a(s){let o={$$slots:{default:[Ee]},$$scope:{ctx:s}};for(let c=0;c{L(f,1)}),T()}n?(e=new n(a(s)),E(e.$$.fragment),w(e.$$.fragment,1),R(e,t.parentNode,t)):e=null}else n&&e.$set(c)},i(s){r||(e&&w(e.$$.fragment,s),r=!0)},o(s){e&&g(e.$$.fragment,s),r=!1},d(s){s&&y(t),e&&L(e,s)}}}function Ee(i){let e,t,r;const l=[i[3]||{}];var n=i[0][2];function a(s){let o={};for(let c=0;c{L(f,1)}),T()}n?(e=new n(a()),E(e.$$.fragment),w(e.$$.fragment,1),R(e,t.parentNode,t)):e=null}else n&&e.$set(c)},i(s){r||(e&&w(e.$$.fragment,s),r=!0)},o(s){e&&g(e.$$.fragment,s),r=!1},d(s){s&&y(t),e&&L(e,s)}}}function Re(i){let e,t,r,l;const n=[ke,$e],a=[];function s(o,c){return o[0][2]?0:1}return e=s(i),t=a[e]=n[e](i),{c(){t.c(),r=m()},l(o){t.l(o),r=m()},m(o,c){a[e].m(o,c),k(o,r,c),l=!0},p(o,c){let f=e;e=s(o),e===f?a[e].p(o,c):(P(),g(a[f],1,1,()=>{a[f]=null}),T(),t=a[e],t?t.p(o,c):(t=a[e]=n[e](o),t.c()),w(t,1),t.m(r.parentNode,r))},i(o){l||(w(t),l=!0)},o(o){g(t),l=!1},d(o){a[e].d(o),o&&y(r)}}}function F(i){let e,t=i[5]&&H(i);return{c(){e=ce("div"),t&&t.c(),this.h()},l(r){e=fe(r,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,class:!0});var l=ue(e);t&&t.l(l),l.forEach(y),this.h()},h(){K(e,"id","svelte-announcer"),K(e,"aria-live","assertive"),K(e,"aria-atomic","true"),K(e,"class","svelte-1j55zn5")},m(r,l){k(r,e,l),t&&t.m(e,null)},p(r,l){r[5]?t?t.p(r,l):(t=H(r),t.c(),t.m(e,null)):t&&(t.d(1),t=null)},d(r){r&&y(e),t&&t.d()}}}function H(i){let e;return{c(){e=he(i[6])},l(t){e=de(t,i[6])},m(t,r){k(t,e,r)},p(t,r){r&64&&_e(e,t[6])},d(t){t&&y(e)}}}function Le(i){let e,t,r,l,n;const a=[ye,ve],s=[];function o(f,h){return f[0][1]?0:1}e=o(i),t=s[e]=a[e](i);let c=i[4]&&F(i);return{c(){t.c(),r=pe(),c&&c.c(),l=m()},l(f){t.l(f),r=me(f),c&&c.l(f),l=m()},m(f,h){s[e].m(f,h),k(f,r,h),c&&c.m(f,h),k(f,l,h),n=!0},p(f,[h]){let u=e;e=o(f),e===u?s[e].p(f,h):(P(),g(s[u],1,1,()=>{s[u]=null}),T(),t=s[e],t?t.p(f,h):(t=s[e]=a[e](f),t.c()),w(t,1),t.m(r.parentNode,r)),f[4]?c?c.p(f,h):(c=F(f),c.c(),c.m(l.parentNode,l)):c&&(c.d(1),c=null)},i(f){n||(w(t),n=!0)},o(f){g(t),n=!1},d(f){s[e].d(f),f&&y(r),c&&c.d(f),f&&y(l)}}}function Se(i,e,t){let{stores:r}=e,{page:l}=e,{components:n}=e,{props_0:a=null}=e,{props_1:s=null}=e,{props_2:o=null}=e;ge("__svelte__",r),we(r.page.notify);let c=!1,f=!1,h=null;return be(()=>{const u=r.page.subscribe(()=>{c&&(t(5,f=!0),t(6,h=document.title||"untitled page"))});return t(4,c=!0),u}),i.$$set=u=>{"stores"in u&&t(7,r=u.stores),"page"in u&&t(8,l=u.page),"components"in u&&t(0,n=u.components),"props_0"in u&&t(1,a=u.props_0),"props_1"in u&&t(2,s=u.props_1),"props_2"in u&&t(3,o=u.props_2)},i.$$.update=()=>{i.$$.dirty&384&&r.page.set(l)},[n,a,s,o,c,f,h,r,l]}class Ue extends ae{constructor(e){super();oe(this,e,Se,Le,le,{stores:7,page:8,components:0,props_0:1,props_1:2,props_2:3})}}const Ae="modulepreload",Q={},je="/staticspaceiframe/julien-c/sveltekit-demo/build/_app/",D=function(e,t){return!t||t.length===0?e():Promise.all(t.map(r=>{if(r=`${je}${r}`,r in Q)return;Q[r]=!0;const l=r.endsWith(".css"),n=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${r}"]${n}`))return;const a=document.createElement("link");if(a.rel=l?"stylesheet":Ae,l||(a.as="script",a.crossOrigin=""),a.href=r,document.head.appendChild(a),l)return new Promise((s,o)=>{a.addEventListener("load",s),a.addEventListener("error",o)})})).then(()=>e())},$=[()=>D(()=>import("./pages/__layout.svelte-63495e35.js"),["pages/__layout.svelte-63495e35.js","assets/pages/__layout.svelte-6fc1a61d.css","chunks/vendor-92f01141.js"]),()=>D(()=>import("./error.svelte-9d0fd51b.js"),["error.svelte-9d0fd51b.js","chunks/vendor-92f01141.js"]),()=>D(()=>import("./pages/index.svelte-a15b343f.js"),["pages/index.svelte-a15b343f.js","assets/pages/index.svelte-c63fe1c6.css","chunks/vendor-92f01141.js"]),()=>D(()=>import("./pages/about.svelte-310947ca.js"),["pages/about.svelte-310947ca.js","assets/pages/about.svelte-bf4528fa.css","chunks/vendor-92f01141.js"]),()=>D(()=>import("./pages/todos/index.svelte-04c91dab.js"),["pages/todos/index.svelte-04c91dab.js","assets/pages/todos/index.svelte-784042c1.css","chunks/vendor-92f01141.js"])],Pe=[[/^\/$/,[$[0],$[2]],[$[1]]],[/^\/about\/?$/,[$[0],$[3]],[$[1]]],,[/^\/todos\/?$/,[$[0],$[4]],[$[1]]]],Te=[$[0](),$[1]()];function Ne(i){let e=i.baseURI;if(!e){const t=i.getElementsByTagName("base");e=t.length?t[0].href:i.URL}return e}let Z="";function Oe(i){Z=i.base,i.assets}function z(){return{x:pageXOffset,y:pageYOffset}}function x(i){return i.composedPath().find(t=>t instanceof Node&&t.nodeName.toUpperCase()==="A")}function ee(i){return i instanceof SVGAElement?new URL(i.href.baseVal,document.baseURI):new URL(i.href)}class Ce{constructor({base:e,routes:t,trailing_slash:r,renderer:l}){this.base=e,this.routes=t,this.trailing_slash=r,this.navigating=0,this.renderer=l,l.router=this,this.enabled=!0,document.body.setAttribute("tabindex","-1"),history.replaceState(history.state||{},"",location.href)}init_listeners(){"scrollRestoration"in history&&(history.scrollRestoration="manual"),addEventListener("beforeunload",()=>{history.scrollRestoration="auto"}),addEventListener("load",()=>{history.scrollRestoration="manual"});let e;addEventListener("scroll",()=>{clearTimeout(e),e=setTimeout(()=>{const n=Y(A({},history.state||{}),{"sveltekit:scroll":z()});history.replaceState(n,document.title,window.location.href)},200)});const t=n=>{const a=x(n);a&&a.href&&a.hasAttribute("sveltekit:prefetch")&&this.prefetch(ee(a))};let r;const l=n=>{clearTimeout(r),r=setTimeout(()=>{var a;(a=n.target)==null||a.dispatchEvent(new CustomEvent("sveltekit:trigger_prefetch",{bubbles:!0}))},20)};addEventListener("touchstart",t),addEventListener("mousemove",l),addEventListener("sveltekit:trigger_prefetch",t),addEventListener("click",n=>{if(!this.enabled||n.button||n.which!==1||n.metaKey||n.ctrlKey||n.shiftKey||n.altKey||n.defaultPrevented)return;const a=x(n);if(!a||!a.href)return;const s=ee(a);if(s.toString()===location.href){location.hash||n.preventDefault();return}const c=(a.getAttribute("rel")||"").split(/\s+/);if(a.hasAttribute("download")||c&&c.includes("external")||(a instanceof SVGAElement?a.target.baseVal:a.target)||!this.owns(s))return;if(s.href.split("#")[0]===location.href.split("#")[0]){setTimeout(()=>history.pushState({},"",s.href));return}history.pushState({},"",s.href);const f=a.hasAttribute("sveltekit:noscroll");this._navigate(s,f?z():null,!1,[],s.hash),n.preventDefault()}),addEventListener("popstate",n=>{if(n.state&&this.enabled){const a=new URL(location.href);this._navigate(a,n.state["sveltekit:scroll"],!1,[])}})}owns(e){return e.origin===location.origin&&e.pathname.startsWith(this.base)}parse(e){if(this.owns(e)){const t=decodeURI(e.pathname.slice(this.base.length)||"/");return{id:e.pathname+e.search,routes:this.routes.filter(([r])=>r.test(t)),url:e,path:t}}}async goto(e,{noscroll:t=!1,replaceState:r=!1,keepfocus:l=!1,state:n={}}={},a){const s=new URL(e,Ne(document));return this.enabled&&this.owns(s)?(history[r?"replaceState":"pushState"](n,"",e),this._navigate(s,t?z():null,l,a,s.hash)):(location.href=s.href,new Promise(()=>{}))}enable(){this.enabled=!0}disable(){this.enabled=!1}async prefetch(e){const t=this.parse(e);if(!t)throw new Error("Attempted to prefetch a URL that does not belong to this app");return this.renderer.load(t)}async _navigate(e,t,r,l,n){const a=this.parse(e);if(!a)throw new Error("Attempted to navigate to a URL that does not belong to this app");this.navigating||dispatchEvent(new CustomEvent("sveltekit:navigation-start")),this.navigating++;let{pathname:s}=e;this.trailing_slash==="never"?s!=="/"&&s.endsWith("/")&&(s=s.slice(0,-1)):this.trailing_slash==="always"&&!e.pathname.split("/").pop().includes(".")&&!s.endsWith("/")&&(s+="/"),a.url=new URL(e.origin+s+e.search+e.hash),history.replaceState({},"",a.url),await this.renderer.handle_navigation(a,l,!1,{hash:n,scroll:t,keepfocus:r}),this.navigating--,this.navigating||dispatchEvent(new CustomEvent("sveltekit:navigation-end"))}}function te(i){return i instanceof Error||i&&i.name&&i.message?i:new Error(JSON.stringify(i))}function Ie(i){let e=5381,t=i.length;if(typeof i=="string")for(;t;)e=e*33^i.charCodeAt(--t);else for(;t;)e=e*33^i[--t];return(e>>>0).toString(36)}function Ve(i){const e=i.status&&i.status>=400&&i.status<=599&&!i.redirect;if(i.error||e){const t=i.status;if(!i.error&&e)return{status:t||500,error:new Error};const r=typeof i.error=="string"?new Error(i.error):i.error;return r 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:r}):{status:t,error:r}:{status:500,error:new Error(`"error" property returned from load() must be a string or instance of Error, received type "${typeof r}"`)}}if(i.redirect){if(!i.status||Math.floor(i.status/100)!==3)return{status:500,error:new Error('"redirect" property returned from load() must be accompanied by a 3xx status code')};if(typeof i.redirect!="string")return{status:500,error:new Error('"redirect" property returned from load() must be a string')}}if(i.context)throw new Error('You are returning "context" from a load function. "context" was renamed to "stuff", please adjust your code accordingly.');return i}function se(i){const e=W(i);let t=!0;function r(){t=!0,e.update(a=>a)}function l(a){t=!1,e.set(a)}function n(a){let s;return e.subscribe(o=>{(s===void 0||t&&o!==s)&&a(s=o)})}return{notify:r,set:l,subscribe:n}}function De(i,e){const t=typeof i=="string"?i:i.url;let r=`script[data-type="svelte-data"][data-url=${JSON.stringify(t)}]`;e&&typeof e.body=="string"&&(r+=`[data-body="${Ie(e.body)}"]`);const l=document.querySelector(r);if(l&&l.textContent){const n=JSON.parse(l.textContent),{body:a}=n,s=X(n,["body"]);return Promise.resolve(new Response(a,s))}return fetch(i,e)}class qe{constructor({Root:e,fallback:t,target:r,session:l}){this.Root=e,this.fallback=t,this.router,this.target=r,this.started=!1,this.session_id=1,this.invalid=new Set,this.invalidating=null,this.autoscroll=!0,this.updating=!1,this.current={url:null,session_id:0,branch:[]},this.cache=new Map,this.loading={id:null,promise:null},this.stores={url:se({}),page:se({}),navigating:W(null),session:W(l)},this.$session=null,this.root=null;let n=!1;this.stores.session.subscribe(async a=>{if(this.$session=a,!n||!this.router)return;this.session_id+=1;const s=this.router.parse(new URL(location.href));s&&this.update(s,[],!0)}),n=!0}disable_scroll_handling(){(this.updating||!this.started)&&(this.autoscroll=!1)}async start({status:e,error:t,nodes:r,url:l,params:n}){const a=[];let s={},o,c;try{for(let f=0;f10||t.includes(e.url.pathname))a=await this._load_error({status:500,error:new Error("Redirect loop"),url:e.url});else{this.router?this.router.goto(a.redirect,{replaceState:!0},[...t,e.url.pathname]):location.href=new URL(a.redirect,location.href).href;return}if(this.updating=!0,this.started?(this.current=a.state,this.root.$set(a.props),this.stores.navigating.set(null)):this._init(a),l){const{hash:c,scroll:f,keepfocus:h}=l;if(h||((o=getSelection())==null||o.removeAllRanges(),document.body.focus()),await 0,this.autoscroll){const u=c&&document.getElementById(c.slice(1));f?scrollTo(f.x,f.y):u?u.scrollIntoView():scrollTo(0,0)}}else await 0;if(this.loading.promise=null,this.loading.id=null,this.autoscroll=!0,this.updating=!1,!this.router)return;const s=a.state.branch[a.state.branch.length-1];s&&s.module.router===!1?this.router.disable():this.router.enable()}load(e){return this.loading.promise=this._get_navigation_result(e,!1),this.loading.id=e.id,this.loading.promise}invalidate(e){return this.invalid.add(e),this.invalidating||(this.invalidating=Promise.resolve().then(async()=>{const t=this.router&&this.router.parse(new URL(location.href));t&&await this.update(t,[],!0),this.invalidating=null})),this.invalidating}_init(e){this.current=e.state;const t=document.querySelector("style[data-svelte]");t&&t.remove(),this.root=new this.Root({target:this.target,props:A({stores:this.stores},e.props),hydrate:!0}),this.started=!0}async _get_navigation_result(e,t){if(this.loading.id===e.id&&this.loading.promise)return this.loading.promise;for(let r=0;ro()),n+=1;else break}const a=await this._load({route:l,info:e},t);if(a)return a}return await this._load_error({status:404,error:new Error(`Not found: ${e.url.pathname}`),url:e.url})}async _get_navigation_result_from_branch({url:e,params:t,branch:r,status:l,error:n}){const a=r.filter(Boolean),s=a.find(h=>h.loaded&&h.loaded.redirect),o={redirect:s&&s.loaded?s.loaded.redirect:void 0,state:{url:e,params:t,branch:r,session_id:this.session_id},props:{components:a.map(h=>h.module.default)}};for(let h=0;h{Object.defineProperty(o.props.page,u,{get:()=>{throw new Error(`$page.${u} has been replaced by $page.url.${p}`)}})};h("origin","origin"),h("path","pathname"),h("query","searchParams")}const c=a[a.length-1],f=c.loaded&&c.loaded.maxage;if(f){const h=e.pathname+e.search;let u=!1;const p=()=>{this.cache.get(h)===o&&this.cache.delete(h),S(),clearTimeout(j)},j=setTimeout(p,f*1e3),S=this.stores.session.subscribe(()=>{u&&p()});u=!0,this.cache.set(h,o)}return o}async _load_node({status:e,error:t,module:r,url:l,params:n,stuff:a}){const s={module:r,uses:{params:new Set,url:!1,session:!1,stuff:!1,dependencies:[]},loaded:null,stuff:a},o={};for(const f in n)Object.defineProperty(o,f,{get(){return s.uses.params.add(f),n[f]},enumerable:!0});const c=this.$session;if(r.load){const{started:f}=this,h={params:o,get url(){return s.uses.url=!0,l},get session(){return s.uses.session=!0,c},get stuff(){return s.uses.stuff=!0,A({},a)},fetch(p,j){const S=typeof p=="string"?p:p.url,{href:U}=new URL(S,l);return s.uses.dependencies.push(U),f?fetch(p,j):De(p,j)}};t&&(h.status=e,h.error=t);const u=await r.load.call(null,h);if(!u)return;s.loaded=Ve(u),s.loaded.stuff&&(s.stuff=s.loaded.stuff)}return s}async _load({route:e,info:{url:t,path:r}},l){const n=t.pathname+t.search;if(!l){const d=this.cache.get(n);if(d)return d}const[a,s,o,c]=e,f=c?c(a.exec(r)):{},h=this.current.url&&{url:n!==this.current.url.pathname+this.current.url.search,params:Object.keys(f).filter(d=>this.current.params[d]!==f[d]),session:this.session_id!==this.current.session_id};let u=[],p={},j=!1,S=200,U;s.forEach(d=>d());e:for(let d=0;dv.uses.params.has(N))||h.session&&v.uses.session||v.uses.dependencies.some(N=>this.invalid.has(N))||j&&v.uses.stuff){_=await this._load_node({module:b,url:t,params:f,stuff:p});const N=d===s.length-1;if(_&&_.loaded){if(_.loaded.error&&(S=_.loaded.status,U=_.loaded.error),_.loaded.redirect)return{redirect:_.loaded.redirect,props:{},state:this.current};_.loaded.stuff&&(j=!0)}else if(N&&b.load)return}else _=v}catch(b){S=500,U=te(b)}if(U){for(;d--;)if(o[d]){let b,v,q=d;for(;!(v=u[q]);)q-=1;try{if(b=await this._load_node({status:S,error:U,module:await o[d](),url:t,params:f,stuff:v.stuff}),b&&b.loaded&&b.loaded.error)continue;u=u.slice(0,q+1).concat(b);break e}catch{continue}}return await this._load_error({status:S,error:U,url:t})}else _&&_.loaded&&_.loaded.stuff&&(p=A(A({},p),_.loaded.stuff)),u.push(_)}return await this._get_navigation_result_from_branch({url:t,params:f,branch:u,status:S,error:U})}async _load_error({status:e,error:t,url:r}){const l={},n=await this._load_node({module:await this.fallback[0],url:r,params:l,stuff:{}}),a=[n,await this._load_node({status:e,error:t,module:await this.fallback[1],url:r,params:l,stuff:n&&n.loaded&&n.loaded.stuff||{}})];return await this._get_navigation_result_from_branch({url:r,params:l,branch:a,status:e,error:t})}}async function We({paths:i,target:e,session:t,route:r,spa:l,trailing_slash:n,hydrate:a}){const s=new qe({Root:Ue,fallback:Te,target:e,session:t}),o=r?new Ce({base:i.base,routes:Pe,trailing_slash:n,renderer:s}):null;Oe(i),a&&await s.start(a),o&&(l&&o.goto(location.href,{replaceState:!0},[]),o.init_listeners()),dispatchEvent(new CustomEvent("sveltekit:start"))}export{We as start};