aotds-docks/docs/_app/start-093bde54.js
2021-06-13 13:04:00 -04:00

2 lines
16 KiB
JavaScript

var t=Object.defineProperty,e=Object.prototype.hasOwnProperty,r=Object.getOwnPropertySymbols,s=Object.prototype.propertyIsEnumerable,o=(e,r,s)=>r in e?t(e,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[r]=s,a=(t,a)=>{for(var n in a||(a={}))e.call(a,n)&&o(t,n,a[n]);if(r)for(var n of r(a))s.call(a,n)&&o(t,n,a[n]);return t};import{S as n,i,s as l,e as c,c as u,a as h,d,b as p,f,t as g,g as m,h as y,j as _,k as b,l as $,m as v,n as w,o as x,p as E,q,r as S,u as R,v as k,w as L,x as O,y as j,z as N,A as P,B as T,C as U}from"./chunks/vendor-7705c5be.js";function A(t){let e,r,s;const o=[t[2]||{}];var a=t[0][1];function n(t){let e={$$slots:{default:[I]},$$scope:{ctx:t}};for(let r=0;r<o.length;r+=1)e=P(e,o[r]);return{props:e}}return a&&(e=new a(n(t))),{c(){e&&_(e.$$.fragment),r=$()},l(t){e&&v(e.$$.fragment,t),r=$()},m(t,o){e&&x(e,t,o),f(t,r,o),s=!0},p(t,s){const i=4&s?E(o,[q(t[2]||{})]):{};if(521&s&&(i.$$scope={dirty:s,ctx:t}),a!==(a=t[0][1])){if(e){T();const t=e;S(t.$$.fragment,1,0,(()=>{L(t,1)})),R()}a?(e=new a(n(t)),_(e.$$.fragment),k(e.$$.fragment,1),x(e,r.parentNode,r)):e=null}else a&&e.$set(i)},i(t){s||(e&&k(e.$$.fragment,t),s=!0)},o(t){e&&S(e.$$.fragment,t),s=!1},d(t){t&&d(r),e&&L(e,t)}}}function C(t){let e,r,s;const o=[t[3]||{}];var a=t[0][2];function n(t){let e={};for(let r=0;r<o.length;r+=1)e=P(e,o[r]);return{props:e}}return a&&(e=new a(n())),{c(){e&&_(e.$$.fragment),r=$()},l(t){e&&v(e.$$.fragment,t),r=$()},m(t,o){e&&x(e,t,o),f(t,r,o),s=!0},p(t,s){const i=8&s?E(o,[q(t[3]||{})]):{};if(a!==(a=t[0][2])){if(e){T();const t=e;S(t.$$.fragment,1,0,(()=>{L(t,1)})),R()}a?(e=new a(n()),_(e.$$.fragment),k(e.$$.fragment,1),x(e,r.parentNode,r)):e=null}else a&&e.$set(i)},i(t){s||(e&&k(e.$$.fragment,t),s=!0)},o(t){e&&S(e.$$.fragment,t),s=!1},d(t){t&&d(r),e&&L(e,t)}}}function I(t){let e,r,s=t[0][2]&&C(t);return{c(){s&&s.c(),e=$()},l(t){s&&s.l(t),e=$()},m(t,o){s&&s.m(t,o),f(t,e,o),r=!0},p(t,r){t[0][2]?s?(s.p(t,r),1&r&&k(s,1)):(s=C(t),s.c(),k(s,1),s.m(e.parentNode,e)):s&&(T(),S(s,1,1,(()=>{s=null})),R())},i(t){r||(k(s),r=!0)},o(t){S(s),r=!1},d(t){s&&s.d(t),t&&d(e)}}}function V(t){let e,r,s=t[0][1]&&A(t);return{c(){s&&s.c(),e=$()},l(t){s&&s.l(t),e=$()},m(t,o){s&&s.m(t,o),f(t,e,o),r=!0},p(t,r){t[0][1]?s?(s.p(t,r),1&r&&k(s,1)):(s=A(t),s.c(),k(s,1),s.m(e.parentNode,e)):s&&(T(),S(s,1,1,(()=>{s=null})),R())},i(t){r||(k(s),r=!0)},o(t){S(s),r=!1},d(t){s&&s.d(t),t&&d(e)}}}function D(t){let e,r=t[5]&&B(t);return{c(){e=c("div"),r&&r.c(),this.h()},l(t){e=u(t,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,class:!0});var s=h(e);r&&r.l(s),s.forEach(d),this.h()},h(){p(e,"id","svelte-announcer"),p(e,"aria-live","assertive"),p(e,"aria-atomic","true"),p(e,"class","svelte-1j55zn5")},m(t,s){f(t,e,s),r&&r.m(e,null)},p(t,s){t[5]?r?r.p(t,s):(r=B(t),r.c(),r.m(e,null)):r&&(r.d(1),r=null)},d(t){t&&d(e),r&&r.d()}}}function B(t){let e,r;return{c(){e=g("Navigated to "),r=g(t[6])},l(s){e=m(s,"Navigated to "),r=m(s,t[6])},m(t,s){f(t,e,s),f(t,r,s)},p(t,e){64&e&&y(r,t[6])},d(t){t&&d(e),t&&d(r)}}}function K(t){let e,r,s,o;const a=[t[1]||{}];var n=t[0][0];function i(t){let e={$$slots:{default:[V]},$$scope:{ctx:t}};for(let r=0;r<a.length;r+=1)e=P(e,a[r]);return{props:e}}n&&(e=new n(i(t)));let l=t[4]&&D(t);return{c(){e&&_(e.$$.fragment),r=b(),l&&l.c(),s=$()},l(t){e&&v(e.$$.fragment,t),r=w(t),l&&l.l(t),s=$()},m(t,a){e&&x(e,t,a),f(t,r,a),l&&l.m(t,a),f(t,s,a),o=!0},p(t,[o]){const c=2&o?E(a,[q(t[1]||{})]):{};if(525&o&&(c.$$scope={dirty:o,ctx:t}),n!==(n=t[0][0])){if(e){T();const t=e;S(t.$$.fragment,1,0,(()=>{L(t,1)})),R()}n?(e=new n(i(t)),_(e.$$.fragment),k(e.$$.fragment,1),x(e,r.parentNode,r)):e=null}else n&&e.$set(c);t[4]?l?l.p(t,o):(l=D(t),l.c(),l.m(s.parentNode,s)):l&&(l.d(1),l=null)},i(t){o||(e&&k(e.$$.fragment,t),o=!0)},o(t){e&&S(e.$$.fragment,t),o=!1},d(t){e&&L(e,t),t&&d(r),l&&l.d(t),t&&d(s)}}}function W(t,e,r){let{stores:s}=e,{page:o}=e,{components:a}=e,{props_0:n=null}=e,{props_1:i=null}=e,{props_2:l=null}=e;O("__svelte__",s),j(s.page.notify);let c=!1,u=!1,h=null;return N((()=>{const t=s.page.subscribe((()=>{c&&(r(5,u=!0),r(6,h=document.title||"untitled page"))}));return r(4,c=!0),t})),t.$$set=t=>{"stores"in t&&r(7,s=t.stores),"page"in t&&r(8,o=t.page),"components"in t&&r(0,a=t.components),"props_0"in t&&r(1,n=t.props_0),"props_1"in t&&r(2,i=t.props_1),"props_2"in t&&r(3,l=t.props_2)},t.$$.update=()=>{384&t.$$.dirty&&s.page.set(o)},[a,n,i,l,c,u,h,s,o]}class z extends n{constructor(t){super(),i(this,t,W,K,l,{stores:7,page:8,components:0,props_0:1,props_1:2,props_2:3})}}let M;const Y={},G=function(t,e){if(!e)return t();if(void 0===M){const t=document.createElement("link").relList;M=t&&t.supports&&t.supports("modulepreload")?"modulepreload":"preload"}return Promise.all(e.map((t=>{if(t in Y)return;Y[t]=!0;const e=t.endsWith(".css"),r=e?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${t}"]${r}`))return;const s=document.createElement("link");return s.rel=e?"stylesheet":M,e||(s.as="script",s.crossOrigin=""),s.href=t,document.head.appendChild(s),e?new Promise(((t,e)=>{s.addEventListener("load",t),s.addEventListener("error",e)})):void 0}))).then((()=>t()))},J=[()=>G((()=>import("./layout.svelte-456bc047.js")),["/_app/layout.svelte-456bc047.js","/_app/chunks/vendor-7705c5be.js"]),()=>G((()=>import("./error.svelte-bbf04dbf.js")),["/_app/error.svelte-bbf04dbf.js","/_app/chunks/vendor-7705c5be.js"]),()=>G((()=>import("./pages/index.svelte-052d6799.js")),["/_app/pages/index.svelte-052d6799.js","/_app/assets/pages/index.svelte-91a0f1d4.css","/_app/chunks/vendor-7705c5be.js"])],X=[[/^\/$/,[J[0],J[2]],[J[1]]]],F=[J[0](),J[1]()];function H(){return{x:pageXOffset,y:pageYOffset}}function Q(t){for(;t&&"A"!==t.nodeName.toUpperCase();)t=t.parentNode;return t}class Z{constructor({base:t,routes:e}){this.base=t,this.routes=e}init(t){let e;this.renderer=t,t.router=this,this.enabled=!0,"scrollRestoration"in history&&(history.scrollRestoration="manual"),addEventListener("beforeunload",(()=>{history.scrollRestoration="auto"})),addEventListener("load",(()=>{history.scrollRestoration="manual"})),addEventListener("scroll",(()=>{clearTimeout(e),e=setTimeout((()=>{const t=a(a({},history.state||{}),{"sveltekit:scroll":H()});history.replaceState(t,document.title,window.location.href)}),50)}));const r=t=>{const e=Q(t.target);e&&e.href&&e.hasAttribute("sveltekit:prefetch")&&this.prefetch(new URL(e.href))};let s;addEventListener("touchstart",r),addEventListener("mousemove",(t=>{clearTimeout(s),s=setTimeout((()=>{r(t)}),20)})),addEventListener("click",(t=>{var e;if(!this.enabled)return;if(t.button||1!==t.which)return;if(t.metaKey||t.ctrlKey||t.shiftKey||t.altKey)return;if(t.defaultPrevented)return;const r=Q(t.target);if(!r)return;if(!r.href)return;const s="object"==typeof r.href&&"SVGAnimatedString"===r.href.constructor.name,o=String(s?r.href.baseVal:r.href);if(o===location.href)return void(location.hash||t.preventDefault());const a=null==(e=r.getAttribute("rel"))?void 0:e.split(/\s+/);if(r.hasAttribute("download")||a&&a.includes("external"))return;if(s?r.target.baseVal:r.target)return;const n=new URL(o);if(n.pathname===location.pathname&&n.search===location.search)return;const i=r.hasAttribute("sveltekit:noscroll");history.pushState({},"",n.href),this._navigate(n,i?H():null,[],n.hash),t.preventDefault()})),addEventListener("popstate",(t=>{if(t.state&&this.enabled){const e=new URL(location.href);this._navigate(e,t.state["sveltekit:scroll"],[])}})),document.body.setAttribute("tabindex","-1"),history.replaceState(history.state||{},"",location.href)}parse(t){if(t.origin!==location.origin)return null;if(!t.pathname.startsWith(this.base))return null;const e=decodeURIComponent(t.pathname.slice(this.base.length)||"/"),r=this.routes.filter((([t])=>t.test(e))),s=new URLSearchParams(t.search);return{id:`${e}?${s}`,routes:r,path:e,query:s}}async goto(t,{noscroll:e=!1,replaceState:r=!1}={},s){if(this.enabled){const o=new URL(t,function(t){let e=t.baseURI;if(!e){const r=t.getElementsByTagName("base");e=r.length?r[0].href:t.URL}return e}(document));return history[r?"replaceState":"pushState"]({},"",t),this._navigate(o,e?H():null,s,o.hash)}return location.href=t,new Promise((()=>{}))}enable(){this.enabled=!0}disable(){this.enabled=!1}async prefetch(t){return this.renderer.load(this.parse(t))}async _navigate(t,e,r,s){const o=this.parse(t);this.renderer.notify({path:o.path,query:o.query}),location.pathname.endsWith("/")&&"/"!==location.pathname&&history.replaceState({},"",`${location.pathname.slice(0,-1)}${location.search}`),await this.renderer.update(o,r),document.body.focus();const a=s&&document.getElementById(s.slice(1));e?scrollTo(e.x,e.y):a?scrollTo(0,a.getBoundingClientRect().top+scrollY):scrollTo(0,0)}}function tt(t){const e=U(t);let r=!0;return{notify:function(){r=!0,e.update((t=>t))},set:function(t){r=!1,e.set(t)},subscribe:function(t){let s;return e.subscribe((e=>{(void 0===s||r&&e!==s)&&t(s=e)}))}}}function et(t,o){const a="string"==typeof t?t:t.url,n=document.querySelector(`script[type="svelte-data"][url="${a}"]`);if(n){const t=JSON.parse(n.textContent),{body:o}=t,a=((t,o)=>{var a={};for(var n in t)e.call(t,n)&&o.indexOf(n)<0&&(a[n]=t[n]);if(null!=t&&r)for(var n of r(t))o.indexOf(n)<0&&s.call(t,n)&&(a[n]=t[n]);return a})(t,["body"]);return Promise.resolve(new Response(o,a))}return fetch(t,o)}class rt{constructor({Root:t,fallback:e,target:r,session:s,host:o}){this.Root=t,this.fallback=e,this.host=o,this.router=null,this.target=r,this.started=!1,this.session_id=1,this.current={page:null,session_id:null,branch:[]},this.cache=new Map,this.loading={id:null,promise:null},this.stores={page:tt({}),navigating:U(null),session:U(s)},this.$session=null,this.root=null;let a=!1;this.stores.session.subscribe((async t=>{if(this.$session=t,!a)return;this.session_id+=1;const e=this.router.parse(new URL(location.href));this.update(e,[])})),a=!0}async start({status:t,error:e,nodes:r,page:s}){const o=[];let n,i,l,c={};try{for(let n=0;n<r.length;n+=1){const u=n===r.length-1,h=await this._load_node({module:await r[n],page:s,context:c,status:u&&t,error:u&&e});if(o.push(h),h&&h.loaded)if(h.loaded.error){if(e)throw h.loaded.error;i=h.loaded.status,l=h.loaded.error}else h.loaded.context&&(c=a(a({},c),h.loaded.context))}n=await this._get_navigation_result_from_branch({page:s,branch:o})}catch(u){if(e)throw u;i=500,l=u}l&&(n=await this._load_error({status:i,error:l,path:s.path,query:s.query})),n.redirect?location.href=new URL(n.redirect,location.href).href:this._init(n)}notify({path:t,query:e}){dispatchEvent(new CustomEvent("sveltekit:navigation-start")),this.started&&this.stores.navigating.set({from:{path:this.current.page.path,query:this.current.page.query},to:{path:t,query:e}})}async update(t,e){const r=this.token={};let s=await this._get_navigation_result(t);if(r!==this.token)return;if(s.redirect){if(!(e.length>10||e.includes(t.path)))return void(this.router?this.router.goto(s.redirect,{replaceState:!0},[...e,t.path]):location.href=new URL(s.redirect,location.href).href);s=await this._load_error({status:500,error:new Error("Redirect loop"),path:t.path,query:t.query})}s.reload?location.reload():this.started?(this.current=s.state,this.root.$set(s.props),this.stores.navigating.set(null),await 0):this._init(s),dispatchEvent(new CustomEvent("sveltekit:navigation-end")),this.loading.promise=null,this.loading.id=null;const o=s.state.branch[s.state.branch.length-1];o&&!1===o.module.router?this.router.disable():this.router.enable()}load(t){return this.loading.promise=this._get_navigation_result(t),this.loading.id=t.id,this.loading.promise}_init(t){this.current=t.state;const e=document.querySelector("style[data-svelte]");e&&e.remove(),this.root=new this.Root({target:this.target,props:a({stores:this.stores},t.props),hydrate:!0}),this.started=!0}async _get_navigation_result(t){if(this.loading.id===t.id)return this.loading.promise;for(let e=0;e<t.routes.length;e+=1){const r=t.routes[e];if(1===r.length)return{reload:!0};let s=e+1;for(;s<t.routes.length;){const e=t.routes[s];if(e[0].toString()!==r[0].toString())break;1!==e.length&&e[1].forEach((t=>t())),s+=1}const o=await this._load({route:r,path:t.path,query:t.query});if(o)return o}return await this._load_error({status:404,error:new Error(`Not found: ${t.path}`),path:t.path,query:t.query})}async _get_navigation_result_from_branch({page:t,branch:e}){const r=e.filter(Boolean),s={state:{page:t,branch:e,session_id:this.session_id},props:{components:r.map((t=>t.module.default))}};for(let n=0;n<r.length;n+=1)r[n].loaded&&(s.props[`props_${n}`]=await r[n].loaded.props);this.current.page&&t.path===this.current.page.path&&t.query.toString()===this.current.page.query.toString()||(s.props.page=t);const o=r[r.length-1],a=o.loaded&&o.loaded.maxage;if(a){const e=`${t.path}?${t.query}`;let r=!1;const o=()=>{this.cache.get(e)===s&&this.cache.delete(e),i(),clearTimeout(n)},n=setTimeout(o,1e3*a),i=this.stores.session.subscribe((()=>{r&&o()}));r=!0,this.cache.set(e,s)}return s}async _load_node({status:t,error:e,module:r,page:s,context:o}){const n={module:r,uses:{params:new Set,path:!1,query:!1,session:!1,context:!1},loaded:null,context:o},i={};for(const a in s.params)Object.defineProperty(i,a,{get:()=>(n.uses.params.add(a),s.params[a]),enumerable:!0});const l=this.$session;if(r.load){const c={page:{host:s.host,params:i,get path(){return n.uses.path=!0,s.path},get query(){return n.uses.query=!0,s.query}},get session(){return n.uses.session=!0,l},get context(){return n.uses.context=!0,a({},o)},fetch:this.started?fetch:et};e&&(c.status=t,c.error=e);const u=await r.load.call(null,c);if(!u)return;n.loaded=function(t){if(t.error){const e="string"==typeof t.error?new Error(t.error):t.error,r=t.status;return e instanceof Error?!r||r<400||r>599?(console.warn('"error" returned from load() without a valid status code — defaulting to 500'),{status:500,error:e}):{status:r,error:e}:{status:500,error:new Error(`"error" property returned from load() must be a string or instance of Error, received type "${typeof e}"`)}}if(t.redirect){if(!t.status||3!==Math.floor(t.status/100))return{status:500,error:new Error('"redirect" property returned from load() must be accompanied by a 3xx status code')};if("string"!=typeof t.redirect)return{status:500,error:new Error('"redirect" property returned from load() must be a string')}}return t}(u),n.loaded.context&&(n.context=n.loaded.context)}return n}async _load({route:t,path:e,query:r}){const s=`${e}?${r}`;if(this.cache.has(s))return this.cache.get(s);const[o,n,i,l]=t,c=l?l(o.exec(e)):{},u=this.current.page&&{path:e!==this.current.page.path,params:Object.keys(c).filter((t=>this.current.page.params[t]!==c[t])),query:r.toString()!==this.current.page.query.toString(),session:this.session_id!==this.current.session_id},h={host:this.host,path:e,query:r,params:c},d=[];let p={},f=!1,g=200,m=null;n.forEach((t=>t()));t:for(let _=0;_<n.length;_+=1){let t;try{if(!n[_])continue;const e=await n[_](),r=this.current.branch[_];if(!r||e!==r.module||u.path&&r.uses.path||u.params.some((t=>r.uses.params.has(t)))||u.query&&r.uses.query||u.session&&r.uses.session||f&&r.uses.context){t=await this._load_node({module:e,page:h,context:p});const r=_===n.length-1;if(t&&t.loaded){if(t.loaded.error&&(g=t.loaded.status,m=t.loaded.error),t.loaded.redirect)return{redirect:t.loaded.redirect};t.loaded.context&&(f=!0)}else if(r&&e.load)return}else t=r}catch(y){g=500,m=y}if(m){for(;_--;)if(i[_]){let t,e,r=_;for(;!(e=d[r]);)r-=1;try{if(t=await this._load_node({status:g,error:m,module:await i[_](),page:h,context:e.context}),t.loaded.error)continue;d.push(t);break t}catch(y){continue}}return await this._load_error({status:g,error:m,path:e,query:r})}t&&t.loaded&&t.loaded.context&&(p=a(a({},p),t.loaded.context)),d.push(t)}return await this._get_navigation_result_from_branch({page:h,branch:d})}async _load_error({status:t,error:e,path:r,query:s}){const o={host:this.host,path:r,query:s,params:{}},a=await this._load_node({module:await this.fallback[0],page:o,context:{}}),n=[a,await this._load_node({status:t,error:e,module:await this.fallback[1],page:o,context:a&&a.loaded&&a.loaded.context})];return await this._get_navigation_result_from_branch({page:o,branch:n})}}async function st({paths:t,target:e,session:r,host:s,route:o,spa:a,hydrate:n}){const i=o&&new Z({base:t.base,routes:X}),l=new rt({Root:z,fallback:F,target:e,session:r,host:s});n&&await l.start(n),o&&i.init(l),a&&i.goto(location.href,{replaceState:!0},[]),dispatchEvent(new CustomEvent("sveltekit:start"))}export{st as start};