PageSourceSearch

https://aviumui.org/assets/chunks/chunk-D1JYe4Qp.js

js aviumui.org collected 2026-09-25 22:37:00 UTC 75,315 bytes, 3 lines download raw bytes

1function de(e){return Array.from(new Set(e))}function I(e,t){const n=ir();return n[e]??(n[e]=t)}function ir(){var e;return globalThis._vike??(globalThis._vike={}),(e=globalThis._vike).globals??(e.globals={}),globalThis._vike.globals}const h=new Proxy({},{get:(e,t)=>n=>t==="code"?`\`${n}\``:t==="string"?`'${n}'`:n}),Wt="0.4.259";let Q;Q??(Q=Dt());function Dt(){return I("utils/assertSingleInstance.ts",{instances:[],alreadyLogged:new Set})}function ge(){return Q??(Q=Dt()),Q}const sr="Client runtime of both Server Routing and Client Routing loaded https://vike.dev/client-runtimes-conflict",Bt="Client runtime loaded twice https://vike.dev/client-runtime-duplicated";function Nt(){const e=ge();{const t=de(e.instances);le(t.length<=1,`vike@${h.bold(t[0])} and vike@${h.bold(t[1])} loaded which is highly discouraged ${h.underline("https://vike.dev/warning/version-mismatch")}`,{onlyOnce:!0,showStackTrace:!1})}e.checkSingleInstance&&e.instances.length>1&&le(!1,Bt,{onlyOnce:!0,showStackTrace:!0})}function qs(e){const t=ge();le(t.isClientRouting!==!1,sr,{onlyOnce:!0,showStackTrace:!0}),le(t.isClientRouting===void 0,Bt,{onlyOnce:!0,showStackTrace:!0}),t.isClientRouting=!0,t.checkSingleInstance=!0,Nt()}function ar(){ge().instances.push(Wt),Nt()}function le(e,t,{onlyOnce:n,showStackTrace:r}){const o=ge();if(e)return;const i=`[Vike][Warning] ${t}`;{const{alreadyLogged:s}=o,a=i;if(s.has(a))return;s.add(a)}console.warn(r?new Error(i):i)}function lr(){return!(typeof process>"u"||!process.cwd||!process.versions||typeof process.versions.node>"u"||!process.release||process.release.name!=="node")}function cr(e,t){const n=new Error(e);return lr()&&(n.stack=ur(n.stack,t)),n}function ur(e,t){if(!e)return e;const n=dr(e);let r=0;return n.filter(i=>i.includes(" (internal/")||i.includes(" (node:internal")?!1:r<t&&fr(i)?(r++,!1):!0).join(`
2`)}function fr(e){return e.startsWith("    at ")}function dr(e){return e.split(/\r?\n/)}function gr(e){return h.bold(h.yellow(e))}function hr(e){return h.bold(h.red(e))}function pr(e){return h.yellow(e)}const A=I("utils/assert.ts",{alreadyLogged:new Set});ar();const mr="[vike]",yr=`[vike@${Wt}]`,br="Bug";function l(e,t){if(e)return;const n=(()=>{if(!t)return null;const s=typeof t=="string"?t:JSON.stringify(t);return h.dim(`Debug for maintainers (you can ignore this): ${s}`)})();let o=[`You stumbled upon a Vike bug. Go to ${h.underline("https://github.com/vikejs/vike/issues/new?template=bug.yml")} and copy-paste this error. A maintainer will fix the bug (usually within 24 hours).`,n].filter(Boolean).join(" ");o=re(o,br,!0);const i=he(o);throw A.onBeforeLog?.(),A.onBeforeErr?.(i),i}function p(e,t,{showStackTrace:n,exitOnError:r}={}){if(e)return;n=n||A.alwaysShowStackTrace,t=re(t,"Wrong Usage");const o=he(t);if(A.onBeforeLog?.(),A.onBeforeErr?.(o),r)console.error(n?o:t),process.exit(1);else throw o}function Vt(e){return e=re(e,"Error"),he(e)}function R(e,t,{onlyOnce:n,showStackTrace:r}){if(e)return;if(r=r||A.alwaysShowStackTrace,n){const{alreadyLogged:i}=A,s=n===!0?t:n;if(i.has(s))return;i.add(s)}const o=re(t,"Warning");if(A.onBeforeLog?.(),r){const i=he(o);A.onBeforeErr?.(i),console.warn(i)}else console.warn(o)}function Pr(e,t,{onlyOnce:n}){t=re(t,null);{const{alreadyLogged:r}=A,o=t;if(r.has(o))return;r.add(o)}A.onBeforeLog?.(),console.log(t)}function re(e,t,n=!1){const r=Sr(n),o=wr(t),i=Cr(e);return A.addAssertTagsDev?`${A.addAssertTagsDev(r,o)}${i}${e}`:`${`${r}${o}`}${i}${e}`}function Cr(e){return e.startsWith("[")?"":" "}function wr(e){if(!e)return"";let t=`[${e}]`;return e==="Warning"?t=pr(t):t=hr(t),t}function Sr(e=!1){return gr(e?yr:mr)}function he(e){const t=cr(e,3);return A.addAssertTagsDev&&(t.stack=t.stack?.replace(/^Error:\s*/,"")),t}function ce(e){const t=e/1e3;if(t<120){const n=lt(t);return`${n} second${ct(n)}`}{const n=t/60,r=lt(n);return`${r} minute${ct(r)}`}}function lt(e){let t=e.toFixed(1);return t.endsWith(".0")&&(t=t.slice(0,-2)),t}function ct(e){return e==="1"?"":"s"}function T(e){return typeof e=="object"&&e!==null}function H(e){return Array.isArray(e)}function Ut(e,t){const n=t.find(r=>r.pageId===e);return l(t.length>0),l(n),n}function zt(e){if(!e||H(e)||e.definedBy)return null;const{filePathToShowToUser:t}=e;return l(t),t}function Gt(e){const t=zt(e);return l(t),t}function xr(e){return[null,void 0].includes(e)?String(e):["boolean","number","string"].includes(typeof e)?JSON.stringify(e):null}function vr(e,t){if(!e)return null;let[n,...r]=e;if(!n||r.length===0&&["*","default",t].includes(n))return null;l(n!=="*");let o="",i="";return n==="default"?o="export default":(o="export",r=[n,...r]),r.forEach(a=>{o=`${o} { ${a}`,i=` }${i}`}),o+i}function kr(e,t,n){return`${ke(e,t)} at ${M(n,t)}`}function Mt(e,t,n){return n?`${ke(e,t)} at ${M(n,t)}`:`${ke(e,t)} internally`}function ke(e,t){return`${e} ${h.cyan(t)} defined`}function M(e,t){let n;return H(e)?n=e:n=[e],l(n.length>=1),n.map(o=>{if(o.definedBy)return Rr(o,t);const{filePathToShowToUser:i,fileExportPathToShowToUser:s}=o,a=vr(s,t);return a?`${i} > ${h.cyan(a)}`:i}).join(" / ")}function Rr(e,t){if(e.definedBy==="api")return`API call ${h.cyan(`${e.operation}({ vikeConfig: { ${t} } })`)}`;const{definedBy:n}=e;if(n==="cli")return`CLI option ${h.cyan(`--${t}`)}`;
2if(n==="env")return`environment variable ${h.cyan(`VIKE_CONFIG="{${t}}"`)}`;l(!1)}function Er(e,t,n){const{value:r,definedAtData:o}=e;return n&&Or(r,n,t,o),e}function Or(e,t,n,r){l(e!==null);const o=typeof e;if(o===t)return;const i=xr(e),s=i!==null?`value ${h.cyan(i)}`:`type ${h.cyan(o)}`,c=`${Mt("Config",n,r)} has an invalid ${s}: it should be a ${h.cyan(t)} instead`;p(!1,c)}function Y(e,t,n){const r=e.configValues[t];return r?Er(r,t,n):null}function B(e){return e instanceof Function||typeof e=="function"}const _r=I("hooks/getHook.ts",{});function Re(e,t){if(!(t in e.exports))return null;const{hooksTimeout:n}=e.config,r=Yt(n,t),o=e.exports[t];if(o===null)return null;const i=e.exportsAll[t][0];l(i.exportValue===o);const s=i.filePath;return l(s),pe(o,t,s,r)}function Ee(e,t){const{hooksTimeout:n}=t.config,r=Yt(n,e),o=[];return t.exportsAll[e]?.forEach(i=>{const s=i.exportValue;if(s===null)return;const a=i.filePath;l(a),o.push(pe(s,e,a,r))}),o}function $r(e,t){const n=e.configValues[t];if(!n?.value)return null;const{hookFn:r,hookFilePath:o}=Tr(n),i=Jt(t);return pe(r,t,o,i)}function Kt(e,t){const n=e.configValues[t];if(!n?.value)return[];const r=n.value;return l(H(r)),r.map((o,i)=>{const s=o,a=Jt(t);l(H(n.definedAtData));const c=Gt(n.definedAtData[i]);return pe(s,t,c,a)})}function Jt(e){return me(e)}function pe(e,t,n,r){return l(n),Ar(e,{hookName:t,hookFilePath:n}),{hookFn:e,hookName:t,hookFilePath:n,hookTimeout:r}}function Tr(e){const t=e.value;l(t);const n=Gt(e.definedAtData);return{hookFn:t,hookFilePath:n}}function Ar(e,{hookName:t,hookFilePath:n}){l(t&&n),l(!t.endsWith(")")),l(!n.endsWith(" ")),p(B(e),`Hook ${t}() defined by ${n} should be a function`)}function Yt(e,t){const n=Ir(e);if(n===!1)return{error:!1,warning:!1};const r=n[t],o=me(t);return r?.error!==void 0&&(o.error=r.error),r?.warning!==void 0&&(o.warning=r.warning),o}function Ir(e){if(e===void 0)return{};if(e===!1)return!1;p(T(e),`Setting ${h.cyan("hooksTimeout")} should be ${h.cyan("false")} or an object`);const t={};return Object.entries(e).forEach(([n,r])=>{if(r===!1){t[n]={error:!1,warning:!1};return}p(T(r),`Setting ${h.cyan(`hooksTimeout.${n}`)} should be ${h.cyan("false")} or an object`);const[o,i]=["error","warning"].map(s=>{const a=r[s];if(a===void 0||a===!1)return a;const c=`Setting ${h.cyan(`hooksTimeout.${n}.${s}`)} should be`;return p(typeof a=="number",`${c} ${h.cyan("false")} or a number`),p(a>0,`${c} a positive number`),a});t[n]={error:o,warning:i}}),t}function me(e){return e==="onBeforeRoute"?{error:5*1e3,warning:1*1e3}:_r.isPrerendering?{error:120*1e3,warning:30*1e3}:(l(!e.toLowerCase().includes("prerender")),{error:30*1e3,warning:4*1e3})}function Fr(e,t){const n=Object.getOwnPropertyDescriptor(e,t);return!!n&&!("value"in n)&&!!n.get}function jr(e){Hr(e)}function Hr(e){if(e.is404===void 0||e.is404===null)return;const t=e.pageProps||{};
2if(!T(t)){R(!1,"pageContext.pageProps should be an object",{showStackTrace:!0,onlyOnce:!0});return}t.is404=t.is404||e.is404,e.pageProps=t}const Lr="__VIKE__NOT_SERIALIZABLE__";function Wr(e){return typeof e=="string"&&Dr(e)?`.${e}`:`[${JSON.stringify(e)}]`}function Dr(e){return/^[a-z0-9\$_]+$/i.test(e)}function U(){return Object.getOwnPropertyDescriptor(globalThis,"window")?.get?.toString().includes("[native code]")??!1}function De(e,t,n,r){return new Proxy(e,{get:(o,i)=>Br(i,e,t,n,r)})}function Br(e,...t){const[n,r,o,i]=t,s=String(e);if(e==="_isProxyObject")return!0;if(e==="dangerouslyUseInternals")return t[2]=!0,De(...t);if(e==="_originalObject")return n;if(i&&!(e in n))return i(e);const a=n[e];return Nr(s,a,r),a}function Nr(e,t,n){if(t!==Lr)return;const r=Wr(e);l(U()),p(!1,`Can't access ${n}${r} on the client side. Because it can't be serialized, see server logs.`)}function qt(e){return l(e._isOriginalObject),De(e,"globalContext")}function Be(e){l(!e._isProxyObject),l(!e.globalContext),l(e._isOriginalObject),jr(e),"_pageId"in e||Object.defineProperty(e,"_pageId",{get(){return R(!1,"pageContext._pageId has been renamed to pageContext.pageId",{showStackTrace:!0,onlyOnce:!0}),e.pageId},enumerable:!1});const t=qt(e._globalContext);return De(e,"pageContext",!0,r=>{if(r==="globalContext")return t;if(r in t)return t[r]})}function Xt(e){["urlPathname","urlParsed","url","pageExports"].forEach(t=>{e.prop&&l(Fr(e,t))})}const Oe=I("utils/execHook.ts",{userHookErrors:new WeakMap,pageContext:null});async function Ne(e,t,n){const r=Ee(e,t);return await ue(r,t,n)}async function Vr(e,t,n){const r=Kt(t._pageConfigGlobal,e),o=n(t);await Promise.all(r.map(async i=>{await en(()=>i.hookFn(o),i,t,null)}))}async function ue(e,t,n){if(!e.length)return[];const r=n(t);return await Promise.all(e.map(async i=>{const s=await en(()=>i.hookFn(r),i,t._globalContext,r);return{...i,hookReturn:s}}))}async function Zt(e,t,n){const r=await ue([e],t,n),{hookReturn:o}=r[0];p(o===void 0,`The ${e.hookName}() hook defined by ${e.hookFilePath} isn't allowed to return a value`)}function Qt(e,t,n,r,o){const i=n&&r(n);return o??(o=()=>e.hookFn(i)),{hookReturn:tn(o,e,t,i)}}function en(e,t,n,r){const{hookName:o,hookFilePath:i,hookTimeout:{error:s,warning:a}}=t;let c,u;const f=new Promise((m,$)=>{c=E=>{d(),m(E)},u=E=>{d(),$(E)}}),d=()=>{g&&clearTimeout(g),y&&clearTimeout(y)},g=ut(a)&&setTimeout(()=>{R(!1,`The ${o}() hook defined by ${i} is slow: it's taking more than ${ce(a)} (https://vike.dev/hooksTimeout)`,{onlyOnce:!1})},a),y=ut(s)&&setTimeout(()=>{const m=Vt(`The ${o}() hook defined by ${i} timed out: it didn't finish after ${ce(s)} (https://vike.dev/hooksTimeout)`);u(m)},s);return(async()=>{try{const m=await tn(e,t,n,r);c(m)}catch(m){T(m)&&Oe.userHookErrors.set(m,{hookName:o,hookFilePath:i}),u(m)}})(),f}function tn(e,t,n,r){const{hookName:o,hookFilePath:i}=t;l(o!=="onHookCall");const s=n._pageConfigGlobal.configValues.onHookCall,a=()=>(nn(r),e());if(!s?.value)return a();let c=!1,u,f,d=()=>{c=!0;try{u=a()}catch(g){throw f=g,g}return u};for(const g of s.value){const y={name:o,filePath:i,call:d};d=()=>((async()=>{try{await g(y,r)}catch(m){m!==f&&console.error(m)}})(),p(c,"onHookCall() must run hook.call()"),u)}if(d(),f)throw f;return u}function ut(e){return!!e&&e!==1/0}function Xs(e){nn(e)}function nn(e){Oe.pageContext=e,Promise.resolve().then(()=>{Oe.pageContext=null})}const Z={},ft=99,dt=5*1e3;function Ur(e){const t=new Date().getTime();Object.keys(Z).forEach(o=>{const i=Z[o];t-i.startTime>dt&&delete Z[o]});const n=Z[e]??(Z[e]={count:0,startTime:t});n.count++;const r=`${e} called ${n.count} times within ${ce(dt)} — infinite loop?`;n.count>ft&&p(!1,r),!n.warned&&n.count>ft*.5&&(R(!1,r,{onlyOnce:!1,showStackTrace:!0}),n.warned=!0)}const zr=25*1e3;function Ve({timeout:e=zr}={}){let t,n,r=!1;const o=new Promise((c,u)=>{t=(...f)=>(r=!0,i(),c(...f)),n=(...f)=>(r=!0,i(),u(...f))}),i=()=>s.forEach(c=>clearTimeout(c)),s=[];let a;return e?a=new Proxy(o,{get(c,u){if(u==="then"&&!r){const d=new Error(`Promise hasn't resolved after ${ce(e)}`);s.push(setTimeout(()=>{l(d.stack),R(!1,Gr(d.stack),{onlyOnce:!1})},e))}const f=Reflect.get(c,u);return typeof f=="function"?f.bind(c):f}}):a=o,{promise:a,resolve:t,reject:n}}function Gr(e){const t="Error: ";return e.startsWith(t)&&(e=e.slice(t.length)),e}function Mr(e){return H(e)&&e.every(t=>typeof t=="string")}function Kr(e){return T(e)&&Object.values(e).every(t=>typeof t=="string")}function P(e,t,n){if(!T(e))return!1;if(!(t in e))return n==="undefined";if(n===void 0)return!0;const r=e[t];return n==="undefined"?r===void 0:n==="array"?H(r):n==="object"?T(r):n==="string[]"?Mr(r):n==="string{}"?Kr(r):n==="function"?B(r):H(n)?typeof r=="string"&&n.includes(r):n==="null"?r===null:n==="true"?r===!0:n==="false"?r===!1:typeof r===n}
2function C(e,t,n){t&&(n||l(!t._isOriginalObject),Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)))}function W(e){window.location.href=e}function z(e,t){l(e===t)}const Jr=[{is:e=>e===void 0,match:e=>e==="!undefined",serialize:()=>"!undefined",deserialize:()=>{}},{is:e=>e===1/0,match:e=>e==="!Infinity",serialize:()=>"!Infinity",deserialize:()=>1/0},{is:e=>e===-1/0,match:e=>e==="!-Infinity",serialize:()=>"!-Infinity",deserialize:()=>-1/0},{is:e=>typeof e=="number"&&isNaN(e),match:e=>e==="!NaN",serialize:()=>"!NaN",deserialize:()=>NaN},{is:e=>e instanceof Date,match:e=>e.startsWith("!Date:"),serialize:e=>"!Date:"+e.toISOString(),deserialize:e=>new Date(e.slice(6))},{is:e=>typeof e=="bigint",match:e=>e.startsWith("!BigInt:"),serialize:e=>"!BigInt:"+e.toString(),deserialize:e=>{if(typeof BigInt>"u")throw new Error("Your JavaScript environement does not support BigInt. Consider adding a polyfill.");return BigInt(e.slice(8))}},{is:e=>e instanceof RegExp,match:e=>e.startsWith("!RegExp:"),serialize:e=>"!RegExp:"+e.toString(),deserialize:e=>{e=e.slice(8);const t=e.match(/\/(.*)\/(.*)?/),n=t[1],r=t[2];return new RegExp(n,r)}},{is:e=>e instanceof Map,match:e=>e.startsWith("!Map:"),serialize:(e,t)=>"!Map:"+t(Array.from(e.entries())),deserialize:(e,t)=>new Map(t(e.slice(5)))},{is:e=>e instanceof Set,match:e=>e.startsWith("!Set:"),serialize:(e,t)=>"!Set:"+t(Array.from(e.values())),deserialize:(e,t)=>new Set(t(e.slice(5)))},{is:e=>typeof e=="string"&&e.startsWith("!"),match:e=>e.startsWith("!"),serialize:e=>"!"+e,deserialize:e=>e.slice(1)}];function Ue(e,t={}){const n=JSON.parse(e);return ze(n,t)}function ze(e,t={},n=[]){return typeof e=="string"?Yr(e,t,n):(typeof e=="object"&&e!==null&&Object.entries(e).forEach(([r,o])=>{e[r]=ze(o,t,[...n,r])}),e)}function Yr(e,t,n){const r=o=>Ue(o,t);{const o=t.reviver?.(n,e,r);if(o){if(typeof o.replacement!="string")return o.replacement;if(e=o.replacement,o.resolved)return e}}for(const{match:o,deserialize:i}of Jr)if(o(e))return i(e,r);return e}const qr="vike_pageContext",Xr="vike_globalContext";function Zr(){l(U())}Qr();function Qr(){Zr()}function eo(){const e=rn(qr);return l(P(e,"pageId","string")),l(P(e,"routeParams","string{}")),e}function to(){return rn(Xr)}function rn(e){const t=document.getElementById(e);p(t,`Couldn't find #${e} (which Vike automatically injects in the HTML): make sure it exists (i.e. don't remove it and make sure your HTML isn't malformed)`);const n=t.textContent;return l(n),Ue(n,{reviver(o,i){if(typeof i=="string")return{replacement:i.replaceAll("\\/","/"),resolved:!1}}})}function no(e){return e==null}function ro(e){return!no(e)}function Ge(e,t){return sn(e,t,!0)}function on(e,t){return sn(e,t,!1)}function sn(e,t,n){const r=n?"CLIENT_ONLY":"SERVER_ONLY",o=e.filter(y=>y.isRelevant(t)&&y.fileType!==".page.route").sort(oo(n,t)),i=y=>{const m=o.filter(E=>E.pageId===t&&E.isEnv(y?"CLIENT_AND_SERVER":r));p(m.length<=1,`Merge the following files into a single file: ${m.map(E=>E.filePath).join(" ")}`);const $=m[0];return l($===void 0||!$.isDefaultPageFile),$},s=i(!1),a=i(!0),c=y=>o.filter(m=>m.isRendererPageFile&&m.isEnv(y?"CLIENT_AND_SERVER":r))[0],u=c(!1),f=c(!0),d=o.filter(y=>y.isDefaultPageFile&&!y.isRendererPageFile&&(y.isEnv(r)||y.isEnv("CLIENT_AND_SERVER")));return[s,a,...d,u,f].filter(ro)}function oo(e,t){const n=e?"CLIENT_ONLY":"SERVER_ONLY",r=-1,o=1,i=0;return(s,a)=>{if(!s.isDefaultPageFile&&a.isDefaultPageFile)return r;if(!a.isDefaultPageFile&&s.isDefaultPageFile)return o;{const c=s.isRendererPageFile,u=a.isRendererPageFile;if(!c&&u)return r;if(!u&&c)return o;l(c===u)}{const c=gt(t,s.filePath),u=gt(t,a.filePath);if(c<u)return r;if(u<c)return o;l(c===u)}{if(s.isEnv(n)&&a.isEnv("CLIENT_AND_SERVER"))return r;if(a.isEnv(n)&&s.isEnv("CLIENT_AND_SERVER"))return o}return i}}function gt(e,t){let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];n++);const r=e.slice(n),o=t.slice(n),i=r.split("/").length,s=o.split("/").length;return i+s}async function io(e,t){const r=on(e,t).filter(i=>i.fileType===".page.server");return await Promise.all(r.map(async i=>{i.exportNames||(l(i.loadExportNames,t),await i.loadExportNames())})),{hasOnBeforeRenderServerSideOnlyHook:r.some(({exportNames:i})=>(l(i),i.includes("onBeforeRender")))}}const ht=["urlPathname","urlParsed"],so=["Page","pageExports","exports"];function ao(e){[...so,...ht].forEach(n=>
2{n in e&&(ht.includes(n)?(l(n.startsWith("url")),R(!1,`pageContext.${n} is already available in the browser when using Client Routing; adding '${n}' to passToClient has no effect`,{onlyOnce:!0})):R(!1,`pageContext.${n} is a built-in that cannot be overridden; adding '${n}' to passToClient has no effect`,{onlyOnce:!0}),delete e[n])})}function D(e,t,n){return typeof e=="string"?pt(e.split(""),t,n).join(""):pt(e,t,n)}function pt(e,t,n){const r=[];let o=t>=0?t:e.length+t;l(o>=0&&o<=e.length);let i=n>=0?n:e.length+n;for(l(i>=0&&i<=e.length);!(o===i||(o===e.length&&(o=0),o===i));){const s=e[o];l(s!==void 0),r.push(s),o++}return r}function ye(e,t){l(fn(e),e),l(t.startsWith("/"));const{hashString:n,withoutHash:r}=lo(e);l(n===null||n.startsWith("#"));const o=n===null?"":an(n.slice(1)),{searchString:i,withoutSearch:s}=mt(r);l(i===null||i.startsWith("?"));let a="";if(i!==null)a=i;else if(e.startsWith("#")){const b=ln();a=b&&mt(b).searchString||""}const c={},u={};Array.from(new URLSearchParams(a)).forEach(([b,w])=>{c[b]=w,u[b]=[...u.hasOwnProperty(b)?u[b]:[],w]});let{protocol:f,origin:d,pathnameAbsoluteWithBase:g}=uo(s,t);const y=s.slice((d||"").length);mo(e,d,y,i,n);let{pathname:m,isBaseMissing:$}=po(g,t);const E=un(d,m,i,n),Ce=d?d.slice(f.length):null,{hostname:we,port:X}=fo(Ce,e);return m=co(m),l(m.startsWith("/")),{href:E,protocol:f,hostname:we,port:X,origin:d,pathname:m,pathnameOriginal:y,isBaseMissing:$,search:c,searchAll:u,searchOriginal:i,hash:o,hashOriginal:n}}function lo(e){const[t,...n]=e.split("#");return{hashString:["",...n].join("#")||null,withoutHash:t}}function mt(e){const[t,...n]=e.split("?");return{searchString:["",...n].join("?")||null,withoutSearch:t}}function an(e){try{return decodeURIComponent(e)}catch{}try{return decodeURI(e)}catch{}return e}function co(e){return e=e.replace(/\s+$/,""),e=e.split("/").map(t=>an(t).split("/").join("%2F")).join("/"),e}function uo(e,t){l(!e.includes("?")&&!e.includes("#"));{const{protocol:n,origin:r,pathname:o}=yt(e);if(r)return{protocol:n,origin:r,pathnameAbsoluteWithBase:o};l(o===e)}if(e.startsWith("/"))return{protocol:null,origin:null,pathnameAbsoluteWithBase:e};{const n=ln();let r;return n?r=yt(n.split("?")[0].split("#")[0]).pathname:r=t,{protocol:null,origin:null,pathnameAbsoluteWithBase:ho(e,r)}}}function ln(){return typeof window<"u"?window?.document?.baseURI:void 0}function yt(e){if(hn(e)){const{protocol:t,uriWithoutProtocol:n}=cn(e);l(t);const[r,...o]=n.split("/"),i=t+r;return{pathname:"/"+o.join("/"),origin:i,protocol:t}}else return{pathname:e,origin:null,protocol:null}}function fo(e,t){const n={hostname:null,port:null};if(!e)return n;const r=e.split(":");if(r.length>1){const o=parseInt(r.pop(),10);l(o||o===0,t),n.port=o}return n.hostname=r.join(":"),n}function cn(e){const[n,...r]=e.split(":");if(r.length===0||!/^[a-z][a-z0-9\+\-]*$/i.test(n))return{protocol:null,uriWithoutProtocol:e};let o=n+":",i=r.join(":");const s="//";return i.startsWith(s)&&(o=o+s,i=i.slice(s.length)),{protocol:o,uriWithoutProtocol:i}}function go(e){return["ipfs://","ipns://"].includes(e)?!1:e.endsWith("://")}function ho(e,t){const n=t.split("/"),r=e.split("/");let o=t.endsWith("/");e.startsWith(".")&&n.pop();for(const s in r){const a=r[s];a==""&&s==="0"||a!="."&&(a==".."?n.pop():(o=!1,n.push(a)))}let i=n.join("/");return o&&!i.endsWith("/")&&(i+="/"),i.startsWith("/")||(i="/"+i),i}function po(e,t){l(e.startsWith("/")),l(Me(t));let n=e;if(l(n.startsWith("/")),l(t.startsWith("/")),t==="/")return{pathname:e,isBaseMissing:!1};let r=t;return t.endsWith("/")&&n===D(t,0,-1)&&(r=D(t,0,-1),l(n===r)),n.startsWith(r)?(l(n.startsWith("/")||n.startsWith("http")),l(n.startsWith(r)),n=n.slice(r.length),n.startsWith("/")||(n="/"+n),l(n.startsWith("/")),{pathname:n,isBaseMissing:!1}):{pathname:e,isBaseMissing:!0}}function Me(e){return e.startsWith("/")}function mo(e,t,n,r,o){const i=un(t,n,r,o);l(e===i)}function un(e,t,n,r){return`${e||""}${t}${n||""}${r||""}`}function fn(e){return dn(e)||gn(e)}function dn(e){return yo(e)||hn(e)}function yo(e){return e.startsWith("/")}function gn(e){return[".","?","#"].some(t=>e.startsWith(t))||e===""}function bo(e){return!e.startsWith("/")&&!gn(e)}function hn(e){const{protocol:t}=cn(e);return!!t&&go(t)}function Po(e,t){p(dn(e),Co(e,t))}function Co(e,t,n,r){let o=`${t} is ${h.string(e)} but it should start with ${h.string("/")}`;return o+=` or a protocol (e.g. ${h.string("http://")})`,o}const wo="/";function So(e,t,n){const{pathnameOriginal:r,searchOriginal:o,hashOriginal:i}=ye(e,wo);e.startsWith("/")&&l(e===`${r}${o||""}${i||""}`,{url:e});const s=r.endsWith("/");let a;return a=r+(s?"":"/")+"index",l(a),a=a+t,`${a}${o||""}${i||""}`}const xo=".pageContext.json";function vo(e){return So(e,xo)}function te(e){return typeof e!="object"||e===null?!1:Object.getPrototypeOf(e)===null?!0:e.constructor.name==="Object"}function pn(e,{hookName:t,hookFilePath:n}){if(e==null)return;l(!t.endsWith(")"));const r=`The ${h.cyan("pageContext")} object provided by the ${t}() hook defined by ${n}`;p(T(e),`${r} should be an object (but it's ${h.cyan(`typeof pageContext === ${JSON.stringify(typeof e)}`)} instead)`),p(!("isPageContext"in e),`${r} shouldn't be the whole ${h.cyan("pageContext")} object, see https://vike.dev/pageContext-manipulation#do-not-return-entire-pagecontext`),R(!("pageId"in e),`${r} sets ${h.cyan("pageContext.pageId")} which means that Vike's routing is overridden. This is an experimental feature: make sure to contact a vike maintainer before using this.`,{onlyOnce:!0}),p(!("is404"in e),`${r}
2 sets ${h.cyan("pageContext.is404")} which is forbidden, use ${h.cyan("throw render()")} instead, see https://vike.dev/render`)}function bt(e){return"["+e.map(t=>"'"+t+"'").join(", ")+"]"}function ko(e,t,n){l(!n.endsWith(" "));const r=[],o=Object.keys(e);for(const i of o)t.includes(i)||r.push(i);p(r.length===0,[n,"returned an object with following unknown keys:",bt(r)+".","Only following keys are allowed:",bt(t)+"."].join(" "))}function Ro(e,t){if(e==null)return;const n=`The onBeforeRender() hook defined by ${t}`;p(te(e),`${n} should return a plain JavaScript object, ${h.cyan("undefined")}, or ${h.cyan("null")}`),ko(e,["pageContext"],n),e.pageContext&&pn(e.pageContext,{hookName:"onBeforeRender",hookFilePath:t})}const Eo="The guard() hook defined by";async function Oo(e,t){let n;e._globalContext._pageFilesAll.length>0?(l(e._globalContext._pageConfigs.length===0),n=_o(e.pageId,e._globalContext._pageFilesAll)):n=Re(e,"guard"),n&&await Zt(n,e,t)}function _o(e,t){const n=t.find(c=>c.pageId===e&&c.fileType===".page.route");if(!n)return null;const{filePath:r,fileExports:o}=n;l(o);const i=o.guard;if(!i)return null;const s=r,a=me("guard");return p(B(i),`${Eo} ${s} should be a function`),{hookFn:i,hookName:"guard",hookFilePath:s,hookTimeout:a}}function $o(e,t,{color:n=o=>o,trailingComma:r=!0}={}){if(l(e.length>0),e.length===1)return n(e[0]);const o=e.slice(0,e.length-1),i=e[e.length-1],s=r&&e.length>2?",":"";return o.map(n).join(", ")+`${s} ${t} `+n(i)}function To(e){const t=new Error("AbortRender");return C(t,{_pageContextAbort:e,[mn]:!0}),t}const mn="_isAbortError";function Pt(e){return typeof e=="object"&&e!==null&&mn in e}function Ao(e){return e._urlRewrite||e._urlRedirect||e.abortStatusCode?(l(P(e,"_abortCall","string")),!0):!1}function Io(e){const t=e.at(-1);if(!t)return null;const n=t._pageContextAbort;return l(n),n}
2function Fo(e,t,n){C(t,{_pageContextAbort:n}),e.push(t),jo(e)}function jo(e){if(e.length<10)return;const t=e.map(n=>n._pageContextAbort._abortCall);de(t).length!==t.length&&p(!1,`Infinite loop: ${t.join(" => ")}`)}const Ho="_pageContextInitIsPassedToClient",yn="_isServerSideError";function Lo(e){const t=e.config?.Page||e.exports?.Page;return C(e,{Page:t}),Xt(e),Wo(e),bn(e)}function bn(e){return Be(e)}function Wo(e){Do(e)}function Do(e){Object.entries(e).forEach(([t,n])=>{delete e[t],e[t]=n})}function K(e){return Lo(e)}const Pn=I("getPageContextFromHooks.ts",{}),Cn=["guard","data","onBeforeRender"];function Bo(){const e=eo();return vn(e),C(e,{_hasPageContextFromServer:!0}),e}async function No(e){for(const t of Cn)Sn(t,e)&&(t==="guard"?await kn(e):await wn(t,e));return e}async function _e(e,t){const n={_hasPageContextFromServer:!1};if(!t&&await Go(e)){const r=await Ko(e);if("is404ServerSideRouted"in r)return{is404ServerSideRouted:!0};const{pageContextFromServer:o}=r;n._hasPageContextFromServer=!0,l(!(yn in o)),l(!("serverSideError"in o)),C(n,o)}return{pageContextFromHooksServer:n}}async function Ct(e,t){let n=!1;for(const i of Cn)if(!(!Sn(i,e)&&e._hasPageContextFromServer))if(i==="guard"){if(t)continue;await kn(e)}else i==="data"&&(n=!0),await wn(i,e);const r=xn("data",e);return(n&&r.client||e._hasPageContextFromServer&&r.server)&&await Ke("onData",e),e}async function Ke(e,t){return await Ne(e,t,n=>K(n))}async function wn(e,t){let n;e==="data"?n=await Vo(t):n=await Uo(t),Object.assign(t,n)}async function Vo(e){const n=(await Ke("data",e))[0];if(!n)return;const{hookReturn:r}=n;return{data:r}}async function Uo(e){const n=(await Ke("onBeforeRender",e))[0];if(!n)return;const{hookReturn:r,hookFilePath:o}=n,i={};Ro(r,o);const s=r?.pageContext;return s&&C(i,s),i}function zo(e){e[Ho]&&(Pn.pageContextInitIsPassedToClient=!0)}async function Go(e){if(Je(e)){const{hasOnBeforeRenderServerSideOnlyHook:t}=await io(e._pageFilesAll,e.pageId);return t}return!!Pn.pageContextInitIsPassedToClient||Mo(e)}function Mo(e){if(Je(e))return!1;const t=Ut(e.pageId,e._globalContext._pageConfigs),n=Y(t,"hasServerOnlyHook")?.value;return l(n===!0||n===!1),n}function Sn(e,t){const n=xn(e,t);return!!n.client&&!n.server}function xn(e,t){if(Je(t))return{client:!1,server:!0};const n=Ut(t.pageId,t._globalContext._pageConfigs);return Y(n,`${e}Env`)?.value??{}}async function Ko(e){let t=vo(e._urlRewrite??e.urlOriginal);const n=await fetch(t);{const i=n.headers.get("content-type"),s="application/json",a=i&&i.includes(s);if(!a&&n.status===404)return W(e.urlOriginal),{is404ServerSideRouted:!0};p(a,`Wrong Content-Type for ${t}: it should be ${s} but it's ${i} instead. Make sure to properly use pageContext.httpResponse.headers, see https://vike.dev/renderPage`)}const r=await n.text(),o=Ue(r);if(l(T(o)),Ao(o))throw To(o);if("serverSideError"in o||yn in o)throw Vt("pageContext couldn't be fetched because an error occurred on the server-side");return vn(o),{pageContextFromServer:o}}function vn(e){p(!("urlOriginal"in e),"Adding 'urlOriginal' to passToClient is forbidden"),l(P(e,"pageId","string")),ao(e)}function Je(e){return e._globalContext._pageConfigs.length===0}async function kn(e){await Oo(e,t=>K(t))}function G(e,t,n){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(e,t,{...r,enumerable:n})}function Jo(e,t){return C(e,t),e}function Yo(){const e={_isOriginalObject:!0,isPageContext:!0};return G(e,"_isOriginalObject",!1),e}function se(e,t,{get:n,...r}){Object.defineProperty(e,t,{...r,get:n})}function qo(e){l(typeof e.urlOriginal=="string"),Xt(e);const t={};return se(t,"urlPathname",{get:En,enumerable:!0,configurable:!0}),se(t,"url",{get:Xo,enumerable:!1,configurable:!0}),se(t,"urlParsed",{get:Zo,enumerable:!0,configurable:!0}),t}function Rn(e){const t=s=>l(typeof n=="string",{src:s,urlResolved:n});let n,r;e.urlLogical?(n=e.urlLogical,r=!1,t(1)):e._urlRewrite?(n=e._urlRewrite,r=!1,t(2)):(n=e.urlOriginal,r=!0,t(3)),t(4);let o=e._urlHandler;o||(o=s=>s),n=o(n);const i=r?e._baseServer:"/";return ye(n,i)}function En(){const{pathname:e}=Rn(this),t=e;return l(t.startsWith("/")),t}function Xo(){return R(!1,"`pageContext.url` is outdated. Use `pageContext.urlPathname`, `pageContext.urlParsed`, or `pageContext.urlOriginal` instead. (See https://vike.dev/migration/0.4.23 for more information.)",{onlyOnce:!0,showStackTrace:!0}),En.call(this)}function Zo(){const{isBaseMissing:e,...t}=Rn(this),n=U(),r=i=>{R(n,`pageContext.urlParsed.${i} isn't available on the server-side (HTTP requests don't include the URL hash)`,{onlyOnce:!0,showStackTrace:!0})},o={...t,get hash(){return r("hash"),t.hash},get hashOriginal(){return r("hashOriginal"),t.hashOriginal}
2,get hashString(){return R(!1,"pageContext.urlParsed.hashString has been renamed to pageContext.urlParsed.hashOriginal",{onlyOnce:!0,showStackTrace:!0}),r("hashString"),t.hashOriginal},get searchString(){return R(!1,"pageContext.urlParsed.searchString has been renamed to pageContext.urlParsed.searchOriginal",{onlyOnce:!0,showStackTrace:!0}),t.searchOriginal}};return G(o,"hashString",!1),G(o,"searchString",!1),n||(G(o,"hash",!1),G(o,"hashOriginal",!1)),o}function On(){return l(Qo("/")),"/"}function Qo(e){return e.startsWith("/")}function ei(e,t,n){Object.keys(e).filter(r=>!0).forEach(r=>delete e[r]),Object.defineProperties(e,Object.getOwnPropertyDescriptors(t))}const ti=["clientRouting"];function ni(e){ti.forEach(t=>{if(l(e.fileExports),!(t in e.fileExports))return;const n=`The value of \`${t}\` is only allowed to be \`true\`.`;p(e.fileExports[t]!==!1,`${e.filePath} has \`export { ${t} }\` with the value \`false\` which is prohibited: remove \`export { ${t} }\` instead. (${n})`),p(e.fileExports[t]===!0,`${e.filePath} has \`export { ${t} }\` with a forbidden value. ${n}`)})}const _n=["render","clientRouting","prerender","doNotPrerender"];function ri(e,t){p(!_n.includes(e),`${t} has \`export default { ${e} }\` which is prohibited, use \`export { ${e} }\` instead.`)}function oi(e){const t=".page.",n=D(e.split(t),0,-1).join(t);return l(!n.includes("\\")),n}function ii(e,t){if(t.length>0){const r=t.filter(o=>o.isErrorPage);return r.length===0?null:(p(r.length===1,"Only one error page can be defined"),r[0].pageId)}const n=de(e.map(({pageId:r})=>r).filter(r=>be(r)));if(p(n.length<=1,`Only one _error.page.js is allowed, but found several: ${n.join(" ")}`),n.length>0){const r=n[0];return l(r),r}return null}function be(e,t){return l(!e.includes("\\")),e.includes("/_error")}const si=["js","cjs","mjs"],ai=["ts","cts","mts"],li=[...si,...ai],ci=["jsx","cjsx","mjsx"],ui=["tsx","ctsx","mtsx"],fi=[...ci,...ui],$n=["vue","svelte","marko","md","mdx"],di=[...li,...fi,...$n];function Tn(e){return di.some(t=>e.endsWith("."+t))}function gi(e){return $n.some(t=>e.endsWith("."+t))}const hi=[".page",".page.server",".page.route",".page.client",".css"];function pi(e){if(e.endsWith(".css"))return".css";l(Tn(e),e);const n=e.split("/").slice(-1)[0].split("."),r=n.slice(-3)[0],o=n.slice(-2)[0];if(o==="page")return".page";if(l(r==="page",e),o==="server")return".page.server";if(o==="client")return".page.client";if(o==="route")return".page.route";l(!1,e)}function An(e){const t=i=>o.pageId===i||o.isDefaultPageFile&&(wt(o.filePath)||mi(i,o.filePath)),n=pi(e),o={filePath:e,fileType:n,isEnv:i=>{if(l(n!==".page.route"),i==="CLIENT_ONLY")return n===".page.client"||n===".css";if(i==="SERVER_ONLY")return n===".page.server";if(i==="CLIENT_AND_SERVER")return n===".page";l(!1)},isRelevant:t,isDefaultPageFile:$e(e),isRendererPageFile:n!==".css"&&$e(e)&&wt(e),isErrorPageFile:be(e),pageId:oi(e)};return o}function $e(e){return be(e)?!1:e.includes("/_default")}function wt(e){return e.includes("/renderer/")}function mi(e,t){l(!e.endsWith("/")),l(!t.endsWith("/")),l($e(t));const n=D(t.split("/"),0,-1).filter(r=>r!=="_default").join("/");return e.startsWith(n)}const yi=["$$registrations","_rerender_only"],bi=[".md",".mdx"],Pi=["server"];function Ci(e,t,n){const r=Object.keys(e),o=u=>u==="default"||u===n,i=r.filter(o),s=h.code("export default"),a=h.code(`export { ${n} }`);i.length===0&&p(!1,`${t} should define ${a} or ${s}`),i.length===2&&p(!1,`${t} is ambiguous: remove ${s} or ${a}`),l(i.length===1),Pi.includes(n)||bi.some(u=>t.endsWith(u))||r.filter(f=>!o(f)).filter(f=>!yi.includes(f)).forEach(f=>{R(!1,`${t} unexpected ${h.cyan(`export { ${f} }`)}, see https://vike.dev/no-side-exports`,{onlyOnce:!0})})}function wi(e,t){const n=e.map(o=>{const i=Te(o.configValuesSerialized);return Si(i),{...o,configValues:i}}),r={configValues:{}};{const o=Te(t.configValuesSerialized);Object.assign(r.configValues,o)}return{pageConfigs:n,pageConfigGlobal:r}}function Si(e){const t="route",n=e[t];if(!n)return;const{value:r,definedAtData:o}=n,i=typeof r;l(o);const s=kr("Config",t,o);p(i==="string"||B(r),`${s}
2 has an invalid type '${i}': it should be a string or a function instead, see https://vike.dev/route`)}function Te(e){const t={};return Object.entries(e).forEach(([r,o])=>{let i;if(o.type==="cumulative"){const{valueSerialized:s,...a}=o;i={value:s.map((u,f)=>{const{value:d,sideExports:g}=St(u,r,()=>{const y=o.definedAtData[f];return l(y),y});return n(g),d}),...a}}else{const{valueSerialized:s,...a}=o,{value:c,sideExports:u}=St(s,r,()=>{l(o.type!=="computed");const{definedAtData:f}=o;return Array.isArray(f)?f[0]:f});n(u),i={value:c,...a}}t[r]=i}),t;function n(r){r.forEach(o=>{const{configName:i,configValue:s}=o;t[i]||(t[i]=s)})}}function St(e,t,n){if(e.type==="js-serialized"){let{value:r}=e;return r=ze(r),{value:r,sideExports:[]}}if(e.type==="pointer-import"){const{value:r}=e;return{value:r,sideExports:[]}}if(e.type==="plus-file"){const r=n(),{exportValues:o}=e;l(!r.definedBy),Ci(o,r.filePathToShowToUser,t);let i,s=!1;const a=[];return Object.entries(o).forEach(([c,u])=>{c!=="default"&&c!==t?a.push({configName:c,configValue:{type:"standard",value:u,definedAtData:{filePathToShowToUser:r.filePathToShowToUser,fileExportPathToShowToUser:[c]}}}):(i=u,l(!s),s=!0)}),l(s),{value:i,sideExports:a}}l(!1)}function In(e,t,n){l(e,typeof e),t(e)||l(!1,{moduleExports:e,moduleExportsKeys:xi(e),moduleId:n})}function xi(e){return[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e),...Object.keys(e)]}function vi(e){In(e,a=>"pageFilesLazy"in a),l(P(e,"pageFilesLazy","object")),l(P(e,"pageFilesEager","object")),l(P(e,"pageFilesExportNamesLazy","object")),l(P(e,"pageFilesExportNamesEager","object")),l(P(e.pageFilesLazy,".page")),l(P(e.pageFilesLazy,".page.client")||P(e.pageFilesLazy,".page.server")),l(P(e,"pageFilesList","string[]")),l(P(e,"pageConfigsSerialized")),l(P(e,"pageConfigGlobalSerialized"));const{pageConfigsSerialized:t,pageConfigGlobalSerialized:n}=e;ki(t),Ri(n);const{pageConfigs:r,pageConfigGlobal:o}=wi(t,n),i={};oe(e.pageFilesLazy).forEach(({filePath:a,pageFile:c,globValue:u})=>{c=i[a]=i[a]??c;const f=u;xt(f),c.loadFile=async()=>{"fileExports"in c||(c.fileExports=await f(),ni(c))}}),oe(e.pageFilesExportNamesLazy).forEach(({filePath:a,pageFile:c,globValue:u})=>{c=i[a]=i[a]??c;const f=u;xt(f),c.loadExportNames=async()=>{if(!("exportNames"in c)){const d=await f();l(P(d,"exportNames","string[]"),c.filePath),c.exportNames=d.exportNames}}}),oe(e.pageFilesEager).forEach(({filePath:a,pageFile:c,globValue:u})=>{c=i[a]=i[a]??c;const f=u;l(T(f)),c.fileExports=f}),oe(e.pageFilesExportNamesEager).forEach(({filePath:a,pageFile:c,globValue:u})=>{c=i[a]=i[a]??c;const f=u;l(T(f)),l(P(f,"exportNames","string[]"),c.filePath),c.exportNames=f.exportNames}),e.pageFilesList.forEach(a=>{i[a]=i[a]??An(a)});const s=Object.values(i);return s.forEach(({filePath:a})=>{l(!a.includes("\\"))}),{pageFilesAll:s,pageConfigs:r,pageConfigGlobal:o}}function oe(e){const t=[];return Object.entries(e).forEach(([n,r])=>{l(hi.includes(n)),l(T(r)),Object.entries(r).forEach(([o,i])=>{const s=An(o);l(s.fileType===n),t.push({filePath:o,pageFile:s,globValue:i})})}),t}function xt(e){l(B(e))}function ki(e){l(H(e)),e.forEach(t=>{l(T(t)),l(P(t,"pageId","string")),l(P(t,"routeFilesystem")),l(P(t,"configValuesSerialized"))})}function Ri(e){l(P(e,"configValuesSerialized"))}function ae(e){return(t,n)=>{const r=e(t),o=e(n);return r===o?0:r>o?-1:1}}function Ei(e){return(t,n)=>{const r=e(t),o=e(n);return r===o?0:r<o?-1:1}}function N(e){return(t,n)=>{const r=e(t),o=e(n);if(l([!0,!1,null].includes(r)),l([!0,!1,null].includes(o)),r===o)return 0;if(r===!0||o===!1)return-1;if(o===!0||r===!1)return 1;l(!1)}}function Oi(e){return N(t=>{const n=e(t);return n===null?null:!n})}function _i(e,t,n){const r=jn({pageConfigGlobalValues:e,pageConfigValues:n}),o=Fn(r),i=(()=>{if(t.isErrorPage)return{...o,isErrorPage:!0};{const s=o.config.route??t.routeFilesystem.routeString;return{...o,route:s}}})();return[t.pageId,i]}function Fn(e){return{config:e.config,_source:e.source,_sources:e.sources,_from:e.from}}function jn({pageConfigGlobalValues:e,pageConfigValues:t}){const n={...e,...t};return Hn({configValues:n})}function $i(e,t,n){const r={},o={},i={};e.forEach(g=>
2{Ii(g).forEach(({exportName:m,exportValue:$,isFromDefaultExport:E})=>{l(m!=="default"),i[m]=i[m]??[],i[m].push({exportValue:$,exportSource:`${g.filePath} > ${E?`\`export default { ${m} }\``:`\`export { ${m} }\``}`,filePath:g.filePath,_filePath:g.filePath,_fileType:g.fileType,_isFromDefaultExport:E})})});let s,a,c;if(t){const g=jn({pageConfigGlobalValues:n.configValues,pageConfigValues:t.configValues});s=g.source,a=g.sources,c=g.from,Object.assign(r,g.config),Object.assign(o,g.configEntries),Object.assign(i,g.exportsAll)}else s={},a={},c={configsStandard:{},configsCumulative:{},configsComputed:{}};const u={},f={};Object.entries(i).forEach(([g,y])=>{y.forEach(({exportValue:m,_fileType:$,_isFromDefaultExport:E})=>{f[g]=f[g]??m,$===".page"&&!E&&(g in u||(u[g]=m))})}),l(!("default"in f)),l(!("default"in i));const d={config:r,from:c,source:s,sources:a,configEntries:o,exports:f,exportsAll:i};return se(d,"pageExports",{get:()=>(U()||R(!1,"pageContext.pageExports is outdated, use pageContext.exports instead",{onlyOnce:!0,showStackTrace:!0}),u),enumerable:!1,configurable:!0}),d}function Ti(e,t){return Ai(e,t,r=>r.configValues)}function Ai(e,t,n){const r=n(t,!0),o=Hn({configValues:r}),i=Fn(o),s=Object.fromEntries(e.map(c=>{const u=n(c);return _i(r,c,u)})),a={...i,pages:s};return{...a,_globalConfigPublic:a}}function Hn(e){const t={},n={},r={},o={},i={},s={configsStandard:{},configsCumulative:{},configsComputed:{}},a=(u,f)=>{o[f]=u,i[f]??(i[f]=[]),i[f].push(u)},c=(u,f,d)=>{const g=zt(d),y=Mt("Config",u,d);n[u]=n[u]??[],n[u].push({configValue:f,configDefinedAt:y,configDefinedByFile:g});const m=u;r[m]=r[m]??[],r[m].push({exportValue:f,exportSource:y,filePath:g,_filePath:g,_fileType:null,_isFromDefaultExport:null})};return Object.entries(e.configValues).forEach(([u,f])=>{const{value:d}=f;if(t[u]=t[u]??d,f.type==="standard"){const g={type:"configsStandard",value:f.value,definedAt:M(f.definedAtData,u)};a(g,u),s.configsStandard[u]=g,c(u,d,f.definedAtData)}if(f.type==="cumulative"){const g={type:"configsCumulative",definedAt:M(f.definedAtData,u),values:f.value.map((y,m)=>{const $=f.definedAtData[m];l($);const E=M($,u);return c(u,y,$),{value:y,definedAt:E}})};a(g,u),s.configsCumulative[u]=g}if(f.type==="computed"){const g={type:"configsComputed",definedAt:"Vike",value:f.value};a(g,u),s.configsComputed[u]=g,c(u,d,f.definedAtData)}}),{config:t,configEntries:n,exportsAll:r,source:o,sources:i,from:s}}function Ii(e){const{filePath:t,fileExports:n}=e;l(n),l(Tn(t));const r=[];return Object.entries(n).sort(Oi(([o])=>o==="default")).forEach(([o,i])=>{let s=o==="default";if(s)if(gi(t))o="Page";else{p(T(i),`The ${h.cyan("export default")} of ${t} should be an object.`),Object.entries(i).forEach(([a,c])=>{ri(a,t),r.push({exportName:a,exportValue:c,isFromDefaultExport:s})});return}r.push({exportName:o,exportValue:i,isFromDefaultExport:s})}),r.forEach(({exportName:o,isFromDefaultExport:i})=>{l(!(i&&_n.includes(o)))}),r}async function Fi(e,t,n,r,o){const{previousCreateGlobalContextPromise:i}=t,{promise:s,resolve:a}=Ve({timeout:null});t.previousCreateGlobalContextPromise=s,i&&(l(t.globalContext),await i);try{const c=ji(e);let u;if(t.globalContext?u=!0:(t.globalContext=c,u=!1),n&&c._pageConfigs.length>0){const g=n?.(c);C(c,g)}else{const g=await r?.(c);C(c,g)}{const g=await o?.(c);C(c,g)}const f=Kt(c._pageConfigGlobal,"onCreateGlobalContext");let d=!1;return Li(t.onCreateGlobalContextHooks??[],f)||(t.onCreateGlobalContextHooks=f,await Vr("onCreateGlobalContext",c,qt),d=!0),u&&(d?ei(t.globalContext,c):C(t.globalContext,c,!0)),t.globalContext}finally{a()}}function ji(e){const{pageFilesAll:t,pageConfigs:n,pageConfigGlobal:r}=vi(e),o=Hi(t,n),i=Ti(n,r),s={isGlobalContext:!0,_isOriginalObject:!0,_virtualFileExportsGlobalEntry:e,_pageFilesAll:t,_pageConfigs:n,_pageConfigGlobal:r,_allPageIds:o,...i};return G(s,"_isOriginalObject",!1),s}function Hi(e,t){const n=e.filter(({isDefaultPageFile:i})=>!i).map(({pageId:i})=>i),r=de(n),o=t.map(i=>i.pageId);return[...r,...o]}function Li(e,t){const n=e.map(o=>o.hookFn),r=t.map(o=>o.hookFn);return n.every(o=>r.includes(o))&&r.every(o=>n.includes(o))}const j=I("getGlobalContextClientInternalShared.ts",(()=>{const{promise:e,resolve:t}=Ve();return{globalContextInitialPromise:e,globalContextInitialPromiseResolve:t}})());async function Ln(){if(j.globalContextPromise)return await j.globalContextPromise;const e=Fi(j.virtualFileExportsGlobalEntry,j,()=>{const n={isClientSide:!0};return C(n,to()),n});j.globalContextPromise=e;const t=await e;return l(j.globalContext===t),j.globalContextInitialPromiseResolve(),t}async function Zs(e){j.virtualFileExportsGlobalEntry!==e&&(delete j.globalContextPromise,j.virtualFileExportsGlobalEntry=e,await Ln())}function Wi(e,t){const r=t.filter(({filesystemRoot:i})=>
2e.startsWith(i)).sort(ae(({filesystemRoot:i})=>i.length))[0];let o;if(r){const{filesystemRoot:i,urlRoot:s}=r,a={pageId:e,filesystemRoot:i,urlRoot:s};l(s.startsWith("/")&&e.startsWith("/")&&i.startsWith("/"),a),l(e.startsWith(i),a),i!=="/"?(l(!i.endsWith("/"),a),o=D(e,i.length,0)):o=e,l(o.startsWith("/"),a),o=s+(s.endsWith("/")?"":"/")+D(o,1,0)}else o=e;return l(o.startsWith("/")),o=o.split("/").filter(i=>i!=="pages"&&i!=="src"&&i!=="index").join("/"),l(!o.includes(".page.")),l(!o.endsWith(".")),o.endsWith("/index")&&(o=D(o,0,-6)),o===""&&(o="/"),l(o.startsWith("/")),l(!o.endsWith("/")||o==="/"),o}function Di(e){return typeof e=="object"&&e!==null&&"then"in e&&B(e.then)}async function Bi(e,t,n){let{hookReturn:r}=Qt({hookFn:e,hookFilePath:n,hookName:"route"},t._globalContext,t,Be);if(Wn(r,`The Route Function ${n}`),r=await r,r===!1)return null;if(r===!0&&(r={}),p(te(r),`The Route Function ${n} should return a boolean or a plain JavaScript object (but it's ${h.cyan(`typeof result === ${JSON.stringify(typeof r)}`)} instead)`),"match"in r){const{match:s}=r;if(p(typeof s=="boolean",`The ${h.cyan("match")} value returned by the Route Function ${n} should be a boolean.`),!s)return null}let o=null;"precedence"in r&&(o=r.precedence,p(typeof o=="number",`The ${h.cyan("precedence")} value returned by the Route Function ${n} should be a number.`)),Dn(r,`The ${h.cyan("routeParams")} object returned by the Route Function ${n} should`);const i=r.routeParams||{};return p(!("pageContext"in r),`Providing ${h.cyan("pageContext")} in Route Functions is prohibited, see https://vike.dev/route-function#cannot-provide-pagecontext`),l(te(i)),Object.keys(r).forEach(s=>{p(s==="match"||s==="routeParams"||s==="precedence",`The Route Function ${n} returned an object with an unknown property ${h.cyan(s)} (the known properties are ${h.cyan("match")}, ${h.cyan("routeParams")}, and ${h.cyan("precedence")})`)}
2),{precedence:o,routeParams:i}}function Wn(e,t){R(!Di(e),`${t} returned a promise, but asynchronous routing is deprecated and will be removed in the next major release, see https://vike.dev/route-function#async`,{onlyOnce:!0})}function vt(){const e=h.cyan("iKnowThePerformanceRisksOfAsyncRouteFunctions");R(!1,`${e} is deprecated and will be removed in the next major release`,{onlyOnce:!0})}function Dn(e,t){l(t.endsWith(" should")),P(e,"routeParams")&&p(P(e,"routeParams","string{}"),`${t} be ${h.bold("Record<string, string>")}`)}async function Ni(e,t,n,r){return await Promise.all(e.filter(o=>o.fileType===".page.route").map(o=>o.loadFile?.())),Vi(e,t,n,r)}function Vi(e,t,n,r){const{onBeforeRouteHook:o,filesystemRoots:i}=zi(e,t,n);return{pageRoutes:Ui(i,e,t,r),onBeforeRouteHook:o}}function Ui(e,t,n,r){const o=[];if(n.length>0){l(e===null);const i=!0;n.filter(s=>!s.isErrorPage).forEach(s=>{const a=s.pageId;let c=null;{const u="route",f=Y(s,u);if(f){const d=f.value;l(f.definedAtData);const g=M(f.definedAtData,u);if(typeof d=="string")c={pageId:a,comesFromV1PageConfig:i,routeString:d,routeDefinedAtString:g,routeType:"STRING"};else{const{definedAtData:y}=f;l(!H(y)&&!y.definedBy);const{filePathToShowToUser:m}=y;l(m),l(B(d)),Y(s,"iKnowThePerformanceRisksOfAsyncRouteFunctions","boolean")&&vt(),c={pageId:a,comesFromV1PageConfig:i,routeFunction:d,routeFunctionFilePath:m,routeDefinedAtString:g,routeType:"FUNCTION"}}}}if(!c){const{routeFilesystem:u}=s;l(u);const{routeString:f,definedAtLocation:d}=u;l(u.routeString.startsWith("/")),c={pageId:a,routeFilesystemDefinedBy:d,comesFromV1PageConfig:i,routeString:f,routeDefinedAtString:null,routeType:"FILESYSTEM"}}l(c),o.push(c)})}if(n.length===0){l(e);const i=!1;r.filter(s=>!be(s)).forEach(s=>{const a=t.find(c=>c.pageId===s&&c.fileType===".page.route");if(!a||!("default"in a.fileExports)){const c=Wi(s,e);l(c.startsWith("/")),l(!c.endsWith("/")||c==="/"),o.push({pageId:s,comesFromV1PageConfig:i,routeString:c,routeDefinedAtString:null,routeFilesystemDefinedBy:`${s}.page.*`,routeType:"FILESYSTEM"})}else{const{filePath:c,fileExports:u}=a;if(l(u.default),P(u,"default","string")){const f=u.default;p(f.startsWith("/"),`A Route String should start with a leading slash '/' but ${c} has \`export default '${f}'\`. Make sure to \`export default '/${f}'\` instead.`),o.push({pageId:s,comesFromV1PageConfig:i,routeString:f,routeDefinedAtString:c,routeType:"STRING"});return}if(P(u,"default","function")){const f=u.default;"iKnowThePerformanceRisksOfAsyncRouteFunctions"in u&&vt(),o.push({pageId:s,comesFromV1PageConfig:i,routeFunction:f,routeFunctionFilePath:c,routeDefinedAtString:c,routeType:"FUNCTION"});return}p(!1,`The default export of ${c} should be a string or a function.`)}})}return o}function zi(e,t,n){if(t.length>0)return{onBeforeRouteHook:$r(n,"onBeforeRoute"),filesystemRoots:null};let r=null;const o=[];return e.filter(i=>i.fileType===".page.route"&&i.isDefaultPageFile).forEach(({filePath:i,fileExports:s})=>{if(l(s),"onBeforeRoute"in s){p(P(s,"onBeforeRoute","function"),`\`export { onBeforeRoute }\` of ${i} should be a function.`);const{onBeforeRoute:a}=s,c="onBeforeRoute";r={hookFilePath:i,hookFn:a,hookName:c,hookTimeout:me(c)}}"filesystemRoutingRoot"in s&&(p(P(s,"filesystemRoutingRoot","string"),`\`export { filesystemRoutingRoot }\` of ${i} should be a string.`),p(P(s,"filesystemRoutingRoot","string"),`\`export { filesystemRoutingRoot }\` of ${i} is \`'${s.filesystemRoutingRoot}'\` but it should start with a leading slash \`/\`.`),o.push({filesystemRoot:Gi(i),urlRoot:s.filesystemRoutingRoot}))}),{onBeforeRouteHook:r,filesystemRoots:o}}function Gi(e){l(e.startsWith("/")),l(!e.endsWith("/"));const t=e.split("/"),n=D(t,0,-1).join("/")||"/";return l(n.startsWith("/")),l(!n.endsWith("/")||n==="/"),n}async function Mi(){const e=await Ln();return C(e,await Ki(e)),e}async function Ki(e){const{pageRoutes:t,onBeforeRouteHook:n}=await Ni(e._pageFilesAll,e._pageConfigs,e._pageConfigGlobal,e._allPageIds);return{_pageRoutes:t,_onBeforeRouteHook:n}}async function Bn(e){const t=Ji(e),n=await Mi();C(t,{_globalContext:n,_pageFilesAll:n._pageFilesAll});const r=Jo(t,n._globalConfigPublic);return z(t,r),t}function Ji(e){const t=Yo();C(t,{isClientSide:!0,isPrerendering:!1,urlOriginal:e,_urlHandler:null});const n=On();l(Me(n)),C(t,{_baseServer:n});const r=qo(t);return C(t,r),t}const Nn=I("utils/assertRouterType.ts",{});function Vn(){qi(Yi()),Nn.isClientRouting=!0}function Yi(){return Nn.isClientRouting!==!1}function qi(e){p(U(),`${h.cyan("import { something } from 'vike/client/router'")} is forbidden on the server-side`,{showStackTrace:!0}),R(e,"You shouldn't `import { something } from 'vike/client/router'` when using Server Routing. The 'vike/client/router' utilities work only with Client Routing. In particular, don't `import { navigate }` nor `import { prefetch }` as they unnecessarily bloat your client-side bundle sizes.",{showStackTrace:!0,onlyOnce:!0})}function Un(e,t){const n=e.filter(o=>o.pageId===t);return l(n.length<=1),n[0]??null}async function Xi(e,t){if("isPageEntryLoaded"in e)return e;const{moduleId:n,moduleExportsPromise:r}=e.loadVirtualFilePageEntry(),o=await r;In(o,()=>"configValuesSerialized"in o,n);const i=o;let s;try{s=kt(i)}catch(a){if(!(a instanceof ReferenceError)&&!(a instanceof TypeError))throw a;await new Promise(c=>setTimeout(c)),s=kt(i)}return Object.assign(e.configValues,s),C(e,{isPageEntryLoaded:!0}),e}function kt(e){return Te(e.configValuesSerialized)}const zn="_isAssetsError";async function Gn(e,t,n,r){const o=Ge(t,e),i=Un(n,e);let s;try{s=(await Promise.all([i&&Xi(i,!1),...o.map(u=>u.loadFile?.())]))[0]}catch(c){throw Zi(c)&&Object.assign(c,{[zn]:!0}),c}const a={};return C(a,$i(o,s,r)),C(a,{_pageFilesLoaded:o}),a}function Ye(e){return e?e[zn]===!0:!1}function Zi(e){return e instanceof Error?["Failed to fetch dynamically imported module","error loading dynamically imported module","Importing a module script failed","error resolving module specifier","failed to resolve module"].some(n=>e.message.toLowerCase().includes(n.toLowerCase())):!1}function ne(e,t){l(!e.startsWith("#"));const{searchOriginal:n,hashOriginal:r,pathname:o}=ye(e,"/");let i=`${o}${n||""}`;
2return t?.withoutHash||(i+=r||""),l(i.startsWith("/")),i}function Mn(e){const t=e.getAttribute("href");return t===null||!fn(t)||t===""||bo(t)||ns(t)||es(e)||ts(e)||!rs(t)||!Qi(e)}function Qi(e){if(os()){const n=e.getAttribute("data-vike-link");return n!==null&&n!=="false"}else return!0}function es(e){const t=e.getAttribute("target"),n=e.getAttribute("rel");return t==="_blank"||t==="_external"||n==="external"||e.hasAttribute("download")}function ts(e){return e.getAttribute("data-vike")==="false"}function ns(e){return!!(e.startsWith("#")||e.includes("#")&&ne(e,{withoutHash:!0})===ne(window.location.href,{withoutHash:!0}))}function Qs(e){return e.startsWith("#")?e===window.location.hash:ne(e)===ne(window.location.href)}function rs(e){const t=On();l(Me(t));const{isBaseMissing:n}=ye(e,t);return!n}function os(){return!!window._disableAutomaticLinkInterception}function ee(e){return e.fileType===".css"?[]:e.exportNames?e.exportNames:(l(e.fileExports,e.filePath),Object.keys(e.fileExports))}function is({pageFilesClientSide:e,pageFilesServerSide:t,pageId:n}){return{isHtmlOnly:r(),isClientRouting:i()};function r(){return t.some(a=>a.pageId===n&&a.fileType===".page")?(o(),!1):!(!t.some(a=>a.pageId===n&&a.fileType===".page.server")||e.some(a=>a.pageId===n&&a.fileType===".page.client"&&ee(a).includes("render")))}function o(){const s=e.some(a=>ee(a).includes("render"));p(s,["No client-side `render()` hook found.","See https://vike.dev/render-modes for more information.",["Loaded client-side page files (none of them `export { render }`):",...e.map((a,c)=>` (${c+1}): ${a.filePath}`)].join(`
3`)].join(" "))}function i(){return e.some(a=>ee(a).includes("clientRouting"))}}function ss({pageFilesClientSide:e,pageFilesServerSide:t,isHtmlOnly:n,isClientRouting:r}){let o=[];const i=t.filter(a=>!e.includes(a)),s=[];if(s.push(...e.map(a=>({id:a.filePath,onlyAssets:!1,eagerlyImported:!1}))),s.push(...i.map(a=>({id:a.filePath,onlyAssets:!0,eagerlyImported:!1}))),n)o=e.map(a=>a.filePath);else{const a=as(r);s.push({id:a,onlyAssets:!1,eagerlyImported:!1}),o=[a]}return{clientEntries:o,clientDependencies:s}}function as(e){return e?"@@vike/dist/client/runtime-client-routing/entry.js":"@@vike/dist/client/runtime-server-routing/entry.js"}function ls(e,t){let n=Ge(e,t);const r=on(e,t),{isHtmlOnly:o,isClientRouting:i}=is({pageFilesClientSide:n,pageFilesServerSide:r,pageId:t});o&&(n=n.filter(c=>c.isEnv("CLIENT_ONLY")&&!ee(c).includes("render")),n=us(n));const{clientEntries:s,clientDependencies:a}=ss({pageFilesClientSide:n,pageFilesServerSide:r,isHtmlOnly:o,isClientRouting:i});return{isHtmlOnly:o,isClientRouting:i,clientEntries:s,clientDependencies:a,pageFilesClientSide:n,pageFilesServerSide:r}}async function cs(e,t,{sharedPageFilesAlreadyLoaded:n}){const r=Ge(e,t);await Promise.all(r.map(async o=>{l(o.isEnv("CLIENT_ONLY")||o.isEnv("CLIENT_AND_SERVER")),await o.loadExportNames?.()}))}function us(e){const t=[];for(const n of e)if(t.push(n),ee(n).includes("overrideDefaultPages"))break;return t}function fs(e,t,n){if(e){const r=Y(e,"clientRouting","boolean")?.value??!1;return{isClientRuntimeLoaded:Y(e,"isClientRuntimeLoaded","boolean")?.value??!1,isClientRouting:r}}else{const{isHtmlOnly:r,isClientRouting:o}=ls(t,n);return{isClientRuntimeLoaded:!r,isClientRouting:o}}}async function Ae(e,t){await cs(t._pageFilesAll,e,{sharedPageFilesAlreadyLoaded:!1});const n=Un(t._globalContext._pageConfigs,e),{isClientRuntimeLoaded:r,isClientRouting:o}=fs(n,t._pageFilesAll,e);return r&&o}function ds(e){return e.replace(/[/\-\\^$*+?.()|[\]{}]/g,"\\$&")}const Kn="@",Ie=":";function gs(e,t="Invalid"){let n=`${t} Route String ${V(e)}`;p(e!=="",`${n} (empty string): set it to ${V("/")} instead`),p(["/","*"].includes(e[0]),`${n}: it should start with ${V("/")} or ${V("*")}`),p(!e.includes("**"),`${n}: set it to ${V(e.split("**").join("*"))} instead`)}function Fe(e,t){gs(e);const n=qe(e),r=n.map(d=>d.param?"[^/]+":d.glob?".*":ds(d.static)).map(d=>`(${d})`).join(""),o=new RegExp(`^${r}/?$`),i=t.match(o);if(!i)return null;const s={},[a,...c]=i;let u=0;const f=n.filter(d=>d.glob).length>1;
3return n.forEach((d,g)=>{let y=c[g];if(d.param&&(s[d.param]=y),d.glob){const m=`*${f?++u:""}`;s[m]=y}}),{routeParams:s}}function qe(e){const t=[],n=o=>{const i=t[t.length-1];i?.static?i.static+=o:t.push({static:o})},r=e.split("/");return r.forEach((o,i)=>{i!==0&&n("/"),ps(o)?(R(!o.startsWith(Ie),`Outdated Route String ${V(e)}, use ${V(e.split(Ie).join(Kn))} instead`,{onlyOnce:!0}),t.push({param:o.slice(1)})):o==="*"&&i===r.length-1&&e!=="*"&&e!=="/*"?t.push({glob:!0}):o.split("*").forEach((s,a)=>{a!==0&&t.push({glob:!0}),s!==""&&n(s)})}),t}function hs(e){const t=[];return qe(e).forEach(r=>{r.param&&t.push(r.param)}),t}function ie(e){const t=qe(e),n=a=>a?.split("/").filter(Boolean).length||0;let r=0;for(const a of t){if(!a.static)break;r+=n(a.static)}const o=t.map(a=>n(a.static)).reduce((a,c)=>a+c,0),i=t.filter(a=>a.param).length,s=t.filter(a=>a.glob).length;return{numberOfStaticPartsBeginning:r,numberOfStaticParts:o,numberOfParams:i,numberOfGlobs:s}}function ps(e){return e.startsWith(Kn)||e.startsWith(Ie)}function Rt(e){const n=Fe(e,e);return l(n),Object.keys(n.routeParams).length===0}function V(e){return U()?`'${e}'`:(e===""&&(e="''"),h.cyan(e))}function ms(e){e.sort(ys).sort(N(t=>t.routeType==="FUNCTION"&&!!t.precedence&&t.precedence<0)).sort(N(t=>t.routeType==="STRING"&&Rt(t.routeString)===!1)).sort(N(t=>t.routeType==="FUNCTION"&&!t.precedence)).sort(N(t=>t.routeType==="STRING"&&Rt(t.routeString)===!0)).sort(N(t=>t.routeType==="FILESYSTEM")).sort(N(t=>t.routeType==="FUNCTION"&&!!t.precedence&&t.precedence>0))}function ys(e,t){{const n=e.precedence??0,r=t.precedence??0;if(n!==r)return n>r?-1:1}if(!t.routeString||!e.routeString)return 0;{const r=ae(o=>ie(o).numberOfStaticPartsBeginning)(e.routeString,t.routeString);if(r!==0)return r}{const r=ae(o=>ie(o).numberOfStaticParts)(e.routeString,t.routeString);if(r!==0)return r}{const r=Ei(o=>ie(o).numberOfGlobs)(e.routeString,t.routeString);if(r!==0)return r}{const r=ae(o=>ie(o).numberOfParams)(e.routeString,t.routeString);if(r!==0)return r}return 0}function bs(e,t){if(!te(e))return!1;for(const n of Object.keys(e))if(!t.includes(n))return!1;return!0}async function Ps(e){const t={};if(!e._globalContext._onBeforeRouteHook)return null;const n=await Cs(e._globalContext._onBeforeRouteHook,e);return n&&(C(t,n),P(t,"pageId","string")||P(t,"pageId","null"))?(P(t,"routeParams")?l(P(t,"routeParams","object")):C(t,{routeParams:{}}),C(t,{_routingProvidedByOnBeforeRouteHook:!0}),t):(C(t,{_routingProvidedByOnBeforeRouteHook:!1}),t)}async function Cs(e,t){let{hookReturn:n}=Qt(e,t._globalContext,t,Be);Wn(n,`The onBeforeRoute() hook ${e.hookFilePath}`),n=await n;const r=`The onBeforeRoute() hook defined by ${e.hookFilePath}`;if(p(n==null||bs(n,["pageContext"])&&P(n,"pageContext"),`${r} should return ${h.cyan("null")}, ${h.cyan("undefined")}, or a plain JavaScript object ${h.cyan("{ pageContext: { /* ... */ } }")}`),n==null)return null;if(p(P(n,"pageContext","object"),`${r} returned ${h.cyan("{ pageContext }")} but pageContext should be a plain JavaScript object.`),P(n.pageContext,"pageId")&&!P(n.pageContext,"pageId","null")){const s=`${r} returned ${h.cyan("{ pageContext: { pageId } }")} but ${h.cyan("pageId")} should be`;p(P(n.pageContext,"pageId","string"),`${s} a string or null`),p(t._globalContext._allPageIds.includes(n.pageContext.pageId),`${s} ${$o(t._globalContext._allPageIds.map(a=>h.cyan(a)),"or")}`)}P(n.pageContext,"routeParams")&&Dn(n.pageContext,`${r} returned ${h.cyan("{ pageContext: { routeParams } }")} but routeParams should`);const o=s=>`${r} returned ${h.cyan(`{ pageContext: { ${s} } }`)} which is deprecated. Return ${h.cyan("{ pageContext: { urlLogical } }")} instead.`;P(n.pageContext,"url")&&(R(!1,o("url"),{onlyOnce:!0}),n.pageContext.urlLogical=n.pageContext.url,delete n.pageContext.url),P(n.pageContext,"urlOriginal")&&(R(!1,o("urlOriginal"),{onlyOnce:!0}),n.pageContext.urlLogical=n.pageContext.urlOriginal,delete n.pageContext.urlOriginal),P(n.pageContext,"urlLogical")&&Po(n.pageContext.urlLogical,`${r} returned ${h.cyan("{ pageContext: { urlLogical } }")} and ${h.cyan("urlLogical")}`),pn(n.pageContext,{hookFilePath:e.hookFilePath,hookName:"onBeforeRoute"});const i={};return C(i,n.pageContext),i}U()&&Vn();async function Jn(e,t){const n={};{const a=await Ps(e);if(a){if(a._routingProvidedByOnBeforeRouteHook)return l(a.pageId),a;C(n,a)}C(e,a)}const r=e._globalContext._allPageIds;p(r.length>0,"No page found. You must create at least one page."),l(e._globalContext._pageFilesAll.length>0||e._globalContext._pageConfigs.length>0);const{urlPathname:o}=e;l(o.startsWith("/"));const i=[];await Promise.all(e._globalContext._pageRoutes.map(async a=>{const{pageId:c,routeType:u}=a;if(a.routeType==="FILESYSTEM"){const{routeString:f}=a,d=Fe(f,o);
3if(d){const{routeParams:g}=d;i.push({pageId:c,routeParams:g,routeString:f,routeType:u})}return}if(a.routeType==="STRING"){const{routeString:f}=a,d=Fe(f,o);if(d){const{routeParams:g}=d;l(u==="STRING"),i.push({pageId:c,routeString:f,routeParams:g,routeType:u})}return}if(a.routeType==="FUNCTION"){const{routeFunction:f,routeFunctionFilePath:d}=a,g=await Bi(f,e,d);if(g){const{routeParams:y,precedence:m}=g;i.push({pageId:c,precedence:m,routeParams:y,routeType:u})}return}l(!1)})),ms(i);const s=i[0]??null;if(C(n,{_routeMatch:s}),!s)return C(n,{pageId:null,routeParams:{}}),n;{const{routeParams:a}=s;l(te(a)),C(n,{pageId:s.pageId,routeParams:s.routeParams})}return n}const Yn=I("getPageContextCurrent.ts",{pageContextCurrent:null});function qn(){const{pageContextCurrent:e}=Yn;return e}function Et(e){Yn.pageContextCurrent=e}const fe=5e3,Ot={staticAssets:"hover",pageContext:fe},je={staticAssets:"hover",pageContext:!1},ws=je;function Xe(e,t){let n=ws;if("prefetchLinks"in e.exports&&p(!1,"`export { prefetchLinks }` is deprecated, use `export { prefetchStaticAssets }` instead."),"prefetchStaticAssets"in e.exports){const r=e.exports.prefetchStaticAssets;n.staticAssets=r}if("prefetch"in e.exports){const{prefetch:r}=e.exports;r===!0&&(n=Ot),r===!1&&(n=je),Object.assign(n,r),n.pageContext===!0&&(n.pageContext=fe)}if(n.staticAssets,t){{let r=t.getAttribute("data-prefetch");r!==null&&(r===""&&(r="true"),r==="true"&&(n=Ot),r==="false"&&(n=je))}{let r=t.getAttribute("data-prefetch-static-assets");r!==null&&(r==="false"&&(n.staticAssets=!1),n.staticAssets=r)}{let r=t.getAttribute("data-prefetch-page-context");if(r!==null){r===""&&(r="true"),r==="true"&&(n.pageContext=fe),r==="false"&&(n.pageContext=!1);const o=parseInt(r,10);Number.isNaN(o)||(n.pageContext=o)}}}return n}Vn();const F=I("prefetch.ts",{linkPrefetchHandlerAdded:new WeakSet,addLinkPrefetchHandlers_debounce:null,mutationObserver:new MutationObserver(Ze),linkTags:document.getElementsByTagName("A"),prefetchedPageContexts:{}});function Ss(e){if(!Xe(e,null).pageContext)return null;const n=Qe(e.urlPathname),r=F.prefetchedPageContexts[n];return!r||r.result.is404ServerSideRouted||Zn(r)?null:r.result.pageContextFromHooksServer}async function xs(e){try{await Gn(e.pageId,e._pageFilesAll,e._globalContext._pageConfigs,e._globalContext._pageConfigGlobal)}catch(t){if(Ye(t))We(t,!0);else throw t}}async function vs(e,t){const n=await _e(e,!1);Xn(e,n,t)}function _t(e,t){et()&&Xn(e,t,null)}function Xn(e,t,n){n===null&&(n=ks());const r=Qe(e.urlPathname);l(et()),F.prefetchedPageContexts[r]={resultFetchedAt:Date.now(),resultMaxAge:n,result:t}}function ks(){const e=qn();if(!e)return 1/0;const t=Xe(e,null);return typeof t.pageContext=="number"?t.pageContext:fe}function Ze(){F.addLinkPrefetchHandlers_debounce&&clearTimeout(F.addLinkPrefetchHandlers_debounce),F.addLinkPrefetchHandlers_debounce=setTimeout(()=>{"requestIdleCallback"in window?requestIdleCallback($t,{timeout:300}):setTimeout($t,150)},250)}function ea(){Ze()}function Rs(){F.mutationObserver.observe(document.body,{childList:!0,subtree:!0})}function Es(){F.mutationObserver.disconnect()}function $t(){for(let e of F.linkTags){if(F.linkPrefetchHandlerAdded.has(e)||(F.linkPrefetchHandlerAdded.add(e),Mn(e)))continue;e.addEventListener("mouseover",()=>{xe(e,"hover")},{passive:!0}),e.addEventListener("touchstart",()=>{xe(e,"hover")},{passive:!0}),new IntersectionObserver(n=>{n.forEach(r=>{r.isIntersecting&&xe(e,"viewport")})}).observe(e)}}async function xe(e,t){let n;const r=qn();if(r)n=Xe(r,e);else if(et())n={staticAssets:"hover",pageContext:1/0};else return;if(Mn(e))return;const o=e.getAttribute("href"),i=await Os(o);i?.pageId&&(l(P(i,"pageId","string")),await Ae(i.pageId,i)&&await Promise.all([(async()=>{n.staticAssets===t&&await xs(i)})(),(async()=>{if(t!=="viewport"&&n.pageContext){const s=Qe(o),a=F.prefetchedPageContexts[s];if(!a||Zn(a)){const c=n.pageContext;await vs(i,c)}}})()]))}function Zn(e){return Date.now()-e.resultFetchedAt>e.resultMaxAge}async function Os(e){const t=await Bn(e);let n;try{n=await Jn(t)}catch{return null}return C(t,n),t}function Qe(e){return e.startsWith("#")&&(e="/"),l(e.startsWith("/"),{urlPathname:e}),e.split("#")[0]}function et(){return"_isBrilloutDocpress"in window}async function _s(e,t){let n=null;n=Re(e,"render");{const r=Re(e,"onRenderClient");r&&(n=r)}if(!n){const r=$s(e);if(l(r),e._globalContext._pageConfigs.length>0)p(!1,`No onRenderClient() hook defined for URL '${r}', but it's needed, see https://vike.dev/onRenderClient`);else{const o=e._pageFilesLoaded.filter(s=>s.fileType===".page.client");let i;o.length===0?i="No file `*.page.client.*` found for URL "+r:i="One of the following files should export a render() hook: "+o.map(s=>s.filePath).join(" "),p(!1,i)}}await Zt(n,e,t)}function $s(e){let t;try{t=e.urlPathname??e.urlOriginal}catch{}return t=t??window.location.href,t}function Pe(e){return ne(window.location.href,e)}const J=I("history.ts",{monkeyPatched:!1,previous:void 0});Is();J.previous=st();function Qn(){if(q(window.history.state))return;const e={vike:{timestamp:rt(),scrollPosition:nt(),triggeredBy:"browser"}};ot(e)}function tt(){const e=window.history.state;return it(e),e}function nt(){return{x:window.scrollX,y:window.scrollY}}function rt(){return new Date().getTime()}function He(e){if(e||(e=nt()),!q(window.history.state))return;const t=tt();ot({...t,vike:{...t.vike,scrollPosition:e}})}function Ts(e,t){if(t)ot(tt(),e);else{const n={vike:{timestamp:rt(),scrollPosition:null,triggeredBy:"vike"}};window.history.pushState(n,"",e)}}function ot(e,t){const n=t??null;window.history.replaceState(e,"",n),it(window.history.state)}function Le(e,t){History.prototype.replaceState.bind(window.history)(e,"",t)}function As(){J.monkeyPatched||(J.monkeyPatched=!0,["pushState","replaceState"].forEach(e
3=>{const t=window.history[e].bind(window.history);window.history[e]=(n={},...r)=>{p(n==null||T(n),`history.${e}(state) argument state must be an object`);const o=q(n)?n:{...n,vike:{scrollPosition:nt(),timestamp:rt(),triggeredBy:"user"}};t(o,...r),it(window.history.state),J.previous=st(),queueMicrotask(()=>{q(window.history.state)||(Object.assign(o,window.history.state),Le(o))})}}))}function q(e){return!!e?.vike}function it(e){q(e)||l(!1,{state:e})}function st(){return{url:Pe(),state:tt()}}function ta(){const{previous:e}=J,t=q(window.history.state),n=window.history.state===null;if(!t&&!n)return W(Pe()),{skip:!0};t||Qn();const r=st();return J.previous=r,n?{skip:!0}:{previous:e,current:r}}function Is(){As(),Qn()}function er(e){window.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&e()})}function Fs(e){window.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&e()})}function js(e){return new Promise(t=>setTimeout(t,e))}function Hs(e,t){let n=!1;return()=>{n||(n=!0,setTimeout(()=>{n=!1,e()},t))}}function Ls(e,t){if(!e&&t&&Ds(t)){Ws(t);return}if(tr(e)){nr(e);return}if(e?.preserveScroll)return;const n=Ns();Bs(n)}function Ws(e){const t=window.history.state;Le(null,e),l(window.history.state===null),window.location.replace(e),Le(t,e)}function Ds(e){return e.includes("#")&&e.includes(":~:text")}function Bs(e){if(!e)Tt();else{const t=decodeURIComponent(e),n=document.getElementById(t)||document.getElementsByName(t)[0];n?(n.scrollIntoView(),n.focus()):e==="top"&&Tt()}}function Tt(){nr({x:0,y:0})}function tr(e){return e?.y!==void 0}function nr(e){const t=()=>{window.scrollTo(e.x,e.y)},n=()=>window.scrollX===e.x&&window.scrollY===e.y;n()||(t(),!n()&&requestAnimationFrame(()=>{t(),!n()&&setTimeout(async()=>{if(t(),n())return;const r=new Date().getTime();for(;;)if(await js(10),t(),n()||new Date().getTime()-r>100)return},0)}))}function Ns(){let{hash:e}=window.location;return e===""?null:(l(e.startsWith("#")),e=e.slice(1),e)}function na(){window.addEventListener("scroll",Hs(He,300),{passive:!0}),er(He)}const rr=I("scrollRestoration.ts",{});function ra(){At(),er(At),Fs(()=>rr.initialRenderIsDone&&or())}function Vs(){rr.initialRenderIsDone=!0,or()}function or(){"scrollRestoration"in window.history&&(window.history.scrollRestoration="manual")}function At(){"scrollRestoration"in window.history&&(window.history.scrollRestoration="auto")}function ve(e){T(e)&&e.isAlreadyLogged||console.error(e)}const v=I("renderPageClient.ts",(()=>{const{promise:e,resolve:t}=Ve();return{renderCounter:0,hydrationAwaitPromise:e,hydrationAwaitPromiseResolve:t}})());async function It(e){Ur("renderPageClient()");const{urlOriginal:t=Pe(),overwriteLastHistoryEntry:n=!1,isBackwardNavigation:r=!1,isHistoryNavigation:o=!1,doNotRenderIfSamePage:i,isClientSideNavigation:s=!0,pageContextInitClient:a,pageContextsAborted:c=[]}=e;let{scrollTarget:u}=e;const{previousPageContext:f}=v;Es();const{isRenderOutdated:d,setHydrationCanBeAborted:g,isFirstRender:y}=Gs(),m={urlOriginal:t,isBackwardNavigation:r,isHistoryNavigation:o,pageContextsAborted:c,isClientSideNavigation:s,pageContextInitClient:a,isFirstRender:y};if(v.clientRoutingIsDisabled){W(t);return}if(!y&&(await v.hydrationAwaitPromise,d())||(await v.onRenderClientPreviousPromise,d()))return;return await $();async function $(){const b=async S=>{await E({err:S})},w=await Ft(!1,m);if(d())return;if(v.isFirstRenderDone&&(l(f),!v.isTransitioning)){v.isTransitioning=!0;const S=Ee("onPageTransitionStart",f);try{await ue(S,w,bn)}catch(x){await b(x);return}if(d())return}if(y){const S=Bo();l(!("urlOriginal"in S)),C(w,S),_t(w,{pageContextFromHooksServer:S})}{let S;try{S=await Jn(w)}catch(x){await b(x);return}if(d())return;if(l(!("urlOriginal"in S)),y){const{pageId:x,routeParams:O,...k}=S;C(w,k),l(P(w,"routeParams","string{}"))}else C(w,S);if(!y){if(!S.pageId){W(t);return}const x=await Ae(S.pageId,w);if(d())return;if(!x){W(t);return}const O=S.pageId&&f?.pageId&&S.pageId===f.pageId;if(i&&O)return}}l(P(w,"pageId","string"));const _=await Ht(w,y,d);if(!_.skip){if("err"in _){await b(_.err);return}if(z(w,_.pageContext),Et(w),w.exports.hydrationCanBeAborted&&g(),!d())if(y){l(P(w,"_hasPageContextFromServer","true"));let S;try{S=await No(w)}catch(x){await b(x);return}return d()?void 0:(z(w,S),await X(w))}else{let S;const x=Ss(w);if(x)S=x;else try{const k=await _e(w,!1);if(k.is404ServerSideRouted)return;S=k.pageContextFromHooksServer,_t(w,k)}catch(k){await b(k);return}if(d())return;l(!("urlOriginal"in S)),C(w,S);let O;try{O=await Ct(w,!1)}catch(k){await b(k);return}return d()?void 0:(z(w,O),await X(w))}}}async function E(b){const{err:w}
3=b;l(w),Pt(w)||ve(w);const _=await Ft(!0,m);if(d())return;C(_,{errorWhileRendering:w});let S;if(Pt(w)){const x=await we(w,_);if(x.skip)return;S=x.pageContextAbort}await Ce(_,b,S)}async function Ce(b,w,_){const S=L=>{ve(L)},x=ii(b._pageFilesAll,b._globalContext._pageConfigs);if(!x)throw new Error("No error page defined.");C(b,{pageId:x,routeParams:{}}),_?(l(_.abortStatusCode),l(!("urlOriginal"in _)),C(b,_),C(b,{is404:_.abortStatusCode===404})):C(b,{is404:!1});const O=await Ae(b.pageId,b);if(d())return;if(!O){W(t);return}const k=await Ht(b,y,d);if(k.skip)return;if("err"in k){S(k.err);return}z(b,k.pageContext),Et(b);let Se;try{const L=await _e(b,!0);if(L.is404ServerSideRouted)return;Se=L.pageContextFromHooksServer}catch(L){S(L);return}if(d())return;l(!("urlOriginal"in Se)),C(b,Se);let at;try{at=await Ct(b,!0)}catch(L){S(L);return}d()||(z(b,at),await X(b,w))}async function we(b,w){const S=b._pageContextAbort;if(Fo(c,w,S),S._urlRewrite)return await It({...e,scrollTarget:void 0,pageContextsAborted:c}),{skip:!0};if(S._urlRedirect){const x=S._urlRedirect.url;if(x.startsWith("/"))await It({...e,scrollTarget:void 0,urlOriginal:x,overwriteLastHistoryEntry:!1,pageContextsAborted:c});else return W(x),{skip:!0};return{skip:!0}}return{pageContextAbort:S}}async function X(b,w){const _=async O=>{w?ve(O):await E({err:O})};zs(t,n),v.previousPageContext=b,l(v.onRenderClientPreviousPromise===void 0);const S=(async()=>{let O;try{await _s(b,K)}catch(k){l(k),O=k}return v.onRenderClientPreviousPromise=void 0,v.isFirstRenderDone=!0,O})();v.onRenderClientPreviousPromise=S;const x=await S;if(!(x&&(await _(x),!w))){if(y&&!x){try{await Ne("onHydrationEnd",b,K)}catch(O){if(await _(O),!w)return}if(d(!0))return}if(!d(!0)){if(v.isTransitioning){v.isTransitioning=void 0,l(f);const O=Ee("onPageTransitionEnd",f);try{await ue(O,b,K)}catch(k){if(await _(k),!w)return}if(d(!0))return}if(!u&&f){const O=jt(f),k=jt(b);k!==!1&&O!==!1&&Ms(k,O)&&(u={preserveScroll:!0})}return Ls(u,t),tr(u)&&He(u),Vs(),b._hasPageContextFromServer&&zo(b),Rs(),Ze(),v.renderedPageContext=b,Us(t),v.hydrationAwaitPromiseResolve(),b}}}}async function Ft(e,{urlOriginal:t,isBackwardNavigation:n,isHistoryNavigation:r,pageContextsAborted:o,isClientSideNavigation:i,pageContextInitClient:s,isFirstRender:a}){const c=v.previousPageContext??null,u=await Bn(t);C(u,{isBackwardNavigation:n,isHistoryNavigation:r,isClientSideNavigation:i,isHydration:a&&!e,previousPageContext:c,pageContextsAborted:o,...s}),v.currentPageContext=u,Object.defineProperty(u,"_previousPageContext",{get(){return R(!1,"pageContext._previousPageContext has been renamed pageContext.previousPageContext",{showStackTrace:!0,onlyOnce:!0}),c},enumerable:!1});{const f=Io(o);l(!f||!("urlOriginal"in f)),C(u,f)}return u}function Us(e){window._vike??(window._vike={}),window._vike.fullyRenderedUrl=e}function zs(e,t){Pe()!==e&&Ts(e,t)}function We(e,t){v.clientRoutingIsDisabled=!0,l(Ye(e)),t&&console.log(e),Pr(!1,["Failed to fetch static asset.","This usually happens when a new frontend is deployed.","Falling back to Server Routing.","(The next page navigation will use Server Routing instead of Client Routing.)"].filter(Boolean).join(" "),{onlyOnce:!0})}function Gs(){const e=++v.renderCounter;l(e>=1);let t=!1;return{isRenderOutdated:o=>e===1&&!t&&!o?!1:e!==v.renderCounter,setHydrationCanBeAborted:()=>{t=!0,v.hydrationAwaitPromiseResolve()},isFirstRender:e===1}}function oa(){return v.renderCounter}function jt(e){const t=e.from.configsStandard.keepScrollPosition;if(!t)return!1;let n=t.value;const r=t.definedAt;l(r);const o=hs(r);return B(n)&&(n=n(e,{configDefinedAt:t.definedAt})),n===!0?[r,...o.map(i=>{const s=e.routeParams[i];return l(s),s})]:n}function Ms(e,t){return e===t?!0:!Array.isArray(e)||!Array.isArray(t)?!1:e.length===t.length&&e.every((n,r)=>e[r]===t[r])}async function Ht(e,t,n){let r=!1,o,i;try{i=await Gn(e.pageId,e._pageFilesAll,e._globalContext._pageConfigs,e._globalContext._pageConfigGlobal)}catch(s){if(o=s,r=!0,Ks(o,e,t))return{skip:!0}}if(n())return{skip:!0};if(r)return{err:o};C(e,i);try{await Ne("onCreatePageContext",e,K)}catch{o=o,r=!0}return n()?{skip:!0}:r?{err:o}
3:{pageContext:e}}function Ks(e,t,n){if(!Ye(e))return!1;if(n)throw We(e,!1),e;return We(e,!0),W(t.urlOriginal),!0}const Js="modulepreload",Ys=function(e){return"/"+e},Lt={},ia=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){let c=function(u){return Promise.all(u.map(f=>Promise.resolve(f).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),a=s?.nonce||s?.getAttribute("nonce");o=c(n.map(u=>{if(u=Ys(u),u in Lt)return;Lt[u]=!0;const f=u.endsWith(".css"),d=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${d}`))return;const g=document.createElement("link");if(g.rel=f?"stylesheet":Js,f||(g.as="script"),g.crossOrigin="",g.href=u,a&&g.setAttribute("nonce",a),document.head.appendChild(g),f)return new Promise((y,m)=>{g.addEventListener("load",y),g.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${u}`)))})}))}function i(s){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s}return o.then(s=>{for(const a of s||[])a.status==="rejected"&&i(a.reason);return t().catch(i)})};export{ia as _,l as a,Vn as b,qs as c,p as d,na as e,Ur as f,I as g,oa as h,Is as i,ea as j,Qs as k,ts as l,Mn as m,fn as n,gn as o,ta as p,Xs as q,It as r,ra as s,Bs as t,Ls as u,Zs as v};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.