diff --git a/.gitignore b/.gitignore index 6635cf5..91f5648 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ .DS_Store node_modules -/build /.svelte-kit /package .env diff --git a/build/client/_app/immutable/assets/0.675f064e.css b/build/client/_app/immutable/assets/0.675f064e.css new file mode 100644 index 0000000..35e1104 --- /dev/null +++ b/build/client/_app/immutable/assets/0.675f064e.css @@ -0,0 +1 @@ +h1{color:purple}section p{color:#00f;font-size:30px}nav.svelte-1oqqfea{border:1px solid green}header.svelte-mw7wrq.svelte-mw7wrq{border:1px solid red}header.svelte-mw7wrq h1.svelte-mw7wrq{font-size:2.4rem}footer.svelte-1lfmg61{border:1px solid blue} diff --git a/build/client/_app/immutable/assets/2.5db023af.css b/build/client/_app/immutable/assets/2.5db023af.css new file mode 100644 index 0000000..519fade --- /dev/null +++ b/build/client/_app/immutable/assets/2.5db023af.css @@ -0,0 +1 @@ +main.svelte-1u03z1s{border:1px solid black}p.svelte-1u03z1s{color:#00f} diff --git a/build/client/_app/immutable/assets/4.805c7000.css b/build/client/_app/immutable/assets/4.805c7000.css new file mode 100644 index 0000000..752ee31 --- /dev/null +++ b/build/client/_app/immutable/assets/4.805c7000.css @@ -0,0 +1 @@ +div.svelte-iatflv p.svelte-iatflv{color:red} diff --git a/build/client/_app/immutable/assets/_layout.675f064e.css b/build/client/_app/immutable/assets/_layout.675f064e.css new file mode 100644 index 0000000..35e1104 --- /dev/null +++ b/build/client/_app/immutable/assets/_layout.675f064e.css @@ -0,0 +1 @@ +h1{color:purple}section p{color:#00f;font-size:30px}nav.svelte-1oqqfea{border:1px solid green}header.svelte-mw7wrq.svelte-mw7wrq{border:1px solid red}header.svelte-mw7wrq h1.svelte-mw7wrq{font-size:2.4rem}footer.svelte-1lfmg61{border:1px solid blue} diff --git a/build/client/_app/immutable/assets/_page.5db023af.css b/build/client/_app/immutable/assets/_page.5db023af.css new file mode 100644 index 0000000..519fade --- /dev/null +++ b/build/client/_app/immutable/assets/_page.5db023af.css @@ -0,0 +1 @@ +main.svelte-1u03z1s{border:1px solid black}p.svelte-1u03z1s{color:#00f} diff --git a/build/client/_app/immutable/assets/_page.805c7000.css b/build/client/_app/immutable/assets/_page.805c7000.css new file mode 100644 index 0000000..752ee31 --- /dev/null +++ b/build/client/_app/immutable/assets/_page.805c7000.css @@ -0,0 +1 @@ +div.svelte-iatflv p.svelte-iatflv{color:red} diff --git a/build/client/_app/immutable/chunks/index.5ae4157e.js b/build/client/_app/immutable/chunks/index.5ae4157e.js new file mode 100644 index 0000000..98e0db6 --- /dev/null +++ b/build/client/_app/immutable/chunks/index.5ae4157e.js @@ -0,0 +1 @@ +var C=Object.defineProperty;var E=(e,t,n)=>t in e?C(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var p=(e,t,n)=>(E(e,typeof t!="symbol"?t+"":t,n),n);import{r as h,n as y,f as w,h as j,i as S,j as B,k as b,l as I,m as M,p as N,q as P,v as T,w as q}from"./scheduler.e108d1fd.js";let $=!1;function H(){$=!0}function L(){$=!1}function O(e,t,n,a){for(;e>1);n(s)<=a?e=s+1:t=s}return e}function D(e){if(e.hydrate_init)return;e.hydrate_init=!0;let t=e.childNodes;if(e.nodeName==="HEAD"){const i=[];for(let r=0;r0&&t[n[s]].claim_order<=r?s+1:O(1,s,_=>t[n[_]].claim_order,r))-1;a[i]=n[o]+1;const u=o+1;n[u]=i,s=Math.max(u,s)}const c=[],l=[];let f=t.length-1;for(let i=n[s]+1;i!=0;i=a[i-1]){for(c.push(t[i-1]);f>=i;f--)l.push(t[f]);f--}for(;f>=0;f--)l.push(t[f]);c.reverse(),l.sort((i,r)=>i.claim_order-r.claim_order);for(let i=0,r=0;i=c[r].claim_order;)r++;const o=r{for(let l=e.claim_info.last_index;l=0;l--){const f=e[l];if(t(f)){const i=n(f);return i===void 0?e.splice(l,1):e[l]=i,s?i===void 0&&e.claim_info.last_index--:e.claim_info.last_index=l,f}}return a()})();return c.claim_order=e.claim_info.total_claimed,e.claim_info.total_claimed+=1,c}function G(e,t,n,a){return A(e,s=>s.nodeName===t,s=>{const c=[];for(let l=0;ls.removeAttribute(l))},()=>a(t))}function ae(e,t,n){return G(e,t,n,W)}function J(e,t){return A(e,n=>n.nodeType===3,n=>{const a=""+t;if(n.data.startsWith(a)){if(n.data.length!==a.length)return n.splitText(a.length)}else n.data=a},()=>x(t),!0)}function le(e){return J(e," ")}function se(e,t){t=""+t,e.data!==t&&(e.data=t)}function fe(e,t,n,a){n==null?e.style.removeProperty(t):e.style.setProperty(t,n,a?"important":"")}function ce(e,t){return new e(t)}const m=new Set;let d;function ue(){d={r:0,c:[],p:d}}function oe(){d.r||h(d.c),d=d.p}function K(e,t){e&&e.i&&(m.delete(e),e.i(t))}function de(e,t,n,a){if(e&&e.o){if(m.has(e))return;m.add(e),d.c.push(()=>{m.delete(e),a&&(n&&e.d(1),a())}),e.o(t)}else a&&a()}function _e(e){e&&e.c()}function me(e,t){e&&e.l(t)}function Q(e,t,n){const{fragment:a,after_update:s}=e.$$;a&&a.m(t,n),b(()=>{const c=e.$$.on_mount.map(P).filter(S);e.$$.on_destroy?e.$$.on_destroy.push(...c):h(c),e.$$.on_mount=[]}),s.forEach(b)}function U(e,t){const n=e.$$;n.fragment!==null&&(I(n.after_update),h(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function X(e,t){e.$$.dirty[0]===-1&&(T.push(e),q(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const v=g.length?g[0]:_;return r.ctx&&s(r.ctx[u],r.ctx[u]=v)&&(!r.skip_bound&&r.bound[u]&&r.bound[u](v),o&&X(e,u)),_}):[],r.update(),o=!0,h(r.before_update),r.fragment=a?a(r.ctx):!1,t.target){if(t.hydrate){H();const u=z(t.target);r.fragment&&r.fragment.l(u),u.forEach(V)}else r.fragment&&r.fragment.c();t.intro&&K(e.$$.fragment),Q(e,t.target,t.anchor),L(),j()}N(i)}class $e{constructor(){p(this,"$$");p(this,"$$set")}$destroy(){U(this,1),this.$destroy=y}$on(t,n){if(!S(n))return y;const a=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return a.push(n),()=>{const s=a.indexOf(n);s!==-1&&a.splice(s,1)}}$set(t){this.$$set&&!B(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const Y="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Y);export{$e as S,ee as a,oe as b,le as c,K as d,ne as e,V as f,W as g,ae as h,he as i,z as j,ie as k,fe as l,x as m,J as n,se as o,ue as p,ce as q,_e as r,te as s,de as t,me as u,Q as v,U as w,re as x,R as y}; diff --git a/build/client/_app/immutable/chunks/scheduler.e108d1fd.js b/build/client/_app/immutable/chunks/scheduler.e108d1fd.js new file mode 100644 index 0000000..eca6947 --- /dev/null +++ b/build/client/_app/immutable/chunks/scheduler.e108d1fd.js @@ -0,0 +1 @@ +function k(){}function x(t,n){for(const e in n)t[e]=n[e];return t}function w(t){return t()}function z(){return Object.create(null)}function j(t){t.forEach(w)}function F(t){return typeof t=="function"}function P(t,n){return t!=t?n==n:t!==n||t&&typeof t=="object"||typeof t=="function"}function S(t){return Object.keys(t).length===0}function E(t,...n){if(t==null){for(const o of n)o(void 0);return k}const e=t.subscribe(...n);return e.unsubscribe?()=>e.unsubscribe():e}function U(t,n,e){t.$$.on_destroy.push(E(n,e))}function A(t,n,e,o){if(t){const r=g(t,n,e,o);return t[0](r)}}function g(t,n,e,o){return t[1]&&o?x(e.ctx.slice(),t[1](o(n))):e.ctx}function B(t,n,e,o){if(t[2]&&o){const r=t[2](o(e));if(n.dirty===void 0)return r;if(typeof r=="object"){const a=[],f=Math.max(n.dirty.length,r.length);for(let s=0;s32){const n=[],e=t.ctx.length/32;for(let o=0;ot.indexOf(o)===-1?n.push(o):e.push(o)),e.forEach(o=>o()),u=n}export{H as a,p as b,A as c,B as d,U as e,z as f,D as g,q as h,F as i,S as j,O as k,J as l,i as m,k as n,G as o,d as p,w as q,j as r,P as s,I as t,C as u,l as v,v as w}; diff --git a/build/client/_app/immutable/chunks/singletons.c5f6caef.js b/build/client/_app/immutable/chunks/singletons.c5f6caef.js new file mode 100644 index 0000000..7ae35fd --- /dev/null +++ b/build/client/_app/immutable/chunks/singletons.c5f6caef.js @@ -0,0 +1 @@ +import{n as d,s as v}from"./scheduler.e108d1fd.js";const u=[];function p(e,t=d){let n;const o=new Set;function r(s){if(v(e,s)&&(e=s,n)){const c=!u.length;for(const l of o)l[1](),u.push(l,e);if(c){for(let l=0;l{o.delete(l),o.size===0&&n&&(n(),n=null)}}return{set:r,update:i,subscribe:a}}var g;const E=((g=globalThis.__sveltekit_rrbcpm)==null?void 0:g.base)??"";var k;const w=((k=globalThis.__sveltekit_rrbcpm)==null?void 0:k.assets)??E,A="1695207502521",y="sveltekit:snapshot",I="sveltekit:scroll",x="sveltekit:index",_={tap:1,hover:2,viewport:3,eager:4,off:-1};function O(e){let t=e.baseURI;if(!t){const n=e.getElementsByTagName("base");t=n.length?n[0].href:e.URL}return t}function U(){return{x:pageXOffset,y:pageYOffset}}function f(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const b={..._,"":_.hover};function m(e){let t=e.assignedSlot??e.parentNode;return(t==null?void 0:t.nodeType)===11&&(t=t.host),t}function L(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=m(e)}}function N(e,t){let n;try{n=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI)}catch{}const o=e instanceof SVGAElement?e.target.baseVal:e.target,r=!n||!!o||S(n,t)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),i=(n==null?void 0:n.origin)===location.origin&&e.hasAttribute("download");return{url:n,external:r,target:o,download:i}}function P(e){let t=null,n=null,o=null,r=null,i=null,a=null,s=e;for(;s&&s!==document.documentElement;)o===null&&(o=f(s,"preload-code")),r===null&&(r=f(s,"preload-data")),t===null&&(t=f(s,"keepfocus")),n===null&&(n=f(s,"noscroll")),i===null&&(i=f(s,"reload")),a===null&&(a=f(s,"replacestate")),s=m(s);function c(l){switch(l){case"":case"true":return!0;case"off":case"false":return!1;default:return null}}return{preload_code:b[o??"off"],preload_data:b[r??"off"],keep_focus:c(t),noscroll:c(n),reload:c(i),replace_state:c(a)}}function h(e){const t=p(e);let n=!0;function o(){n=!0,t.update(a=>a)}function r(a){n=!1,t.set(a)}function i(a){let s;return t.subscribe(c=>{(s===void 0||n&&c!==s)&&a(s=c)})}return{notify:o,set:r,subscribe:i}}function R(){const{set:e,subscribe:t}=p(!1);let n;async function o(){clearTimeout(n);try{const r=await fetch(`${w}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!r.ok)return!1;const a=(await r.json()).version!==A;return a&&(e(!0),clearTimeout(n)),a}catch{return!1}}return{subscribe:t,check:o}}function S(e,t){return e.origin!==location.origin||!e.pathname.startsWith(t)}function V(e){e.client}const Y={url:h({}),page:h({}),navigating:p(null),updated:R()};export{x as I,_ as P,I as S,y as a,N as b,P as c,Y as d,E as e,L as f,O as g,V as h,S as i,U as s}; diff --git a/build/client/_app/immutable/entry/app.02cfa3d8.js b/build/client/_app/immutable/entry/app.02cfa3d8.js new file mode 100644 index 0000000..01d11db --- /dev/null +++ b/build/client/_app/immutable/entry/app.02cfa3d8.js @@ -0,0 +1 @@ +import{s as q,a as B,o as U,t as j,b as D}from"../chunks/scheduler.e108d1fd.js";import{S as W,i as z,s as F,e as h,c as G,a as g,t as d,b as L,d as p,f as w,g as H,h as J,j as K,k as I,l as m,m as M,n as Q,o as X,p as P,q as k,r as v,u as N,v as E,w as y}from"../chunks/index.5ae4157e.js";const Y="modulepreload",Z=function(o,e){return new URL(o,e).href},O={},R=function(e,n,i){if(!n||n.length===0)return e();const s=document.getElementsByTagName("link");return Promise.all(n.map(f=>{if(f=Z(f,i),f in O)return;O[f]=!0;const t=f.endsWith(".css"),r=t?'[rel="stylesheet"]':"";if(!!i)for(let a=s.length-1;a>=0;a--){const u=s[a];if(u.href===f&&(!t||u.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${f}"]${r}`))return;const c=document.createElement("link");if(c.rel=t?"stylesheet":Y,t||(c.as="script",c.crossOrigin=""),c.href=f,document.head.appendChild(c),t)return new Promise((a,u)=>{c.addEventListener("load",a),c.addEventListener("error",()=>u(new Error(`Unable to preload CSS for ${f}`)))})})).then(()=>e()).catch(f=>{const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=f,window.dispatchEvent(t),!t.defaultPrevented)throw f})},re={};function $(o){let e,n,i;var s=o[1][0];function f(t,r){return{props:{data:t[3],form:t[2]}}}return s&&(e=k(s,f(o)),o[12](e)),{c(){e&&v(e.$$.fragment),n=h()},l(t){e&&N(e.$$.fragment,t),n=h()},m(t,r){e&&E(e,t,r),g(t,n,r),i=!0},p(t,r){if(r&2&&s!==(s=t[1][0])){if(e){P();const l=e;d(l.$$.fragment,1,0,()=>{y(l,1)}),L()}s?(e=k(s,f(t)),t[12](e),v(e.$$.fragment),p(e.$$.fragment,1),E(e,n.parentNode,n)):e=null}else if(s){const l={};r&8&&(l.data=t[3]),r&4&&(l.form=t[2]),e.$set(l)}},i(t){i||(e&&p(e.$$.fragment,t),i=!0)},o(t){e&&d(e.$$.fragment,t),i=!1},d(t){t&&w(n),o[12](null),e&&y(e,t)}}}function x(o){let e,n,i;var s=o[1][0];function f(t,r){return{props:{data:t[3],$$slots:{default:[ee]},$$scope:{ctx:t}}}}return s&&(e=k(s,f(o)),o[11](e)),{c(){e&&v(e.$$.fragment),n=h()},l(t){e&&N(e.$$.fragment,t),n=h()},m(t,r){e&&E(e,t,r),g(t,n,r),i=!0},p(t,r){if(r&2&&s!==(s=t[1][0])){if(e){P();const l=e;d(l.$$.fragment,1,0,()=>{y(l,1)}),L()}s?(e=k(s,f(t)),t[11](e),v(e.$$.fragment),p(e.$$.fragment,1),E(e,n.parentNode,n)):e=null}else if(s){const l={};r&8&&(l.data=t[3]),r&8215&&(l.$$scope={dirty:r,ctx:t}),e.$set(l)}},i(t){i||(e&&p(e.$$.fragment,t),i=!0)},o(t){e&&d(e.$$.fragment,t),i=!1},d(t){t&&w(n),o[11](null),e&&y(e,t)}}}function ee(o){let e,n,i;var s=o[1][1];function f(t,r){return{props:{data:t[4],form:t[2]}}}return s&&(e=k(s,f(o)),o[10](e)),{c(){e&&v(e.$$.fragment),n=h()},l(t){e&&N(e.$$.fragment,t),n=h()},m(t,r){e&&E(e,t,r),g(t,n,r),i=!0},p(t,r){if(r&2&&s!==(s=t[1][1])){if(e){P();const l=e;d(l.$$.fragment,1,0,()=>{y(l,1)}),L()}s?(e=k(s,f(t)),t[10](e),v(e.$$.fragment),p(e.$$.fragment,1),E(e,n.parentNode,n)):e=null}else if(s){const l={};r&16&&(l.data=t[4]),r&4&&(l.form=t[2]),e.$set(l)}},i(t){i||(e&&p(e.$$.fragment,t),i=!0)},o(t){e&&d(e.$$.fragment,t),i=!1},d(t){t&&w(n),o[10](null),e&&y(e,t)}}}function S(o){let e,n=o[6]&&T(o);return{c(){e=H("div"),n&&n.c(),this.h()},l(i){e=J(i,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var s=K(e);n&&n.l(s),s.forEach(w),this.h()},h(){I(e,"id","svelte-announcer"),I(e,"aria-live","assertive"),I(e,"aria-atomic","true"),m(e,"position","absolute"),m(e,"left","0"),m(e,"top","0"),m(e,"clip","rect(0 0 0 0)"),m(e,"clip-path","inset(50%)"),m(e,"overflow","hidden"),m(e,"white-space","nowrap"),m(e,"width","1px"),m(e,"height","1px")},m(i,s){g(i,e,s),n&&n.m(e,null)},p(i,s){i[6]?n?n.p(i,s):(n=T(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},d(i){i&&w(e),n&&n.d()}}}function T(o){let e;return{c(){e=M(o[7])},l(n){e=Q(n,o[7])},m(n,i){g(n,e,i)},p(n,i){i&128&&X(e,n[7])},d(n){n&&w(e)}}}function te(o){let e,n,i,s,f;const t=[x,$],r=[];function l(a,u){return a[1][1]?0:1}e=l(o),n=r[e]=t[e](o);let c=o[5]&&S(o);return{c(){n.c(),i=F(),c&&c.c(),s=h()},l(a){n.l(a),i=G(a),c&&c.l(a),s=h()},m(a,u){r[e].m(a,u),g(a,i,u),c&&c.m(a,u),g(a,s,u),f=!0},p(a,[u]){let b=e;e=l(a),e===b?r[e].p(a,u):(P(),d(r[b],1,1,()=>{r[b]=null}),L(),n=r[e],n?n.p(a,u):(n=r[e]=t[e](a),n.c()),p(n,1),n.m(i.parentNode,i)),a[5]?c?c.p(a,u):(c=S(a),c.c(),c.m(s.parentNode,s)):c&&(c.d(1),c=null)},i(a){f||(p(n),f=!0)},o(a){d(n),f=!1},d(a){a&&(w(i),w(s)),r[e].d(a),c&&c.d(a)}}}function ne(o,e,n){let{stores:i}=e,{page:s}=e,{constructors:f}=e,{components:t=[]}=e,{form:r}=e,{data_0:l=null}=e,{data_1:c=null}=e;B(i.page.notify);let a=!1,u=!1,b=null;U(()=>{const _=i.page.subscribe(()=>{a&&(n(6,u=!0),j().then(()=>{n(7,b=document.title||"untitled page")}))});return n(5,a=!0),_});function V(_){D[_?"unshift":"push"](()=>{t[1]=_,n(0,t)})}function A(_){D[_?"unshift":"push"](()=>{t[0]=_,n(0,t)})}function C(_){D[_?"unshift":"push"](()=>{t[0]=_,n(0,t)})}return o.$$set=_=>{"stores"in _&&n(8,i=_.stores),"page"in _&&n(9,s=_.page),"constructors"in _&&n(1,f=_.constructors),"components"in _&&n(0,t=_.components),"form"in _&&n(2,r=_.form),"data_0"in _&&n(3,l=_.data_0),"data_1"in _&&n(4,c=_.data_1)},o.$$.update=()=>{o.$$.dirty&768&&i.page.set(s)},[t,f,r,l,c,a,u,b,i,s,V,A,C]}class oe extends W{constructor(e){super(),z(this,e,ne,te,q,{stores:8,page:9,constructors:1,components:0,form:2,data_0:3,data_1:4})}}const ae=[()=>R(()=>import("../nodes/0.c6b7f96f.js"),["../nodes/0.c6b7f96f.js","../chunks/scheduler.e108d1fd.js","../chunks/index.5ae4157e.js","../assets/0.675f064e.css"],import.meta.url),()=>R(()=>import("../nodes/1.d912ddfa.js"),["../nodes/1.d912ddfa.js","../chunks/scheduler.e108d1fd.js","../chunks/index.5ae4157e.js","../chunks/singletons.c5f6caef.js"],import.meta.url),()=>R(()=>import("../nodes/2.d9995499.js"),["../nodes/2.d9995499.js","../chunks/scheduler.e108d1fd.js","../chunks/index.5ae4157e.js","../assets/2.5db023af.css"],import.meta.url),()=>R(()=>import("../nodes/3.af1c8f7a.js"),["../nodes/3.af1c8f7a.js","../chunks/scheduler.e108d1fd.js","../chunks/index.5ae4157e.js"],import.meta.url),()=>R(()=>import("../nodes/4.a10d64ed.js"),["../nodes/4.a10d64ed.js","../chunks/scheduler.e108d1fd.js","../chunks/index.5ae4157e.js","../assets/4.805c7000.css"],import.meta.url)],le=[],fe={"/":[2],"/kurs":[3],"/om":[4]},ce={handleError:({error:o})=>{console.error(o)}};export{fe as dictionary,ce as hooks,re as matchers,ae as nodes,oe as root,le as server_loads}; diff --git a/build/client/_app/immutable/entry/start.72dab473.js b/build/client/_app/immutable/entry/start.72dab473.js new file mode 100644 index 0000000..e21c1fb --- /dev/null +++ b/build/client/_app/immutable/entry/start.72dab473.js @@ -0,0 +1,3 @@ +import{o as we,t as ye}from"../chunks/scheduler.e108d1fd.js";import{S as Ge,a as Je,I as M,g as Ce,f as Me,b as _e,c as le,s as ee,i as ve,d as F,e as J,P as Ve,h as Xe}from"../chunks/singletons.c5f6caef.js";function Ze(t,r){return t==="/"||r==="ignore"?t:r==="never"?t.endsWith("/")?t.slice(0,-1):t:r==="always"&&!t.endsWith("/")?t+"/":t}function Qe(t){return t.split("%25").map(decodeURI).join("%25")}function et(t){for(const r in t)t[r]=decodeURIComponent(t[r]);return t}const tt=["href","pathname","search","searchParams","toString","toJSON"];function nt(t,r){const u=new URL(t);for(const s of tt)Object.defineProperty(u,s,{get(){return r(),t[s]},enumerable:!0,configurable:!0});return at(u),u}function at(t){Object.defineProperty(t,"hash",{get(){throw new Error("Cannot access event.url.hash. Consider using `$page.url.hash` inside a component instead")}})}const rt="/__data.json";function ot(t){return t.replace(/\/$/,"")+rt}function it(...t){let r=5381;for(const u of t)if(typeof u=="string"){let s=u.length;for(;s;)r=r*33^u.charCodeAt(--s)}else if(ArrayBuffer.isView(u)){const s=new Uint8Array(u.buffer,u.byteOffset,u.byteLength);let d=s.length;for(;d;)r=r*33^s[--d]}else throw new TypeError("value must be a string or TypedArray");return(r>>>0).toString(36)}const fe=window.fetch;window.fetch=(t,r)=>((t instanceof Request?t.method:(r==null?void 0:r.method)||"GET")!=="GET"&&ne.delete(ke(t)),fe(t,r));const ne=new Map;function st(t,r){const u=ke(t,r),s=document.querySelector(u);if(s!=null&&s.textContent){const{body:d,...f}=JSON.parse(s.textContent),E=s.getAttribute("data-ttl");return E&&ne.set(u,{body:d,init:f,ttl:1e3*Number(E)}),Promise.resolve(new Response(d,f))}return fe(t,r)}function ct(t,r,u){if(ne.size>0){const s=ke(t,u),d=ne.get(s);if(d){if(performance.now(){const d=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(s);if(d)return r.push({name:d[1],matcher:d[2],optional:!1,rest:!0,chained:!0}),"(?:/(.*))?";const f=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(s);if(f)return r.push({name:f[1],matcher:f[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!s)return;const E=s.split(/\[(.+?)\](?!\])/);return"/"+E.map((w,p)=>{if(p%2){if(w.startsWith("x+"))return be(String.fromCharCode(parseInt(w.slice(2),16)));if(w.startsWith("u+"))return be(String.fromCharCode(...w.slice(2).split("-").map(U=>parseInt(U,16))));const g=lt.exec(w);if(!g)throw new Error(`Invalid param: ${w}. Params and matcher names can only have underscores and alphanumeric characters.`);const[,D,x,k,N]=g;return r.push({name:k,matcher:N,optional:!!D,rest:!!x,chained:x?p===1&&E[0]==="":!1}),x?"(.*?)":D?"([^/]*)?":"([^/]+?)"}return be(w)}).join("")}).join("")}/?$`),params:r}}function ut(t){return!/^\([^)]+\)$/.test(t)}function dt(t){return t.slice(1).split("/").filter(ut)}function pt(t,r,u){const s={},d=t.slice(1);let f=0;for(let E=0;Ep).join("/"),f=0),w===void 0){l.rest&&(s[l.name]="");continue}if(!l.matcher||u[l.matcher](w)){s[l.name]=w;const p=r[E+1],g=d[E+1];p&&!p.rest&&p.optional&&g&&l.chained&&(f=0);continue}if(l.optional&&l.chained){f++;continue}return}if(!f)return s}function be(t){return t.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function ht({nodes:t,server_loads:r,dictionary:u,matchers:s}){const d=new Set(r);return Object.entries(u).map(([l,[w,p,g]])=>{const{pattern:D,params:x}=ft(l),k={id:l,exec:N=>{const U=D.exec(N);if(U)return pt(U,x,s)},errors:[1,...g||[]].map(N=>t[N]),layouts:[0,...p||[]].map(E),leaf:f(w)};return k.errors.length=k.layouts.length=Math.max(k.errors.length,k.layouts.length),k});function f(l){const w=l<0;return w&&(l=~l),[w,t[l]]}function E(l){return l===void 0?l:[d.has(l),t[l]]}}function Ke(t){try{return JSON.parse(sessionStorage[t])}catch{}}function qe(t,r){const u=JSON.stringify(r);try{sessionStorage[t]=u}catch{}}const gt=-1,mt=-2,wt=-3,yt=-4,_t=-5,vt=-6;function bt(t,r){if(typeof t=="number")return d(t,!0);if(!Array.isArray(t)||t.length===0)throw new Error("Invalid input");const u=t,s=Array(u.length);function d(f,E=!1){if(f===gt)return;if(f===wt)return NaN;if(f===yt)return 1/0;if(f===_t)return-1/0;if(f===vt)return-0;if(E)throw new Error("Invalid input");if(f in s)return s[f];const l=u[f];if(!l||typeof l!="object")s[f]=l;else if(Array.isArray(l))if(typeof l[0]=="string"){const w=l[0],p=r==null?void 0:r[w];if(p)return s[f]=p(d(l[1]));switch(w){case"Date":s[f]=new Date(l[1]);break;case"Set":const g=new Set;s[f]=g;for(let k=1;kr!=null)}const ze=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...ze];const St=new Set([...ze]);[...St];async function kt(t){var r;for(const u in t)if(typeof((r=t[u])==null?void 0:r.then)=="function")return Object.fromEntries(await Promise.all(Object.entries(t).map(async([s,d])=>[s,await d])));return t}class te{constructor(r,u){this.status=r,typeof u=="string"?this.body={message:u}:u?this.body=u:this.body={message:`Error: ${r}`}}toString(){return JSON.stringify(this.body)}}class Fe{constructor(r,u){this.status=r,this.location=u}}const Rt="x-sveltekit-invalidated",At="x-sveltekit-trailing-slash",K=Ke(Ge)??{},Q=Ke(Je)??{};function Ee(t){K[t]=ee()}function It(t,r){var $e;const u=ht(t),s=t.nodes[0],d=t.nodes[1];s(),d();const f=document.documentElement,E=[],l=[];let w=null;const p={before_navigate:[],on_navigate:[],after_navigate:[]};let g={branch:[],error:null,url:null},D=!1,x=!1,k=!0,N=!1,U=!1,H=!1,B=!1,V,T=($e=history.state)==null?void 0:$e[M];T||(T=Date.now(),history.replaceState({...history.state,[M]:T},"",location.href));const ue=K[T];ue&&(history.scrollRestoration="manual",scrollTo(ue.x,ue.y));let q,ae,W;async function Re(){if(W=W||Promise.resolve(),await W,!W)return;W=null;const e=new URL(location.href),i=X(e,!0);w=null;const n=ae={},o=i&&await he(i);if(n===ae&&o){if(o.type==="redirect")return re(new URL(o.location,e).href,{},[e.pathname],n);o.props.page!==void 0&&(q=o.props.page),V.$set(o.props)}}function Ae(e){l.some(i=>i==null?void 0:i.snapshot)&&(Q[e]=l.map(i=>{var n;return(n=i==null?void 0:i.snapshot)==null?void 0:n.capture()}))}function Ie(e){var i;(i=Q[e])==null||i.forEach((n,o)=>{var a,c;(c=(a=l[o])==null?void 0:a.snapshot)==null||c.restore(n)})}function Le(){Ee(T),qe(Ge,K),Ae(T),qe(Je,Q)}async function re(e,{noScroll:i=!1,replaceState:n=!1,keepFocus:o=!1,state:a={},invalidateAll:c=!1},h,v){return typeof e=="string"&&(e=new URL(e,Ce(document))),ce({url:e,scroll:i?ee():null,keepfocus:o,redirect_chain:h,details:{state:a,replaceState:n},nav_token:v,accepted:()=>{c&&(B=!0)},blocked:()=>{},type:"goto"})}async function Pe(e){return w={id:e.id,promise:he(e).then(i=>(i.type==="loaded"&&i.state.error&&(w=null),i))},w.promise}async function oe(...e){const n=u.filter(o=>e.some(a=>o.exec(a))).map(o=>Promise.all([...o.layouts,o.leaf].map(a=>a==null?void 0:a[1]())));await Promise.all(n)}function Oe(e){var o;g=e.state;const i=document.querySelector("style[data-sveltekit]");i&&i.remove(),q=e.props.page,V=new t.root({target:r,props:{...e.props,stores:F,components:l},hydrate:!0}),Ie(T);const n={from:null,to:{params:g.params,route:{id:((o=g.route)==null?void 0:o.id)??null},url:new URL(location.href)},willUnload:!1,type:"enter",complete:Promise.resolve()};p.after_navigate.forEach(a=>a(n)),x=!0}async function Y({url:e,params:i,branch:n,status:o,error:a,route:c,form:h}){let v="never";for(const y of n)(y==null?void 0:y.slash)!==void 0&&(v=y.slash);e.pathname=Ze(e.pathname,v),e.search=e.search;const b={type:"loaded",state:{url:e,params:i,branch:n,error:a,route:c},props:{constructors:Et(n).map(y=>y.node.component)}};h!==void 0&&(b.props.form=h);let _={},L=!q,A=0;for(let y=0;y(v.route=!0,m[O])}),params:new Proxy(o,{get:(m,O)=>(v.params.add(O),m[O])}),data:(c==null?void 0:c.data)??null,url:nt(n,()=>{v.url=!0}),async fetch(m,O){let j;m instanceof Request?(j=m.url,O={body:m.method==="GET"||m.method==="HEAD"?void 0:await m.blob(),cache:m.cache,credentials:m.credentials,headers:m.headers,integrity:m.integrity,keepalive:m.keepalive,method:m.method,mode:m.mode,redirect:m.redirect,referrer:m.referrer,referrerPolicy:m.referrerPolicy,signal:m.signal,...O}):j=m;const C=new URL(j,n);return P(C.href),C.origin===n.origin&&(j=C.href.slice(n.origin.length)),x?ct(j,C.href,O):st(j,O)},setHeaders:()=>{},depends:P,parent(){return v.parent=!0,i()}};h=await b.universal.load.call(null,y)??null,h=h?await kt(h):null}return{node:b,loader:e,server:c,universal:(L=b.universal)!=null&&L.load?{type:"data",data:h,uses:v}:null,data:h??(c==null?void 0:c.data)??null,slash:((A=b.universal)==null?void 0:A.trailingSlash)??(c==null?void 0:c.slash)}}function Ue(e,i,n,o,a){if(B)return!0;if(!o)return!1;if(o.parent&&e||o.route&&i||o.url&&n)return!0;for(const c of o.params)if(a[c]!==g.params[c])return!0;for(const c of o.dependencies)if(E.some(h=>h(new URL(c))))return!0;return!1}function pe(e,i){return(e==null?void 0:e.type)==="data"?e:(e==null?void 0:e.type)==="skip"?i??null:null}async function he({id:e,invalidating:i,url:n,params:o,route:a}){if((w==null?void 0:w.id)===e)return w.promise;const{errors:c,layouts:h,leaf:v}=a,b=[...h,v];c.forEach(S=>S==null?void 0:S().catch(()=>{})),b.forEach(S=>S==null?void 0:S[1]().catch(()=>{}));let _=null;const L=g.url?e!==g.url.pathname+g.url.search:!1,A=g.route?a.id!==g.route.id:!1;let P=!1;const y=b.map((S,I)=>{var G;const R=g.branch[I],$=!!(S!=null&&S[0])&&((R==null?void 0:R.loader)!==S[1]||Ue(P,A,L,(G=R.server)==null?void 0:G.uses,o));return $&&(P=!0),$});if(y.some(Boolean)){try{_=await He(n,y)}catch(S){return ie({status:S instanceof te?S.status:500,error:await Z(S,{url:n,params:o,route:{id:a.id}}),url:n,route:a})}if(_.type==="redirect")return _}const m=_==null?void 0:_.nodes;let O=!1;const j=b.map(async(S,I)=>{var ge;if(!S)return;const R=g.branch[I],$=m==null?void 0:m[I];if((!$||$.type==="skip")&&S[1]===(R==null?void 0:R.loader)&&!Ue(O,A,L,(ge=R.universal)==null?void 0:ge.uses,o))return R;if(O=!0,($==null?void 0:$.type)==="error")throw $;return de({loader:S[1],url:n,params:o,route:a,parent:async()=>{var De;const Te={};for(let me=0;me{});const C=[];for(let S=0;SPromise.resolve({}),server_data_node:pe(c)}),b={node:await d(),loader:d,universal:null,server:null,data:null};return await Y({url:n,params:a,branch:[v,b],status:e,error:i,route:null})}function X(e,i){if(ve(e,J))return;const n=se(e);for(const o of u){const a=o.exec(n);if(a)return{id:e.pathname+e.search,invalidating:i,route:o,params:et(a),url:e}}}function se(e){return Qe(e.pathname.slice(J.length)||"/")}function Ne({url:e,type:i,intent:n,delta:o}){let a=!1;const c=Be(g,n,e,i);o!==void 0&&(c.navigation.delta=o);const h={...c.navigation,cancel:()=>{a=!0,c.reject(new Error("navigation was cancelled"))}};return U||p.before_navigate.forEach(v=>v(h)),a?null:c}async function ce({url:e,scroll:i,keepfocus:n,redirect_chain:o,details:a,type:c,delta:h,nav_token:v={},accepted:b,blocked:_}){var j,C,S;const L=X(e,!1),A=Ne({url:e,type:c,delta:h,intent:L});if(!A){_();return}const P=T;b(),U=!0,x&&F.navigating.set(A.navigation),ae=v;let y=L&&await he(L);if(!y){if(ve(e,J))return await z(e);y=await je(e,{id:null},await Z(new Error(`Not found: ${e.pathname}`),{url:e,params:{},route:{id:null}}),404)}if(e=(L==null?void 0:L.url)||e,ae!==v)return A.reject(new Error("navigation was aborted")),!1;if(y.type==="redirect")if(o.length>10||o.includes(e.pathname))y=await ie({status:500,error:await Z(new Error("Redirect loop"),{url:e,params:{},route:{id:null}}),url:e,route:{id:null}});else return re(new URL(y.location,e).href,{},[...o,e.pathname],v),!1;else((j=y.props.page)==null?void 0:j.status)>=400&&await F.updated.check()&&await z(e);if(E.length=0,B=!1,N=!0,Ee(P),Ae(P),(C=y.props.page)!=null&&C.url&&y.props.page.url.pathname!==e.pathname&&(e.pathname=(S=y.props.page)==null?void 0:S.url.pathname),a){const I=a.replaceState?0:1;if(a.state[M]=T+=I,history[a.replaceState?"replaceState":"pushState"](a.state,"",e),!a.replaceState){let R=T+1;for(;Q[R]||K[R];)delete Q[R],delete K[R],R+=1}}if(w=null,x){g=y.state,y.props.page&&(y.props.page.url=e);const I=(await Promise.all(p.on_navigate.map(R=>R(A.navigation)))).filter(R=>typeof R=="function");if(I.length>0){let R=function(){p.after_navigate=p.after_navigate.filter($=>!I.includes($))};I.push(R),p.after_navigate.push(...I)}V.$set(y.props)}else Oe(y);const{activeElement:m}=document;if(await ye(),k){const I=e.hash&&document.getElementById(decodeURIComponent(e.hash.slice(1)));i?scrollTo(i.x,i.y):I?I.scrollIntoView():scrollTo(0,0)}const O=document.activeElement!==m&&document.activeElement!==document.body;!n&&!O&&Se(),k=!0,y.props.page&&(q=y.props.page),U=!1,c==="popstate"&&Ie(T),A.fulfil(void 0),p.after_navigate.forEach(I=>I(A.navigation)),F.navigating.set(null),N=!1}async function je(e,i,n,o){return e.origin===location.origin&&e.pathname===location.pathname&&!D?await ie({status:o,error:n,url:e,route:i}):await z(e)}function z(e){return location.href=e.href,new Promise(()=>{})}function Ye(){let e;f.addEventListener("mousemove",c=>{const h=c.target;clearTimeout(e),e=setTimeout(()=>{o(h,2)},20)});function i(c){o(c.composedPath()[0],1)}f.addEventListener("mousedown",i),f.addEventListener("touchstart",i,{passive:!0});const n=new IntersectionObserver(c=>{for(const h of c)h.isIntersecting&&(oe(se(new URL(h.target.href))),n.unobserve(h.target))},{threshold:0});function o(c,h){const v=Me(c,f);if(!v)return;const{url:b,external:_,download:L}=_e(v,J);if(_||L)return;const A=le(v);if(!A.reload)if(h<=A.preload_data){const P=X(b,!1);P&&Pe(P)}else h<=A.preload_code&&oe(se(b))}function a(){n.disconnect();for(const c of f.querySelectorAll("a")){const{url:h,external:v,download:b}=_e(c,J);if(v||b)continue;const _=le(c);_.reload||(_.preload_code===Ve.viewport&&n.observe(c),_.preload_code===Ve.eager&&oe(se(h)))}}p.after_navigate.push(a),a()}function Z(e,i){return e instanceof te?e.body:t.hooks.handleError({error:e,event:i})??{message:i.route.id!=null?"Internal Error":"Not Found"}}return{after_navigate:e=>{we(()=>(p.after_navigate.push(e),()=>{const i=p.after_navigate.indexOf(e);p.after_navigate.splice(i,1)}))},before_navigate:e=>{we(()=>(p.before_navigate.push(e),()=>{const i=p.before_navigate.indexOf(e);p.before_navigate.splice(i,1)}))},on_navigate:e=>{we(()=>(p.on_navigate.push(e),()=>{const i=p.on_navigate.indexOf(e);p.on_navigate.splice(i,1)}))},disable_scroll_handling:()=>{(N||!x)&&(k=!1)},goto:(e,i={})=>re(e,i,[]),invalidate:e=>{if(typeof e=="function")E.push(e);else{const{href:i}=new URL(e,location.href);E.push(n=>n.href===i)}return Re()},invalidate_all:()=>(B=!0,Re()),preload_data:async e=>{const i=new URL(e,Ce(document)),n=X(i,!1);if(!n)throw new Error(`Attempted to preload a URL that does not belong to this app: ${i}`);await Pe(n)},preload_code:oe,apply_action:async e=>{if(e.type==="error"){const i=new URL(location.href),{branch:n,route:o}=g;if(!o)return;const a=await xe(g.branch.length,n,o.errors);if(a){const c=await Y({url:i,params:g.params,branch:n.slice(0,a.idx).concat(a.node),status:e.status??500,error:e.error,route:o});g=c.state,V.$set(c.props),ye().then(Se)}}else e.type==="redirect"?re(e.location,{invalidateAll:!0},[]):(V.$set({form:null,page:{...q,form:e.data,status:e.status}}),await ye(),V.$set({form:e.data}),e.type==="success"&&Se())},_start_router:()=>{var i;history.scrollRestoration="manual",addEventListener("beforeunload",n=>{let o=!1;if(Le(),!U){const a=Be(g,void 0,null,"leave"),c={...a.navigation,cancel:()=>{o=!0,a.reject(new Error("navigation was cancelled"))}};p.before_navigate.forEach(h=>h(c))}o?(n.preventDefault(),n.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Le()}),(i=navigator.connection)!=null&&i.saveData||Ye(),f.addEventListener("click",n=>{var P;if(n.button||n.which!==1||n.metaKey||n.ctrlKey||n.shiftKey||n.altKey||n.defaultPrevented)return;const o=Me(n.composedPath()[0],f);if(!o)return;const{url:a,external:c,target:h,download:v}=_e(o,J);if(!a)return;if(h==="_parent"||h==="_top"){if(window.parent!==window)return}else if(h&&h!=="_self")return;const b=le(o);if(!(o instanceof SVGAElement)&&a.protocol!==location.protocol&&!(a.protocol==="https:"||a.protocol==="http:")||v)return;if(c||b.reload){Ne({url:a,type:"link"})?U=!0:n.preventDefault();return}const[L,A]=a.href.split("#");if(A!==void 0&&L===location.href.split("#")[0]){if(g.url.hash===a.hash){n.preventDefault(),(P=o.ownerDocument.getElementById(A))==null||P.scrollIntoView();return}if(H=!0,Ee(T),e(a),!b.replace_state)return;H=!1,n.preventDefault()}ce({url:a,scroll:b.noscroll?ee():null,keepfocus:b.keep_focus??!1,redirect_chain:[],details:{state:{},replaceState:b.replace_state??a.href===location.href},accepted:()=>n.preventDefault(),blocked:()=>n.preventDefault(),type:"link"})}),f.addEventListener("submit",n=>{if(n.defaultPrevented)return;const o=HTMLFormElement.prototype.cloneNode.call(n.target),a=n.submitter;if(((a==null?void 0:a.formMethod)||o.method)!=="get")return;const h=new URL((a==null?void 0:a.hasAttribute("formaction"))&&(a==null?void 0:a.formAction)||o.action);if(ve(h,J))return;const v=n.target,{keep_focus:b,noscroll:_,reload:L,replace_state:A}=le(v);if(L)return;n.preventDefault(),n.stopPropagation();const P=new FormData(v),y=a==null?void 0:a.getAttribute("name");y&&P.append(y,(a==null?void 0:a.getAttribute("value"))??""),h.search=new URLSearchParams(P).toString(),ce({url:h,scroll:_?ee():null,keepfocus:b??!1,redirect_chain:[],details:{state:{},replaceState:A??h.href===location.href},nav_token:{},accepted:()=>{},blocked:()=>{},type:"form"})}),addEventListener("popstate",async n=>{var o;if((o=n.state)!=null&&o[M]){if(n.state[M]===T)return;const a=K[n.state[M]];if(g.url.href.split("#")[0]===location.href.split("#")[0]){K[T]=ee(),T=n.state[M],scrollTo(a.x,a.y);return}const c=n.state[M]-T;await ce({url:new URL(location.href),scroll:a,keepfocus:!1,redirect_chain:[],details:null,accepted:()=>{T=n.state[M]},blocked:()=>{history.go(-c)},type:"popstate",delta:c})}else if(!H){const a=new URL(location.href);e(a)}}),addEventListener("hashchange",()=>{H&&(H=!1,history.replaceState({...history.state,[M]:++T},"",location.href))});for(const n of document.querySelectorAll("link"))n.rel==="icon"&&(n.href=n.href);addEventListener("pageshow",n=>{n.persisted&&F.navigating.set(null)});function e(n){g.url=n,F.page.set({...q,url:n}),F.page.notify()}},_hydrate:async({status:e=200,error:i,node_ids:n,params:o,route:a,data:c,form:h})=>{D=!0;const v=new URL(location.href);({params:o={},route:a={id:null}}=X(v,!1)||{});let b;try{const _=n.map(async(P,y)=>{const m=c[y];return m!=null&&m.uses&&(m.uses=We(m.uses)),de({loader:t.nodes[P],url:v,params:o,route:a,parent:async()=>{const O={};for(let j=0;jP===a.id);if(A){const P=A.layouts;for(let y=0;yd?"1":"0").join(""));const s=await fe(u.href);if(!s.ok)throw new te(s.status,await s.json());return new Promise(async d=>{var g;const f=new Map,E=s.body.getReader(),l=new TextDecoder;function w(D){return bt(D,{Promise:x=>new Promise((k,N)=>{f.set(x,{fulfil:k,reject:N})})})}let p="";for(;;){const{done:D,value:x}=await E.read();if(D&&!p)break;for(p+=!x&&p?` +`:l.decode(x);;){const k=p.indexOf(` +`);if(k===-1)break;const N=JSON.parse(p.slice(0,k));if(p=p.slice(k+1),N.type==="redirect")return d(N);if(N.type==="data")(g=N.nodes)==null||g.forEach(U=>{(U==null?void 0:U.type)==="data"&&(U.uses=We(U.uses),U.data=w(U.data))}),d(N);else if(N.type==="chunk"){const{id:U,data:H,error:B}=N,V=f.get(U);f.delete(U),B?V.reject(w(B)):V.fulfil(w(H))}}}})}function We(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)}}function Se(){const t=document.querySelector("[autofocus]");if(t)t.focus();else{const r=document.body,u=r.getAttribute("tabindex");r.tabIndex=-1,r.focus({preventScroll:!0,focusVisible:!1}),u!==null?r.setAttribute("tabindex",u):r.removeAttribute("tabindex");const s=getSelection();if(s&&s.type!=="None"){const d=[];for(let f=0;f{if(s.rangeCount===d.length){for(let f=0;f{d=g,f=D});return E.catch(()=>{}),{navigation:{from:{params:t.params,route:{id:((w=t.route)==null?void 0:w.id)??null},url:t.url},to:u&&{params:(r==null?void 0:r.params)??null,route:{id:((p=r==null?void 0:r.route)==null?void 0:p.id)??null},url:u},willUnload:!r,type:s,complete:E},fulfil:d,reject:f}}async function Ot(t,r,u){const s=It(t,r);Xe({client:s}),u?await s._hydrate(u):s.goto(location.href,{replaceState:!0}),s._start_router()}export{Ot as start}; diff --git a/build/client/_app/immutable/nodes/0.c6b7f96f.js b/build/client/_app/immutable/nodes/0.c6b7f96f.js new file mode 100644 index 0000000..842b679 --- /dev/null +++ b/build/client/_app/immutable/nodes/0.c6b7f96f.js @@ -0,0 +1 @@ +import{s as d,n as c,c as E,u as S,g as b,d as k}from"../chunks/scheduler.e108d1fd.js";import{S as g,i as x,g as p,h,x as M,k as v,a as _,f as u,s as y,r as w,j as F,c as H,u as C,y as T,v as q,d as m,t as $,w as L}from"../chunks/index.5ae4157e.js";function N(o){let e,a='';return{c(){e=p("nav"),e.innerHTML=a,this.h()},l(n){e=h(n,"NAV",{class:!0,"data-svelte-h":!0}),M(e)!=="svelte-xs80ax"&&(e.innerHTML=a),this.h()},h(){v(e,"class","svelte-1oqqfea")},m(n,l){_(n,e,l)},p:c,i:c,o:c,d(n){n&&u(e)}}}class O extends g{constructor(e){super(),x(this,e,null,N,d,{})}}function R(o){let e,a,n="SvelteKit",l,r,i;return r=new O({}),{c(){e=p("header"),a=p("h1"),a.textContent=n,l=y(),w(r.$$.fragment),this.h()},l(s){e=h(s,"HEADER",{class:!0});var t=F(e);a=h(t,"H1",{class:!0,"data-svelte-h":!0}),M(a)!=="svelte-1cpe83x"&&(a.textContent=n),l=H(t),C(r.$$.fragment,t),t.forEach(u),this.h()},h(){v(a,"class","svelte-mw7wrq"),v(e,"class","svelte-mw7wrq")},m(s,t){_(s,e,t),T(e,a),T(e,l),q(r,e,null),i=!0},p:c,i(s){i||(m(r.$$.fragment,s),i=!0)},o(s){$(r.$$.fragment,s),i=!1},d(s){s&&u(e),L(r)}}}class A extends g{constructor(e){super(),x(this,e,null,R,d,{})}}function K(o){let e,a="

footer

";return{c(){e=p("footer"),e.innerHTML=a,this.h()},l(n){e=h(n,"FOOTER",{class:!0,"data-svelte-h":!0}),M(e)!=="svelte-mbw76k"&&(e.innerHTML=a),this.h()},h(){v(e,"class","svelte-1lfmg61")},m(n,l){_(n,e,l)},p:c,i:c,o:c,d(n){n&&u(e)}}}class j extends g{constructor(e){super(),x(this,e,null,K,d,{})}}function D(o){let e,a,n,l,r;e=new A({});const i=o[1].default,s=E(i,o,o[0],null);return l=new j({}),{c(){w(e.$$.fragment),a=y(),s&&s.c(),n=y(),w(l.$$.fragment)},l(t){C(e.$$.fragment,t),a=H(t),s&&s.l(t),n=H(t),C(l.$$.fragment,t)},m(t,f){q(e,t,f),_(t,a,f),s&&s.m(t,f),_(t,n,f),q(l,t,f),r=!0},p(t,[f]){s&&s.p&&(!r||f&1)&&S(s,i,t,t[0],r?k(i,t[0],f,null):b(t[0]),null)},i(t){r||(m(e.$$.fragment,t),m(s,t),m(l.$$.fragment,t),r=!0)},o(t){$(e.$$.fragment,t),$(s,t),$(l.$$.fragment,t),r=!1},d(t){t&&(u(a),u(n)),L(e,t),s&&s.d(t),L(l,t)}}}function U(o,e,a){let{$$slots:n={},$$scope:l}=e;return o.$$set=r=>{"$$scope"in r&&a(0,l=r.$$scope)},[l,n]}class B extends g{constructor(e){super(),x(this,e,U,D,d,{})}}export{B as component}; diff --git a/build/client/_app/immutable/nodes/1.d912ddfa.js b/build/client/_app/immutable/nodes/1.d912ddfa.js new file mode 100644 index 0000000..463993c --- /dev/null +++ b/build/client/_app/immutable/nodes/1.d912ddfa.js @@ -0,0 +1 @@ +import{s as S,n as _,e as x}from"../chunks/scheduler.e108d1fd.js";import{S as y,i as j,g as f,m as d,s as q,h as g,j as h,n as v,f as u,c as C,a as m,y as $,o as E}from"../chunks/index.5ae4157e.js";import{d as H}from"../chunks/singletons.c5f6caef.js";const P=()=>{const s=H;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},k={subscribe(s){return P().page.subscribe(s)}};function w(s){var b;let t,r=s[0].status+"",o,n,i,c=((b=s[0].error)==null?void 0:b.message)+"",l;return{c(){t=f("h1"),o=d(r),n=q(),i=f("p"),l=d(c)},l(e){t=g(e,"H1",{});var a=h(t);o=v(a,r),a.forEach(u),n=C(e),i=g(e,"P",{});var p=h(i);l=v(p,c),p.forEach(u)},m(e,a){m(e,t,a),$(t,o),m(e,n,a),m(e,i,a),$(i,l)},p(e,[a]){var p;a&1&&r!==(r=e[0].status+"")&&E(o,r),a&1&&c!==(c=((p=e[0].error)==null?void 0:p.message)+"")&&E(l,c)},i:_,o:_,d(e){e&&(u(t),u(n),u(i))}}}function z(s,t,r){let o;return x(s,k,n=>r(0,o=n)),[o]}let F=class extends y{constructor(t){super(),j(this,t,z,w,S,{})}};export{F as component}; diff --git a/build/client/_app/immutable/nodes/2.d9995499.js b/build/client/_app/immutable/nodes/2.d9995499.js new file mode 100644 index 0000000..9f8fd47 --- /dev/null +++ b/build/client/_app/immutable/nodes/2.d9995499.js @@ -0,0 +1 @@ +import{s as i,n as s}from"../chunks/scheduler.e108d1fd.js";import{S as o,i as r,g as c,h as m,x as h,k as p,a as v,f as _}from"../chunks/index.5ae4157e.js";function d(n){let e,a='

Welcome to SvelteKit med Jack

Visit kit.svelte.dev to read the documentation

';return{c(){e=c("main"),e.innerHTML=a,this.h()},l(t){e=m(t,"MAIN",{class:!0,"data-svelte-h":!0}),h(e)!=="svelte-e842qm"&&(e.innerHTML=a),this.h()},h(){p(e,"class","svelte-1u03z1s")},m(t,l){v(t,e,l)},p:s,i:s,o:s,d(t){t&&_(e)}}}class g extends o{constructor(e){super(),r(this,e,null,d,i,{})}}export{g as component}; diff --git a/build/client/_app/immutable/nodes/3.af1c8f7a.js b/build/client/_app/immutable/nodes/3.af1c8f7a.js new file mode 100644 index 0000000..0ed3f3c --- /dev/null +++ b/build/client/_app/immutable/nodes/3.af1c8f7a.js @@ -0,0 +1 @@ +import{s as r,n}from"../chunks/scheduler.e108d1fd.js";import{S as l,i,g as m,h as c,x as p,a as f,f as u}from"../chunks/index.5ae4157e.js";function x(s){let t,a="kurs";return{c(){t=m("p"),t.textContent=a},l(e){t=c(e,"P",{"data-svelte-h":!0}),p(t)!=="svelte-b478y1"&&(t.textContent=a)},m(e,o){f(e,t,o)},p:n,i:n,o:n,d(e){e&&u(t)}}}class h extends l{constructor(t){super(),i(this,t,null,x,r,{})}}export{h as component}; diff --git a/build/client/_app/immutable/nodes/4.a10d64ed.js b/build/client/_app/immutable/nodes/4.a10d64ed.js new file mode 100644 index 0000000..b2fcab0 --- /dev/null +++ b/build/client/_app/immutable/nodes/4.a10d64ed.js @@ -0,0 +1 @@ +import{s as C,n as o}from"../chunks/scheduler.e108d1fd.js";import{S as H,i as T,g as p,s as u,h as _,x as r,c as x,k as g,a as n,f as i}from"../chunks/index.5ae4157e.js";function L(d){let e,m="Om SvelteKit",v,s,f='

Hej

',c,l,h="

På dig

";return{c(){e=p("h2"),e.textContent=m,v=u(),s=p("div"),s.innerHTML=f,c=u(),l=p("section"),l.innerHTML=h,this.h()},l(t){e=_(t,"H2",{"data-svelte-h":!0}),r(e)!=="svelte-1hsv6g7"&&(e.textContent=m),v=x(t),s=_(t,"DIV",{class:!0,"data-svelte-h":!0}),r(s)!=="svelte-1huuvjq"&&(s.innerHTML=f),c=x(t),l=_(t,"SECTION",{"data-svelte-h":!0}),r(l)!=="svelte-ezj15c"&&(l.innerHTML=h),this.h()},h(){g(s,"class","svelte-iatflv")},m(t,a){n(t,e,a),n(t,v,a),n(t,s,a),n(t,c,a),n(t,l,a)},p:o,i:o,o,d(t){t&&(i(e),i(v),i(s),i(c),i(l))}}}class j extends H{constructor(e){super(),T(this,e,null,L,C,{})}}export{j as component}; diff --git a/build/client/_app/version.json b/build/client/_app/version.json new file mode 100644 index 0000000..50235a8 --- /dev/null +++ b/build/client/_app/version.json @@ -0,0 +1 @@ +{"version":"1695207502521"} \ No newline at end of file diff --git a/build/client/favicon.png b/build/client/favicon.png new file mode 100644 index 0000000..825b9e6 Binary files /dev/null and b/build/client/favicon.png differ diff --git a/build/env.js b/build/env.js new file mode 100644 index 0000000..74787fe --- /dev/null +++ b/build/env.js @@ -0,0 +1,37 @@ +/* global "" */ + +const expected = new Set([ + 'SOCKET_PATH', + 'HOST', + 'PORT', + 'ORIGIN', + 'XFF_DEPTH', + 'ADDRESS_HEADER', + 'PROTOCOL_HEADER', + 'HOST_HEADER', + 'BODY_SIZE_LIMIT' +]); + +if ("") { + for (const name in process.env) { + if (name.startsWith("")) { + const unprefixed = name.slice("".length); + if (!expected.has(unprefixed)) { + throw new Error( + `You should change envPrefix (${""}) to avoid conflicts with existing environment variables — unexpectedly saw ${name}` + ); + } + } + } +} + +/** + * @param {string} name + * @param {any} fallback + */ +function env(name, fallback) { + const prefixed = "" + name; + return prefixed in process.env ? process.env[prefixed] : fallback; +} + +export { env }; diff --git a/build/handler.js b/build/handler.js new file mode 100644 index 0000000..877183d --- /dev/null +++ b/build/handler.js @@ -0,0 +1,1307 @@ +import './shims.js'; +import fs$1 from 'node:fs'; +import path from 'node:path'; +import * as fs from 'fs'; +import { readdirSync, statSync } from 'fs'; +import { resolve, join, normalize } from 'path'; +import * as qs from 'querystring'; +import { fileURLToPath } from 'node:url'; +import { Server } from './server/index.js'; +import { manifest, prerendered } from './server/manifest.js'; +import { env } from './env.js'; + +function totalist(dir, callback, pre='') { + dir = resolve('.', dir); + let arr = readdirSync(dir); + let i=0, abs, stats; + for (; i < arr.length; i++) { + abs = join(dir, arr[i]); + stats = statSync(abs); + stats.isDirectory() + ? totalist(abs, callback, join(pre, arr[i])) + : callback(join(pre, arr[i]), abs, stats); + } +} + +/** + * @typedef ParsedURL + * @type {import('.').ParsedURL} + */ + +/** + * @typedef Request + * @property {string} url + * @property {ParsedURL} _parsedUrl + */ + +/** + * @param {Request} req + * @returns {ParsedURL|void} + */ +function parse$1(req) { + let raw = req.url; + if (raw == null) return; + + let prev = req._parsedUrl; + if (prev && prev.raw === raw) return prev; + + let pathname=raw, search='', query; + + if (raw.length > 1) { + let idx = raw.indexOf('?', 1); + + if (idx !== -1) { + search = raw.substring(idx); + pathname = raw.substring(0, idx); + if (search.length > 1) { + query = qs.parse(search.substring(1)); + } + } + } + + return req._parsedUrl = { pathname, search, query, raw }; +} + +const mimes = { + "ez": "application/andrew-inset", + "aw": "application/applixware", + "atom": "application/atom+xml", + "atomcat": "application/atomcat+xml", + "atomdeleted": "application/atomdeleted+xml", + "atomsvc": "application/atomsvc+xml", + "dwd": "application/atsc-dwd+xml", + "held": "application/atsc-held+xml", + "rsat": "application/atsc-rsat+xml", + "bdoc": "application/bdoc", + "xcs": "application/calendar+xml", + "ccxml": "application/ccxml+xml", + "cdfx": "application/cdfx+xml", + "cdmia": "application/cdmi-capability", + "cdmic": "application/cdmi-container", + "cdmid": "application/cdmi-domain", + "cdmio": "application/cdmi-object", + "cdmiq": "application/cdmi-queue", + "cu": "application/cu-seeme", + "mpd": "application/dash+xml", + "davmount": "application/davmount+xml", + "dbk": "application/docbook+xml", + "dssc": "application/dssc+der", + "xdssc": "application/dssc+xml", + "es": "application/ecmascript", + "ecma": "application/ecmascript", + "emma": "application/emma+xml", + "emotionml": "application/emotionml+xml", + "epub": "application/epub+zip", + "exi": "application/exi", + "fdt": "application/fdt+xml", + "pfr": "application/font-tdpfr", + "geojson": "application/geo+json", + "gml": "application/gml+xml", + "gpx": "application/gpx+xml", + "gxf": "application/gxf", + "gz": "application/gzip", + "hjson": "application/hjson", + "stk": "application/hyperstudio", + "ink": "application/inkml+xml", + "inkml": "application/inkml+xml", + "ipfix": "application/ipfix", + "its": "application/its+xml", + "jar": "application/java-archive", + "war": "application/java-archive", + "ear": "application/java-archive", + "ser": "application/java-serialized-object", + "class": "application/java-vm", + "js": "application/javascript", + "mjs": "application/javascript", + "json": "application/json", + "map": "application/json", + "json5": "application/json5", + "jsonml": "application/jsonml+json", + "jsonld": "application/ld+json", + "lgr": "application/lgr+xml", + "lostxml": "application/lost+xml", + "hqx": "application/mac-binhex40", + "cpt": "application/mac-compactpro", + "mads": "application/mads+xml", + "webmanifest": "application/manifest+json", + "mrc": "application/marc", + "mrcx": "application/marcxml+xml", + "ma": "application/mathematica", + "nb": "application/mathematica", + "mb": "application/mathematica", + "mathml": "application/mathml+xml", + "mbox": "application/mbox", + "mscml": "application/mediaservercontrol+xml", + "metalink": "application/metalink+xml", + "meta4": "application/metalink4+xml", + "mets": "application/mets+xml", + "maei": "application/mmt-aei+xml", + "musd": "application/mmt-usd+xml", + "mods": "application/mods+xml", + "m21": "application/mp21", + "mp21": "application/mp21", + "mp4s": "application/mp4", + "m4p": "application/mp4", + "doc": "application/msword", + "dot": "application/msword", + "mxf": "application/mxf", + "nq": "application/n-quads", + "nt": "application/n-triples", + "cjs": "application/node", + "bin": "application/octet-stream", + "dms": "application/octet-stream", + "lrf": "application/octet-stream", + "mar": "application/octet-stream", + "so": "application/octet-stream", + "dist": "application/octet-stream", + "distz": "application/octet-stream", + "pkg": "application/octet-stream", + "bpk": "application/octet-stream", + "dump": "application/octet-stream", + "elc": "application/octet-stream", + "deploy": "application/octet-stream", + "exe": "application/octet-stream", + "dll": "application/octet-stream", + "deb": "application/octet-stream", + "dmg": "application/octet-stream", + "iso": "application/octet-stream", + "img": "application/octet-stream", + "msi": "application/octet-stream", + "msp": "application/octet-stream", + "msm": "application/octet-stream", + "buffer": "application/octet-stream", + "oda": "application/oda", + "opf": "application/oebps-package+xml", + "ogx": "application/ogg", + "omdoc": "application/omdoc+xml", + "onetoc": "application/onenote", + "onetoc2": "application/onenote", + "onetmp": "application/onenote", + "onepkg": "application/onenote", + "oxps": "application/oxps", + "relo": "application/p2p-overlay+xml", + "xer": "application/patch-ops-error+xml", + "pdf": "application/pdf", + "pgp": "application/pgp-encrypted", + "asc": "application/pgp-signature", + "sig": "application/pgp-signature", + "prf": "application/pics-rules", + "p10": "application/pkcs10", + "p7m": "application/pkcs7-mime", + "p7c": "application/pkcs7-mime", + "p7s": "application/pkcs7-signature", + "p8": "application/pkcs8", + "ac": "application/pkix-attr-cert", + "cer": "application/pkix-cert", + "crl": "application/pkix-crl", + "pkipath": "application/pkix-pkipath", + "pki": "application/pkixcmp", + "pls": "application/pls+xml", + "ai": "application/postscript", + "eps": "application/postscript", + "ps": "application/postscript", + "provx": "application/provenance+xml", + "cww": "application/prs.cww", + "pskcxml": "application/pskc+xml", + "raml": "application/raml+yaml", + "rdf": "application/rdf+xml", + "owl": "application/rdf+xml", + "rif": "application/reginfo+xml", + "rnc": "application/relax-ng-compact-syntax", + "rl": "application/resource-lists+xml", + "rld": "application/resource-lists-diff+xml", + "rs": "application/rls-services+xml", + "rapd": "application/route-apd+xml", + "sls": "application/route-s-tsid+xml", + "rusd": "application/route-usd+xml", + "gbr": "application/rpki-ghostbusters", + "mft": "application/rpki-manifest", + "roa": "application/rpki-roa", + "rsd": "application/rsd+xml", + "rss": "application/rss+xml", + "rtf": "application/rtf", + "sbml": "application/sbml+xml", + "scq": "application/scvp-cv-request", + "scs": "application/scvp-cv-response", + "spq": "application/scvp-vp-request", + "spp": "application/scvp-vp-response", + "sdp": "application/sdp", + "senmlx": "application/senml+xml", + "sensmlx": "application/sensml+xml", + "setpay": "application/set-payment-initiation", + "setreg": "application/set-registration-initiation", + "shf": "application/shf+xml", + "siv": "application/sieve", + "sieve": "application/sieve", + "smi": "application/smil+xml", + "smil": "application/smil+xml", + "rq": "application/sparql-query", + "srx": "application/sparql-results+xml", + "gram": "application/srgs", + "grxml": "application/srgs+xml", + "sru": "application/sru+xml", + "ssdl": "application/ssdl+xml", + "ssml": "application/ssml+xml", + "swidtag": "application/swid+xml", + "tei": "application/tei+xml", + "teicorpus": "application/tei+xml", + "tfi": "application/thraud+xml", + "tsd": "application/timestamped-data", + "toml": "application/toml", + "trig": "application/trig", + "ttml": "application/ttml+xml", + "ubj": "application/ubjson", + "rsheet": "application/urc-ressheet+xml", + "td": "application/urc-targetdesc+xml", + "vxml": "application/voicexml+xml", + "wasm": "application/wasm", + "wgt": "application/widget", + "hlp": "application/winhlp", + "wsdl": "application/wsdl+xml", + "wspolicy": "application/wspolicy+xml", + "xaml": "application/xaml+xml", + "xav": "application/xcap-att+xml", + "xca": "application/xcap-caps+xml", + "xdf": "application/xcap-diff+xml", + "xel": "application/xcap-el+xml", + "xns": "application/xcap-ns+xml", + "xenc": "application/xenc+xml", + "xhtml": "application/xhtml+xml", + "xht": "application/xhtml+xml", + "xlf": "application/xliff+xml", + "xml": "application/xml", + "xsl": "application/xml", + "xsd": "application/xml", + "rng": "application/xml", + "dtd": "application/xml-dtd", + "xop": "application/xop+xml", + "xpl": "application/xproc+xml", + "xslt": "application/xml", + "xspf": "application/xspf+xml", + "mxml": "application/xv+xml", + "xhvml": "application/xv+xml", + "xvml": "application/xv+xml", + "xvm": "application/xv+xml", + "yang": "application/yang", + "yin": "application/yin+xml", + "zip": "application/zip", + "3gpp": "video/3gpp", + "adp": "audio/adpcm", + "amr": "audio/amr", + "au": "audio/basic", + "snd": "audio/basic", + "mid": "audio/midi", + "midi": "audio/midi", + "kar": "audio/midi", + "rmi": "audio/midi", + "mxmf": "audio/mobile-xmf", + "mp3": "audio/mpeg", + "m4a": "audio/mp4", + "mp4a": "audio/mp4", + "mpga": "audio/mpeg", + "mp2": "audio/mpeg", + "mp2a": "audio/mpeg", + "m2a": "audio/mpeg", + "m3a": "audio/mpeg", + "oga": "audio/ogg", + "ogg": "audio/ogg", + "spx": "audio/ogg", + "opus": "audio/ogg", + "s3m": "audio/s3m", + "sil": "audio/silk", + "wav": "audio/wav", + "weba": "audio/webm", + "xm": "audio/xm", + "ttc": "font/collection", + "otf": "font/otf", + "ttf": "font/ttf", + "woff": "font/woff", + "woff2": "font/woff2", + "exr": "image/aces", + "apng": "image/apng", + "avif": "image/avif", + "bmp": "image/bmp", + "cgm": "image/cgm", + "drle": "image/dicom-rle", + "emf": "image/emf", + "fits": "image/fits", + "g3": "image/g3fax", + "gif": "image/gif", + "heic": "image/heic", + "heics": "image/heic-sequence", + "heif": "image/heif", + "heifs": "image/heif-sequence", + "hej2": "image/hej2k", + "hsj2": "image/hsj2", + "ief": "image/ief", + "jls": "image/jls", + "jp2": "image/jp2", + "jpg2": "image/jp2", + "jpeg": "image/jpeg", + "jpg": "image/jpeg", + "jpe": "image/jpeg", + "jph": "image/jph", + "jhc": "image/jphc", + "jpm": "image/jpm", + "jpx": "image/jpx", + "jpf": "image/jpx", + "jxr": "image/jxr", + "jxra": "image/jxra", + "jxrs": "image/jxrs", + "jxs": "image/jxs", + "jxsc": "image/jxsc", + "jxsi": "image/jxsi", + "jxss": "image/jxss", + "ktx": "image/ktx", + "ktx2": "image/ktx2", + "png": "image/png", + "btif": "image/prs.btif", + "pti": "image/prs.pti", + "sgi": "image/sgi", + "svg": "image/svg+xml", + "svgz": "image/svg+xml", + "t38": "image/t38", + "tif": "image/tiff", + "tiff": "image/tiff", + "tfx": "image/tiff-fx", + "webp": "image/webp", + "wmf": "image/wmf", + "disposition-notification": "message/disposition-notification", + "u8msg": "message/global", + "u8dsn": "message/global-delivery-status", + "u8mdn": "message/global-disposition-notification", + "u8hdr": "message/global-headers", + "eml": "message/rfc822", + "mime": "message/rfc822", + "3mf": "model/3mf", + "gltf": "model/gltf+json", + "glb": "model/gltf-binary", + "igs": "model/iges", + "iges": "model/iges", + "msh": "model/mesh", + "mesh": "model/mesh", + "silo": "model/mesh", + "mtl": "model/mtl", + "obj": "model/obj", + "stpz": "model/step+zip", + "stpxz": "model/step-xml+zip", + "stl": "model/stl", + "wrl": "model/vrml", + "vrml": "model/vrml", + "x3db": "model/x3d+fastinfoset", + "x3dbz": "model/x3d+binary", + "x3dv": "model/x3d-vrml", + "x3dvz": "model/x3d+vrml", + "x3d": "model/x3d+xml", + "x3dz": "model/x3d+xml", + "appcache": "text/cache-manifest", + "manifest": "text/cache-manifest", + "ics": "text/calendar", + "ifb": "text/calendar", + "coffee": "text/coffeescript", + "litcoffee": "text/coffeescript", + "css": "text/css", + "csv": "text/csv", + "html": "text/html", + "htm": "text/html", + "shtml": "text/html", + "jade": "text/jade", + "jsx": "text/jsx", + "less": "text/less", + "markdown": "text/markdown", + "md": "text/markdown", + "mml": "text/mathml", + "mdx": "text/mdx", + "n3": "text/n3", + "txt": "text/plain", + "text": "text/plain", + "conf": "text/plain", + "def": "text/plain", + "list": "text/plain", + "log": "text/plain", + "in": "text/plain", + "ini": "text/plain", + "dsc": "text/prs.lines.tag", + "rtx": "text/richtext", + "sgml": "text/sgml", + "sgm": "text/sgml", + "shex": "text/shex", + "slim": "text/slim", + "slm": "text/slim", + "spdx": "text/spdx", + "stylus": "text/stylus", + "styl": "text/stylus", + "tsv": "text/tab-separated-values", + "t": "text/troff", + "tr": "text/troff", + "roff": "text/troff", + "man": "text/troff", + "me": "text/troff", + "ms": "text/troff", + "ttl": "text/turtle", + "uri": "text/uri-list", + "uris": "text/uri-list", + "urls": "text/uri-list", + "vcard": "text/vcard", + "vtt": "text/vtt", + "yaml": "text/yaml", + "yml": "text/yaml", + "3gp": "video/3gpp", + "3g2": "video/3gpp2", + "h261": "video/h261", + "h263": "video/h263", + "h264": "video/h264", + "m4s": "video/iso.segment", + "jpgv": "video/jpeg", + "jpgm": "image/jpm", + "mj2": "video/mj2", + "mjp2": "video/mj2", + "ts": "video/mp2t", + "mp4": "video/mp4", + "mp4v": "video/mp4", + "mpg4": "video/mp4", + "mpeg": "video/mpeg", + "mpg": "video/mpeg", + "mpe": "video/mpeg", + "m1v": "video/mpeg", + "m2v": "video/mpeg", + "ogv": "video/ogg", + "qt": "video/quicktime", + "mov": "video/quicktime", + "webm": "video/webm" +}; + +function lookup(extn) { + let tmp = ('' + extn).trim().toLowerCase(); + let idx = tmp.lastIndexOf('.'); + return mimes[!~idx ? tmp : tmp.substring(++idx)]; +} + +const noop = () => {}; + +function isMatch(uri, arr) { + for (let i=0; i < arr.length; i++) { + if (arr[i].test(uri)) return true; + } +} + +function toAssume(uri, extns) { + let i=0, x, len=uri.length - 1; + if (uri.charCodeAt(len) === 47) { + uri = uri.substring(0, len); + } + + let arr=[], tmp=`${uri}/index`; + for (; i < extns.length; i++) { + x = extns[i] ? `.${extns[i]}` : ''; + if (uri) arr.push(uri + x); + arr.push(tmp + x); + } + + return arr; +} + +function viaCache(cache, uri, extns) { + let i=0, data, arr=toAssume(uri, extns); + for (; i < arr.length; i++) { + if (data = cache[arr[i]]) return data; + } +} + +function viaLocal(dir, isEtag, uri, extns) { + let i=0, arr=toAssume(uri, extns); + let abs, stats, name, headers; + for (; i < arr.length; i++) { + abs = normalize(join(dir, name=arr[i])); + if (abs.startsWith(dir) && fs.existsSync(abs)) { + stats = fs.statSync(abs); + if (stats.isDirectory()) continue; + headers = toHeaders(name, stats, isEtag); + headers['Cache-Control'] = isEtag ? 'no-cache' : 'no-store'; + return { abs, stats, headers }; + } + } +} + +function is404(req, res) { + return (res.statusCode=404,res.end()); +} + +function send(req, res, file, stats, headers) { + let code=200, tmp, opts={}; + headers = { ...headers }; + + for (let key in headers) { + tmp = res.getHeader(key); + if (tmp) headers[key] = tmp; + } + + if (tmp = res.getHeader('content-type')) { + headers['Content-Type'] = tmp; + } + + if (req.headers.range) { + code = 206; + let [x, y] = req.headers.range.replace('bytes=', '').split('-'); + let end = opts.end = parseInt(y, 10) || stats.size - 1; + let start = opts.start = parseInt(x, 10) || 0; + + if (end >= stats.size) { + end = stats.size - 1; + } + + if (start >= stats.size) { + res.setHeader('Content-Range', `bytes */${stats.size}`); + res.statusCode = 416; + return res.end(); + } + + headers['Content-Range'] = `bytes ${start}-${end}/${stats.size}`; + headers['Content-Length'] = (end - start + 1); + headers['Accept-Ranges'] = 'bytes'; + } + + res.writeHead(code, headers); + fs.createReadStream(file, opts).pipe(res); +} + +const ENCODING = { + '.br': 'br', + '.gz': 'gzip', +}; + +function toHeaders(name, stats, isEtag) { + let enc = ENCODING[name.slice(-3)]; + + let ctype = lookup(name.slice(0, enc && -3)) || ''; + if (ctype === 'text/html') ctype += ';charset=utf-8'; + + let headers = { + 'Content-Length': stats.size, + 'Content-Type': ctype, + 'Last-Modified': stats.mtime.toUTCString(), + }; + + if (enc) headers['Content-Encoding'] = enc; + if (isEtag) headers['ETag'] = `W/"${stats.size}-${stats.mtime.getTime()}"`; + + return headers; +} + +function sirv (dir, opts={}) { + dir = resolve(dir || '.'); + + let isNotFound = opts.onNoMatch || is404; + let setHeaders = opts.setHeaders || noop; + + let extensions = opts.extensions || ['html', 'htm']; + let gzips = opts.gzip && extensions.map(x => `${x}.gz`).concat('gz'); + let brots = opts.brotli && extensions.map(x => `${x}.br`).concat('br'); + + const FILES = {}; + + let fallback = '/'; + let isEtag = !!opts.etag; + let isSPA = !!opts.single; + if (typeof opts.single === 'string') { + let idx = opts.single.lastIndexOf('.'); + fallback += !!~idx ? opts.single.substring(0, idx) : opts.single; + } + + let ignores = []; + if (opts.ignores !== false) { + ignores.push(/[/]([A-Za-z\s\d~$._-]+\.\w+){1,}$/); // any extn + if (opts.dotfiles) ignores.push(/\/\.\w/); + else ignores.push(/\/\.well-known/); + [].concat(opts.ignores || []).forEach(x => { + ignores.push(new RegExp(x, 'i')); + }); + } + + let cc = opts.maxAge != null && `public,max-age=${opts.maxAge}`; + if (cc && opts.immutable) cc += ',immutable'; + else if (cc && opts.maxAge === 0) cc += ',must-revalidate'; + + if (!opts.dev) { + totalist(dir, (name, abs, stats) => { + if (/\.well-known[\\+\/]/.test(name)) ; // keep + else if (!opts.dotfiles && /(^\.|[\\+|\/+]\.)/.test(name)) return; + + let headers = toHeaders(name, stats, isEtag); + if (cc) headers['Cache-Control'] = cc; + + FILES['/' + name.normalize().replace(/\\+/g, '/')] = { abs, stats, headers }; + }); + } + + let lookup = opts.dev ? viaLocal.bind(0, dir, isEtag) : viaCache.bind(0, FILES); + + return function (req, res, next) { + let extns = ['']; + let pathname = parse$1(req).pathname; + let val = req.headers['accept-encoding'] || ''; + if (gzips && val.includes('gzip')) extns.unshift(...gzips); + if (brots && /(br|brotli)/i.test(val)) extns.unshift(...brots); + extns.push(...extensions); // [...br, ...gz, orig, ...exts] + + if (pathname.indexOf('%') !== -1) { + try { pathname = decodeURI(pathname); } + catch (err) { /* malform uri */ } + } + + let data = lookup(pathname, extns) || isSPA && !isMatch(pathname, ignores) && lookup(fallback, extns); + if (!data) return next ? next() : isNotFound(req, res); + + if (isEtag && req.headers['if-none-match'] === data.headers['ETag']) { + res.writeHead(304); + return res.end(); + } + + if (gzips || brots) { + res.setHeader('Vary', 'Accept-Encoding'); + } + + setHeaders(res, pathname, data.stats); + send(req, res, data.abs, data.stats, data.headers); + }; +} + +var setCookie = {exports: {}}; + +var defaultParseOptions = { + decodeValues: true, + map: false, + silent: false, +}; + +function isNonEmptyString(str) { + return typeof str === "string" && !!str.trim(); +} + +function parseString(setCookieValue, options) { + var parts = setCookieValue.split(";").filter(isNonEmptyString); + + var nameValuePairStr = parts.shift(); + var parsed = parseNameValuePair(nameValuePairStr); + var name = parsed.name; + var value = parsed.value; + + options = options + ? Object.assign({}, defaultParseOptions, options) + : defaultParseOptions; + + try { + value = options.decodeValues ? decodeURIComponent(value) : value; // decode cookie value + } catch (e) { + console.error( + "set-cookie-parser encountered an error while decoding a cookie with value '" + + value + + "'. Set options.decodeValues to false to disable this feature.", + e + ); + } + + var cookie = { + name: name, + value: value, + }; + + parts.forEach(function (part) { + var sides = part.split("="); + var key = sides.shift().trimLeft().toLowerCase(); + var value = sides.join("="); + if (key === "expires") { + cookie.expires = new Date(value); + } else if (key === "max-age") { + cookie.maxAge = parseInt(value, 10); + } else if (key === "secure") { + cookie.secure = true; + } else if (key === "httponly") { + cookie.httpOnly = true; + } else if (key === "samesite") { + cookie.sameSite = value; + } else { + cookie[key] = value; + } + }); + + return cookie; +} + +function parseNameValuePair(nameValuePairStr) { + // Parses name-value-pair according to rfc6265bis draft + + var name = ""; + var value = ""; + var nameValueArr = nameValuePairStr.split("="); + if (nameValueArr.length > 1) { + name = nameValueArr.shift(); + value = nameValueArr.join("="); // everything after the first =, joined by a "=" if there was more than one part + } else { + value = nameValuePairStr; + } + + return { name: name, value: value }; +} + +function parse(input, options) { + options = options + ? Object.assign({}, defaultParseOptions, options) + : defaultParseOptions; + + if (!input) { + if (!options.map) { + return []; + } else { + return {}; + } + } + + if (input.headers) { + if (typeof input.headers.getSetCookie === "function") { + // for fetch responses - they combine headers of the same type in the headers array, + // but getSetCookie returns an uncombined array + input = input.headers.getSetCookie(); + } else if (input.headers["set-cookie"]) { + // fast-path for node.js (which automatically normalizes header names to lower-case + input = input.headers["set-cookie"]; + } else { + // slow-path for other environments - see #25 + var sch = + input.headers[ + Object.keys(input.headers).find(function (key) { + return key.toLowerCase() === "set-cookie"; + }) + ]; + // warn if called on a request-like object with a cookie header rather than a set-cookie header - see #34, 36 + if (!sch && input.headers.cookie && !options.silent) { + console.warn( + "Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning." + ); + } + input = sch; + } + } + if (!Array.isArray(input)) { + input = [input]; + } + + options = options + ? Object.assign({}, defaultParseOptions, options) + : defaultParseOptions; + + if (!options.map) { + return input.filter(isNonEmptyString).map(function (str) { + return parseString(str, options); + }); + } else { + var cookies = {}; + return input.filter(isNonEmptyString).reduce(function (cookies, str) { + var cookie = parseString(str, options); + cookies[cookie.name] = cookie; + return cookies; + }, cookies); + } +} + +/* + Set-Cookie header field-values are sometimes comma joined in one string. This splits them without choking on commas + that are within a single set-cookie field-value, such as in the Expires portion. + + This is uncommon, but explicitly allowed - see https://tools.ietf.org/html/rfc2616#section-4.2 + Node.js does this for every header *except* set-cookie - see https://github.com/nodejs/node/blob/d5e363b77ebaf1caf67cd7528224b651c86815c1/lib/_http_incoming.js#L128 + React Native's fetch does this for *every* header, including set-cookie. + + Based on: https://github.com/google/j2objc/commit/16820fdbc8f76ca0c33472810ce0cb03d20efe25 + Credits to: https://github.com/tomball for original and https://github.com/chrusart for JavaScript implementation +*/ +function splitCookiesString(cookiesString) { + if (Array.isArray(cookiesString)) { + return cookiesString; + } + if (typeof cookiesString !== "string") { + return []; + } + + var cookiesStrings = []; + var pos = 0; + var start; + var ch; + var lastComma; + var nextStart; + var cookiesSeparatorFound; + + function skipWhitespace() { + while (pos < cookiesString.length && /\s/.test(cookiesString.charAt(pos))) { + pos += 1; + } + return pos < cookiesString.length; + } + + function notSpecialChar() { + ch = cookiesString.charAt(pos); + + return ch !== "=" && ch !== ";" && ch !== ","; + } + + while (pos < cookiesString.length) { + start = pos; + cookiesSeparatorFound = false; + + while (skipWhitespace()) { + ch = cookiesString.charAt(pos); + if (ch === ",") { + // ',' is a cookie separator if we have later first '=', not ';' or ',' + lastComma = pos; + pos += 1; + + skipWhitespace(); + nextStart = pos; + + while (pos < cookiesString.length && notSpecialChar()) { + pos += 1; + } + + // currently special character + if (pos < cookiesString.length && cookiesString.charAt(pos) === "=") { + // we found cookies separator + cookiesSeparatorFound = true; + // pos is inside the next cookie, so back up and return it. + pos = nextStart; + cookiesStrings.push(cookiesString.substring(start, lastComma)); + start = pos; + } else { + // in param ',' or param separator ';', + // we continue from that comma + pos = lastComma + 1; + } + } else { + pos += 1; + } + } + + if (!cookiesSeparatorFound || pos >= cookiesString.length) { + cookiesStrings.push(cookiesString.substring(start, cookiesString.length)); + } + } + + return cookiesStrings; +} + +setCookie.exports = parse; +setCookie.exports.parse = parse; +setCookie.exports.parseString = parseString; +var splitCookiesString_1 = setCookie.exports.splitCookiesString = splitCookiesString; + +class HttpError { + /** + * @param {number} status + * @param {{message: string} extends App.Error ? (App.Error | string | undefined) : App.Error} body + */ + constructor(status, body) { + this.status = status; + if (typeof body === 'string') { + this.body = { message: body }; + } else if (body) { + this.body = body; + } else { + this.body = { message: `Error: ${status}` }; + } + } + + toString() { + return JSON.stringify(this.body); + } +} + +/** + * @overload + * @param {number} status + * @param {App.Error} body + * @return {HttpError} + */ + +/** + * @overload + * @param {number} status + * @param {{ message: string } extends App.Error ? App.Error | string | undefined : never} [body] + * @return {HttpError} + */ + +/** + * Creates an `HttpError` object with an HTTP status code and an optional message. + * This object, if thrown during request handling, will cause SvelteKit to + * return an error response without invoking `handleError`. + * Make sure you're not catching the thrown error, which would prevent SvelteKit from handling it. + * @param {number} status The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses). Must be in the range 400-599. + * @param {{ message: string } extends App.Error ? App.Error | string | undefined : never} body An object that conforms to the App.Error type. If a string is passed, it will be used as the message property. + */ +function error(status, body) { + if ((isNaN(status) || status < 400 || status > 599)) { + throw new Error(`HTTP error status codes must be between 400 and 599 — ${status} is invalid`); + } + + return new HttpError(status, body); +} + +new TextEncoder(); + +/** + * @param {import('http').IncomingMessage} req + * @param {number} [body_size_limit] + */ +function get_raw_body(req, body_size_limit) { + const h = req.headers; + + if (!h['content-type']) { + return null; + } + + const content_length = Number(h['content-length']); + + // check if no request body + if ( + (req.httpVersionMajor === 1 && isNaN(content_length) && h['transfer-encoding'] == null) || + content_length === 0 + ) { + return null; + } + + let length = content_length; + + if (body_size_limit) { + if (!length) { + length = body_size_limit; + } else if (length > body_size_limit) { + throw error( + 413, + `Received content-length of ${length}, but only accept up to ${body_size_limit} bytes.` + ); + } + } + + if (req.destroyed) { + const readable = new ReadableStream(); + readable.cancel(); + return readable; + } + + let size = 0; + let cancelled = false; + + return new ReadableStream({ + start(controller) { + req.on('error', (error) => { + cancelled = true; + controller.error(error); + }); + + req.on('end', () => { + if (cancelled) return; + controller.close(); + }); + + req.on('data', (chunk) => { + if (cancelled) return; + + size += chunk.length; + if (size > length) { + cancelled = true; + controller.error( + error( + 413, + `request body size exceeded ${ + content_length ? "'content-length'" : 'BODY_SIZE_LIMIT' + } of ${length}` + ) + ); + return; + } + + controller.enqueue(chunk); + + if (controller.desiredSize === null || controller.desiredSize <= 0) { + req.pause(); + } + }); + }, + + pull() { + req.resume(); + }, + + cancel(reason) { + cancelled = true; + req.destroy(reason); + } + }); +} + +/** + * @param {{ + * request: import('http').IncomingMessage; + * base: string; + * bodySizeLimit?: number; + * }} options + * @returns {Promise} + */ +async function getRequest({ request, base, bodySizeLimit }) { + return new Request(base + request.url, { + // @ts-expect-error + duplex: 'half', + method: request.method, + headers: /** @type {Record} */ (request.headers), + body: get_raw_body(request, bodySizeLimit) + }); +} + +/** + * @param {import('http').ServerResponse} res + * @param {Response} response + * @returns {Promise} + */ +async function setResponse(res, response) { + for (const [key, value] of response.headers) { + try { + res.setHeader( + key, + key === 'set-cookie' + ? splitCookiesString_1( + // This is absurd but necessary, TODO: investigate why + /** @type {string}*/ (response.headers.get(key)) + ) + : value + ); + } catch (error) { + res.getHeaderNames().forEach((name) => res.removeHeader(name)); + res.writeHead(500).end(String(error)); + return; + } + } + + res.writeHead(response.status); + + if (!response.body) { + res.end(); + return; + } + + if (response.body.locked) { + res.end( + 'Fatal error: Response body is locked. ' + + "This can happen when the response was already read (for example through 'response.json()' or 'response.text()')." + ); + return; + } + + const reader = response.body.getReader(); + + if (res.destroyed) { + reader.cancel(); + return; + } + + const cancel = (/** @type {Error|undefined} */ error) => { + res.off('close', cancel); + res.off('error', cancel); + + // If the reader has already been interrupted with an error earlier, + // then it will appear here, it is useless, but it needs to be catch. + reader.cancel(error).catch(() => {}); + if (error) res.destroy(error); + }; + + res.on('close', cancel); + res.on('error', cancel); + + next(); + async function next() { + try { + for (;;) { + const { done, value } = await reader.read(); + + if (done) break; + + if (!res.write(value)) { + res.once('drain', next); + return; + } + } + res.end(); + } catch (error) { + cancel(error instanceof Error ? error : new Error(String(error))); + } + } +} + +/* global "" */ + +const server = new Server(manifest); +await server.init({ env: process.env }); +const origin = env('ORIGIN', undefined); +const xff_depth = parseInt(env('XFF_DEPTH', '1')); +const address_header = env('ADDRESS_HEADER', '').toLowerCase(); +const protocol_header = env('PROTOCOL_HEADER', '').toLowerCase(); +const host_header = env('HOST_HEADER', 'host').toLowerCase(); +const body_size_limit = parseInt(env('BODY_SIZE_LIMIT', '524288')); + +const dir = path.dirname(fileURLToPath(import.meta.url)); + +/** + * @param {string} path + * @param {boolean} client + */ +function serve(path, client = false) { + return ( + fs$1.existsSync(path) && + sirv(path, { + etag: true, + gzip: true, + brotli: true, + setHeaders: + client && + ((res, pathname) => { + // only apply to build directory, not e.g. version.json + if (pathname.startsWith(`/${manifest.appPath}/immutable/`) && res.statusCode === 200) { + res.setHeader('cache-control', 'public,max-age=31536000,immutable'); + } + }) + }) + ); +} + +// required because the static file server ignores trailing slashes +/** @returns {import('polka').Middleware} */ +function serve_prerendered() { + const handler = serve(path.join(dir, 'prerendered')); + + return (req, res, next) => { + let { pathname, search, query } = parse$1(req); + + try { + pathname = decodeURIComponent(pathname); + } catch { + // ignore invalid URI + } + + if (prerendered.has(pathname)) { + return handler(req, res, next); + } + + // remove or add trailing slash as appropriate + let location = pathname.at(-1) === '/' ? pathname.slice(0, -1) : pathname + '/'; + if (prerendered.has(location)) { + if (query) location += search; + res.writeHead(308, { location }).end(); + } else { + next(); + } + }; +} + +/** @type {import('polka').Middleware} */ +const ssr = async (req, res) => { + /** @type {Request | undefined} */ + let request; + + try { + request = await getRequest({ + base: origin || get_origin(req.headers), + request: req, + bodySizeLimit: body_size_limit + }); + } catch (err) { + res.statusCode = err.status || 400; + res.end('Invalid request body'); + return; + } + + setResponse( + res, + await server.respond(request, { + platform: { req }, + getClientAddress: () => { + if (address_header) { + if (!(address_header in req.headers)) { + throw new Error( + `Address header was specified with ${ + "" + 'ADDRESS_HEADER' + }=${address_header} but is absent from request` + ); + } + + const value = /** @type {string} */ (req.headers[address_header]) || ''; + + if (address_header === 'x-forwarded-for') { + const addresses = value.split(','); + + if (xff_depth < 1) { + throw new Error(`${"" + 'XFF_DEPTH'} must be a positive integer`); + } + + if (xff_depth > addresses.length) { + throw new Error( + `${"" + 'XFF_DEPTH'} is ${xff_depth}, but only found ${ + addresses.length + } addresses` + ); + } + return addresses[addresses.length - xff_depth].trim(); + } + + return value; + } + + return ( + req.connection?.remoteAddress || + // @ts-expect-error + req.connection?.socket?.remoteAddress || + req.socket?.remoteAddress || + // @ts-expect-error + req.info?.remoteAddress + ); + } + }) + ); +}; + +/** @param {import('polka').Middleware[]} handlers */ +function sequence(handlers) { + /** @type {import('polka').Middleware} */ + return (req, res, next) => { + /** + * @param {number} i + * @returns {ReturnType} + */ + function handle(i) { + if (i < handlers.length) { + return handlers[i](req, res, () => handle(i + 1)); + } else { + return next(); + } + } + + return handle(0); + }; +} + +/** + * @param {import('http').IncomingHttpHeaders} headers + * @returns + */ +function get_origin(headers) { + const protocol = (protocol_header && headers[protocol_header]) || 'https'; + const host = headers[host_header]; + return `${protocol}://${host}`; +} + +const handler = sequence( + [ + serve(path.join(dir, 'client'), true), + serve(path.join(dir, 'static')), + serve_prerendered(), + ssr + ].filter(Boolean) +); + +export { handler }; diff --git a/build/index.js b/build/index.js new file mode 100644 index 0000000..ff85152 --- /dev/null +++ b/build/index.js @@ -0,0 +1,225 @@ +import { handler } from './handler.js'; +import { env } from './env.js'; +import http from 'http'; +import * as qs from 'querystring'; + +function parse$1 (str, loose) { + if (str instanceof RegExp) return { keys:false, pattern:str }; + var c, o, tmp, ext, keys=[], pattern='', arr = str.split('/'); + arr[0] || arr.shift(); + + while (tmp = arr.shift()) { + c = tmp[0]; + if (c === '*') { + keys.push('wild'); + pattern += '/(.*)'; + } else if (c === ':') { + o = tmp.indexOf('?', 1); + ext = tmp.indexOf('.', 1); + keys.push( tmp.substring(1, !!~o ? o : !!~ext ? ext : tmp.length) ); + pattern += !!~o && !~ext ? '(?:/([^/]+?))?' : '/([^/]+?)'; + if (!!~ext) pattern += (!!~o ? '?' : '') + '\\' + tmp.substring(ext); + } else { + pattern += '/' + tmp; + } + } + + return { + keys: keys, + pattern: new RegExp('^' + pattern + (loose ? '(?=$|\/)' : '\/?$'), 'i') + }; +} + +class Trouter { + constructor() { + this.routes = []; + + this.all = this.add.bind(this, ''); + this.get = this.add.bind(this, 'GET'); + this.head = this.add.bind(this, 'HEAD'); + this.patch = this.add.bind(this, 'PATCH'); + this.options = this.add.bind(this, 'OPTIONS'); + this.connect = this.add.bind(this, 'CONNECT'); + this.delete = this.add.bind(this, 'DELETE'); + this.trace = this.add.bind(this, 'TRACE'); + this.post = this.add.bind(this, 'POST'); + this.put = this.add.bind(this, 'PUT'); + } + + use(route, ...fns) { + let handlers = [].concat.apply([], fns); + let { keys, pattern } = parse$1(route, true); + this.routes.push({ keys, pattern, method:'', handlers }); + return this; + } + + add(method, route, ...fns) { + let { keys, pattern } = parse$1(route); + let handlers = [].concat.apply([], fns); + this.routes.push({ keys, pattern, method, handlers }); + return this; + } + + find(method, url) { + let isHEAD=(method === 'HEAD'); + let i=0, j=0, k, tmp, arr=this.routes; + let matches=[], params={}, handlers=[]; + for (; i < arr.length; i++) { + tmp = arr[i]; + if (tmp.method.length === 0 || tmp.method === method || isHEAD && tmp.method === 'GET') { + if (tmp.keys === false) { + matches = tmp.pattern.exec(url); + if (matches === null) continue; + if (matches.groups !== void 0) for (k in matches.groups) params[k]=matches.groups[k]; + tmp.handlers.length > 1 ? (handlers=handlers.concat(tmp.handlers)) : handlers.push(tmp.handlers[0]); + } else if (tmp.keys.length > 0) { + matches = tmp.pattern.exec(url); + if (matches === null) continue; + for (j=0; j < tmp.keys.length;) params[tmp.keys[j]]=matches[++j]; + tmp.handlers.length > 1 ? (handlers=handlers.concat(tmp.handlers)) : handlers.push(tmp.handlers[0]); + } else if (tmp.pattern.test(url)) { + tmp.handlers.length > 1 ? (handlers=handlers.concat(tmp.handlers)) : handlers.push(tmp.handlers[0]); + } + } // else not a match + } + + return { params, handlers }; + } +} + +/** + * @typedef ParsedURL + * @type {import('.').ParsedURL} + */ + +/** + * @typedef Request + * @property {string} url + * @property {ParsedURL} _parsedUrl + */ + +/** + * @param {Request} req + * @returns {ParsedURL|void} + */ +function parse(req) { + let raw = req.url; + if (raw == null) return; + + let prev = req._parsedUrl; + if (prev && prev.raw === raw) return prev; + + let pathname=raw, search='', query; + + if (raw.length > 1) { + let idx = raw.indexOf('?', 1); + + if (idx !== -1) { + search = raw.substring(idx); + pathname = raw.substring(0, idx); + if (search.length > 1) { + query = qs.parse(search.substring(1)); + } + } + } + + return req._parsedUrl = { pathname, search, query, raw }; +} + +function onError(err, req, res) { + let code = typeof err.status === 'number' && err.status; + code = res.statusCode = (code && code >= 100 ? code : 500); + if (typeof err === 'string' || Buffer.isBuffer(err)) res.end(err); + else res.end(err.message || http.STATUS_CODES[code]); +} + +const mount = fn => fn instanceof Polka ? fn.attach : fn; + +class Polka extends Trouter { + constructor(opts={}) { + super(); + this.parse = parse; + this.server = opts.server; + this.handler = this.handler.bind(this); + this.onError = opts.onError || onError; // catch-all handler + this.onNoMatch = opts.onNoMatch || this.onError.bind(null, { status: 404 }); + this.attach = (req, res) => setImmediate(this.handler, req, res); + } + + use(base, ...fns) { + if (base === '/') { + super.use(base, fns.map(mount)); + } else if (typeof base === 'function' || base instanceof Polka) { + super.use('/', [base, ...fns].map(mount)); + } else { + super.use(base, + (req, _, next) => { + if (typeof base === 'string') { + let len = base.length; + base.startsWith('/') || len++; + req.url = req.url.substring(len) || '/'; + req.path = req.path.substring(len) || '/'; + } else { + req.url = req.url.replace(base, '') || '/'; + req.path = req.path.replace(base, '') || '/'; + } + if (req.url.charAt(0) !== '/') { + req.url = '/' + req.url; + } + next(); + }, + fns.map(mount), + (req, _, next) => { + req.path = req._parsedUrl.pathname; + req.url = req.path + req._parsedUrl.search; + next(); + } + ); + } + return this; // chainable + } + + listen() { + (this.server = this.server || http.createServer()).on('request', this.attach); + this.server.listen.apply(this.server, arguments); + return this; + } + + handler(req, res, next) { + let info = this.parse(req), path = info.pathname; + let obj = this.find(req.method, req.path=path); + + req.url = path + info.search; + req.originalUrl = req.originalUrl || req.url; + req.query = info.query || {}; + req.search = info.search; + req.params = obj.params; + + if (path.length > 1 && path.indexOf('%', 1) !== -1) { + for (let k in req.params) { + try { req.params[k] = decodeURIComponent(req.params[k]); } + catch (e) { /* malform uri segment */ } + } + } + + let i=0, arr=obj.handlers.concat(this.onNoMatch), len=arr.length; + let loop = async () => res.finished || (i < len) && arr[i++](req, res, next); + (next = next || (err => err ? this.onError(err, req, res, next) : loop().catch(next)))(); // init + } +} + +function polka (opts) { + return new Polka(opts); +} + +const path = env('SOCKET_PATH', false); +const host = env('HOST', '0.0.0.0'); +const port = env('PORT', !path && '3000'); + +const server = polka().use(handler); + +server.listen({ path, host, port }, () => { + console.log(`Listening on ${path ? path : host + ':' + port}`); +}); + +export { host, path, port, server }; diff --git a/build/server/chunks/0-d3be1c89.js b/build/server/chunks/0-d3be1c89.js new file mode 100644 index 0000000..7373735 --- /dev/null +++ b/build/server/chunks/0-d3be1c89.js @@ -0,0 +1,9 @@ +const index = 0; +let component_cache; +const component = async () => component_cache ??= (await import('./_layout.svelte-9bc3433c.js')).default; +const imports = ["_app/immutable/nodes/0.c6b7f96f.js","_app/immutable/chunks/scheduler.e108d1fd.js","_app/immutable/chunks/index.5ae4157e.js"]; +const stylesheets = ["_app/immutable/assets/0.675f064e.css"]; +const fonts = []; + +export { component, fonts, imports, index, stylesheets }; +//# sourceMappingURL=0-d3be1c89.js.map diff --git a/build/server/chunks/0-d3be1c89.js.map b/build/server/chunks/0-d3be1c89.js.map new file mode 100644 index 0000000..f4b83ef --- /dev/null +++ b/build/server/chunks/0-d3be1c89.js.map @@ -0,0 +1 @@ +{"version":3,"file":"0-d3be1c89.js","sources":["../../../.svelte-kit/adapter-node/nodes/0.js"],"sourcesContent":["\n\nexport const index = 0;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/pages/_layout.svelte.js')).default;\nexport const imports = [\"_app/immutable/nodes/0.c6b7f96f.js\",\"_app/immutable/chunks/scheduler.e108d1fd.js\",\"_app/immutable/chunks/index.5ae4157e.js\"];\nexport const stylesheets = [\"_app/immutable/assets/0.675f064e.css\"];\nexport const fonts = [];\n"],"names":[],"mappings":"AAEY,MAAC,KAAK,GAAG,EAAE;AACvB,IAAI,eAAe,CAAC;AACR,MAAC,SAAS,GAAG,YAAY,eAAe,KAAK,CAAC,MAAM,OAAO,8BAAoC,CAAC,EAAE,QAAQ;AAC1G,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,6CAA6C,CAAC,yCAAyC,EAAE;AAC1I,MAAC,WAAW,GAAG,CAAC,sCAAsC,EAAE;AACxD,MAAC,KAAK,GAAG;;;;"} \ No newline at end of file diff --git a/build/server/chunks/1-1ce25579.js b/build/server/chunks/1-1ce25579.js new file mode 100644 index 0000000..264d985 --- /dev/null +++ b/build/server/chunks/1-1ce25579.js @@ -0,0 +1,9 @@ +const index = 1; +let component_cache; +const component = async () => component_cache ??= (await import('./error.svelte-2a42fd80.js')).default; +const imports = ["_app/immutable/nodes/1.d912ddfa.js","_app/immutable/chunks/scheduler.e108d1fd.js","_app/immutable/chunks/index.5ae4157e.js","_app/immutable/chunks/singletons.c5f6caef.js"]; +const stylesheets = []; +const fonts = []; + +export { component, fonts, imports, index, stylesheets }; +//# sourceMappingURL=1-1ce25579.js.map diff --git a/build/server/chunks/1-1ce25579.js.map b/build/server/chunks/1-1ce25579.js.map new file mode 100644 index 0000000..4147140 --- /dev/null +++ b/build/server/chunks/1-1ce25579.js.map @@ -0,0 +1 @@ +{"version":3,"file":"1-1ce25579.js","sources":["../../../.svelte-kit/adapter-node/nodes/1.js"],"sourcesContent":["\n\nexport const index = 1;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/fallbacks/error.svelte.js')).default;\nexport const imports = [\"_app/immutable/nodes/1.d912ddfa.js\",\"_app/immutable/chunks/scheduler.e108d1fd.js\",\"_app/immutable/chunks/index.5ae4157e.js\",\"_app/immutable/chunks/singletons.c5f6caef.js\"];\nexport const stylesheets = [];\nexport const fonts = [];\n"],"names":[],"mappings":"AAEY,MAAC,KAAK,GAAG,EAAE;AACvB,IAAI,eAAe,CAAC;AACR,MAAC,SAAS,GAAG,YAAY,eAAe,KAAK,CAAC,MAAM,OAAO,4BAAsC,CAAC,EAAE,QAAQ;AAC5G,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,6CAA6C,CAAC,yCAAyC,CAAC,8CAA8C,EAAE;AACzL,MAAC,WAAW,GAAG,GAAG;AAClB,MAAC,KAAK,GAAG;;;;"} \ No newline at end of file diff --git a/build/server/chunks/2-60b872d2.js b/build/server/chunks/2-60b872d2.js new file mode 100644 index 0000000..b025c3f --- /dev/null +++ b/build/server/chunks/2-60b872d2.js @@ -0,0 +1,9 @@ +const index = 2; +let component_cache; +const component = async () => component_cache ??= (await import('./_page.svelte-25537e00.js')).default; +const imports = ["_app/immutable/nodes/2.d9995499.js","_app/immutable/chunks/scheduler.e108d1fd.js","_app/immutable/chunks/index.5ae4157e.js"]; +const stylesheets = ["_app/immutable/assets/2.5db023af.css"]; +const fonts = []; + +export { component, fonts, imports, index, stylesheets }; +//# sourceMappingURL=2-60b872d2.js.map diff --git a/build/server/chunks/2-60b872d2.js.map b/build/server/chunks/2-60b872d2.js.map new file mode 100644 index 0000000..3bc1d52 --- /dev/null +++ b/build/server/chunks/2-60b872d2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"2-60b872d2.js","sources":["../../../.svelte-kit/adapter-node/nodes/2.js"],"sourcesContent":["\n\nexport const index = 2;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/pages/_page.svelte.js')).default;\nexport const imports = [\"_app/immutable/nodes/2.d9995499.js\",\"_app/immutable/chunks/scheduler.e108d1fd.js\",\"_app/immutable/chunks/index.5ae4157e.js\"];\nexport const stylesheets = [\"_app/immutable/assets/2.5db023af.css\"];\nexport const fonts = [];\n"],"names":[],"mappings":"AAEY,MAAC,KAAK,GAAG,EAAE;AACvB,IAAI,eAAe,CAAC;AACR,MAAC,SAAS,GAAG,YAAY,eAAe,KAAK,CAAC,MAAM,OAAO,4BAAkC,CAAC,EAAE,QAAQ;AACxG,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,6CAA6C,CAAC,yCAAyC,EAAE;AAC1I,MAAC,WAAW,GAAG,CAAC,sCAAsC,EAAE;AACxD,MAAC,KAAK,GAAG;;;;"} \ No newline at end of file diff --git a/build/server/chunks/3-4360e939.js b/build/server/chunks/3-4360e939.js new file mode 100644 index 0000000..b3d4248 --- /dev/null +++ b/build/server/chunks/3-4360e939.js @@ -0,0 +1,9 @@ +const index = 3; +let component_cache; +const component = async () => component_cache ??= (await import('./_page.svelte-7f647b2a.js')).default; +const imports = ["_app/immutable/nodes/3.af1c8f7a.js","_app/immutable/chunks/scheduler.e108d1fd.js","_app/immutable/chunks/index.5ae4157e.js"]; +const stylesheets = []; +const fonts = []; + +export { component, fonts, imports, index, stylesheets }; +//# sourceMappingURL=3-4360e939.js.map diff --git a/build/server/chunks/3-4360e939.js.map b/build/server/chunks/3-4360e939.js.map new file mode 100644 index 0000000..61a1ac4 --- /dev/null +++ b/build/server/chunks/3-4360e939.js.map @@ -0,0 +1 @@ +{"version":3,"file":"3-4360e939.js","sources":["../../../.svelte-kit/adapter-node/nodes/3.js"],"sourcesContent":["\n\nexport const index = 3;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/pages/kurs/_page.svelte.js')).default;\nexport const imports = [\"_app/immutable/nodes/3.af1c8f7a.js\",\"_app/immutable/chunks/scheduler.e108d1fd.js\",\"_app/immutable/chunks/index.5ae4157e.js\"];\nexport const stylesheets = [];\nexport const fonts = [];\n"],"names":[],"mappings":"AAEY,MAAC,KAAK,GAAG,EAAE;AACvB,IAAI,eAAe,CAAC;AACR,MAAC,SAAS,GAAG,YAAY,eAAe,KAAK,CAAC,MAAM,OAAO,4BAAuC,CAAC,EAAE,QAAQ;AAC7G,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,6CAA6C,CAAC,yCAAyC,EAAE;AAC1I,MAAC,WAAW,GAAG,GAAG;AAClB,MAAC,KAAK,GAAG;;;;"} \ No newline at end of file diff --git a/build/server/chunks/4-5fd67c3f.js b/build/server/chunks/4-5fd67c3f.js new file mode 100644 index 0000000..ec738a9 --- /dev/null +++ b/build/server/chunks/4-5fd67c3f.js @@ -0,0 +1,9 @@ +const index = 4; +let component_cache; +const component = async () => component_cache ??= (await import('./_page.svelte-c2686a1e.js')).default; +const imports = ["_app/immutable/nodes/4.a10d64ed.js","_app/immutable/chunks/scheduler.e108d1fd.js","_app/immutable/chunks/index.5ae4157e.js"]; +const stylesheets = ["_app/immutable/assets/4.805c7000.css"]; +const fonts = []; + +export { component, fonts, imports, index, stylesheets }; +//# sourceMappingURL=4-5fd67c3f.js.map diff --git a/build/server/chunks/4-5fd67c3f.js.map b/build/server/chunks/4-5fd67c3f.js.map new file mode 100644 index 0000000..aa231f1 --- /dev/null +++ b/build/server/chunks/4-5fd67c3f.js.map @@ -0,0 +1 @@ +{"version":3,"file":"4-5fd67c3f.js","sources":["../../../.svelte-kit/adapter-node/nodes/4.js"],"sourcesContent":["\n\nexport const index = 4;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/pages/om/_page.svelte.js')).default;\nexport const imports = [\"_app/immutable/nodes/4.a10d64ed.js\",\"_app/immutable/chunks/scheduler.e108d1fd.js\",\"_app/immutable/chunks/index.5ae4157e.js\"];\nexport const stylesheets = [\"_app/immutable/assets/4.805c7000.css\"];\nexport const fonts = [];\n"],"names":[],"mappings":"AAEY,MAAC,KAAK,GAAG,EAAE;AACvB,IAAI,eAAe,CAAC;AACR,MAAC,SAAS,GAAG,YAAY,eAAe,KAAK,CAAC,MAAM,OAAO,4BAAqC,CAAC,EAAE,QAAQ;AAC3G,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,6CAA6C,CAAC,yCAAyC,EAAE;AAC1I,MAAC,WAAW,GAAG,CAAC,sCAAsC,EAAE;AACxD,MAAC,KAAK,GAAG;;;;"} \ No newline at end of file diff --git a/build/server/chunks/_layout.svelte-9bc3433c.js b/build/server/chunks/_layout.svelte-9bc3433c.js new file mode 100644 index 0000000..02e1f52 --- /dev/null +++ b/build/server/chunks/_layout.svelte-9bc3433c.js @@ -0,0 +1,32 @@ +import { c as create_ssr_component, v as validate_component } from './ssr-7369fb3e.js'; + +const css$2 = { + code: "nav.svelte-1oqqfea{border:1px solid green}", + map: null +}; +const Nav = create_ssr_component(($$result, $$props, $$bindings, slots) => { + $$result.css.add(css$2); + return ``; +}); +const css$1 = { + code: "header.svelte-mw7wrq.svelte-mw7wrq{border:1px solid red}header.svelte-mw7wrq h1.svelte-mw7wrq{font-size:2.4rem}", + map: null +}; +const Header = create_ssr_component(($$result, $$props, $$bindings, slots) => { + $$result.css.add(css$1); + return `

SvelteKit

${validate_component(Nav, "Nav").$$render($$result, {}, {}, {})}
`; +}); +const css = { + code: "footer.svelte-1lfmg61{border:1px solid blue}", + map: null +}; +const Footer = create_ssr_component(($$result, $$props, $$bindings, slots) => { + $$result.css.add(css); + return `

footer

`; +}); +const Layout = create_ssr_component(($$result, $$props, $$bindings, slots) => { + return `${validate_component(Header, "Header").$$render($$result, {}, {}, {})} ${slots.default ? slots.default({}) : ``} ${validate_component(Footer, "Footer").$$render($$result, {}, {}, {})}`; +}); + +export { Layout as default }; +//# sourceMappingURL=_layout.svelte-9bc3433c.js.map diff --git a/build/server/chunks/_layout.svelte-9bc3433c.js.map b/build/server/chunks/_layout.svelte-9bc3433c.js.map new file mode 100644 index 0000000..45a51cc --- /dev/null +++ b/build/server/chunks/_layout.svelte-9bc3433c.js.map @@ -0,0 +1 @@ +{"version":3,"file":"_layout.svelte-9bc3433c.js","sources":["../../../.svelte-kit/adapter-node/entries/pages/_layout.svelte.js"],"sourcesContent":["import { c as create_ssr_component, v as validate_component } from \"../../chunks/ssr.js\";\nconst global = \"\";\nconst Nav_svelte_svelte_type_style_lang = \"\";\nconst css$2 = {\n code: \"nav.svelte-1oqqfea{border:1px solid green}\",\n map: null\n};\nconst Nav = create_ssr_component(($$result, $$props, $$bindings, slots) => {\n $$result.css.add(css$2);\n return ``;\n});\nconst Header_svelte_svelte_type_style_lang = \"\";\nconst css$1 = {\n code: \"header.svelte-mw7wrq.svelte-mw7wrq{border:1px solid red}header.svelte-mw7wrq h1.svelte-mw7wrq{font-size:2.4rem}\",\n map: null\n};\nconst Header = create_ssr_component(($$result, $$props, $$bindings, slots) => {\n $$result.css.add(css$1);\n return `

SvelteKit

${validate_component(Nav, \"Nav\").$$render($$result, {}, {}, {})}
`;\n});\nconst Footer_svelte_svelte_type_style_lang = \"\";\nconst css = {\n code: \"footer.svelte-1lfmg61{border:1px solid blue}\",\n map: null\n};\nconst Footer = create_ssr_component(($$result, $$props, $$bindings, slots) => {\n $$result.css.add(css);\n return `

footer

`;\n});\nconst Layout = create_ssr_component(($$result, $$props, $$bindings, slots) => {\n return `${validate_component(Header, \"Header\").$$render($$result, {}, {}, {})} ${slots.default ? slots.default({}) : ``} ${validate_component(Footer, \"Footer\").$$render($$result, {}, {}, {})}`;\n});\nexport {\n Layout as default\n};\n"],"names":[],"mappings":";;AAGA,MAAM,KAAK,GAAG;AACd,EAAE,IAAI,EAAE,4CAA4C;AACpD,EAAE,GAAG,EAAE,IAAI;AACX,CAAC,CAAC;AACF,MAAM,GAAG,GAAG,oBAAoB,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,KAAK;AAC3E,EAAE,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AAC1B,EAAE,OAAO,CAAC,yIAAyI,CAAC,CAAC;AACrJ,CAAC,CAAC,CAAC;AAEH,MAAM,KAAK,GAAG;AACd,EAAE,IAAI,EAAE,iHAAiH;AACzH,EAAE,GAAG,EAAE,IAAI;AACX,CAAC,CAAC;AACF,MAAM,MAAM,GAAG,oBAAoB,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,KAAK;AAC9E,EAAE,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AAC1B,EAAE,OAAO,CAAC,sGAAsG,EAAE,kBAAkB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC;AAC5L,CAAC,CAAC,CAAC;AAEH,MAAM,GAAG,GAAG;AACZ,EAAE,IAAI,EAAE,8CAA8C;AACtD,EAAE,GAAG,EAAE,IAAI;AACX,CAAC,CAAC;AACF,MAAM,MAAM,GAAG,oBAAoB,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,KAAK;AAC9E,EAAE,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACxB,EAAE,OAAO,CAAC,oFAAoF,CAAC,CAAC;AAChG,CAAC,CAAC,CAAC;AACE,MAAC,MAAM,GAAG,oBAAoB,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,KAAK;AAC9E,EAAE,OAAO,CAAC,EAAE,kBAAkB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,kBAAkB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;AACnM,CAAC;;;;"} \ No newline at end of file diff --git a/build/server/chunks/_page.svelte-25537e00.js b/build/server/chunks/_page.svelte-25537e00.js new file mode 100644 index 0000000..818a3b6 --- /dev/null +++ b/build/server/chunks/_page.svelte-25537e00.js @@ -0,0 +1,13 @@ +import { c as create_ssr_component } from './ssr-7369fb3e.js'; + +const css = { + code: "main.svelte-1u03z1s{border:1px solid black}p.svelte-1u03z1s{color:blue}", + map: null +}; +const Page = create_ssr_component(($$result, $$props, $$bindings, slots) => { + $$result.css.add(css); + return `

Welcome to SvelteKit med Jack

Visit kit.svelte.dev to read the documentation

`; +}); + +export { Page as default }; +//# sourceMappingURL=_page.svelte-25537e00.js.map diff --git a/build/server/chunks/_page.svelte-25537e00.js.map b/build/server/chunks/_page.svelte-25537e00.js.map new file mode 100644 index 0000000..a1134dc --- /dev/null +++ b/build/server/chunks/_page.svelte-25537e00.js.map @@ -0,0 +1 @@ +{"version":3,"file":"_page.svelte-25537e00.js","sources":["../../../.svelte-kit/adapter-node/entries/pages/_page.svelte.js"],"sourcesContent":["import { c as create_ssr_component } from \"../../chunks/ssr.js\";\nconst _page_svelte_svelte_type_style_lang = \"\";\nconst css = {\n code: \"main.svelte-1u03z1s{border:1px solid black}p.svelte-1u03z1s{color:blue}\",\n map: null\n};\nconst Page = create_ssr_component(($$result, $$props, $$bindings, slots) => {\n $$result.css.add(css);\n return `

Welcome to SvelteKit med Jack

Visit kit.svelte.dev to read the documentation

`;\n});\nexport {\n Page as default\n};\n"],"names":[],"mappings":";;AAEA,MAAM,GAAG,GAAG;AACZ,EAAE,IAAI,EAAE,yEAAyE;AACjF,EAAE,GAAG,EAAE,IAAI;AACX,CAAC,CAAC;AACG,MAAC,IAAI,GAAG,oBAAoB,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,KAAK;AAC5E,EAAE,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACxB,EAAE,OAAO,CAAC,2NAA2N,CAAC,CAAC;AACvO,CAAC;;;;"} \ No newline at end of file diff --git a/build/server/chunks/_page.svelte-7f647b2a.js b/build/server/chunks/_page.svelte-7f647b2a.js new file mode 100644 index 0000000..274e86c --- /dev/null +++ b/build/server/chunks/_page.svelte-7f647b2a.js @@ -0,0 +1,8 @@ +import { c as create_ssr_component } from './ssr-7369fb3e.js'; + +const Page = create_ssr_component(($$result, $$props, $$bindings, slots) => { + return `

kurs

`; +}); + +export { Page as default }; +//# sourceMappingURL=_page.svelte-7f647b2a.js.map diff --git a/build/server/chunks/_page.svelte-7f647b2a.js.map b/build/server/chunks/_page.svelte-7f647b2a.js.map new file mode 100644 index 0000000..2d3cfb5 --- /dev/null +++ b/build/server/chunks/_page.svelte-7f647b2a.js.map @@ -0,0 +1 @@ +{"version":3,"file":"_page.svelte-7f647b2a.js","sources":["../../../.svelte-kit/adapter-node/entries/pages/kurs/_page.svelte.js"],"sourcesContent":["import { c as create_ssr_component } from \"../../../chunks/ssr.js\";\nconst Page = create_ssr_component(($$result, $$props, $$bindings, slots) => {\n return `

kurs

`;\n});\nexport {\n Page as default\n};\n"],"names":[],"mappings":";;AACK,MAAC,IAAI,GAAG,oBAAoB,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,KAAK;AAC5E,EAAE,OAAO,CAAC,yCAAyC,CAAC,CAAC;AACrD,CAAC;;;;"} \ No newline at end of file diff --git a/build/server/chunks/_page.svelte-c2686a1e.js b/build/server/chunks/_page.svelte-c2686a1e.js new file mode 100644 index 0000000..ceca382 --- /dev/null +++ b/build/server/chunks/_page.svelte-c2686a1e.js @@ -0,0 +1,13 @@ +import { c as create_ssr_component } from './ssr-7369fb3e.js'; + +const css = { + code: "div.svelte-iatflv p.svelte-iatflv{color:red}", + map: null +}; +const Page = create_ssr_component(($$result, $$props, $$bindings, slots) => { + $$result.css.add(css); + return `

Om SvelteKit

Hej

På dig

`; +}); + +export { Page as default }; +//# sourceMappingURL=_page.svelte-c2686a1e.js.map diff --git a/build/server/chunks/_page.svelte-c2686a1e.js.map b/build/server/chunks/_page.svelte-c2686a1e.js.map new file mode 100644 index 0000000..ac14095 --- /dev/null +++ b/build/server/chunks/_page.svelte-c2686a1e.js.map @@ -0,0 +1 @@ +{"version":3,"file":"_page.svelte-c2686a1e.js","sources":["../../../.svelte-kit/adapter-node/entries/pages/om/_page.svelte.js"],"sourcesContent":["import { c as create_ssr_component } from \"../../../chunks/ssr.js\";\nconst _page_svelte_svelte_type_style_lang = \"\";\nconst css = {\n code: \"div.svelte-iatflv p.svelte-iatflv{color:red}\",\n map: null\n};\nconst Page = create_ssr_component(($$result, $$props, $$bindings, slots) => {\n $$result.css.add(css);\n return `

Om SvelteKit

Hej

På dig

`;\n});\nexport {\n Page as default\n};\n"],"names":[],"mappings":";;AAEA,MAAM,GAAG,GAAG;AACZ,EAAE,IAAI,EAAE,8CAA8C;AACtD,EAAE,GAAG,EAAE,IAAI;AACX,CAAC,CAAC;AACG,MAAC,IAAI,GAAG,oBAAoB,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,KAAK;AAC5E,EAAE,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACxB,EAAE,OAAO,CAAC,oNAAoN,CAAC,CAAC;AAChO,CAAC;;;;"} \ No newline at end of file diff --git a/build/server/chunks/error.svelte-2a42fd80.js b/build/server/chunks/error.svelte-2a42fd80.js new file mode 100644 index 0000000..ca1837d --- /dev/null +++ b/build/server/chunks/error.svelte-2a42fd80.js @@ -0,0 +1,32 @@ +import { c as create_ssr_component, b as subscribe, e as escape, g as getContext } from './ssr-7369fb3e.js'; + +const getStores = () => { + const stores = getContext("__svelte__"); + return { + /** @type {typeof page} */ + page: { + subscribe: stores.page.subscribe + }, + /** @type {typeof navigating} */ + navigating: { + subscribe: stores.navigating.subscribe + }, + /** @type {typeof updated} */ + updated: stores.updated + }; +}; +const page = { + subscribe(fn) { + const store = getStores().page; + return store.subscribe(fn); + } +}; +const Error$1 = create_ssr_component(($$result, $$props, $$bindings, slots) => { + let $page, $$unsubscribe_page; + $$unsubscribe_page = subscribe(page, (value) => $page = value); + $$unsubscribe_page(); + return `

${escape($page.status)}

${escape($page.error?.message)}

`; +}); + +export { Error$1 as default }; +//# sourceMappingURL=error.svelte-2a42fd80.js.map diff --git a/build/server/chunks/error.svelte-2a42fd80.js.map b/build/server/chunks/error.svelte-2a42fd80.js.map new file mode 100644 index 0000000..e7e0382 --- /dev/null +++ b/build/server/chunks/error.svelte-2a42fd80.js.map @@ -0,0 +1 @@ +{"version":3,"file":"error.svelte-2a42fd80.js","sources":["../../../.svelte-kit/adapter-node/entries/fallbacks/error.svelte.js"],"sourcesContent":["import { g as getContext, c as create_ssr_component, b as subscribe, e as escape } from \"../../chunks/ssr.js\";\nconst getStores = () => {\n const stores = getContext(\"__svelte__\");\n return {\n /** @type {typeof page} */\n page: {\n subscribe: stores.page.subscribe\n },\n /** @type {typeof navigating} */\n navigating: {\n subscribe: stores.navigating.subscribe\n },\n /** @type {typeof updated} */\n updated: stores.updated\n };\n};\nconst page = {\n subscribe(fn) {\n const store = getStores().page;\n return store.subscribe(fn);\n }\n};\nconst Error$1 = create_ssr_component(($$result, $$props, $$bindings, slots) => {\n let $page, $$unsubscribe_page;\n $$unsubscribe_page = subscribe(page, (value) => $page = value);\n $$unsubscribe_page();\n return `

${escape($page.status)}

${escape($page.error?.message)}

`;\n});\nexport {\n Error$1 as default\n};\n"],"names":[],"mappings":";;AACA,MAAM,SAAS,GAAG,MAAM;AACxB,EAAE,MAAM,MAAM,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;AAC1C,EAAE,OAAO;AACT;AACA,IAAI,IAAI,EAAE;AACV,MAAM,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,SAAS;AACtC,KAAK;AACL;AACA,IAAI,UAAU,EAAE;AAChB,MAAM,SAAS,EAAE,MAAM,CAAC,UAAU,CAAC,SAAS;AAC5C,KAAK;AACL;AACA,IAAI,OAAO,EAAE,MAAM,CAAC,OAAO;AAC3B,GAAG,CAAC;AACJ,CAAC,CAAC;AACF,MAAM,IAAI,GAAG;AACb,EAAE,SAAS,CAAC,EAAE,EAAE;AAChB,IAAI,MAAM,KAAK,GAAG,SAAS,EAAE,CAAC,IAAI,CAAC;AACnC,IAAI,OAAO,KAAK,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;AAC/B,GAAG;AACH,CAAC,CAAC;AACG,MAAC,OAAO,GAAG,oBAAoB,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,KAAK;AAC/E,EAAE,IAAI,KAAK,EAAE,kBAAkB,CAAC;AAChC,EAAE,kBAAkB,GAAG,SAAS,CAAC,IAAI,EAAE,CAAC,KAAK,KAAK,KAAK,GAAG,KAAK,CAAC,CAAC;AACjE,EAAE,kBAAkB,EAAE,CAAC;AACvB,EAAE,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC;AACnF,CAAC;;;;"} \ No newline at end of file diff --git a/build/server/chunks/ssr-7369fb3e.js b/build/server/chunks/ssr-7369fb3e.js new file mode 100644 index 0000000..c7d5dad --- /dev/null +++ b/build/server/chunks/ssr-7369fb3e.js @@ -0,0 +1,109 @@ +function noop() { +} +function run(fn) { + return fn(); +} +function blank_object() { + return /* @__PURE__ */ Object.create(null); +} +function run_all(fns) { + fns.forEach(run); +} +function safe_not_equal(a, b) { + return a != a ? b == b : a !== b || a && typeof a === "object" || typeof a === "function"; +} +function subscribe(store, ...callbacks) { + if (store == null) { + for (const callback of callbacks) { + callback(void 0); + } + return noop; + } + const unsub = store.subscribe(...callbacks); + return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub; +} +let current_component; +function set_current_component(component) { + current_component = component; +} +function get_current_component() { + if (!current_component) + throw new Error("Function called outside component initialization"); + return current_component; +} +function setContext(key, context) { + get_current_component().$$.context.set(key, context); + return context; +} +function getContext(key) { + return get_current_component().$$.context.get(key); +} +const ATTR_REGEX = /[&"]/g; +const CONTENT_REGEX = /[&<]/g; +function escape(value, is_attr = false) { + const str = String(value); + const pattern = is_attr ? ATTR_REGEX : CONTENT_REGEX; + pattern.lastIndex = 0; + let escaped = ""; + let last = 0; + while (pattern.test(str)) { + const i = pattern.lastIndex - 1; + const ch = str[i]; + escaped += str.substring(last, i) + (ch === "&" ? "&" : ch === '"' ? """ : "<"); + last = i + 1; + } + return escaped + str.substring(last); +} +const missing_component = { + $$render: () => "" +}; +function validate_component(component, name) { + if (!component || !component.$$render) { + if (name === "svelte:component") + name += " this={...}"; + throw new Error( + `<${name}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules. Otherwise you may need to fix a <${name}>.` + ); + } + return component; +} +let on_destroy; +function create_ssr_component(fn) { + function $$render(result, props, bindings, slots, context) { + const parent_component = current_component; + const $$ = { + on_destroy, + context: new Map(context || (parent_component ? parent_component.$$.context : [])), + // these will be immediately discarded + on_mount: [], + before_update: [], + after_update: [], + callbacks: blank_object() + }; + set_current_component({ $$ }); + const html = fn(result, props, bindings, slots); + set_current_component(parent_component); + return html; + } + return { + render: (props = {}, { $$slots = {}, context = /* @__PURE__ */ new Map() } = {}) => { + on_destroy = []; + const result = { title: "", head: "", css: /* @__PURE__ */ new Set() }; + const html = $$render(result, props, {}, $$slots, context); + run_all(on_destroy); + return { + html, + css: { + code: Array.from(result.css).map((css) => css.code).join("\n"), + map: null + // TODO + }, + head: result.title + result.head + }; + }, + $$render + }; +} + +export { safe_not_equal as a, subscribe as b, create_ssr_component as c, escape as e, getContext as g, missing_component as m, noop as n, setContext as s, validate_component as v }; +//# sourceMappingURL=ssr-7369fb3e.js.map diff --git a/build/server/chunks/ssr-7369fb3e.js.map b/build/server/chunks/ssr-7369fb3e.js.map new file mode 100644 index 0000000..1b5e118 --- /dev/null +++ b/build/server/chunks/ssr-7369fb3e.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ssr-7369fb3e.js","sources":["../../../.svelte-kit/adapter-node/chunks/ssr.js"],"sourcesContent":["function noop() {\n}\nfunction run(fn) {\n return fn();\n}\nfunction blank_object() {\n return /* @__PURE__ */ Object.create(null);\n}\nfunction run_all(fns) {\n fns.forEach(run);\n}\nfunction safe_not_equal(a, b) {\n return a != a ? b == b : a !== b || a && typeof a === \"object\" || typeof a === \"function\";\n}\nfunction subscribe(store, ...callbacks) {\n if (store == null) {\n for (const callback of callbacks) {\n callback(void 0);\n }\n return noop;\n }\n const unsub = store.subscribe(...callbacks);\n return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;\n}\nlet current_component;\nfunction set_current_component(component) {\n current_component = component;\n}\nfunction get_current_component() {\n if (!current_component)\n throw new Error(\"Function called outside component initialization\");\n return current_component;\n}\nfunction setContext(key, context) {\n get_current_component().$$.context.set(key, context);\n return context;\n}\nfunction getContext(key) {\n return get_current_component().$$.context.get(key);\n}\nconst ATTR_REGEX = /[&\"]/g;\nconst CONTENT_REGEX = /[&<]/g;\nfunction escape(value, is_attr = false) {\n const str = String(value);\n const pattern = is_attr ? ATTR_REGEX : CONTENT_REGEX;\n pattern.lastIndex = 0;\n let escaped = \"\";\n let last = 0;\n while (pattern.test(str)) {\n const i = pattern.lastIndex - 1;\n const ch = str[i];\n escaped += str.substring(last, i) + (ch === \"&\" ? \"&\" : ch === '\"' ? \""\" : \"<\");\n last = i + 1;\n }\n return escaped + str.substring(last);\n}\nconst missing_component = {\n $$render: () => \"\"\n};\nfunction validate_component(component, name) {\n if (!component || !component.$$render) {\n if (name === \"svelte:component\")\n name += \" this={...}\";\n throw new Error(\n `<${name}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules. Otherwise you may need to fix a <${name}>.`\n );\n }\n return component;\n}\nlet on_destroy;\nfunction create_ssr_component(fn) {\n function $$render(result, props, bindings, slots, context) {\n const parent_component = current_component;\n const $$ = {\n on_destroy,\n context: new Map(context || (parent_component ? parent_component.$$.context : [])),\n // these will be immediately discarded\n on_mount: [],\n before_update: [],\n after_update: [],\n callbacks: blank_object()\n };\n set_current_component({ $$ });\n const html = fn(result, props, bindings, slots);\n set_current_component(parent_component);\n return html;\n }\n return {\n render: (props = {}, { $$slots = {}, context = /* @__PURE__ */ new Map() } = {}) => {\n on_destroy = [];\n const result = { title: \"\", head: \"\", css: /* @__PURE__ */ new Set() };\n const html = $$render(result, props, {}, $$slots, context);\n run_all(on_destroy);\n return {\n html,\n css: {\n code: Array.from(result.css).map((css) => css.code).join(\"\\n\"),\n map: null\n // TODO\n },\n head: result.title + result.head\n };\n },\n $$render\n };\n}\nexport {\n setContext as a,\n subscribe as b,\n create_ssr_component as c,\n escape as e,\n getContext as g,\n missing_component as m,\n noop as n,\n safe_not_equal as s,\n validate_component as v\n};\n"],"names":[],"mappings":"AAAA,SAAS,IAAI,GAAG;AAChB,CAAC;AACD,SAAS,GAAG,CAAC,EAAE,EAAE;AACjB,EAAE,OAAO,EAAE,EAAE,CAAC;AACd,CAAC;AACD,SAAS,YAAY,GAAG;AACxB,EAAE,uBAAuB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAC7C,CAAC;AACD,SAAS,OAAO,CAAC,GAAG,EAAE;AACtB,EAAE,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AACnB,CAAC;AACD,SAAS,cAAc,CAAC,CAAC,EAAE,CAAC,EAAE;AAC9B,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,KAAK,UAAU,CAAC;AAC5F,CAAC;AACD,SAAS,SAAS,CAAC,KAAK,EAAE,GAAG,SAAS,EAAE;AACxC,EAAE,IAAI,KAAK,IAAI,IAAI,EAAE;AACrB,IAAI,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE;AACtC,MAAM,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;AACvB,KAAK;AACL,IAAI,OAAO,IAAI,CAAC;AAChB,GAAG;AACH,EAAE,MAAM,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC,CAAC;AAC9C,EAAE,OAAO,KAAK,CAAC,WAAW,GAAG,MAAM,KAAK,CAAC,WAAW,EAAE,GAAG,KAAK,CAAC;AAC/D,CAAC;AACD,IAAI,iBAAiB,CAAC;AACtB,SAAS,qBAAqB,CAAC,SAAS,EAAE;AAC1C,EAAE,iBAAiB,GAAG,SAAS,CAAC;AAChC,CAAC;AACD,SAAS,qBAAqB,GAAG;AACjC,EAAE,IAAI,CAAC,iBAAiB;AACxB,IAAI,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;AACxE,EAAE,OAAO,iBAAiB,CAAC;AAC3B,CAAC;AACD,SAAS,UAAU,CAAC,GAAG,EAAE,OAAO,EAAE;AAClC,EAAE,qBAAqB,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;AACvD,EAAE,OAAO,OAAO,CAAC;AACjB,CAAC;AACD,SAAS,UAAU,CAAC,GAAG,EAAE;AACzB,EAAE,OAAO,qBAAqB,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACrD,CAAC;AACD,MAAM,UAAU,GAAG,OAAO,CAAC;AAC3B,MAAM,aAAa,GAAG,OAAO,CAAC;AAC9B,SAAS,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,EAAE;AACxC,EAAE,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;AAC5B,EAAE,MAAM,OAAO,GAAG,OAAO,GAAG,UAAU,GAAG,aAAa,CAAC;AACvD,EAAE,OAAO,CAAC,SAAS,GAAG,CAAC,CAAC;AACxB,EAAE,IAAI,OAAO,GAAG,EAAE,CAAC;AACnB,EAAE,IAAI,IAAI,GAAG,CAAC,CAAC;AACf,EAAE,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;AAC5B,IAAI,MAAM,CAAC,GAAG,OAAO,CAAC,SAAS,GAAG,CAAC,CAAC;AACpC,IAAI,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;AACtB,IAAI,OAAO,IAAI,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,KAAK,GAAG,GAAG,OAAO,GAAG,EAAE,KAAK,GAAG,GAAG,QAAQ,GAAG,MAAM,CAAC,CAAC;AAChG,IAAI,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;AACjB,GAAG;AACH,EAAE,OAAO,OAAO,GAAG,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;AACvC,CAAC;AACI,MAAC,iBAAiB,GAAG;AAC1B,EAAE,QAAQ,EAAE,MAAM,EAAE;AACpB,EAAE;AACF,SAAS,kBAAkB,CAAC,SAAS,EAAE,IAAI,EAAE;AAC7C,EAAE,IAAI,CAAC,SAAS,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE;AACzC,IAAI,IAAI,IAAI,KAAK,kBAAkB;AACnC,MAAM,IAAI,IAAI,aAAa,CAAC;AAC5B,IAAI,MAAM,IAAI,KAAK;AACnB,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,kMAAkM,EAAE,IAAI,CAAC,EAAE,CAAC;AAC3N,KAAK,CAAC;AACN,GAAG;AACH,EAAE,OAAO,SAAS,CAAC;AACnB,CAAC;AACD,IAAI,UAAU,CAAC;AACf,SAAS,oBAAoB,CAAC,EAAE,EAAE;AAClC,EAAE,SAAS,QAAQ,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE;AAC7D,IAAI,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;AAC/C,IAAI,MAAM,EAAE,GAAG;AACf,MAAM,UAAU;AAChB,MAAM,OAAO,EAAE,IAAI,GAAG,CAAC,OAAO,KAAK,gBAAgB,GAAG,gBAAgB,CAAC,EAAE,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC;AACxF;AACA,MAAM,QAAQ,EAAE,EAAE;AAClB,MAAM,aAAa,EAAE,EAAE;AACvB,MAAM,YAAY,EAAE,EAAE;AACtB,MAAM,SAAS,EAAE,YAAY,EAAE;AAC/B,KAAK,CAAC;AACN,IAAI,qBAAqB,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAClC,IAAI,MAAM,IAAI,GAAG,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;AACpD,IAAI,qBAAqB,CAAC,gBAAgB,CAAC,CAAC;AAC5C,IAAI,OAAO,IAAI,CAAC;AAChB,GAAG;AACH,EAAE,OAAO;AACT,IAAI,MAAM,EAAE,CAAC,KAAK,GAAG,EAAE,EAAE,EAAE,OAAO,GAAG,EAAE,EAAE,OAAO,mBAAmB,IAAI,GAAG,EAAE,EAAE,GAAG,EAAE,KAAK;AACxF,MAAM,UAAU,GAAG,EAAE,CAAC;AACtB,MAAM,MAAM,MAAM,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,kBAAkB,IAAI,GAAG,EAAE,EAAE,CAAC;AAC7E,MAAM,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AACjE,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC;AAC1B,MAAM,OAAO;AACb,QAAQ,IAAI;AACZ,QAAQ,GAAG,EAAE;AACb,UAAU,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;AACxE,UAAU,GAAG,EAAE,IAAI;AACnB;AACA,SAAS;AACT,QAAQ,IAAI,EAAE,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,IAAI;AACxC,OAAO,CAAC;AACR,KAAK;AACL,IAAI,QAAQ;AACZ,GAAG,CAAC;AACJ;;;;"} \ No newline at end of file diff --git a/build/server/index.js b/build/server/index.js new file mode 100644 index 0000000..adc449a --- /dev/null +++ b/build/server/index.js @@ -0,0 +1,4141 @@ +import { c as create_ssr_component, s as setContext, v as validate_component, m as missing_component, n as noop, a as safe_not_equal } from './chunks/ssr-7369fb3e.js'; + +let base = ""; +let assets = base; +const initial = { base, assets }; +function reset() { + base = initial.base; + assets = initial.assets; +} +let public_env = {}; +function set_private_env(environment) { +} +function set_public_env(environment) { + public_env = environment; +} +function afterUpdate() { +} +const Root = create_ssr_component(($$result, $$props, $$bindings, slots) => { + let { stores } = $$props; + let { page } = $$props; + let { constructors } = $$props; + let { components = [] } = $$props; + let { form } = $$props; + let { data_0 = null } = $$props; + let { data_1 = null } = $$props; + { + setContext("__svelte__", stores); + } + afterUpdate(stores.page.notify); + if ($$props.stores === void 0 && $$bindings.stores && stores !== void 0) + $$bindings.stores(stores); + if ($$props.page === void 0 && $$bindings.page && page !== void 0) + $$bindings.page(page); + if ($$props.constructors === void 0 && $$bindings.constructors && constructors !== void 0) + $$bindings.constructors(constructors); + if ($$props.components === void 0 && $$bindings.components && components !== void 0) + $$bindings.components(components); + if ($$props.form === void 0 && $$bindings.form && form !== void 0) + $$bindings.form(form); + if ($$props.data_0 === void 0 && $$bindings.data_0 && data_0 !== void 0) + $$bindings.data_0(data_0); + if ($$props.data_1 === void 0 && $$bindings.data_1 && data_1 !== void 0) + $$bindings.data_1(data_1); + let $$settled; + let $$rendered; + do { + $$settled = true; + { + stores.page.set(page); + } + $$rendered = ` ${constructors[1] ? `${validate_component(constructors[0] || missing_component, "svelte:component").$$render( + $$result, + { data: data_0, this: components[0] }, + { + this: ($$value) => { + components[0] = $$value; + $$settled = false; + } + }, + { + default: () => { + return `${validate_component(constructors[1] || missing_component, "svelte:component").$$render( + $$result, + { data: data_1, form, this: components[1] }, + { + this: ($$value) => { + components[1] = $$value; + $$settled = false; + } + }, + {} + )}`; + } + } + )}` : `${validate_component(constructors[0] || missing_component, "svelte:component").$$render( + $$result, + { data: data_0, form, this: components[0] }, + { + this: ($$value) => { + components[0] = $$value; + $$settled = false; + } + }, + {} + )}`} ${``}`; + } while (!$$settled); + return $$rendered; +}); +const options = { + app_template_contains_nonce: false, + csp: { "mode": "auto", "directives": { "upgrade-insecure-requests": false, "block-all-mixed-content": false }, "reportOnly": { "upgrade-insecure-requests": false, "block-all-mixed-content": false } }, + csrf_check_origin: true, + track_server_fetches: false, + embedded: false, + env_public_prefix: "PUBLIC_", + env_private_prefix: "", + hooks: null, + // added lazily, via `get_hooks` + preload_strategy: "modulepreload", + root: Root, + service_worker: false, + templates: { + app: ({ head, body, assets: assets2, nonce, env }) => '\n\n \n \n \n \n ' + head + '\n \n \n
' + body + "
\n \n\n", + error: ({ status, message }) => '\n\n \n \n ' + message + ` + + + + +
+ ` + status + '\n
\n

' + message + "

\n
\n
\n \n\n" + }, + version_hash: "rrbcpm" +}; +function get_hooks() { + return {}; +} + +/** @type {Record} */ +const escaped = { + '<': '\\u003C', + '\\': '\\\\', + '\b': '\\b', + '\f': '\\f', + '\n': '\\n', + '\r': '\\r', + '\t': '\\t', + '\u2028': '\\u2028', + '\u2029': '\\u2029' +}; + +class DevalueError extends Error { + /** + * @param {string} message + * @param {string[]} keys + */ + constructor(message, keys) { + super(message); + this.name = 'DevalueError'; + this.path = keys.join(''); + } +} + +/** @param {any} thing */ +function is_primitive(thing) { + return Object(thing) !== thing; +} + +const object_proto_names = /* @__PURE__ */ Object.getOwnPropertyNames( + Object.prototype +) + .sort() + .join('\0'); + +/** @param {any} thing */ +function is_plain_object(thing) { + const proto = Object.getPrototypeOf(thing); + + return ( + proto === Object.prototype || + proto === null || + Object.getOwnPropertyNames(proto).sort().join('\0') === object_proto_names + ); +} + +/** @param {any} thing */ +function get_type(thing) { + return Object.prototype.toString.call(thing).slice(8, -1); +} + +/** @param {string} char */ +function get_escaped_char(char) { + switch (char) { + case '"': + return '\\"'; + case '<': + return '\\u003C'; + case '\\': + return '\\\\'; + case '\n': + return '\\n'; + case '\r': + return '\\r'; + case '\t': + return '\\t'; + case '\b': + return '\\b'; + case '\f': + return '\\f'; + case '\u2028': + return '\\u2028'; + case '\u2029': + return '\\u2029'; + default: + return char < ' ' + ? `\\u${char.charCodeAt(0).toString(16).padStart(4, '0')}` + : ''; + } +} + +/** @param {string} str */ +function stringify_string(str) { + let result = ''; + let last_pos = 0; + const len = str.length; + + for (let i = 0; i < len; i += 1) { + const char = str[i]; + const replacement = get_escaped_char(char); + if (replacement) { + result += str.slice(last_pos, i) + replacement; + last_pos = i + 1; + } + } + + return `"${last_pos === 0 ? str : result + str.slice(last_pos)}"`; +} + +const chars$1 = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$'; +const unsafe_chars = /[<\b\f\n\r\t\0\u2028\u2029]/g; +const reserved = + /^(?:do|if|in|for|int|let|new|try|var|byte|case|char|else|enum|goto|long|this|void|with|await|break|catch|class|const|final|float|short|super|throw|while|yield|delete|double|export|import|native|return|switch|throws|typeof|boolean|default|extends|finally|package|private|abstract|continue|debugger|function|volatile|interface|protected|transient|implements|instanceof|synchronized)$/; + +/** + * Turn a value into the JavaScript that creates an equivalent value + * @param {any} value + * @param {(value: any) => string | void} [replacer] + */ +function uneval(value, replacer) { + const counts = new Map(); + + /** @type {string[]} */ + const keys = []; + + const custom = new Map(); + + /** @param {any} thing */ + function walk(thing) { + if (typeof thing === 'function') { + throw new DevalueError(`Cannot stringify a function`, keys); + } + + if (!is_primitive(thing)) { + if (counts.has(thing)) { + counts.set(thing, counts.get(thing) + 1); + return; + } + + counts.set(thing, 1); + + if (replacer) { + const str = replacer(thing); + + if (typeof str === 'string') { + custom.set(thing, str); + return; + } + } + + const type = get_type(thing); + + switch (type) { + case 'Number': + case 'BigInt': + case 'String': + case 'Boolean': + case 'Date': + case 'RegExp': + return; + + case 'Array': + /** @type {any[]} */ (thing).forEach((value, i) => { + keys.push(`[${i}]`); + walk(value); + keys.pop(); + }); + break; + + case 'Set': + Array.from(thing).forEach(walk); + break; + + case 'Map': + for (const [key, value] of thing) { + keys.push( + `.get(${is_primitive(key) ? stringify_primitive$1(key) : '...'})` + ); + walk(value); + keys.pop(); + } + break; + + default: + if (!is_plain_object(thing)) { + throw new DevalueError( + `Cannot stringify arbitrary non-POJOs`, + keys + ); + } + + if (Object.getOwnPropertySymbols(thing).length > 0) { + throw new DevalueError( + `Cannot stringify POJOs with symbolic keys`, + keys + ); + } + + for (const key in thing) { + keys.push(`.${key}`); + walk(thing[key]); + keys.pop(); + } + } + } + } + + walk(value); + + const names = new Map(); + + Array.from(counts) + .filter((entry) => entry[1] > 1) + .sort((a, b) => b[1] - a[1]) + .forEach((entry, i) => { + names.set(entry[0], get_name(i)); + }); + + /** + * @param {any} thing + * @returns {string} + */ + function stringify(thing) { + if (names.has(thing)) { + return names.get(thing); + } + + if (is_primitive(thing)) { + return stringify_primitive$1(thing); + } + + if (custom.has(thing)) { + return custom.get(thing); + } + + const type = get_type(thing); + + switch (type) { + case 'Number': + case 'String': + case 'Boolean': + return `Object(${stringify(thing.valueOf())})`; + + case 'RegExp': + return `new RegExp(${stringify_string(thing.source)}, "${ + thing.flags + }")`; + + case 'Date': + return `new Date(${thing.getTime()})`; + + case 'Array': + const members = /** @type {any[]} */ (thing).map((v, i) => + i in thing ? stringify(v) : '' + ); + const tail = thing.length === 0 || thing.length - 1 in thing ? '' : ','; + return `[${members.join(',')}${tail}]`; + + case 'Set': + case 'Map': + return `new ${type}([${Array.from(thing).map(stringify).join(',')}])`; + + default: + const obj = `{${Object.keys(thing) + .map((key) => `${safe_key(key)}:${stringify(thing[key])}`) + .join(',')}}`; + const proto = Object.getPrototypeOf(thing); + if (proto === null) { + return Object.keys(thing).length > 0 + ? `Object.assign(Object.create(null),${obj})` + : `Object.create(null)`; + } + + return obj; + } + } + + const str = stringify(value); + + if (names.size) { + /** @type {string[]} */ + const params = []; + + /** @type {string[]} */ + const statements = []; + + /** @type {string[]} */ + const values = []; + + names.forEach((name, thing) => { + params.push(name); + + if (custom.has(thing)) { + values.push(/** @type {string} */ (custom.get(thing))); + return; + } + + if (is_primitive(thing)) { + values.push(stringify_primitive$1(thing)); + return; + } + + const type = get_type(thing); + + switch (type) { + case 'Number': + case 'String': + case 'Boolean': + values.push(`Object(${stringify(thing.valueOf())})`); + break; + + case 'RegExp': + values.push(thing.toString()); + break; + + case 'Date': + values.push(`new Date(${thing.getTime()})`); + break; + + case 'Array': + values.push(`Array(${thing.length})`); + /** @type {any[]} */ (thing).forEach((v, i) => { + statements.push(`${name}[${i}]=${stringify(v)}`); + }); + break; + + case 'Set': + values.push(`new Set`); + statements.push( + `${name}.${Array.from(thing) + .map((v) => `add(${stringify(v)})`) + .join('.')}` + ); + break; + + case 'Map': + values.push(`new Map`); + statements.push( + `${name}.${Array.from(thing) + .map(([k, v]) => `set(${stringify(k)}, ${stringify(v)})`) + .join('.')}` + ); + break; + + default: + values.push( + Object.getPrototypeOf(thing) === null ? 'Object.create(null)' : '{}' + ); + Object.keys(thing).forEach((key) => { + statements.push( + `${name}${safe_prop(key)}=${stringify(thing[key])}` + ); + }); + } + }); + + statements.push(`return ${str}`); + + return `(function(${params.join(',')}){${statements.join( + ';' + )}}(${values.join(',')}))`; + } else { + return str; + } +} + +/** @param {number} num */ +function get_name(num) { + let name = ''; + + do { + name = chars$1[num % chars$1.length] + name; + num = ~~(num / chars$1.length) - 1; + } while (num >= 0); + + return reserved.test(name) ? `${name}0` : name; +} + +/** @param {string} c */ +function escape_unsafe_char(c) { + return escaped[c] || c; +} + +/** @param {string} str */ +function escape_unsafe_chars(str) { + return str.replace(unsafe_chars, escape_unsafe_char); +} + +/** @param {string} key */ +function safe_key(key) { + return /^[_$a-zA-Z][_$a-zA-Z0-9]*$/.test(key) + ? key + : escape_unsafe_chars(JSON.stringify(key)); +} + +/** @param {string} key */ +function safe_prop(key) { + return /^[_$a-zA-Z][_$a-zA-Z0-9]*$/.test(key) + ? `.${key}` + : `[${escape_unsafe_chars(JSON.stringify(key))}]`; +} + +/** @param {any} thing */ +function stringify_primitive$1(thing) { + if (typeof thing === 'string') return stringify_string(thing); + if (thing === void 0) return 'void 0'; + if (thing === 0 && 1 / thing < 0) return '-0'; + const str = String(thing); + if (typeof thing === 'number') return str.replace(/^(-)?0\./, '$1.'); + if (typeof thing === 'bigint') return thing + 'n'; + return str; +} + +const UNDEFINED = -1; +const HOLE = -2; +const NAN = -3; +const POSITIVE_INFINITY = -4; +const NEGATIVE_INFINITY = -5; +const NEGATIVE_ZERO = -6; + +/** + * Turn a value into a JSON string that can be parsed with `devalue.parse` + * @param {any} value + * @param {Record any>} [reducers] + */ +function stringify(value, reducers) { + /** @type {any[]} */ + const stringified = []; + + /** @type {Map} */ + const indexes = new Map(); + + /** @type {Array<{ key: string, fn: (value: any) => any }>} */ + const custom = []; + for (const key in reducers) { + custom.push({ key, fn: reducers[key] }); + } + + /** @type {string[]} */ + const keys = []; + + let p = 0; + + /** @param {any} thing */ + function flatten(thing) { + if (typeof thing === 'function') { + throw new DevalueError(`Cannot stringify a function`, keys); + } + + if (indexes.has(thing)) return indexes.get(thing); + + if (thing === undefined) return UNDEFINED; + if (Number.isNaN(thing)) return NAN; + if (thing === Infinity) return POSITIVE_INFINITY; + if (thing === -Infinity) return NEGATIVE_INFINITY; + if (thing === 0 && 1 / thing < 0) return NEGATIVE_ZERO; + + const index = p++; + indexes.set(thing, index); + + for (const { key, fn } of custom) { + const value = fn(thing); + if (value) { + stringified[index] = `["${key}",${flatten(value)}]`; + return index; + } + } + + let str = ''; + + if (is_primitive(thing)) { + str = stringify_primitive(thing); + } else { + const type = get_type(thing); + + switch (type) { + case 'Number': + case 'String': + case 'Boolean': + str = `["Object",${stringify_primitive(thing)}]`; + break; + + case 'BigInt': + str = `["BigInt",${thing}]`; + break; + + case 'Date': + str = `["Date","${thing.toISOString()}"]`; + break; + + case 'RegExp': + const { source, flags } = thing; + str = flags + ? `["RegExp",${stringify_string(source)},"${flags}"]` + : `["RegExp",${stringify_string(source)}]`; + break; + + case 'Array': + str = '['; + + for (let i = 0; i < thing.length; i += 1) { + if (i > 0) str += ','; + + if (i in thing) { + keys.push(`[${i}]`); + str += flatten(thing[i]); + keys.pop(); + } else { + str += HOLE; + } + } + + str += ']'; + + break; + + case 'Set': + str = '["Set"'; + + for (const value of thing) { + str += `,${flatten(value)}`; + } + + str += ']'; + break; + + case 'Map': + str = '["Map"'; + + for (const [key, value] of thing) { + keys.push( + `.get(${is_primitive(key) ? stringify_primitive(key) : '...'})` + ); + str += `,${flatten(key)},${flatten(value)}`; + } + + str += ']'; + break; + + default: + if (!is_plain_object(thing)) { + throw new DevalueError( + `Cannot stringify arbitrary non-POJOs`, + keys + ); + } + + if (Object.getOwnPropertySymbols(thing).length > 0) { + throw new DevalueError( + `Cannot stringify POJOs with symbolic keys`, + keys + ); + } + + if (Object.getPrototypeOf(thing) === null) { + str = '["null"'; + for (const key in thing) { + keys.push(`.${key}`); + str += `,${stringify_string(key)},${flatten(thing[key])}`; + keys.pop(); + } + str += ']'; + } else { + str = '{'; + let started = false; + for (const key in thing) { + if (started) str += ','; + started = true; + keys.push(`.${key}`); + str += `${stringify_string(key)}:${flatten(thing[key])}`; + keys.pop(); + } + str += '}'; + } + } + } + + stringified[index] = str; + return index; + } + + const index = flatten(value); + + // special case — value is represented as a negative index + if (index < 0) return `${index}`; + + return `[${stringified.join(',')}]`; +} + +/** + * @param {any} thing + * @returns {string} + */ +function stringify_primitive(thing) { + const type = typeof thing; + if (type === 'string') return stringify_string(thing); + if (thing instanceof String) return stringify_string(thing.toString()); + if (thing === void 0) return UNDEFINED.toString(); + if (thing === 0 && 1 / thing < 0) return NEGATIVE_ZERO.toString(); + if (type === 'bigint') return `["BigInt","${thing}"]`; + return String(thing); +} + +var cookie = {}; + +/*! + * cookie + * Copyright(c) 2012-2014 Roman Shtylman + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ + +var hasRequiredCookie; + +function requireCookie () { + if (hasRequiredCookie) return cookie; + hasRequiredCookie = 1; + + /** + * Module exports. + * @public + */ + + cookie.parse = parse; + cookie.serialize = serialize; + + /** + * Module variables. + * @private + */ + + var __toString = Object.prototype.toString; + + /** + * RegExp to match field-content in RFC 7230 sec 3.2 + * + * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ] + * field-vchar = VCHAR / obs-text + * obs-text = %x80-FF + */ + + var fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/; + + /** + * Parse a cookie header. + * + * Parse the given cookie header string into an object + * The object has the various cookies as keys(names) => values + * + * @param {string} str + * @param {object} [options] + * @return {object} + * @public + */ + + function parse(str, options) { + if (typeof str !== 'string') { + throw new TypeError('argument str must be a string'); + } + + var obj = {}; + var opt = options || {}; + var dec = opt.decode || decode; + + var index = 0; + while (index < str.length) { + var eqIdx = str.indexOf('=', index); + + // no more cookie pairs + if (eqIdx === -1) { + break + } + + var endIdx = str.indexOf(';', index); + + if (endIdx === -1) { + endIdx = str.length; + } else if (endIdx < eqIdx) { + // backtrack on prior semicolon + index = str.lastIndexOf(';', eqIdx - 1) + 1; + continue + } + + var key = str.slice(index, eqIdx).trim(); + + // only assign once + if (undefined === obj[key]) { + var val = str.slice(eqIdx + 1, endIdx).trim(); + + // quoted values + if (val.charCodeAt(0) === 0x22) { + val = val.slice(1, -1); + } + + obj[key] = tryDecode(val, dec); + } + + index = endIdx + 1; + } + + return obj; + } + + /** + * Serialize data into a cookie header. + * + * Serialize the a name value pair into a cookie string suitable for + * http headers. An optional options object specified cookie parameters. + * + * serialize('foo', 'bar', { httpOnly: true }) + * => "foo=bar; httpOnly" + * + * @param {string} name + * @param {string} val + * @param {object} [options] + * @return {string} + * @public + */ + + function serialize(name, val, options) { + var opt = options || {}; + var enc = opt.encode || encode; + + if (typeof enc !== 'function') { + throw new TypeError('option encode is invalid'); + } + + if (!fieldContentRegExp.test(name)) { + throw new TypeError('argument name is invalid'); + } + + var value = enc(val); + + if (value && !fieldContentRegExp.test(value)) { + throw new TypeError('argument val is invalid'); + } + + var str = name + '=' + value; + + if (null != opt.maxAge) { + var maxAge = opt.maxAge - 0; + + if (isNaN(maxAge) || !isFinite(maxAge)) { + throw new TypeError('option maxAge is invalid') + } + + str += '; Max-Age=' + Math.floor(maxAge); + } + + if (opt.domain) { + if (!fieldContentRegExp.test(opt.domain)) { + throw new TypeError('option domain is invalid'); + } + + str += '; Domain=' + opt.domain; + } + + if (opt.path) { + if (!fieldContentRegExp.test(opt.path)) { + throw new TypeError('option path is invalid'); + } + + str += '; Path=' + opt.path; + } + + if (opt.expires) { + var expires = opt.expires; + + if (!isDate(expires) || isNaN(expires.valueOf())) { + throw new TypeError('option expires is invalid'); + } + + str += '; Expires=' + expires.toUTCString(); + } + + if (opt.httpOnly) { + str += '; HttpOnly'; + } + + if (opt.secure) { + str += '; Secure'; + } + + if (opt.priority) { + var priority = typeof opt.priority === 'string' + ? opt.priority.toLowerCase() + : opt.priority; + + switch (priority) { + case 'low': + str += '; Priority=Low'; + break + case 'medium': + str += '; Priority=Medium'; + break + case 'high': + str += '; Priority=High'; + break + default: + throw new TypeError('option priority is invalid') + } + } + + if (opt.sameSite) { + var sameSite = typeof opt.sameSite === 'string' + ? opt.sameSite.toLowerCase() : opt.sameSite; + + switch (sameSite) { + case true: + str += '; SameSite=Strict'; + break; + case 'lax': + str += '; SameSite=Lax'; + break; + case 'strict': + str += '; SameSite=Strict'; + break; + case 'none': + str += '; SameSite=None'; + break; + default: + throw new TypeError('option sameSite is invalid'); + } + } + + return str; + } + + /** + * URL-decode string value. Optimized to skip native call when no %. + * + * @param {string} str + * @returns {string} + */ + + function decode (str) { + return str.indexOf('%') !== -1 + ? decodeURIComponent(str) + : str + } + + /** + * URL-encode value. + * + * @param {string} str + * @returns {string} + */ + + function encode (val) { + return encodeURIComponent(val) + } + + /** + * Determine if value is a Date. + * + * @param {*} val + * @private + */ + + function isDate (val) { + return __toString.call(val) === '[object Date]' || + val instanceof Date + } + + /** + * Try decoding a string using a decoding function. + * + * @param {string} str + * @param {function} decode + * @private + */ + + function tryDecode(str, decode) { + try { + return decode(str); + } catch (e) { + return str; + } + } + return cookie; +} + +var cookieExports = requireCookie(); + +var setCookie = {exports: {}}; + +var hasRequiredSetCookie; + +function requireSetCookie () { + if (hasRequiredSetCookie) return setCookie.exports; + hasRequiredSetCookie = 1; + + var defaultParseOptions = { + decodeValues: true, + map: false, + silent: false, + }; + + function isNonEmptyString(str) { + return typeof str === "string" && !!str.trim(); + } + + function parseString(setCookieValue, options) { + var parts = setCookieValue.split(";").filter(isNonEmptyString); + + var nameValuePairStr = parts.shift(); + var parsed = parseNameValuePair(nameValuePairStr); + var name = parsed.name; + var value = parsed.value; + + options = options + ? Object.assign({}, defaultParseOptions, options) + : defaultParseOptions; + + try { + value = options.decodeValues ? decodeURIComponent(value) : value; // decode cookie value + } catch (e) { + console.error( + "set-cookie-parser encountered an error while decoding a cookie with value '" + + value + + "'. Set options.decodeValues to false to disable this feature.", + e + ); + } + + var cookie = { + name: name, + value: value, + }; + + parts.forEach(function (part) { + var sides = part.split("="); + var key = sides.shift().trimLeft().toLowerCase(); + var value = sides.join("="); + if (key === "expires") { + cookie.expires = new Date(value); + } else if (key === "max-age") { + cookie.maxAge = parseInt(value, 10); + } else if (key === "secure") { + cookie.secure = true; + } else if (key === "httponly") { + cookie.httpOnly = true; + } else if (key === "samesite") { + cookie.sameSite = value; + } else { + cookie[key] = value; + } + }); + + return cookie; + } + + function parseNameValuePair(nameValuePairStr) { + // Parses name-value-pair according to rfc6265bis draft + + var name = ""; + var value = ""; + var nameValueArr = nameValuePairStr.split("="); + if (nameValueArr.length > 1) { + name = nameValueArr.shift(); + value = nameValueArr.join("="); // everything after the first =, joined by a "=" if there was more than one part + } else { + value = nameValuePairStr; + } + + return { name: name, value: value }; + } + + function parse(input, options) { + options = options + ? Object.assign({}, defaultParseOptions, options) + : defaultParseOptions; + + if (!input) { + if (!options.map) { + return []; + } else { + return {}; + } + } + + if (input.headers) { + if (typeof input.headers.getSetCookie === "function") { + // for fetch responses - they combine headers of the same type in the headers array, + // but getSetCookie returns an uncombined array + input = input.headers.getSetCookie(); + } else if (input.headers["set-cookie"]) { + // fast-path for node.js (which automatically normalizes header names to lower-case + input = input.headers["set-cookie"]; + } else { + // slow-path for other environments - see #25 + var sch = + input.headers[ + Object.keys(input.headers).find(function (key) { + return key.toLowerCase() === "set-cookie"; + }) + ]; + // warn if called on a request-like object with a cookie header rather than a set-cookie header - see #34, 36 + if (!sch && input.headers.cookie && !options.silent) { + console.warn( + "Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning." + ); + } + input = sch; + } + } + if (!Array.isArray(input)) { + input = [input]; + } + + options = options + ? Object.assign({}, defaultParseOptions, options) + : defaultParseOptions; + + if (!options.map) { + return input.filter(isNonEmptyString).map(function (str) { + return parseString(str, options); + }); + } else { + var cookies = {}; + return input.filter(isNonEmptyString).reduce(function (cookies, str) { + var cookie = parseString(str, options); + cookies[cookie.name] = cookie; + return cookies; + }, cookies); + } + } + + /* + Set-Cookie header field-values are sometimes comma joined in one string. This splits them without choking on commas + that are within a single set-cookie field-value, such as in the Expires portion. + + This is uncommon, but explicitly allowed - see https://tools.ietf.org/html/rfc2616#section-4.2 + Node.js does this for every header *except* set-cookie - see https://github.com/nodejs/node/blob/d5e363b77ebaf1caf67cd7528224b651c86815c1/lib/_http_incoming.js#L128 + React Native's fetch does this for *every* header, including set-cookie. + + Based on: https://github.com/google/j2objc/commit/16820fdbc8f76ca0c33472810ce0cb03d20efe25 + Credits to: https://github.com/tomball for original and https://github.com/chrusart for JavaScript implementation + */ + function splitCookiesString(cookiesString) { + if (Array.isArray(cookiesString)) { + return cookiesString; + } + if (typeof cookiesString !== "string") { + return []; + } + + var cookiesStrings = []; + var pos = 0; + var start; + var ch; + var lastComma; + var nextStart; + var cookiesSeparatorFound; + + function skipWhitespace() { + while (pos < cookiesString.length && /\s/.test(cookiesString.charAt(pos))) { + pos += 1; + } + return pos < cookiesString.length; + } + + function notSpecialChar() { + ch = cookiesString.charAt(pos); + + return ch !== "=" && ch !== ";" && ch !== ","; + } + + while (pos < cookiesString.length) { + start = pos; + cookiesSeparatorFound = false; + + while (skipWhitespace()) { + ch = cookiesString.charAt(pos); + if (ch === ",") { + // ',' is a cookie separator if we have later first '=', not ';' or ',' + lastComma = pos; + pos += 1; + + skipWhitespace(); + nextStart = pos; + + while (pos < cookiesString.length && notSpecialChar()) { + pos += 1; + } + + // currently special character + if (pos < cookiesString.length && cookiesString.charAt(pos) === "=") { + // we found cookies separator + cookiesSeparatorFound = true; + // pos is inside the next cookie, so back up and return it. + pos = nextStart; + cookiesStrings.push(cookiesString.substring(start, lastComma)); + start = pos; + } else { + // in param ',' or param separator ';', + // we continue from that comma + pos = lastComma + 1; + } + } else { + pos += 1; + } + } + + if (!cookiesSeparatorFound || pos >= cookiesString.length) { + cookiesStrings.push(cookiesString.substring(start, cookiesString.length)); + } + } + + return cookiesStrings; + } + + setCookie.exports = parse; + setCookie.exports.parse = parse; + setCookie.exports.parseString = parseString; + setCookie.exports.splitCookiesString = splitCookiesString; + return setCookie.exports; +} + +var setCookieExports = requireSetCookie(); + +const DEV = false; +const SVELTE_KIT_ASSETS = "/_svelte_kit_assets"; +const ENDPOINT_METHODS = /* @__PURE__ */ new Set([ + "GET", + "POST", + "PUT", + "PATCH", + "DELETE", + "OPTIONS", + "HEAD" +]); +const PAGE_METHODS = /* @__PURE__ */ new Set(["GET", "POST", "HEAD"]); +function negotiate(accept, types) { + const parts = []; + accept.split(",").forEach((str, i) => { + const match = /([^/]+)\/([^;]+)(?:;q=([0-9.]+))?/.exec(str); + if (match) { + const [, type, subtype, q = "1"] = match; + parts.push({ type, subtype, q: +q, i }); + } + }); + parts.sort((a, b) => { + if (a.q !== b.q) { + return b.q - a.q; + } + if (a.subtype === "*" !== (b.subtype === "*")) { + return a.subtype === "*" ? 1 : -1; + } + if (a.type === "*" !== (b.type === "*")) { + return a.type === "*" ? 1 : -1; + } + return a.i - b.i; + }); + let accepted; + let min_priority = Infinity; + for (const mimetype of types) { + const [type, subtype] = mimetype.split("/"); + const priority = parts.findIndex( + (part) => (part.type === type || part.type === "*") && (part.subtype === subtype || part.subtype === "*") + ); + if (priority !== -1 && priority < min_priority) { + accepted = mimetype; + min_priority = priority; + } + } + return accepted; +} +function is_content_type(request, ...types) { + const type = request.headers.get("content-type")?.split(";", 1)[0].trim() ?? ""; + return types.includes(type.toLowerCase()); +} +function is_form_content_type(request) { + return is_content_type( + request, + "application/x-www-form-urlencoded", + "multipart/form-data", + "text/plain" + ); +} +class HttpError { + /** + * @param {number} status + * @param {{message: string} extends App.Error ? (App.Error | string | undefined) : App.Error} body + */ + constructor(status, body) { + this.status = status; + if (typeof body === "string") { + this.body = { message: body }; + } else if (body) { + this.body = body; + } else { + this.body = { message: `Error: ${status}` }; + } + } + toString() { + return JSON.stringify(this.body); + } +} +class Redirect { + /** + * @param {300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308} status + * @param {string} location + */ + constructor(status, location) { + this.status = status; + this.location = location; + } +} +class ActionFailure { + /** + * @param {number} status + * @param {T} [data] + */ + constructor(status, data) { + this.status = status; + this.data = data; + } +} +function exec(match, params, matchers) { + const result = {}; + const values = match.slice(1); + let buffered = 0; + for (let i = 0; i < params.length; i += 1) { + const param = params[i]; + let value = values[i - buffered]; + if (param.chained && param.rest && buffered) { + value = values.slice(i - buffered, i + 1).filter((s2) => s2).join("/"); + buffered = 0; + } + if (value === void 0) { + if (param.rest) + result[param.name] = ""; + continue; + } + if (!param.matcher || matchers[param.matcher](value)) { + result[param.name] = value; + const next_param = params[i + 1]; + const next_value = values[i + 1]; + if (next_param && !next_param.rest && next_param.optional && next_value && param.chained) { + buffered = 0; + } + continue; + } + if (param.optional && param.chained) { + buffered++; + continue; + } + return; + } + if (buffered) + return; + return result; +} +function error(status, body) { + if (isNaN(status) || status < 400 || status > 599) { + throw new Error(`HTTP error status codes must be between 400 and 599 — ${status} is invalid`); + } + return new HttpError(status, body); +} +function json(data, init2) { + const body = JSON.stringify(data); + const headers = new Headers(init2?.headers); + if (!headers.has("content-length")) { + headers.set("content-length", encoder$3.encode(body).byteLength.toString()); + } + if (!headers.has("content-type")) { + headers.set("content-type", "application/json"); + } + return new Response(body, { + ...init2, + headers + }); +} +const encoder$3 = new TextEncoder(); +function text(body, init2) { + const headers = new Headers(init2?.headers); + if (!headers.has("content-length")) { + const encoded = encoder$3.encode(body); + headers.set("content-length", encoded.byteLength.toString()); + return new Response(encoded, { + ...init2, + headers + }); + } + return new Response(body, { + ...init2, + headers + }); +} +function coalesce_to_error(err) { + return err instanceof Error || err && /** @type {any} */ + err.name && /** @type {any} */ + err.message ? ( + /** @type {Error} */ + err + ) : new Error(JSON.stringify(err)); +} +function normalize_error(error2) { + return ( + /** @type {import('../runtime/control.js').Redirect | import('../runtime/control.js').HttpError | Error} */ + error2 + ); +} +function method_not_allowed(mod, method) { + return text(`${method} method not allowed`, { + status: 405, + headers: { + // https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/405 + // "The server must generate an Allow header field in a 405 status code response" + allow: allowed_methods(mod).join(", ") + } + }); +} +function allowed_methods(mod) { + const allowed = Array.from(ENDPOINT_METHODS).filter((method) => method in mod); + if ("GET" in mod || "HEAD" in mod) + allowed.push("HEAD"); + return allowed; +} +function static_error_page(options2, status, message) { + let page = options2.templates.error({ status, message }); + return text(page, { + headers: { "content-type": "text/html; charset=utf-8" }, + status + }); +} +async function handle_fatal_error(event, options2, error2) { + error2 = error2 instanceof HttpError ? error2 : coalesce_to_error(error2); + const status = error2 instanceof HttpError ? error2.status : 500; + const body = await handle_error_and_jsonify(event, options2, error2); + const type = negotiate(event.request.headers.get("accept") || "text/html", [ + "application/json", + "text/html" + ]); + if (event.isDataRequest || type === "application/json") { + return json(body, { + status + }); + } + return static_error_page(options2, status, body.message); +} +async function handle_error_and_jsonify(event, options2, error2) { + if (error2 instanceof HttpError) { + return error2.body; + } else { + return await options2.hooks.handleError({ error: error2, event }) ?? { + message: event.route.id != null ? "Internal Error" : "Not Found" + }; + } +} +function redirect_response(status, location) { + const response = new Response(void 0, { + status, + headers: { location } + }); + return response; +} +function clarify_devalue_error(event, error2) { + if (error2.path) { + return `Data returned from \`load\` while rendering ${event.route.id} is not serializable: ${error2.message} (data${error2.path})`; + } + if (error2.path === "") { + return `Data returned from \`load\` while rendering ${event.route.id} is not a plain object`; + } + return error2.message; +} +function stringify_uses(node) { + const uses = []; + if (node.uses && node.uses.dependencies.size > 0) { + uses.push(`"dependencies":${JSON.stringify(Array.from(node.uses.dependencies))}`); + } + if (node.uses && node.uses.params.size > 0) { + uses.push(`"params":${JSON.stringify(Array.from(node.uses.params))}`); + } + if (node.uses?.parent) + uses.push('"parent":1'); + if (node.uses?.route) + uses.push('"route":1'); + if (node.uses?.url) + uses.push('"url":1'); + return `"uses":{${uses.join(",")}}`; +} +async function render_endpoint(event, mod, state) { + const method = ( + /** @type {import('types').HttpMethod} */ + event.request.method + ); + let handler = mod[method] || mod.fallback; + if (method === "HEAD" && mod.GET && !mod.HEAD) { + handler = mod.GET; + } + if (!handler) { + return method_not_allowed(mod, method); + } + const prerender = mod.prerender ?? state.prerender_default; + if (prerender && (mod.POST || mod.PATCH || mod.PUT || mod.DELETE)) { + throw new Error("Cannot prerender endpoints that have mutative methods"); + } + if (state.prerendering && !prerender) { + if (state.depth > 0) { + throw new Error(`${event.route.id} is not prerenderable`); + } else { + return new Response(void 0, { status: 204 }); + } + } + try { + let response = await handler( + /** @type {import('@sveltejs/kit').RequestEvent>} */ + event + ); + if (!(response instanceof Response)) { + throw new Error( + `Invalid response from route ${event.url.pathname}: handler should return a Response object` + ); + } + if (state.prerendering) { + response = new Response(response.body, { + status: response.status, + statusText: response.statusText, + headers: new Headers(response.headers) + }); + response.headers.set("x-sveltekit-prerender", String(prerender)); + } + return response; + } catch (e) { + if (e instanceof Redirect) { + return new Response(void 0, { + status: e.status, + headers: { location: e.location } + }); + } + throw e; + } +} +function is_endpoint_request(event) { + const { method, headers } = event.request; + if (ENDPOINT_METHODS.has(method) && !PAGE_METHODS.has(method)) { + return true; + } + if (method === "POST" && headers.get("x-sveltekit-action") === "true") + return false; + const accept = event.request.headers.get("accept") ?? "*/*"; + return negotiate(accept, ["*", "text/html"]) !== "text/html"; +} +function compact(arr) { + return arr.filter( + /** @returns {val is NonNullable} */ + (val) => val != null + ); +} +function normalize_path(path, trailing_slash) { + if (path === "/" || trailing_slash === "ignore") + return path; + if (trailing_slash === "never") { + return path.endsWith("/") ? path.slice(0, -1) : path; + } else if (trailing_slash === "always" && !path.endsWith("/")) { + return path + "/"; + } + return path; +} +function decode_pathname(pathname) { + return pathname.split("%25").map(decodeURI).join("%25"); +} +function decode_params(params) { + for (const key2 in params) { + params[key2] = decodeURIComponent(params[key2]); + } + return params; +} +const tracked_url_properties = ( + /** @type {const} */ + [ + "href", + "pathname", + "search", + "searchParams", + "toString", + "toJSON" + ] +); +function make_trackable(url, callback) { + const tracked = new URL(url); + for (const property of tracked_url_properties) { + Object.defineProperty(tracked, property, { + get() { + callback(); + return url[property]; + }, + enumerable: true, + configurable: true + }); + } + { + tracked[Symbol.for("nodejs.util.inspect.custom")] = (depth, opts, inspect) => { + return inspect(url, opts); + }; + } + disable_hash(tracked); + return tracked; +} +function disable_hash(url) { + allow_nodejs_console_log(url); + Object.defineProperty(url, "hash", { + get() { + throw new Error( + "Cannot access event.url.hash. Consider using `$page.url.hash` inside a component instead" + ); + } + }); +} +function disable_search(url) { + allow_nodejs_console_log(url); + for (const property of ["search", "searchParams"]) { + Object.defineProperty(url, property, { + get() { + throw new Error(`Cannot access url.${property} on a page with prerendering enabled`); + } + }); + } +} +function allow_nodejs_console_log(url) { + { + url[Symbol.for("nodejs.util.inspect.custom")] = (depth, opts, inspect) => { + return inspect(new URL(url), opts); + }; + } +} +const DATA_SUFFIX = "/__data.json"; +function has_data_suffix(pathname) { + return pathname.endsWith(DATA_SUFFIX); +} +function add_data_suffix(pathname) { + return pathname.replace(/\/$/, "") + DATA_SUFFIX; +} +function strip_data_suffix(pathname) { + return pathname.slice(0, -DATA_SUFFIX.length); +} +function is_action_json_request(event) { + const accept = negotiate(event.request.headers.get("accept") ?? "*/*", [ + "application/json", + "text/html" + ]); + return accept === "application/json" && event.request.method === "POST"; +} +async function handle_action_json_request(event, options2, server) { + const actions = server?.actions; + if (!actions) { + const no_actions_error = error(405, "POST method not allowed. No actions exist for this page"); + return action_json( + { + type: "error", + error: await handle_error_and_jsonify(event, options2, no_actions_error) + }, + { + status: no_actions_error.status, + headers: { + // https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/405 + // "The server must generate an Allow header field in a 405 status code response" + allow: "GET" + } + } + ); + } + check_named_default_separate(actions); + try { + const data = await call_action(event, actions); + if (false) + ; + if (data instanceof ActionFailure) { + return action_json({ + type: "failure", + status: data.status, + // @ts-expect-error we assign a string to what is supposed to be an object. That's ok + // because we don't use the object outside, and this way we have better code navigation + // through knowing where the related interface is used. + data: stringify_action_response( + data.data, + /** @type {string} */ + event.route.id + ) + }); + } else { + return action_json({ + type: "success", + status: data ? 200 : 204, + // @ts-expect-error see comment above + data: stringify_action_response( + data, + /** @type {string} */ + event.route.id + ) + }); + } + } catch (e) { + const err = normalize_error(e); + if (err instanceof Redirect) { + return action_json_redirect(err); + } + return action_json( + { + type: "error", + error: await handle_error_and_jsonify(event, options2, check_incorrect_fail_use(err)) + }, + { + status: err instanceof HttpError ? err.status : 500 + } + ); + } +} +function check_incorrect_fail_use(error2) { + return error2 instanceof ActionFailure ? new Error('Cannot "throw fail()". Use "return fail()"') : error2; +} +function action_json_redirect(redirect) { + return action_json({ + type: "redirect", + status: redirect.status, + location: redirect.location + }); +} +function action_json(data, init2) { + return json(data, init2); +} +function is_action_request(event) { + return event.request.method === "POST"; +} +async function handle_action_request(event, server) { + const actions = server?.actions; + if (!actions) { + event.setHeaders({ + // https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/405 + // "The server must generate an Allow header field in a 405 status code response" + allow: "GET" + }); + return { + type: "error", + error: error(405, "POST method not allowed. No actions exist for this page") + }; + } + check_named_default_separate(actions); + try { + const data = await call_action(event, actions); + if (false) + ; + if (data instanceof ActionFailure) { + return { + type: "failure", + status: data.status, + data: data.data + }; + } else { + return { + type: "success", + status: 200, + // @ts-expect-error this will be removed upon serialization, so `undefined` is the same as omission + data + }; + } + } catch (e) { + const err = normalize_error(e); + if (err instanceof Redirect) { + return { + type: "redirect", + status: err.status, + location: err.location + }; + } + return { + type: "error", + error: check_incorrect_fail_use(err) + }; + } +} +function check_named_default_separate(actions) { + if (actions.default && Object.keys(actions).length > 1) { + throw new Error( + "When using named actions, the default action cannot be used. See the docs for more info: https://kit.svelte.dev/docs/form-actions#named-actions" + ); + } +} +async function call_action(event, actions) { + const url = new URL(event.request.url); + let name = "default"; + for (const param of url.searchParams) { + if (param[0].startsWith("/")) { + name = param[0].slice(1); + if (name === "default") { + throw new Error('Cannot use reserved action name "default"'); + } + break; + } + } + const action = actions[name]; + if (!action) { + throw new Error(`No action with name '${name}' found`); + } + if (!is_form_content_type(event.request)) { + throw new Error( + `Actions expect form-encoded data (received ${event.request.headers.get("content-type")})` + ); + } + return action(event); +} +function uneval_action_response(data, route_id) { + return try_deserialize(data, uneval, route_id); +} +function stringify_action_response(data, route_id) { + return try_deserialize(data, stringify, route_id); +} +function try_deserialize(data, fn, route_id) { + try { + return fn(data); + } catch (e) { + const error2 = ( + /** @type {any} */ + e + ); + if ("path" in error2) { + let message = `Data returned from action inside ${route_id} is not serializable: ${error2.message}`; + if (error2.path !== "") + message += ` (data.${error2.path})`; + throw new Error(message); + } + throw error2; + } +} +async function unwrap_promises(object) { + for (const key2 in object) { + if (typeof object[key2]?.then === "function") { + return Object.fromEntries( + await Promise.all(Object.entries(object).map(async ([key3, value]) => [key3, await value])) + ); + } + } + return object; +} +const INVALIDATED_PARAM = "x-sveltekit-invalidated"; +const TRAILING_SLASH_PARAM = "x-sveltekit-trailing-slash"; +async function load_server_data({ + event, + state, + node, + parent, + // TODO 2.0: Remove this + track_server_fetches +}) { + if (!node?.server) + return null; + const uses = { + dependencies: /* @__PURE__ */ new Set(), + params: /* @__PURE__ */ new Set(), + parent: false, + route: false, + url: false + }; + const url = make_trackable(event.url, () => { + uses.url = true; + }); + if (state.prerendering) { + disable_search(url); + } + const result = await node.server.load?.call(null, { + ...event, + fetch: (info, init2) => { + const url2 = new URL(info instanceof Request ? info.url : info, event.url); + if (track_server_fetches) { + uses.dependencies.add(url2.href); + } + return event.fetch(info, init2); + }, + /** @param {string[]} deps */ + depends: (...deps) => { + for (const dep of deps) { + const { href } = new URL(dep, event.url); + uses.dependencies.add(href); + } + }, + params: new Proxy(event.params, { + get: (target, key2) => { + uses.params.add(key2); + return target[ + /** @type {string} */ + key2 + ]; + } + }), + parent: async () => { + uses.parent = true; + return parent(); + }, + route: new Proxy(event.route, { + get: (target, key2) => { + uses.route = true; + return target[ + /** @type {'id'} */ + key2 + ]; + } + }), + url + }); + const data = result ? await unwrap_promises(result) : null; + return { + type: "data", + data, + uses, + slash: node.server.trailingSlash + }; +} +async function load_data({ + event, + fetched, + node, + parent, + server_data_promise, + state, + resolve_opts, + csr +}) { + const server_data_node = await server_data_promise; + if (!node?.universal?.load) { + return server_data_node?.data ?? null; + } + const result = await node.universal.load.call(null, { + url: event.url, + params: event.params, + data: server_data_node?.data ?? null, + route: event.route, + fetch: create_universal_fetch(event, state, fetched, csr, resolve_opts), + setHeaders: event.setHeaders, + depends: () => { + }, + parent + }); + const data = result ? await unwrap_promises(result) : null; + return data; +} +function create_universal_fetch(event, state, fetched, csr, resolve_opts) { + return async (input, init2) => { + const cloned_body = input instanceof Request && input.body ? input.clone().body : null; + const cloned_headers = input instanceof Request && [...input.headers].length ? new Headers(input.headers) : init2?.headers; + let response = await event.fetch(input, init2); + const url = new URL(input instanceof Request ? input.url : input, event.url); + const same_origin = url.origin === event.url.origin; + let dependency; + if (same_origin) { + if (state.prerendering) { + dependency = { response, body: null }; + state.prerendering.dependencies.set(url.pathname, dependency); + } + } else { + const mode = input instanceof Request ? input.mode : init2?.mode ?? "cors"; + if (mode === "no-cors") { + response = new Response("", { + status: response.status, + statusText: response.statusText, + headers: response.headers + }); + } else { + const acao = response.headers.get("access-control-allow-origin"); + if (!acao || acao !== event.url.origin && acao !== "*") { + throw new Error( + `CORS error: ${acao ? "Incorrect" : "No"} 'Access-Control-Allow-Origin' header is present on the requested resource` + ); + } + } + } + const proxy = new Proxy(response, { + get(response2, key2, _receiver) { + async function text2() { + const body = await response2.text(); + if (!body || typeof body === "string") { + const status_number = Number(response2.status); + if (isNaN(status_number)) { + throw new Error( + `response.status is not a number. value: "${response2.status}" type: ${typeof response2.status}` + ); + } + fetched.push({ + url: same_origin ? url.href.slice(event.url.origin.length) : url.href, + method: event.request.method, + request_body: ( + /** @type {string | ArrayBufferView | undefined} */ + input instanceof Request && cloned_body ? await stream_to_string(cloned_body) : init2?.body + ), + request_headers: cloned_headers, + response_body: body, + response: response2 + }); + } + if (dependency) { + dependency.body = body; + } + return body; + } + if (key2 === "arrayBuffer") { + return async () => { + const buffer = await response2.arrayBuffer(); + if (dependency) { + dependency.body = new Uint8Array(buffer); + } + return buffer; + }; + } + if (key2 === "text") { + return text2; + } + if (key2 === "json") { + return async () => { + return JSON.parse(await text2()); + }; + } + return Reflect.get(response2, key2, response2); + } + }); + if (csr) { + const get = response.headers.get; + response.headers.get = (key2) => { + const lower = key2.toLowerCase(); + const value = get.call(response.headers, lower); + if (value && !lower.startsWith("x-sveltekit-")) { + const included = resolve_opts.filterSerializedResponseHeaders(lower, value); + if (!included) { + throw new Error( + `Failed to get response header "${lower}" — it must be included by the \`filterSerializedResponseHeaders\` option: https://kit.svelte.dev/docs/hooks#server-hooks-handle (at ${event.route.id})` + ); + } + } + return value; + }; + } + return proxy; + }; +} +async function stream_to_string(stream) { + let result = ""; + const reader = stream.getReader(); + const decoder = new TextDecoder(); + while (true) { + const { done, value } = await reader.read(); + if (done) { + break; + } + result += decoder.decode(value); + } + return result; +} +const subscriber_queue = []; +function readable(value, start) { + return { + subscribe: writable(value, start).subscribe + }; +} +function writable(value, start = noop) { + let stop; + const subscribers = /* @__PURE__ */ new Set(); + function set(new_value) { + if (safe_not_equal(value, new_value)) { + value = new_value; + if (stop) { + const run_queue = !subscriber_queue.length; + for (const subscriber of subscribers) { + subscriber[1](); + subscriber_queue.push(subscriber, value); + } + if (run_queue) { + for (let i = 0; i < subscriber_queue.length; i += 2) { + subscriber_queue[i][0](subscriber_queue[i + 1]); + } + subscriber_queue.length = 0; + } + } + } + } + function update(fn) { + set(fn(value)); + } + function subscribe(run, invalidate = noop) { + const subscriber = [run, invalidate]; + subscribers.add(subscriber); + if (subscribers.size === 1) { + stop = start(set, update) || noop; + } + run(value); + return () => { + subscribers.delete(subscriber); + if (subscribers.size === 0 && stop) { + stop(); + stop = null; + } + }; + } + return { set, update, subscribe }; +} +function hash(...values) { + let hash2 = 5381; + for (const value of values) { + if (typeof value === "string") { + let i = value.length; + while (i) + hash2 = hash2 * 33 ^ value.charCodeAt(--i); + } else if (ArrayBuffer.isView(value)) { + const buffer = new Uint8Array(value.buffer, value.byteOffset, value.byteLength); + let i = buffer.length; + while (i) + hash2 = hash2 * 33 ^ buffer[--i]; + } else { + throw new TypeError("value must be a string or TypedArray"); + } + } + return (hash2 >>> 0).toString(36); +} +const escape_html_attr_dict = { + "&": "&", + '"': """ +}; +const escape_html_attr_regex = new RegExp( + // special characters + `[${Object.keys(escape_html_attr_dict).join("")}]|[\\ud800-\\udbff](?![\\udc00-\\udfff])|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\udc00-\\udfff]`, + "g" +); +function escape_html_attr(str) { + const escaped_str = str.replace(escape_html_attr_regex, (match) => { + if (match.length === 2) { + return match; + } + return escape_html_attr_dict[match] ?? `&#${match.charCodeAt(0)};`; + }); + return `"${escaped_str}"`; +} +const replacements = { + "<": "\\u003C", + "\u2028": "\\u2028", + "\u2029": "\\u2029" +}; +const pattern = new RegExp(`[${Object.keys(replacements).join("")}]`, "g"); +function serialize_data(fetched, filter, prerendering = false) { + const headers = {}; + let cache_control = null; + let age = null; + let varyAny = false; + for (const [key2, value] of fetched.response.headers) { + if (filter(key2, value)) { + headers[key2] = value; + } + if (key2 === "cache-control") + cache_control = value; + else if (key2 === "age") + age = value; + else if (key2 === "vary" && value.trim() === "*") + varyAny = true; + } + const payload = { + status: fetched.response.status, + statusText: fetched.response.statusText, + headers, + body: fetched.response_body + }; + const safe_payload = JSON.stringify(payload).replace(pattern, (match) => replacements[match]); + const attrs = [ + 'type="application/json"', + "data-sveltekit-fetched", + `data-url=${escape_html_attr(fetched.url)}` + ]; + if (fetched.request_headers || fetched.request_body) { + const values = []; + if (fetched.request_headers) { + values.push([...new Headers(fetched.request_headers)].join(",")); + } + if (fetched.request_body) { + values.push(fetched.request_body); + } + attrs.push(`data-hash="${hash(...values)}"`); + } + if (!prerendering && fetched.method === "GET" && cache_control && !varyAny) { + const match = /s-maxage=(\d+)/g.exec(cache_control) ?? /max-age=(\d+)/g.exec(cache_control); + if (match) { + const ttl = +match[1] - +(age ?? "0"); + attrs.push(`data-ttl="${ttl}"`); + } + } + return `