@void/platform 1.1.11 → 1.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- var ro=Object.defineProperty;var s=(e,t)=>ro(e,"name",{value:t,configurable:!0});function Ct(e,t){let r=e.get(t);return r!==void 0&&(e.delete(t),e.set(t,r)),r}s(Ct,"lruGet");function vt(e,t,r){if(e.size>=256){let n=e.keys().next();n.done||e.delete(n.value)}e.set(t,r)}s(vt,"lruSet");function no(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e===95}s(no,"isNameChar");function It(e,t){return e==="seg"?t!==47:t!==10&&t!==13&&t!==8232&&t!==8233}s(It,"accepts");function Oe(e,t){if(!t)return;let r=e[e.length-1];r?.kind==="text"?r.text+=t:e.push({kind:"text",text:t})}s(Oe,"pushText");function Sr(e){let t=[],r=[],n=!1,o=0;for(;o<e.length;){let a=e[o];if(a===":"){let i=o+1;for(;i<e.length&&no(e.charCodeAt(i));)i++;if(i===o+1){Oe(t,":"),o++;continue}let l=e.slice(o+1,i);r.push(l);let u=e[i]==="*";t.push({kind:u?"any":"seg",name:l}),o=u?i+1:i}else if(a==="*")n?t.push({kind:"any"}):(r.push("splat"),t.push({kind:"any",name:"splat"}),n=!0),o++;else{let i=o+1;for(;i<e.length&&e[i]!==":"&&e[i]!=="*";)i++;Oe(t,e.slice(o,i)),o=i}}return{tokens:t,paramNames:r}}s(Sr,"parseCapture");function Tr(e,t){let r=t.split("*");Oe(e,r[0]);for(let n=1;n<r.length;n++)e.push({kind:"any"}),Oe(e,r[n])}s(Tr,"parseStars");function oo(e){let t=[],r=e.split("/");for(let n=0;n<r.length;n++){let o=r[n];n>0&&Oe(t,"/");let a=o.slice(1,-4);o[0]!==":"||o.length<2?Tr(t,o):o.length>5&&o.endsWith("{.+}")&&!a.includes("{")&&!a.includes("}")?t.push({kind:"plus"}):t.push({kind:"seg"})}return t}s(oo,"parseSegments");function kt(e){let t=[];for(let n of e)n.kind==="any"&&t[t.length-1]?.kind==="any"||t.push(n);let r=new Int32Array(t.length+1);return t.forEach((n,o)=>{let a=n.kind==="text"?n.text.length:n.kind==="any"?0:1;r[o+1]=r[o]+a}),{steps:t,starts:r,minLength:r[t.length]}}s(kt,"prepare");function Pt(e,t,r,n,o){let a=0;if(e.kind==="text"){for(let u=o.length-1;u>=0;u--){let d=n[u]===1&&t.startsWith(e.text,r+u)?1:0;o[u]=d,a|=d}return a===1}let i=e.kind,l=0;for(let u=o.length-1;u>=0;u--){let d=i==="any"?n[u]===1||l===1&&It(i,t.charCodeAt(r+u)):(n[u]===1||l===1)&&It(i,t.charCodeAt(r+u));o[u]=d?1:0,l=o[u],a|=l}return a===1}s(Pt,"stepBack");function Tt(e){let t=new Uint8Array(e);return t[e-1]=1,t}s(Tt,"endRow");function Cr({steps:e,minLength:t},r){let n=e[0],o=e[e.length-1];return r.length<t||n?.kind==="text"&&!r.startsWith(n.text)||o?.kind==="text"&&!r.endsWith(o.text)}s(Cr,"quickReject");function xt(e,t){if(Cr(e,t))return!1;let{steps:r,starts:n,minLength:o}=e,a=Tt(t.length-o+1),i=new Uint8Array(a.length),l=r[0]?.kind==="text"?1:0;for(let u=r.length-1;u>=l;u--){if(!Pt(r[u],t,n[u],a,i))return!1;let d=a;a=i,i=d}return a[0]===1}s(xt,"matches");function so(e,t,r,n,o){if(e.kind==="text")return r+e.text.length;let a=e.kind==="any"?0:1,i=o.length-1-n+a,l=0;for(;l<i&&It(e.kind,t.charCodeAt(r+l));)l++;for(;l>a&&o[n+l-a]!==1;)l--;return r+l}s(so,"greedyEnd");function io(e,t,r){if(Cr(e,t))return null;let{steps:n,starts:o,minLength:a}=e,i=n.length,l=t.length-a+1,u=i*l<=65536?1:Math.ceil(Math.sqrt(i)),d=new Map([[i,Tt(l)]]),f=Tt(l),m=new Uint8Array(l),c=n[0]?.kind==="text"?1:0;for(let g=i-1;g>=c;g--){if(!Pt(n[g],t,o[g],f,m))return null;g%u===0&&d.set(g,m.slice());let S=f;f=m,m=S}if(f[0]!==1)return null;let E=Array.from({length:u},()=>new Uint8Array(l)),p=0,T=s(g=>g===p?d.get(g):E[g%u],"rowAt"),R=new Int32Array(r+1),w=0;for(let g=0;g<=r;g++){if(g+1>p){p=Math.min(i,Math.ceil((g+1)/u)*u);for(let S=p-1;S>g;S--)Pt(n[S],t,o[S],T(S+1),E[S%u])}w=so(n[g],t,w,w-o[g],T(g+1)),R[g]=w}return R}s(io,"greedyEnds");function ao(e){let t="";for(let r of e)r.kind==="text"?t+=r.text.replace(/[.+?^${}()|[\]\\:]/g,"\\$&"):r.kind==="seg"?t+=`(?<${r.name}>[^/]+)`:t+=r.name?`(?<${r.name}>.*)`:".*";return new RegExp(`^${t}$`)}s(ao,"toRegExp");var _r=new Map;function vr(e){let t=Ct(_r,e);if(t)return t;let{tokens:r,paramNames:n}=Sr(e),o,a=new Set;for(let f of n)a.has(f)?o??=`Duplicate capture group name "${f}"`:f.charCodeAt(0)>=48&&f.charCodeAt(0)<=57&&(o??=`Invalid capture group name "${f}"`),a.add(f);let i=kt(r),l=-1;i.steps.forEach((f,m)=>{f.kind!=="text"&&f.name&&(l=m)});let u,d={...i,paramNames:n,error:o,lastNamed:l,get regex(){return u??=ao(Sr(e).tokens)}};return vt(_r,e,d),d}s(vr,"compile");function tt(e){let t=vr(e);if(t.error)throw new SyntaxError(t.error);return t}s(tt,"compilePattern");function rt(e,t){let r=vr(e);if(r.error)return null;let{steps:n,lastNamed:o}=r,a=o===-1?void 0:io(r,t,o);if(a===null||a===void 0&&!xt(r,t))return null;let i=Object.create(null);for(let l of r.paramNames)i[l]="";for(let l=0;a&&l<=o;l++){let u=n[l];u.kind!=="text"&&u.name&&(i[u.name]=t.slice(l===0?0:a[l-1],a[l]))}return i}s(rt,"matchPatternCaptures");var Ir=new Map;function ue(e,t){let r=Ct(Ir,e);if(!r){let n=[];Tr(n,e),r=kt(n),vt(Ir,e,r)}return xt(r,t)}s(ue,"matchLiteralPattern");var Pr=new Map;function G(e,t){let r=Ct(Pr,e);return r||(r=kt(oo(e)),vt(Pr,e,r)),xt(r,t)}s(G,"matchSegmentPattern");function nt(e,t){let r=e.replace(/:([A-Za-z0-9_]+)\*?/g,(n,o)=>t[o]??n);return/^[/\\]{2}/.test(r)&&!/^[/\\]{2}/.test(e)?"/"+r.replace(/^[/\\]+/,""):r}s(nt,"substituteParams");var co=new Set(["set-cookie"]);function lo(e){if(e.length<2||e[0]!=='"'||e[e.length-1]!=='"')return null;let t="";for(let r=1;r<e.length-1;r+=1){let n=e[r];if(n==="\\"){if(r+=1,r>=e.length-1)return null;t+=e[r]}else{if(n==='"')return null;t+=n}}return t}s(lo,"parseQuotedString");function Dt(e){let t=[],r=s(a=>{let i=a.trim();i.length>0&&t.push({raw:i,directive:lo(i)})},"pushMember"),n=0,o=!1;for(let a=0;a<e.length;a+=1){let i=e[a];o?i==="\\"?a+=1:i==='"'&&(o=!1):i==='"'?o=!0:i===","&&(r(e.slice(n,a)),n=a+1)}return r(e.slice(n)),t}s(Dt,"parseClearSiteData");function ot(e){let t=[];for(let{raw:r,directive:n}of Dt(e)){let o=n?.toLowerCase();if(o==="*")return null;n===null||o==="cookies"||t.push(r)}return t.length>0?t.join(", "):null}s(ot,"sanitizeClearSiteData");function q(e,t,r,n){if(!r||r.length===0)return e;let o=[];for(let d of r)ue(d.pattern,t)&&o.push(...d.headers);if(o.length===0)return e;let a=new Response(e.body,e),i=n?.cookieIsolation!=="origin",l=i?e.headers.get("clear-site-data"):null,u=l===null?null:ot(l);for(let[d,f]of o){let m=d.toLowerCase();if(!(i&&co.has(m))){if(i&&m==="clear-site-data"){let c=ot(f);c!==null?a.headers.set(d,c):u!==null?a.headers.set(d,u):a.headers.delete(d);continue}a.headers.set(d,f)}}return a}s(q,"applyHeaderRules");function ne(e,t,r){if(!t?.length)return null;for(let n of t){if(n.host&&n.host!==r)continue;try{tt(n.source)}catch(i){console.warn(`[dispatch] skipping routing rule with invalid source ${JSON.stringify(n.source)}: ${i instanceof Error?i.message:String(i)}`);continue}let o=rt(n.source,e);if(!o)continue;let a=nt(n.destination,o);return n.status===200?{type:"rewrite",destination:a}:{type:"redirect",destination:a,status:n.status}}return null}s(ne,"applyRoutingRules");function Le(e,t){if(!t||t==="?")return e;let r=e.indexOf("#"),n=r===-1?e:e.slice(0,r),o=r===-1?"":e.slice(r),a=n.indexOf("?");if(a===-1)return n+t+o;if(a===n.length-1)return n.slice(0,a)+o;let i=new URLSearchParams(t),l=new URLSearchParams(n.slice(a+1));for(let[u,d]of i)l.has(u)||l.append(u,d);return n.slice(0,a)+"?"+l.toString()+o}s(Le,"mergeQueryIntoLocation");function we(e){let t;try{t=decodeURIComponent(e)}catch{return e}if(t===e)return e;let r=Dr(t);return r===null?e:kr(r)===kr(e)?t:e}s(we,"safeDecodePathname");function kr(e){return e.replace(/%[0-9a-fA-F]{2}/g,t=>t.toUpperCase())}s(kr,"normalizePercentCase");function Dr(e){try{let t=new URL("https://void.invalid/");return t.pathname=e,t.pathname}catch{return null}}s(Dr,"reencodePathname");function xr(e,t,r){if(t[e])return{path:e,hash:t[e]};switch(r){case"auto-trailing-slash":{let n=e+".html";if(t[n])return{path:n,hash:t[n]};let o=(e.endsWith("/")?e:e+"/")+"index.html";if(t[o])return{path:o,hash:t[o]};break}case"force-trailing-slash":{if(!e.endsWith("/")&&e!=="/"){let o=e+"/index.html";if(t[o])return{path:o,hash:t[o],redirect:e+"/"}}let n=e+"index.html";if(t[n])return{path:n,hash:t[n]};break}case"drop-trailing-slash":{if(e==="/"){if(t["/index.html"])return{path:"/index.html",hash:t["/index.html"]};break}if(e.endsWith("/")){let o=e.slice(0,-1),a=o+".html";if(t[a])return{path:a,hash:t[a],redirect:o}}let n=e+".html";if(t[n])return{path:n,hash:t[n]};break}case"none":break}return null}s(xr,"matchManifestEntry");function pe(e,t,r){let n=r.html_handling??"auto-trailing-slash",o=xr(e,t,n);if(!o){let a=we(e);if(a!==e&&(o=xr(a,t,n),o?.redirect!==void 0)){let i=Dr(o.redirect);i!==null&&(o={...o,redirect:i})}}if(o)return o;switch(r.not_found_handling??"none"){case"single-page-application":if(t["/index.html"])return{path:"/index.html",hash:t["/index.html"],spa:!0};break;case"404-page":if(t["/404.html"])return{path:"/404.html",hash:t["/404.html"],notFound:!0};break}return null}s(pe,"resolveStaticPath");var uo={html:"text/html; charset=utf-8",htm:"text/html; charset=utf-8",css:"text/css; charset=utf-8",js:"text/javascript; charset=utf-8",mjs:"text/javascript; charset=utf-8",json:"application/json; charset=utf-8",xml:"application/xml; charset=utf-8",svg:"image/svg+xml; charset=utf-8",txt:"text/plain; charset=utf-8",csv:"text/csv; charset=utf-8",md:"text/markdown; charset=utf-8",markdown:"text/markdown; charset=utf-8",yaml:"text/yaml; charset=utf-8",yml:"text/yaml; charset=utf-8",toml:"application/toml",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",ico:"image/x-icon",webp:"image/webp",avif:"image/avif",woff:"font/woff",woff2:"font/woff2",ttf:"font/ttf",otf:"font/otf",eot:"application/vnd.ms-fontobject",pdf:"application/pdf",wasm:"application/wasm",webmanifest:"application/manifest+json; charset=utf-8",map:"application/json; charset=utf-8",mp4:"video/mp4",webm:"video/webm",mp3:"audio/mpeg",ogg:"audio/ogg"};function Ot(e){let t=e.split(".").pop()?.toLowerCase()??"";return uo[t]??"application/octet-stream"}s(Ot,"getContentType");function Ne(e,t){if(e!=="application/null")return!e||e==="application/octet-stream"?Ot(t):e}s(Ne,"resolveAssetContentType");function Lt(e){let t=new Headers({"Cache-Control":"no-store"});return e.retryAt&&Number.isFinite(Date.parse(e.retryAt))&&t.set("Retry-After",String(Math.max(0,Math.ceil((Date.parse(e.retryAt)-Date.now())/1e3)))),Response.json(e,{status:429,headers:t})}s(Lt,"usageLimitResponse");var Or="x-void-shared-cache-policy";var Lr=200;var fo="public, max-age=0, must-revalidate";function Y(e){let t=new Response(e.body,e);return t.headers.set("Cache-Control",fo),t.headers.delete(Or),t}s(Y,"clientRevalidateResponse");function mo(e){return e.headers.get("content-type")?.toLowerCase().split(";",1)[0]?.trim()}s(mo,"mediaType");function K(e){return mo(e)==="text/event-stream"}s(K,"isEventStreamResponse");function Ue(e,t){if(typeof e!="string"||e.trim()==="")throw new Error(`${t} must be a non-empty string.`);return e}s(Ue,"requiredString");var oe=1073741824,yo={free:{requestsPerMonth:3e6,cpuMsPerRequest:10,maxCpuMsPerRequest:10,subRequestsPerInvocation:50,deploysPerDay:100,d1StorageBytes:1*oe,r2StorageBytes:5*oe,kvStorageBytes:1*oe,aiNeuronsPerMonth:1e5,retainedDeployments:1,sandboxRuntimeSecondsPerMonth:1,sandboxMaxConcurrentInstances:1,concurrentBuilds:1,buildTimeoutMinutes:10},solo:{requestsPerMonth:1e7,cpuMsPerRequest:30,maxCpuMsPerRequest:3e4,subRequestsPerInvocation:50,deploysPerDay:500,d1StorageBytes:5*oe,r2StorageBytes:25*oe,kvStorageBytes:5*oe,aiNeuronsPerMonth:3e5,retainedDeployments:5,sandboxRuntimeSecondsPerMonth:108e3,sandboxMaxConcurrentInstances:2,concurrentBuilds:2,buildTimeoutMinutes:15},pro:{requestsPerMonth:1e8,cpuMsPerRequest:50,maxCpuMsPerRequest:3e4,subRequestsPerInvocation:1e3,deploysPerDay:3e3,d1StorageBytes:10*oe,r2StorageBytes:100*oe,kvStorageBytes:25*oe,aiNeuronsPerMonth:5e5,retainedDeployments:25,sandboxRuntimeSecondsPerMonth:72e4,sandboxMaxConcurrentInstances:10,concurrentBuilds:3,buildTimeoutMinutes:15},sponsored:{requestsPerMonth:0,cpuMsPerRequest:50,maxCpuMsPerRequest:3e4,subRequestsPerInvocation:1e3,deploysPerDay:0,d1StorageBytes:0,r2StorageBytes:0,kvStorageBytes:0,aiNeuronsPerMonth:0,retainedDeployments:0,sandboxRuntimeSecondsPerMonth:0,sandboxMaxConcurrentInstances:0,concurrentBuilds:6,buildTimeoutMinutes:20},custom:{requestsPerMonth:0,cpuMsPerRequest:0,maxCpuMsPerRequest:0,subRequestsPerInvocation:0,deploysPerDay:0,d1StorageBytes:0,r2StorageBytes:0,kvStorageBytes:0,aiNeuronsPerMonth:0,retainedDeployments:0,sandboxRuntimeSecondsPerMonth:0,sandboxMaxConcurrentInstances:0,concurrentBuilds:0,buildTimeoutMinutes:0}};var wo=["github","google","oidc","cloudflare-access"];var Ao={ai:!0,customDomains:!1,email:!1,githubActions:!1,githubOAuth:!0,googleOAuth:!1,managedBuilds:!1,sandbox:!1},bo={apiHostname:null,dashboardHostname:null,proxyHostname:null};function Nr(e){let t=e.trim().toLowerCase().replaceAll(/[^a-z0-9-]+/g,"-").replaceAll(/^-+|-+$/g,"").replaceAll(/-{2,}/g,"-");if(!t)throw new Error("The installation name must contain a letter or number.");if(t.length>40)throw new Error("The installation name must be 40 characters or fewer after normalization.");return t}s(Nr,"normalizeInstallationSlug");function fe(e){let t=e.trim().toLowerCase();if(t.endsWith(".")&&(t=t.slice(0,-1)),t.length>253||!t.includes(".")||t.split(".").some(r=>!/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/.test(r)))throw new Error(`Invalid domain: ${JSON.stringify(e)}.`);return t}s(fe,"normalizeApplicationDomain");function Ro(e){let t=e.trim(),r;try{r=new URL(t)}catch{throw new Error("The dashboard URL must be an HTTPS origin.")}if(!/^https:\/\/[^/?#]+\/?$/i.test(t)||/[\s\\]/.test(t)||r.protocol!=="https:"||r.username||r.password||r.pathname!=="/"||r.search||r.hash)throw new Error("The dashboard URL must be an HTTPS origin without credentials, a path, query, or fragment.");return r.hostname=fe(r.hostname),r.origin}s(Ro,"normalizePlatformDashboardUrl");function Eo(e){let t=`void-${Nr(e)}`,r=t.replaceAll("-","_");return{aiGateway:t,apiWorker:`${t}-api`,assetsBucket:`${t}-assets`,cronQueue:`${t}-cron-fires`,deploymentQueue:`${t}-deployments`,dashboardWorker:`${t}-dashboard`,dispatchNamespace:`${t}-users`,dispatchWorker:`${t}-dispatch`,emailGatewayWorker:`${t}-email-gateway`,hyperdrive:`${t}-database`,isrCacheKv:`${t}-isr-cache`,legacyAssetsKv:`${t}-legacy-assets`,logsDataset:`${r}_logs`,proxyWorker:`${t}-proxy`,requestsDataset:`${r}_requests`,routingKv:`${t}-routing`,tailWorker:`${t}-tail`,usageQueue:`${t}-usage-events`}}s(Eo,"createPlatformResourceNames");function So(e){if(!e.zoneName&&e.workersDev){if(e.dedicatedZone)throw new Error("workers.dev cannot use a dedicated-zone catch-all.");return[]}let t=fe(e.baseDomain),r=fe(e.zoneName);if(t!==r&&!t.endsWith(`.${r}`))throw new Error(`Application domain ${t} is not inside zone ${r}.`);let n=[{pattern:`*.${t}/*`,zoneName:r},{pattern:`*.${t}`,zoneName:r}];if(e.dedicatedZone){if(t!==r)throw new Error("A dedicated-zone catch-all requires the application domain to be the zone.");n.push({pattern:"*/*",zoneName:r},{pattern:"*",zoneName:r})}return n}s(So,"createApplicationRoutes");function _o(e){if(e.emailSharedZoneId===void 0!=(e.emailSenderDomain===void 0))throw new Error("Shared email configuration requires both emailSenderDomain and emailSharedZoneId.");let t=Nr(e.installationSlug),r=fe(e.application.baseDomain),n=e.application.workersDev;if(n&&(!/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/.test(n.subdomain)||!/^[a-z0-9][a-z0-9-]{0,80}$/.test(n.installationId)))throw new Error("Invalid workers.dev installation identity.");let o=n&&e.application.zoneName===""?"":fe(e.application.zoneName);if(!o&&r!==`${n.subdomain}.workers.dev`)throw new Error("workers.dev application domain must match its account subdomain.");let a={...Eo(t),...e.resources},i={...Ao,...e.capabilities};if(i.managedBuilds&&!i.githubActions)throw new Error("Managed builds require the GitHub Actions capability.");if(e.appAccess!==void 0&&!["public","platform","custom"].includes(e.appAccess))throw new Error("appAccess must be public, platform, or custom.");let l=e.authentication?.providers??["github"];if(l.some(m=>!wo.includes(m))||new Set(l).size!==l.length)throw new Error("Authentication providers must be unique supported login kinds.");let u=e.authentication?.configurable===!0||e.authentication?.accessProtection===!0||l.some(m=>m==="oidc"||m==="cloudflare-access");if(l.length===0)throw new Error("At least one authentication provider is required.");if(l.includes("github")!==i.githubOAuth)throw new Error("The GitHub provider and githubOAuth capability must agree.");if(l.includes("google")!==i.googleOAuth)throw new Error("The Google provider and googleOAuth capability must agree.");let d=e.controlPlane?.dashboardUrl===void 0?void 0:Ro(e.controlPlane.dashboardUrl),f={...e.appAccess!==void 0?{appAccess:e.appAccess}:{},application:{baseDomain:r,dedicatedZone:e.application.dedicatedZone??!1,zoneName:o,...n?{workersDev:{...n}}:{},...e.application.zoneId?{zoneId:Ue(e.application.zoneId,"application.zoneId")}:{}},authentication:{providers:[...l],...u?{configurable:!0}:{},...e.authentication?.accessProtection?{accessProtection:!0}:{}},capabilities:i,...e.emailSharedZoneId!==void 0?{emailSharedZoneId:Ue(e.emailSharedZoneId,"emailSharedZoneId")}:{},...e.emailSenderDomain!==void 0?{emailSenderDomain:fe(e.emailSenderDomain)}:{},controlPlane:{...bo,...e.controlPlane,...d!==void 0?{dashboardUrl:d,dashboardHostname:e.controlPlane?.dashboardHostname??new URL(d).hostname}:{}},displayName:Ue(e.displayName,"displayName").trim(),installationSlug:t,resources:a,schemaVersion:e.appAccess!==void 0?4:u?3:n?2:1};So(f.application);for(let[m,c]of Object.entries(f.controlPlane))m!=="dashboardUrl"&&c!==null&&fe(c);if(f.controlPlane.dashboardUrl){let m=new URL(f.controlPlane.dashboardUrl).hostname;if(f.controlPlane.dashboardHostname!==m)throw new Error("The dashboard URL and dashboard hostname must agree.")}for(let[m,c]of Object.entries(f.resources))Ue(c,`resources.${m}`);return f}s(_o,"createPlatformDeploymentManifest");var Ur=2;function Ae(e){let t=e.SITE_DOMAIN??e.BASE_HOSTNAME??"void.app";return e.PLATFORM_APPLICATION?Io(JSON.parse(e.PLATFORM_APPLICATION)):{baseDomain:t,zoneName:t,dedicatedZone:!1}}s(Ae,"readPlatformApplication");function Io(e){return _o({installationSlug:"runtime",displayName:"Runtime",application:e}).application}s(Io,"parsePlatformApplication");function Mr(e){return`workers-dev:${e}`}s(Mr,"platformWorkersDevAliasKey");var Po="__void/platform/application/v1";async function Hr(e){if(!e.PLATFORM_APPLICATION)return e;let t=await e.ROUTING.get(Po);if(!t)return e;let r=Ae(e),n=Ae({PLATFORM_APPLICATION:t});if(!r.workersDev||!n.workersDev||r.workersDev.installationId!==n.workersDev.installationId||r.workersDev.subdomain!==n.workersDev.subdomain)throw new Error("Application routing belongs to another platform installation.");return{...e,PLATFORM_APPLICATION:t,SITE_DOMAIN:n.baseDomain,BASE_HOSTNAME:n.baseDomain,...n.zoneId?{CF_ZONE_ID:n.zoneId}:{}}}s(Hr,"resolvePlatformApplicationEnvironment");function To(e){return`void-${e.installationId.slice(-12)}-`}s(To,"platformProjectIngressPrefix");function Co(e,t){if(!/^proj_[a-z0-9]{1,32}$/.test(e.id)||!/^[a-z0-9][a-z0-9-]*$/.test(e.slug))throw new Error("Invalid platform project identity.");let r=To(t),n=`-${e.id.slice(5)}`;return`${r}${e.slug.slice(0,63-r.length-n.length).replace(/-+$/,"")}${n}`}s(Co,"platformProjectIngressName");function $r(e,t){return`${Co(e,t)}.${t.subdomain}.workers.dev`}s($r,"platformProjectWorkersDevHostname");var Nt="void-platform-health";function Fr(e){return e.zoneName?`${Nt}.${e.baseDomain}`:null}s(Fr,"platformHealthHostname");import{WorkerEntrypoint as hs}from"cloudflare:workers";var st=new TextEncoder,it=new TextDecoder,at=new TextDecoder("utf-8",{fatal:!0}),da=2**32;function Vr(...e){let t=e.reduce((o,{length:a})=>o+a,0),r=new Uint8Array(t),n=0;for(let o of e)r.set(o,n),n+=o.length;return r}s(Vr,"concat");var vo=/[^\x00-\x7f]/;function be(e){if(typeof e=="string"&&e.length>=128){if(vo.test(e))throw new TypeError("non-ASCII string encountered in encode()");return st.encode(e)}let t=new Uint8Array(e.length);for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);if(n>127)throw new TypeError("non-ASCII string encountered in encode()");t[r]=n}return t}s(be,"encode");function Kr(e,t=!1){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e,{alphabet:t?"base64url":"base64"});if(t){if(e.includes("+")||e.includes("/"))throw new TypeError("Invalid base64url");e=e.replace(/-/g,"+").replace(/_/g,"/")}let r=atob(e),n=new Uint8Array(r.length);for(let o=0;o<r.length;o++)n[o]=r.charCodeAt(o);return n}s(Kr,"decodeBase64");var V=class extends Error{static{s(this,"JOSEError")}static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(t,r){super(t,r),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}},se=class extends V{static{s(this,"JWTClaimValidationFailed")}static code="ERR_JWT_CLAIM_VALIDATION_FAILED";code="ERR_JWT_CLAIM_VALIDATION_FAILED";claim;reason;payload;constructor(t,r,n="unspecified",o="unspecified"){super(t,{cause:{claim:n,reason:o,payload:r}}),this.claim=n,this.reason=o,this.payload=r}},Me=class extends V{static{s(this,"JWTExpired")}static code="ERR_JWT_EXPIRED";code="ERR_JWT_EXPIRED";claim;reason;payload;constructor(t,r,n="unspecified",o="unspecified"){super(t,{cause:{claim:n,reason:o,payload:r}}),this.claim=n,this.reason=o,this.payload=r}},ct=class extends V{static{s(this,"JOSEAlgNotAllowed")}static code="ERR_JOSE_ALG_NOT_ALLOWED";code="ERR_JOSE_ALG_NOT_ALLOWED"},Q=class extends V{static{s(this,"JOSENotSupported")}static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"};var F=class extends V{static{s(this,"JWSInvalid")}static code="ERR_JWS_INVALID";code="ERR_JWS_INVALID"},Re=class extends V{static{s(this,"JWTInvalid")}static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"};var He=class extends V{static{s(this,"JWKSInvalid")}static code="ERR_JWKS_INVALID";code="ERR_JWKS_INVALID"},Ee=class extends V{static{s(this,"JWKSNoMatchingKey")}static code="ERR_JWKS_NO_MATCHING_KEY";code="ERR_JWKS_NO_MATCHING_KEY";constructor(t="no applicable key found in the JSON Web Key Set",r){super(t,r)}},lt=class extends V{static{s(this,"JWKSMultipleMatchingKeys")}[Symbol.asyncIterator]=async function*(){};static code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";constructor(t="multiple matching keys found in the JSON Web Key Set",r){super(t,r)}},dt=class extends V{static{s(this,"JWKSTimeout")}static code="ERR_JWKS_TIMEOUT";code="ERR_JWKS_TIMEOUT";constructor(t="request timed out",r){super(t,r)}},ut=class extends V{static{s(this,"JWSSignatureVerificationFailed")}static code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";constructor(t="signature verification failed",r){super(t,r)}};var ko="The input to be decoded is not correctly encoded.";function $e(e){try{return Kr(typeof e=="string"?e:it.decode(e),!0)}catch(t){throw new TypeError(ko,{cause:t})}}s($e,"decode");function ce(e){if(typeof e!="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}s(ce,"isObject");function pt(e){return ce(e)&&Array.isArray(e.keys)&&Array.from(e.keys).every(ce)}s(pt,"isJwkSet");function jr(...e){let t=new Set;for(let r of e)if(r)for(let n of Object.keys(r)){if(t.has(n))return!1;t.add(n)}return!0}s(jr,"isDisjoint");function Ut(e,t,r){try{return $e(e)}catch{throw new r(`Failed to base64url decode the ${t}`)}}s(Ut,"decodeBase64url");function Wr(e,t,r){try{return be(e)}catch{throw new r(`The ${t} is not a valid base64url string`)}}s(Wr,"encodeBase64url");function Jr(e,t,r){let n;try{n=JSON.parse(at.decode($e(e)))}catch{throw new t(r)}if(!ce(n))throw new t(r);return n}s(Jr,"parseJoseHeader");var zr={__proto__:null,b64:!0};function Br(e,t){if(t!==void 0&&(!Array.isArray(t)||t.some(r=>typeof r!="string")))throw new TypeError(`"${e}" option must be an array of strings`);return t===void 0?void 0:new Set(t)}s(Br,"validateAlgorithms");function Gr(e,t,r,n,o){if(o.crit!==void 0&&n?.crit===void 0)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!n||n.crit===void 0)return[];if(!Array.isArray(n.crit)||n.crit.length===0||n.crit.some(i=>typeof i!="string"||i.length===0))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let a=r===void 0?t:{__proto__:null,...r,...t};for(let i of n.crit){if(!(i in a))throw new Q(`Extension Header Parameter "${i}" is not recognized`);if(!Object.hasOwn(o,i)||o[i]===void 0)throw new e(`Extension Header Parameter "${i}" is missing`);if(a[i]&&(!Object.hasOwn(n,i)||n[i]===void 0))throw new e(`Extension Header Parameter "${i}" MUST be integrity protected`)}return n.crit}s(Gr,"validateCrit");function qr(e,t){if(t.includes("b64")){let r=e.b64;if(typeof r!="boolean")throw new F('The "b64" (base64url-encode payload) Header Parameter must be a boolean');return r}return!0}s(qr,"validateB64");var xo=s(e=>e[Symbol.toStringTag],"tag"),Do=s((e,t,r)=>{let{alg:n}=e;if(t.use!==void 0){let o=r==="sign"||r==="verify"?"sig":"enc";if(t.use!==o)throw new TypeError(`Invalid key for this operation, its "use" must be "${o}" when present`)}if(t.alg!==void 0&&t.alg!==n)throw new TypeError(`Invalid key for this operation, its "alg" must be "${n}" when present`);if(Array.isArray(t.key_ops)){let o=r==="encrypt"||r==="decrypt"?e.ops?.[r==="encrypt"?0:1]:r;if(o&&!t.key_ops.includes(o))throw new TypeError(`Invalid key for this operation, its "key_ops" must include "${o}" when present`)}},"jwkMatchesOp");async function Qr(e,t,r){let{alg:n,secret:o}=e,a=r==="decrypt"||r==="sign";if(o&&t instanceof Uint8Array)return t;let i,l;if(ce(t)){if(i=$o(t),typeof i.kty!="string")throw Yr(n,t,o);if(!(o?i.kty==="oct"&&typeof i.k=="string":i.kty!=="oct"&&(a?i.kty==="AKP"&&typeof i.priv=="string"||typeof i.d=="string":i.d===void 0&&i.priv===void 0)))throw new TypeError(o?'JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present':`JSON Web Key for this operation must be a ${a?"private":"public"} JWK`);if(Do(e,i,r),i.kty==="oct")return $e(i.k);if(!Object.isFrozen(t)){let{key_ops:f}=t;Array.isArray(f)&&Object.freeze(f),Object.freeze(t)}}else{if(!No(t))throw Yr(n,t,o);let f=o?"secret":a?"private":"public";if(t.type!==f&&(o||["secret","public","private"].includes(t.type)))throw new TypeError(`${xo(t)} instances must be of type "${f}" for the ${n} algorithm`);if(Xr(t))return t;if(l=t,l.type==="secret")return l.export()}Mt||=new WeakMap;let u=t,d=Mt.get(u);if(d?.[n])return d[n];if(d||Mt.set(u,d={}),l&&typeof l.toCryptoKey=="function"){let f=l.type==="public",m=Oo[l.asymmetricKeyDetails?.namedCurve],c=e.resolve?.({crv:m,asymmetricKeyType:l.asymmetricKeyType})??e.subtle;return d[n]=l.toCryptoKey(c,f,e.usages[f?0:1])}return i??=l.export({format:"jwk"}),i.alg=n,d[n]=await $t(e,i)}s(Qr,"prepareKey");var Mt,Oo={__proto__:null,prime256v1:"P-256",secp384r1:"P-384",secp521r1:"P-521"};var Xr=s(e=>{if(e?.[Symbol.toStringTag]==="CryptoKey")return!0;try{return e instanceof CryptoKey}catch{return!1}},"isCryptoKey"),Lo=s(e=>e?.[Symbol.toStringTag]==="KeyObject","isKeyObject"),No=s(e=>Xr(e)||Lo(e),"isKeyLike");function Uo(e,t,...r){if(r.length>2){let n=r.pop();e+=`one of type ${r.join(", ")}, or ${n}.`}else r.length===2?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return t==null?e+=` Received ${t}`:typeof t=="function"&&t.name?e+=` Received function ${t.name}`:typeof t=="object"&&t!=null&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}s(Uo,"message");function Yr(e,t,r){let n=["CryptoKey","KeyObject","JSON Web Key"];return r&&n.push("Uint8Array"),new TypeError(Uo(`Key for the ${e} algorithm must be `,t,...n))}s(Yr,"invalidKeyType");var ft=s((e,t="algorithm.name")=>new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`),"unusable");function Mo(e,t){if(t&&!e.usages.includes(t))throw new TypeError(`CryptoKey does not support this operation, its usages must include ${t}.`)}s(Mo,"checkUsage");function Zr(e,t){let{modulusLength:r}=t.algorithm;if(typeof r!="number"||r<2048)throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}s(Zr,"checkModulusLength");function Ho(e,t,r){let n=e.algorithm;if(n.name!==t.name)throw ft(t.name);if(t.hash&&n.hash?.name!==t.hash)throw ft(t.hash,"algorithm.hash");if(t.namedCurve&&n.namedCurve!==t.namedCurve)throw ft(t.namedCurve,"algorithm.namedCurve");if(t.length!==void 0&&n.length!==t.length)throw ft(t.length,"algorithm.length");Mo(e,r)}s(Ho,"checkCryptoKey");function Ht(e){return{__proto__:null,...e}}s(Ht,"snapshotJwk");function $o(e){let t=Ht(e);if(t.ext!==void 0&&typeof t.ext!="boolean")throw new TypeError('"ext" (Extractable) Parameter must be a boolean');if(t.key_ops!==void 0){let r=t.key_ops,n=Array.isArray(r)?[...r]:void 0;if(!n||n.some(o=>typeof o!="string")||new Set(n).size!==n.length)throw new TypeError('"key_ops" (Key Operations) Parameter must be an array of unique strings');t.key_ops=n}return t}s($o,"normalizeJwk");async function $t(e,t,r){if(!e.kty.includes(t.kty))throw new Q('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');let n=e.resolve?.({kty:t.kty,crv:t.crv})??e.subtle,o=!!(t.d||t.priv),a={...t,ext:r??t.ext};return a.kty!=="AKP"&&delete a.alg,delete a.use,crypto.subtle.importKey("jwk",a,n,a.ext??!o,t.key_ops??e.usages[o?1:0])}s($t,"jwkToKey");async function en(e,t,r,n=!1){return e instanceof Uint8Array&&(e=await crypto.subtle.importKey("raw",e,t,n,[r])),Ho(e,t,r),e}s(en,"rawKey");function tn(e){let t={__proto__:null};for(let r in e)t[r]={...e[r],alg:r};return t}s(tn,"table");var Fe=[["verify"],["sign"]];function Ft(e){let t={name:"HMAC",hash:`SHA-${e}`};return{kty:["oct"],secret:!0,subtle:t,signing:t,usages:Fe}}s(Ft,"hmac");function Se(e,t){let r={name:t?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:`SHA-${e}`};return{kty:["RSA"],subtle:r,signing:t?{...r,saltLength:t}:r,usages:Fe,minRsaBits:2048}}s(Se,"rsa");function Vt(e,t){return{kty:["EC"],crv:e,subtle:{name:"ECDSA",namedCurve:e},signing:{name:"ECDSA",hash:`SHA-${t}`},usages:Fe}}s(Vt,"ecdsa");function rn(){let e={name:"Ed25519"};return{kty:["OKP"],crv:"Ed25519",subtle:e,signing:e,usages:Fe}}s(rn,"eddsa");function Kt(e){let t={name:`ML-DSA-${e}`};return{kty:["AKP"],subtle:t,signing:t,usages:Fe}}s(Kt,"mldsa");var jt=tn({HS256:Ft(256),HS384:Ft(384),HS512:Ft(512),RS256:Se(256),RS384:Se(384),RS512:Se(512),PS256:Se(256,32),PS384:Se(384,48),PS512:Se(512,64),ES256:Vt("P-256",256),ES384:Vt("P-384",384),ES512:Vt("P-521",512),EdDSA:rn(),Ed25519:rn(),"ML-DSA-44":Kt(44),"ML-DSA-65":Kt(65),"ML-DSA-87":Kt(87)});function nn(e){let t=typeof e=="string"?jt[e]:void 0;if(!t)throw new Q(`alg ${e} is not supported either by JOSE or your javascript runtime`);return t}s(nn,"jwsAlgorithm");function on(e){return[e&&Br("algorithms",e.algorithms),e?.crit]}s(on,"prepareVerify");function Fo(e){return e===void 0?{}:Jr(e,F,"JWS Protected Header is invalid")}s(Fo,"parseProtectedHeader");function Vo(e){try{return be(e)}catch{throw new F("JWS Compact Serialization payload must use only ASCII characters")}}s(Vo,"encodeCompactUnencodedPayload");async function Ko(e,t,r,n,o){let{protected:a,header:i,payload:l}=e,u=o??Fo(a);if(!jr(u,i))throw new F("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let d={...u,...i},f=qr(u,Gr(F,zr,t[1],u,d)),{alg:m}=d;if(typeof m!="string"||!m)throw new F('JWS "alg" (Algorithm) Header Parameter missing or invalid');if(t[0]&&!t[0].has(m))throw new ct('"alg" (Algorithm) Header Parameter value not allowed');if(f){if(typeof l!="string")throw new F("JWS Payload must be a string")}else if(typeof l!="string"&&!(l instanceof Uint8Array))throw new F("JWS Payload must be a string or an Uint8Array instance");let c=f||typeof l!="string"?l:n(l),E=!1;typeof r=="function"&&(r=await r(u,e),E=!0);let p=nn(m),T=Vr(a!==void 0?be(a):new Uint8Array,be("."),typeof c=="string"?t[2]??=Wr(c,"payload",F):c),R=Ut(e.signature,"signature",F),w=await Qr(p,r,"verify"),g=await en(w,p.subtle,"verify");p.minRsaBits&&Zr(p.alg,g);let S=!1;try{S=await crypto.subtle.verify(p.signing,g,R,T)}catch{}if(!S)throw new ut;let H={payload:typeof c=="string"?Ut(c,"payload",F):c};return a!==void 0&&(H.protectedHeader=u),i!==void 0&&(H.unprotectedHeader=i),E?[{...H,key:w},f]:[H,f]}s(Ko,"verifySignature");async function sn(e,t,r){if(e instanceof Uint8Array&&(e=it.decode(e)),typeof e!="string")throw new F("Compact JWS must be a string or Uint8Array");let{0:n,1:o,2:a,length:i}=e.split(".");if(i!==3)throw new F("Invalid Compact JWS");return Ko({payload:o,protected:n,signature:a},t,r,Vo)}s(sn,"verifyCompact");var jo=s(e=>Math.floor(e.getTime()/1e3),"epoch"),Wo={s:1,m:60,h:3600,d:86400,w:604800,y:31557600},Jo=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i,_e="check_failed";function Wt(){throw new TypeError("Invalid time period format")}s(Wt,"invalidDuration");function an(e){typeof e!="string"&&Wt();let t=Jo.exec(e);(!t||t[4]&&t[1])&&Wt();let r=parseFloat(t[2]),n=Math.round(r*Wo[t[3][0].toLowerCase()]);return Number.isFinite(n)||Wt(),t[1]==="-"||t[4]==="ago"?-n:n}s(an,"secs");function Jt(e,t){if(!Number.isFinite(t))throw new TypeError(`Invalid ${e} input`);return t}s(Jt,"validateInput");var cn=s(e=>{let t=e.toLowerCase();return e.includes("/")?t:`application/${t}`},"normalizeTyp"),zo=s((e,t)=>typeof e=="string"?t.includes(e):Array.isArray(e)?t.some(r=>e.includes(r)):!1,"checkAudiencePresence");function zt(e,t,r=!1){let n=e[t];if(!(n===void 0&&!r)){if(typeof n!="number")throw new se(`"${t}" claim must be a number`,e,t,"invalid");return n}}s(zt,"validateNumericDate");function Bt(e,t){throw new se(`unexpected "${t}" claim value`,e,t,_e)}s(Bt,"unexpectedClaim");function ln(e,t,r={}){let n;try{n=JSON.parse(at.decode(t))}catch{}if(!ce(n))throw new Re("JWT Claims Set must be a top-level JSON object");let{typ:o}=r;if(o!==void 0&&(typeof e.typ!="string"||cn(e.typ)!==cn(o)))throw new se('unexpected "typ" JWT header value',n,"typ",_e);let{requiredClaims:a=[],issuer:i,subject:l,audience:u,maxTokenAge:d}=r,f=[...a];d!==void 0&&f.push("iat"),u!==void 0&&f.push("aud"),l!==void 0&&f.push("sub"),i!==void 0&&f.push("iss");for(let g of new Set(f.reverse()))if(!Object.hasOwn(n,g))throw new se(`missing required "${g}" claim`,n,g,"missing");i!==void 0&&!(Array.isArray(i)?i:[i]).includes(n.iss)&&Bt(n,"iss"),l!==void 0&&n.sub!==l&&Bt(n,"sub"),u!==void 0&&!zo(n.aud,typeof u=="string"?[u]:u)&&Bt(n,"aud");let{clockTolerance:m}=r,c=0;if(typeof m=="string")c=an(m);else if(m!==void 0){if(typeof m!="number")throw new TypeError("Invalid clockTolerance option type");c=m}Jt("clockTolerance option",c);let{currentDate:E}=r,p=Jt("currentDate option",jo(E===void 0?new Date:E)),T=zt(n,"iat",d!==void 0),R=zt(n,"nbf");if(R!==void 0&&R>p+c)throw new se('"nbf" claim timestamp check failed',n,"nbf",_e);let w=zt(n,"exp");if(w!==void 0&&w<=p-c)throw new Me('"exp" claim timestamp check failed',n,"exp",_e);if(d!==void 0){let g=p-T,S=Jt("maxTokenAge option",typeof d=="number"?d:an(d));if(g-c>S)throw new Me('"iat" claim timestamp check failed (too far in the past)',n,"iat",_e);if(g<-c)throw new se('"iat" claim timestamp check failed (it should be in the past)',n,"iat",_e)}return n}s(ln,"validateClaimsSet");async function Gt(e,t,r){let[n,o]=await sn(e,on(r),t);if(!o)throw new Re("JWTs MUST NOT use unencoded payload");let a=ln(n.protectedHeader,n.payload,r);return{...n,payload:a}}s(Gt,"jwtVerify");function Bo(e,t,r,n){let{kty:o,key_ops:a,ext:i,kid:l,alg:u,use:d,crv:f}=e;return(i===void 0||typeof i=="boolean")&&(a===void 0||Array.isArray(a)&&a.every((m,c)=>typeof m=="string"&&a.indexOf(m)===c)&&a.includes("verify"))&&t.kty.includes(o)&&(n===void 0||typeof n=="string"&&n===l)&&(u===void 0?o!=="AKP":r===u)&&(d===void 0||d==="sig")&&(!t.crv||f===t.crv)}s(Bo,"isUsableJWK");async function dn(e,t,r){let n=e.get(t)||e.set(t,{}).get(t),{alg:o}=r;if(n[o]===void 0){let a=$t(r,t,!0).then(i=>{if(i.type!=="public")throw new He("JSON Web Key Set members must be public keys");return n[o]=i,i}).catch(i=>{throw n[o]===a&&delete n[o],i});n[o]=a}return n[o]}s(dn,"importWithAlgCache");function qt(e){let t;try{t=structuredClone(e)}catch{}if(!pt(t))throw new He("JSON Web Key Set malformed");let r=t.keys.map(o=>{let a=Ht(o);return Array.isArray(a.key_ops)&&(a.key_ops=[...a.key_ops]),a}),n=new WeakMap;return Object.defineProperty(async(o,a)=>{let{alg:i,kid:l}={...o,...a?.header},u=typeof i=="string"?jt[i]:void 0;if(!u||u.secret)throw new Q('Unsupported "alg" value for a JSON Web Key Set');let d=t.keys.filter((c,E)=>Bo(r[E],u,i,l)),{0:f,length:m}=d;if(!m)throw new Ee;if(m!==1){let c=new lt;throw c[Symbol.asyncIterator]=async function*(){for(let E of d)try{yield await dn(n,E,u)}catch{}},c}return dn(n,f,u)},"jwks",{value:s(()=>structuredClone(t),"value")})}s(qt,"createLocalJWKSet");function Go(){return typeof WebSocketPair<"u"||typeof navigator<"u"&&!0||typeof EdgeRuntime<"u"&&EdgeRuntime==="vercel"}s(Go,"isCloudflareWorkers");var Yt;(typeof navigator>"u"||!"Cloudflare-Workers"?.startsWith?.("Mozilla/5.0 "))&&(Yt="jose/v6.2.12");var mt=Symbol();async function qo(e,t,r,n=fetch){let o=await n(e,{method:"GET",signal:r,redirect:"manual",headers:t}).catch(a=>{throw a.name==="TimeoutError"?new dt:a});if(o.status!==200)throw new V("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await o.json()}catch{throw new V("Failed to parse the JSON Web Key Set HTTP response as JSON")}}s(qo,"fetchJwks");var pn=Symbol();function Ve(e,t){return Number.isFinite(e)&&Date.now()<e+t}s(Ve,"isFreshFor");function un(e,t,r){if(Number.isNaN(e))throw new TypeError(`"${r}" option must not be NaN`);return typeof e=="number"?e:t}s(un,"validateDuration");function Qt(e,t){if(!(e instanceof URL))throw new TypeError("url must be an instance of URL");let r=new URL(e.href).href,n=t??{},o=n.timeoutDuration;if(typeof o=="number"&&(!Number.isInteger(o)||o<0))throw new TypeError('"timeoutDuration" option must be a non-negative integer');let a=typeof o=="number"?o:5e3,i=un(n.cooldownDuration,3e4,"cooldownDuration"),l=un(n.cacheMaxAge,6e5,"cacheMaxAge"),u=new Headers(n.headers);Yt&&!u.has("User-Agent")&&u.set("User-Agent",Yt),u.has("accept")||u.set("accept","application/json, application/jwk-set+json");let d=n[mt],f=n[pn],m,c,E=0,p=0,T;if(f&&typeof f=="object"){let{uat:w,jwks:g}=f;Ve(w,l)&&pt(g)&&(m=w,T=qt(g))}let R=s(async()=>{if(c&&Go()&&(c=void 0),!c){let w=++E,g=c=qo(r,u,AbortSignal.timeout(a),d).then(S=>{let H=qt(S);if(w<=p)return;T=H;let $=Date.now();f&&(f.uat=$,f.jwks=S),m=$,p=w}).finally(()=>{c===g&&(c=void 0)})}await c},"reload");return Object.defineProperties(async(w,g)=>{(!T||!Ve(m,l))&&await R();try{return await T(w,g)}catch(S){if(S instanceof Ee&&!Ve(m,i))return await R(),T(w,g);throw S}},{coolingDown:{get:s(()=>Ve(m,i),"get"),enumerable:!0},fresh:{get:s(()=>Ve(m,l),"get"),enumerable:!0},reload:{value:R,enumerable:!0},reloading:{get:s(()=>!!c,"get"),enumerable:!0},jwks:{value:s(()=>T?.jwks(),"value"),enumerable:!0}})}s(Qt,"createRemoteJWKSet");function fn(e,t){let r=e.toLowerCase(),n=t.toLowerCase(),o=r.indexOf("*");if(o===-1)return r===n;let a=r.slice(0,o),i=r.slice(o+1);if(a.includes(".")||!i.startsWith(".")||i.includes("*")||!n.startsWith(a)||!n.endsWith(i))return!1;let l=n.slice(0,-i.length);return l.length>0&&!l.includes(".")}s(fn,"matchesHostname");function Yo(e,t){let r=t.audiences.find(n=>!n.hostname.includes("*")&&fn(n.hostname,e));return r?r.audience:t.audiences.find(n=>fn(n.hostname,e))?.audience??null}s(Yo,"resolveAccessAudience");var Xt=class{constructor(t=(r,n)=>fetch(r,n)){this.request=t}request;static{s(this,"ProjectAccessVerifier")}keys=new Map;async verify(t,r,n){try{let o=Yo(t,n);if(!o||!r||r.length>32*1024)return!1;let a=n.teamDomain.replace(/\/+$/,""),i=new URL(a);if(i.protocol!=="https:"||!i.hostname.endsWith(".cloudflareaccess.com")||i.origin!==a)return!1;let l=this.keys.get(a);l||(this.keys.size>=16&&this.keys.delete(this.keys.keys().next().value),l=Qt(new URL(`${a}/cdn-cgi/access/certs`),{timeoutDuration:1e4,[mt]:async(d,f)=>{let m=await this.request(d,{...f,redirect:"manual"});if(m.status>=300&&m.status<400)throw await m.body?.cancel(),new Error("Access key endpoint redirected.");return m}}),this.keys.set(a,l));let{payload:u}=await Gt(r,l,{issuer:a,audience:o,algorithms:["RS256"],requiredClaims:["iss","aud","iat","exp","type"]});return u.type==="app"&&typeof u.iat=="number"&&u.iat<=Date.now()/1e3+30}catch{return!1}}},mn=new Xt;function Ke(e){return e.slice(e.lastIndexOf("/")+1).includes(".")}s(Ke,"hasExtension");function X(e){return e==="/api"||e.startsWith("/api/")}s(X,"isApiPath");function Zt(e,t,r=!1){return X(e)?"api":t&&(!Ke(e)||r)?"ssr":null}s(Zt,"classifyDynamicRequestType");var er='system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif';function tr(e){return e.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;")}s(tr,"escapeHtml");function hn(e,t,r=!1){let n=`${e}: ${t}`,o=`${e}: `;return`<!doctype html>
1
+ var ro=Object.defineProperty;var s=(e,t)=>ro(e,"name",{value:t,configurable:!0});function Ct(e,t){let r=e.get(t);return r!==void 0&&(e.delete(t),e.set(t,r)),r}s(Ct,"lruGet");function vt(e,t,r){if(e.size>=256){let n=e.keys().next();n.done||e.delete(n.value)}e.set(t,r)}s(vt,"lruSet");function no(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e===95}s(no,"isNameChar");function It(e,t){return e==="seg"?t!==47:t!==10&&t!==13&&t!==8232&&t!==8233}s(It,"accepts");function Oe(e,t){if(!t)return;let r=e[e.length-1];r?.kind==="text"?r.text+=t:e.push({kind:"text",text:t})}s(Oe,"pushText");function Sr(e){let t=[],r=[],n=!1,o=0;for(;o<e.length;){let a=e[o];if(a===":"){let i=o+1;for(;i<e.length&&no(e.charCodeAt(i));)i++;if(i===o+1){Oe(t,":"),o++;continue}let l=e.slice(o+1,i);r.push(l);let u=e[i]==="*";t.push({kind:u?"any":"seg",name:l}),o=u?i+1:i}else if(a==="*")n?t.push({kind:"any"}):(r.push("splat"),t.push({kind:"any",name:"splat"}),n=!0),o++;else{let i=o+1;for(;i<e.length&&e[i]!==":"&&e[i]!=="*";)i++;Oe(t,e.slice(o,i)),o=i}}return{tokens:t,paramNames:r}}s(Sr,"parseCapture");function Tr(e,t){let r=t.split("*");Oe(e,r[0]);for(let n=1;n<r.length;n++)e.push({kind:"any"}),Oe(e,r[n])}s(Tr,"parseStars");function oo(e){let t=[],r=e.split("/");for(let n=0;n<r.length;n++){let o=r[n];n>0&&Oe(t,"/");let a=o.slice(1,-4);o[0]!==":"||o.length<2?Tr(t,o):o.length>5&&o.endsWith("{.+}")&&!a.includes("{")&&!a.includes("}")?t.push({kind:"plus"}):t.push({kind:"seg"})}return t}s(oo,"parseSegments");function kt(e){let t=[];for(let n of e)n.kind==="any"&&t[t.length-1]?.kind==="any"||t.push(n);let r=new Int32Array(t.length+1);return t.forEach((n,o)=>{let a=n.kind==="text"?n.text.length:n.kind==="any"?0:1;r[o+1]=r[o]+a}),{steps:t,starts:r,minLength:r[t.length]}}s(kt,"prepare");function Pt(e,t,r,n,o){let a=0;if(e.kind==="text"){for(let u=o.length-1;u>=0;u--){let d=n[u]===1&&t.startsWith(e.text,r+u)?1:0;o[u]=d,a|=d}return a===1}let i=e.kind,l=0;for(let u=o.length-1;u>=0;u--){let d=i==="any"?n[u]===1||l===1&&It(i,t.charCodeAt(r+u)):(n[u]===1||l===1)&&It(i,t.charCodeAt(r+u));o[u]=d?1:0,l=o[u],a|=l}return a===1}s(Pt,"stepBack");function Tt(e){let t=new Uint8Array(e);return t[e-1]=1,t}s(Tt,"endRow");function Cr({steps:e,minLength:t},r){let n=e[0],o=e[e.length-1];return r.length<t||n?.kind==="text"&&!r.startsWith(n.text)||o?.kind==="text"&&!r.endsWith(o.text)}s(Cr,"quickReject");function xt(e,t){if(Cr(e,t))return!1;let{steps:r,starts:n,minLength:o}=e,a=Tt(t.length-o+1),i=new Uint8Array(a.length),l=r[0]?.kind==="text"?1:0;for(let u=r.length-1;u>=l;u--){if(!Pt(r[u],t,n[u],a,i))return!1;let d=a;a=i,i=d}return a[0]===1}s(xt,"matches");function so(e,t,r,n,o){if(e.kind==="text")return r+e.text.length;let a=e.kind==="any"?0:1,i=o.length-1-n+a,l=0;for(;l<i&&It(e.kind,t.charCodeAt(r+l));)l++;for(;l>a&&o[n+l-a]!==1;)l--;return r+l}s(so,"greedyEnd");function io(e,t,r){if(Cr(e,t))return null;let{steps:n,starts:o,minLength:a}=e,i=n.length,l=t.length-a+1,u=i*l<=65536?1:Math.ceil(Math.sqrt(i)),d=new Map([[i,Tt(l)]]),f=Tt(l),m=new Uint8Array(l),c=n[0]?.kind==="text"?1:0;for(let g=i-1;g>=c;g--){if(!Pt(n[g],t,o[g],f,m))return null;g%u===0&&d.set(g,m.slice());let S=f;f=m,m=S}if(f[0]!==1)return null;let E=Array.from({length:u},()=>new Uint8Array(l)),p=0,T=s(g=>g===p?d.get(g):E[g%u],"rowAt"),R=new Int32Array(r+1),w=0;for(let g=0;g<=r;g++){if(g+1>p){p=Math.min(i,Math.ceil((g+1)/u)*u);for(let S=p-1;S>g;S--)Pt(n[S],t,o[S],T(S+1),E[S%u])}w=so(n[g],t,w,w-o[g],T(g+1)),R[g]=w}return R}s(io,"greedyEnds");function ao(e){let t="";for(let r of e)r.kind==="text"?t+=r.text.replace(/[.+?^${}()|[\]\\:]/g,"\\$&"):r.kind==="seg"?t+=`(?<${r.name}>[^/]+)`:t+=r.name?`(?<${r.name}>.*)`:".*";return new RegExp(`^${t}$`)}s(ao,"toRegExp");var _r=new Map;function vr(e){let t=Ct(_r,e);if(t)return t;let{tokens:r,paramNames:n}=Sr(e),o,a=new Set;for(let f of n)a.has(f)?o??=`Duplicate capture group name "${f}"`:f.charCodeAt(0)>=48&&f.charCodeAt(0)<=57&&(o??=`Invalid capture group name "${f}"`),a.add(f);let i=kt(r),l=-1;i.steps.forEach((f,m)=>{f.kind!=="text"&&f.name&&(l=m)});let u,d={...i,paramNames:n,error:o,lastNamed:l,get regex(){return u??=ao(Sr(e).tokens)}};return vt(_r,e,d),d}s(vr,"compile");function tt(e){let t=vr(e);if(t.error)throw new SyntaxError(t.error);return t}s(tt,"compilePattern");function rt(e,t){let r=vr(e);if(r.error)return null;let{steps:n,lastNamed:o}=r,a=o===-1?void 0:io(r,t,o);if(a===null||a===void 0&&!xt(r,t))return null;let i=Object.create(null);for(let l of r.paramNames)i[l]="";for(let l=0;a&&l<=o;l++){let u=n[l];u.kind!=="text"&&u.name&&(i[u.name]=t.slice(l===0?0:a[l-1],a[l]))}return i}s(rt,"matchPatternCaptures");var Ir=new Map;function ue(e,t){let r=Ct(Ir,e);if(!r){let n=[];Tr(n,e),r=kt(n),vt(Ir,e,r)}return xt(r,t)}s(ue,"matchLiteralPattern");var Pr=new Map;function G(e,t){let r=Ct(Pr,e);return r||(r=kt(oo(e)),vt(Pr,e,r)),xt(r,t)}s(G,"matchSegmentPattern");function nt(e,t){let r=e.replace(/:([A-Za-z0-9_]+)\*?/g,(n,o)=>t[o]??n);return/^[/\\]{2}/.test(r)&&!/^[/\\]{2}/.test(e)?"/"+r.replace(/^[/\\]+/,""):r}s(nt,"substituteParams");var co=new Set(["set-cookie"]);function lo(e){if(e.length<2||e[0]!=='"'||e[e.length-1]!=='"')return null;let t="";for(let r=1;r<e.length-1;r+=1){let n=e[r];if(n==="\\"){if(r+=1,r>=e.length-1)return null;t+=e[r]}else{if(n==='"')return null;t+=n}}return t}s(lo,"parseQuotedString");function Dt(e){let t=[],r=s(a=>{let i=a.trim();i.length>0&&t.push({raw:i,directive:lo(i)})},"pushMember"),n=0,o=!1;for(let a=0;a<e.length;a+=1){let i=e[a];o?i==="\\"?a+=1:i==='"'&&(o=!1):i==='"'?o=!0:i===","&&(r(e.slice(n,a)),n=a+1)}return r(e.slice(n)),t}s(Dt,"parseClearSiteData");function ot(e){let t=[];for(let{raw:r,directive:n}of Dt(e)){let o=n?.toLowerCase();if(o==="*")return null;n===null||o==="cookies"||t.push(r)}return t.length>0?t.join(", "):null}s(ot,"sanitizeClearSiteData");function q(e,t,r,n){if(!r||r.length===0)return e;let o=[];for(let d of r)ue(d.pattern,t)&&o.push(...d.headers);if(o.length===0)return e;let a=new Response(e.body,e),i=n?.cookieIsolation!=="origin",l=i?e.headers.get("clear-site-data"):null,u=l===null?null:ot(l);for(let[d,f]of o){let m=d.toLowerCase();if(!(i&&co.has(m))){if(i&&m==="clear-site-data"){let c=ot(f);c!==null?a.headers.set(d,c):u!==null?a.headers.set(d,u):a.headers.delete(d);continue}a.headers.set(d,f)}}return a}s(q,"applyHeaderRules");function ne(e,t,r){if(!t?.length)return null;for(let n of t){if(n.host&&n.host!==r)continue;try{tt(n.source)}catch(i){console.warn(`[dispatch] skipping routing rule with invalid source ${JSON.stringify(n.source)}: ${i instanceof Error?i.message:String(i)}`);continue}let o=rt(n.source,e);if(!o)continue;let a=nt(n.destination,o);return n.status===200?{type:"rewrite",destination:a}:{type:"redirect",destination:a,status:n.status}}return null}s(ne,"applyRoutingRules");function Le(e,t){if(!t||t==="?")return e;let r=e.indexOf("#"),n=r===-1?e:e.slice(0,r),o=r===-1?"":e.slice(r),a=n.indexOf("?");if(a===-1)return n+t+o;if(a===n.length-1)return n.slice(0,a)+o;let i=new URLSearchParams(t),l=new URLSearchParams(n.slice(a+1));for(let[u,d]of i)l.has(u)||l.append(u,d);return n.slice(0,a)+"?"+l.toString()+o}s(Le,"mergeQueryIntoLocation");function we(e){let t;try{t=decodeURIComponent(e)}catch{return e}if(t===e)return e;let r=Dr(t);if(r===null)return e;let n=kr(e).replace(/%5B/g,"[").replace(/%5D/g,"]");return kr(r)===n?t:e}s(we,"safeDecodePathname");function kr(e){return e.replace(/%[0-9a-fA-F]{2}/g,t=>t.toUpperCase())}s(kr,"normalizePercentCase");function Dr(e){try{let t=new URL("https://void.invalid/");return t.pathname=e,t.pathname}catch{return null}}s(Dr,"reencodePathname");function xr(e,t,r){if(t[e])return{path:e,hash:t[e]};switch(r){case"auto-trailing-slash":{let n=e+".html";if(t[n])return{path:n,hash:t[n]};let o=(e.endsWith("/")?e:e+"/")+"index.html";if(t[o])return{path:o,hash:t[o]};break}case"force-trailing-slash":{if(!e.endsWith("/")&&e!=="/"){let o=e+"/index.html";if(t[o])return{path:o,hash:t[o],redirect:e+"/"}}let n=e+"index.html";if(t[n])return{path:n,hash:t[n]};break}case"drop-trailing-slash":{if(e==="/"){if(t["/index.html"])return{path:"/index.html",hash:t["/index.html"]};break}if(e.endsWith("/")){let o=e.slice(0,-1),a=o+".html";if(t[a])return{path:a,hash:t[a],redirect:o}}let n=e+".html";if(t[n])return{path:n,hash:t[n]};break}case"none":break}return null}s(xr,"matchManifestEntry");function pe(e,t,r){let n=r.html_handling??"auto-trailing-slash",o=xr(e,t,n);if(!o){let a=we(e);if(a!==e&&(o=xr(a,t,n),o?.redirect!==void 0)){let i=Dr(o.redirect);i!==null&&(o={...o,redirect:i})}}if(o)return o;switch(r.not_found_handling??"none"){case"single-page-application":if(t["/index.html"])return{path:"/index.html",hash:t["/index.html"],spa:!0};break;case"404-page":if(t["/404.html"])return{path:"/404.html",hash:t["/404.html"],notFound:!0};break}return null}s(pe,"resolveStaticPath");var uo={html:"text/html; charset=utf-8",htm:"text/html; charset=utf-8",css:"text/css; charset=utf-8",js:"text/javascript; charset=utf-8",mjs:"text/javascript; charset=utf-8",json:"application/json; charset=utf-8",xml:"application/xml; charset=utf-8",svg:"image/svg+xml; charset=utf-8",txt:"text/plain; charset=utf-8",csv:"text/csv; charset=utf-8",md:"text/markdown; charset=utf-8",markdown:"text/markdown; charset=utf-8",yaml:"text/yaml; charset=utf-8",yml:"text/yaml; charset=utf-8",toml:"application/toml",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",ico:"image/x-icon",webp:"image/webp",avif:"image/avif",woff:"font/woff",woff2:"font/woff2",ttf:"font/ttf",otf:"font/otf",eot:"application/vnd.ms-fontobject",pdf:"application/pdf",wasm:"application/wasm",webmanifest:"application/manifest+json; charset=utf-8",map:"application/json; charset=utf-8",mp4:"video/mp4",webm:"video/webm",mp3:"audio/mpeg",ogg:"audio/ogg"};function Ot(e){let t=e.split(".").pop()?.toLowerCase()??"";return uo[t]??"application/octet-stream"}s(Ot,"getContentType");function Ne(e,t){if(e!=="application/null")return!e||e==="application/octet-stream"?Ot(t):e}s(Ne,"resolveAssetContentType");function Lt(e){let t=new Headers({"Cache-Control":"no-store"});return e.retryAt&&Number.isFinite(Date.parse(e.retryAt))&&t.set("Retry-After",String(Math.max(0,Math.ceil((Date.parse(e.retryAt)-Date.now())/1e3)))),Response.json(e,{status:429,headers:t})}s(Lt,"usageLimitResponse");var Or="x-void-shared-cache-policy";var Lr=200;var fo="public, max-age=0, must-revalidate";function Y(e){let t=new Response(e.body,e);return t.headers.set("Cache-Control",fo),t.headers.delete(Or),t}s(Y,"clientRevalidateResponse");function mo(e){return e.headers.get("content-type")?.toLowerCase().split(";",1)[0]?.trim()}s(mo,"mediaType");function K(e){return mo(e)==="text/event-stream"}s(K,"isEventStreamResponse");function Ue(e,t){if(typeof e!="string"||e.trim()==="")throw new Error(`${t} must be a non-empty string.`);return e}s(Ue,"requiredString");var oe=1073741824,yo={free:{requestsPerMonth:3e6,cpuMsPerRequest:10,maxCpuMsPerRequest:10,subRequestsPerInvocation:50,deploysPerDay:100,d1StorageBytes:1*oe,r2StorageBytes:5*oe,kvStorageBytes:1*oe,aiNeuronsPerMonth:1e5,retainedDeployments:1,sandboxRuntimeSecondsPerMonth:1,sandboxMaxConcurrentInstances:1,concurrentBuilds:1,buildTimeoutMinutes:10},solo:{requestsPerMonth:1e7,cpuMsPerRequest:30,maxCpuMsPerRequest:3e4,subRequestsPerInvocation:50,deploysPerDay:500,d1StorageBytes:5*oe,r2StorageBytes:25*oe,kvStorageBytes:5*oe,aiNeuronsPerMonth:3e5,retainedDeployments:5,sandboxRuntimeSecondsPerMonth:108e3,sandboxMaxConcurrentInstances:2,concurrentBuilds:2,buildTimeoutMinutes:15},pro:{requestsPerMonth:1e8,cpuMsPerRequest:50,maxCpuMsPerRequest:3e4,subRequestsPerInvocation:1e3,deploysPerDay:3e3,d1StorageBytes:10*oe,r2StorageBytes:100*oe,kvStorageBytes:25*oe,aiNeuronsPerMonth:5e5,retainedDeployments:25,sandboxRuntimeSecondsPerMonth:72e4,sandboxMaxConcurrentInstances:10,concurrentBuilds:3,buildTimeoutMinutes:15},sponsored:{requestsPerMonth:0,cpuMsPerRequest:50,maxCpuMsPerRequest:3e4,subRequestsPerInvocation:1e3,deploysPerDay:0,d1StorageBytes:0,r2StorageBytes:0,kvStorageBytes:0,aiNeuronsPerMonth:0,retainedDeployments:0,sandboxRuntimeSecondsPerMonth:0,sandboxMaxConcurrentInstances:0,concurrentBuilds:6,buildTimeoutMinutes:20},custom:{requestsPerMonth:0,cpuMsPerRequest:0,maxCpuMsPerRequest:0,subRequestsPerInvocation:0,deploysPerDay:0,d1StorageBytes:0,r2StorageBytes:0,kvStorageBytes:0,aiNeuronsPerMonth:0,retainedDeployments:0,sandboxRuntimeSecondsPerMonth:0,sandboxMaxConcurrentInstances:0,concurrentBuilds:0,buildTimeoutMinutes:0}};var wo=["github","google","oidc","cloudflare-access"];var Ao={ai:!0,customDomains:!1,email:!1,githubActions:!1,githubOAuth:!0,googleOAuth:!1,managedBuilds:!1,sandbox:!1},bo={apiHostname:null,dashboardHostname:null,proxyHostname:null};function Nr(e){let t=e.trim().toLowerCase().replaceAll(/[^a-z0-9-]+/g,"-").replaceAll(/^-+|-+$/g,"").replaceAll(/-{2,}/g,"-");if(!t)throw new Error("The installation name must contain a letter or number.");if(t.length>40)throw new Error("The installation name must be 40 characters or fewer after normalization.");return t}s(Nr,"normalizeInstallationSlug");function fe(e){let t=e.trim().toLowerCase();if(t.endsWith(".")&&(t=t.slice(0,-1)),t.length>253||!t.includes(".")||t.split(".").some(r=>!/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/.test(r)))throw new Error(`Invalid domain: ${JSON.stringify(e)}.`);return t}s(fe,"normalizeApplicationDomain");function Ro(e){let t=e.trim(),r;try{r=new URL(t)}catch{throw new Error("The dashboard URL must be an HTTPS origin.")}if(!/^https:\/\/[^/?#]+\/?$/i.test(t)||/[\s\\]/.test(t)||r.protocol!=="https:"||r.username||r.password||r.pathname!=="/"||r.search||r.hash)throw new Error("The dashboard URL must be an HTTPS origin without credentials, a path, query, or fragment.");return r.hostname=fe(r.hostname),r.origin}s(Ro,"normalizePlatformDashboardUrl");function Eo(e){let t=`void-${Nr(e)}`,r=t.replaceAll("-","_");return{aiGateway:t,apiWorker:`${t}-api`,assetsBucket:`${t}-assets`,cronQueue:`${t}-cron-fires`,deploymentQueue:`${t}-deployments`,dashboardWorker:`${t}-dashboard`,dispatchNamespace:`${t}-users`,dispatchWorker:`${t}-dispatch`,emailGatewayWorker:`${t}-email-gateway`,hyperdrive:`${t}-database`,isrCacheKv:`${t}-isr-cache`,legacyAssetsKv:`${t}-legacy-assets`,logsDataset:`${r}_logs`,proxyWorker:`${t}-proxy`,requestsDataset:`${r}_requests`,routingKv:`${t}-routing`,tailWorker:`${t}-tail`,usageQueue:`${t}-usage-events`}}s(Eo,"createPlatformResourceNames");function So(e){if(!e.zoneName&&e.workersDev){if(e.dedicatedZone)throw new Error("workers.dev cannot use a dedicated-zone catch-all.");return[]}let t=fe(e.baseDomain),r=fe(e.zoneName);if(t!==r&&!t.endsWith(`.${r}`))throw new Error(`Application domain ${t} is not inside zone ${r}.`);let n=[{pattern:`*.${t}/*`,zoneName:r},{pattern:`*.${t}`,zoneName:r}];if(e.dedicatedZone){if(t!==r)throw new Error("A dedicated-zone catch-all requires the application domain to be the zone.");n.push({pattern:"*/*",zoneName:r},{pattern:"*",zoneName:r})}return n}s(So,"createApplicationRoutes");function _o(e){if(e.emailSharedZoneId===void 0!=(e.emailSenderDomain===void 0))throw new Error("Shared email configuration requires both emailSenderDomain and emailSharedZoneId.");let t=Nr(e.installationSlug),r=fe(e.application.baseDomain),n=e.application.workersDev;if(n&&(!/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/.test(n.subdomain)||!/^[a-z0-9][a-z0-9-]{0,80}$/.test(n.installationId)))throw new Error("Invalid workers.dev installation identity.");let o=n&&e.application.zoneName===""?"":fe(e.application.zoneName);if(!o&&r!==`${n.subdomain}.workers.dev`)throw new Error("workers.dev application domain must match its account subdomain.");let a={...Eo(t),...e.resources},i={...Ao,...e.capabilities};if(i.managedBuilds&&!i.githubActions)throw new Error("Managed builds require the GitHub Actions capability.");if(e.appAccess!==void 0&&!["public","platform","custom"].includes(e.appAccess))throw new Error("appAccess must be public, platform, or custom.");let l=e.authentication?.providers??["github"];if(l.some(m=>!wo.includes(m))||new Set(l).size!==l.length)throw new Error("Authentication providers must be unique supported login kinds.");let u=e.authentication?.configurable===!0||e.authentication?.accessProtection===!0||l.some(m=>m==="oidc"||m==="cloudflare-access");if(l.length===0)throw new Error("At least one authentication provider is required.");if(l.includes("github")!==i.githubOAuth)throw new Error("The GitHub provider and githubOAuth capability must agree.");if(l.includes("google")!==i.googleOAuth)throw new Error("The Google provider and googleOAuth capability must agree.");let d=e.controlPlane?.dashboardUrl===void 0?void 0:Ro(e.controlPlane.dashboardUrl),f={...e.appAccess!==void 0?{appAccess:e.appAccess}:{},application:{baseDomain:r,dedicatedZone:e.application.dedicatedZone??!1,zoneName:o,...n?{workersDev:{...n}}:{},...e.application.zoneId?{zoneId:Ue(e.application.zoneId,"application.zoneId")}:{}},authentication:{providers:[...l],...u?{configurable:!0}:{},...e.authentication?.accessProtection?{accessProtection:!0}:{}},capabilities:i,...e.emailSharedZoneId!==void 0?{emailSharedZoneId:Ue(e.emailSharedZoneId,"emailSharedZoneId")}:{},...e.emailSenderDomain!==void 0?{emailSenderDomain:fe(e.emailSenderDomain)}:{},controlPlane:{...bo,...e.controlPlane,...d!==void 0?{dashboardUrl:d,dashboardHostname:e.controlPlane?.dashboardHostname??new URL(d).hostname}:{}},displayName:Ue(e.displayName,"displayName").trim(),installationSlug:t,resources:a,schemaVersion:e.appAccess!==void 0?4:u?3:n?2:1};So(f.application);for(let[m,c]of Object.entries(f.controlPlane))m!=="dashboardUrl"&&c!==null&&fe(c);if(f.controlPlane.dashboardUrl){let m=new URL(f.controlPlane.dashboardUrl).hostname;if(f.controlPlane.dashboardHostname!==m)throw new Error("The dashboard URL and dashboard hostname must agree.")}for(let[m,c]of Object.entries(f.resources))Ue(c,`resources.${m}`);return f}s(_o,"createPlatformDeploymentManifest");var Ur=2;function Ae(e){let t=e.SITE_DOMAIN??e.BASE_HOSTNAME??"void.app";return e.PLATFORM_APPLICATION?Io(JSON.parse(e.PLATFORM_APPLICATION)):{baseDomain:t,zoneName:t,dedicatedZone:!1}}s(Ae,"readPlatformApplication");function Io(e){return _o({installationSlug:"runtime",displayName:"Runtime",application:e}).application}s(Io,"parsePlatformApplication");function Mr(e){return`workers-dev:${e}`}s(Mr,"platformWorkersDevAliasKey");var Po="__void/platform/application/v1";async function Hr(e){if(!e.PLATFORM_APPLICATION)return e;let t=await e.ROUTING.get(Po);if(!t)return e;let r=Ae(e),n=Ae({PLATFORM_APPLICATION:t});if(!r.workersDev||!n.workersDev||r.workersDev.installationId!==n.workersDev.installationId||r.workersDev.subdomain!==n.workersDev.subdomain)throw new Error("Application routing belongs to another platform installation.");return{...e,PLATFORM_APPLICATION:t,SITE_DOMAIN:n.baseDomain,BASE_HOSTNAME:n.baseDomain,...n.zoneId?{CF_ZONE_ID:n.zoneId}:{}}}s(Hr,"resolvePlatformApplicationEnvironment");function To(e){return`void-${e.installationId.slice(-12)}-`}s(To,"platformProjectIngressPrefix");function Co(e,t){if(!/^proj_[a-z0-9]{1,32}$/.test(e.id)||!/^[a-z0-9][a-z0-9-]*$/.test(e.slug))throw new Error("Invalid platform project identity.");let r=To(t),n=`-${e.id.slice(5)}`;return`${r}${e.slug.slice(0,63-r.length-n.length).replace(/-+$/,"")}${n}`}s(Co,"platformProjectIngressName");function $r(e,t){return`${Co(e,t)}.${t.subdomain}.workers.dev`}s($r,"platformProjectWorkersDevHostname");var Nt="void-platform-health";function Fr(e){return e.zoneName?`${Nt}.${e.baseDomain}`:null}s(Fr,"platformHealthHostname");import{WorkerEntrypoint as hs}from"cloudflare:workers";var st=new TextEncoder,it=new TextDecoder,at=new TextDecoder("utf-8",{fatal:!0}),da=2**32;function Vr(...e){let t=e.reduce((o,{length:a})=>o+a,0),r=new Uint8Array(t),n=0;for(let o of e)r.set(o,n),n+=o.length;return r}s(Vr,"concat");var vo=/[^\x00-\x7f]/;function be(e){if(typeof e=="string"&&e.length>=128){if(vo.test(e))throw new TypeError("non-ASCII string encountered in encode()");return st.encode(e)}let t=new Uint8Array(e.length);for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);if(n>127)throw new TypeError("non-ASCII string encountered in encode()");t[r]=n}return t}s(be,"encode");function Kr(e,t=!1){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e,{alphabet:t?"base64url":"base64"});if(t){if(e.includes("+")||e.includes("/"))throw new TypeError("Invalid base64url");e=e.replace(/-/g,"+").replace(/_/g,"/")}let r=atob(e),n=new Uint8Array(r.length);for(let o=0;o<r.length;o++)n[o]=r.charCodeAt(o);return n}s(Kr,"decodeBase64");var V=class extends Error{static{s(this,"JOSEError")}static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(t,r){super(t,r),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}},se=class extends V{static{s(this,"JWTClaimValidationFailed")}static code="ERR_JWT_CLAIM_VALIDATION_FAILED";code="ERR_JWT_CLAIM_VALIDATION_FAILED";claim;reason;payload;constructor(t,r,n="unspecified",o="unspecified"){super(t,{cause:{claim:n,reason:o,payload:r}}),this.claim=n,this.reason=o,this.payload=r}},Me=class extends V{static{s(this,"JWTExpired")}static code="ERR_JWT_EXPIRED";code="ERR_JWT_EXPIRED";claim;reason;payload;constructor(t,r,n="unspecified",o="unspecified"){super(t,{cause:{claim:n,reason:o,payload:r}}),this.claim=n,this.reason=o,this.payload=r}},ct=class extends V{static{s(this,"JOSEAlgNotAllowed")}static code="ERR_JOSE_ALG_NOT_ALLOWED";code="ERR_JOSE_ALG_NOT_ALLOWED"},Q=class extends V{static{s(this,"JOSENotSupported")}static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"};var F=class extends V{static{s(this,"JWSInvalid")}static code="ERR_JWS_INVALID";code="ERR_JWS_INVALID"},Re=class extends V{static{s(this,"JWTInvalid")}static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"};var He=class extends V{static{s(this,"JWKSInvalid")}static code="ERR_JWKS_INVALID";code="ERR_JWKS_INVALID"},Ee=class extends V{static{s(this,"JWKSNoMatchingKey")}static code="ERR_JWKS_NO_MATCHING_KEY";code="ERR_JWKS_NO_MATCHING_KEY";constructor(t="no applicable key found in the JSON Web Key Set",r){super(t,r)}},lt=class extends V{static{s(this,"JWKSMultipleMatchingKeys")}[Symbol.asyncIterator]=async function*(){};static code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";constructor(t="multiple matching keys found in the JSON Web Key Set",r){super(t,r)}},dt=class extends V{static{s(this,"JWKSTimeout")}static code="ERR_JWKS_TIMEOUT";code="ERR_JWKS_TIMEOUT";constructor(t="request timed out",r){super(t,r)}},ut=class extends V{static{s(this,"JWSSignatureVerificationFailed")}static code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";constructor(t="signature verification failed",r){super(t,r)}};var ko="The input to be decoded is not correctly encoded.";function $e(e){try{return Kr(typeof e=="string"?e:it.decode(e),!0)}catch(t){throw new TypeError(ko,{cause:t})}}s($e,"decode");function ce(e){if(typeof e!="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}s(ce,"isObject");function pt(e){return ce(e)&&Array.isArray(e.keys)&&Array.from(e.keys).every(ce)}s(pt,"isJwkSet");function jr(...e){let t=new Set;for(let r of e)if(r)for(let n of Object.keys(r)){if(t.has(n))return!1;t.add(n)}return!0}s(jr,"isDisjoint");function Ut(e,t,r){try{return $e(e)}catch{throw new r(`Failed to base64url decode the ${t}`)}}s(Ut,"decodeBase64url");function Wr(e,t,r){try{return be(e)}catch{throw new r(`The ${t} is not a valid base64url string`)}}s(Wr,"encodeBase64url");function Jr(e,t,r){let n;try{n=JSON.parse(at.decode($e(e)))}catch{throw new t(r)}if(!ce(n))throw new t(r);return n}s(Jr,"parseJoseHeader");var zr={__proto__:null,b64:!0};function Br(e,t){if(t!==void 0&&(!Array.isArray(t)||t.some(r=>typeof r!="string")))throw new TypeError(`"${e}" option must be an array of strings`);return t===void 0?void 0:new Set(t)}s(Br,"validateAlgorithms");function Gr(e,t,r,n,o){if(o.crit!==void 0&&n?.crit===void 0)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!n||n.crit===void 0)return[];if(!Array.isArray(n.crit)||n.crit.length===0||n.crit.some(i=>typeof i!="string"||i.length===0))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let a=r===void 0?t:{__proto__:null,...r,...t};for(let i of n.crit){if(!(i in a))throw new Q(`Extension Header Parameter "${i}" is not recognized`);if(!Object.hasOwn(o,i)||o[i]===void 0)throw new e(`Extension Header Parameter "${i}" is missing`);if(a[i]&&(!Object.hasOwn(n,i)||n[i]===void 0))throw new e(`Extension Header Parameter "${i}" MUST be integrity protected`)}return n.crit}s(Gr,"validateCrit");function qr(e,t){if(t.includes("b64")){let r=e.b64;if(typeof r!="boolean")throw new F('The "b64" (base64url-encode payload) Header Parameter must be a boolean');return r}return!0}s(qr,"validateB64");var xo=s(e=>e[Symbol.toStringTag],"tag"),Do=s((e,t,r)=>{let{alg:n}=e;if(t.use!==void 0){let o=r==="sign"||r==="verify"?"sig":"enc";if(t.use!==o)throw new TypeError(`Invalid key for this operation, its "use" must be "${o}" when present`)}if(t.alg!==void 0&&t.alg!==n)throw new TypeError(`Invalid key for this operation, its "alg" must be "${n}" when present`);if(Array.isArray(t.key_ops)){let o=r==="encrypt"||r==="decrypt"?e.ops?.[r==="encrypt"?0:1]:r;if(o&&!t.key_ops.includes(o))throw new TypeError(`Invalid key for this operation, its "key_ops" must include "${o}" when present`)}},"jwkMatchesOp");async function Qr(e,t,r){let{alg:n,secret:o}=e,a=r==="decrypt"||r==="sign";if(o&&t instanceof Uint8Array)return t;let i,l;if(ce(t)){if(i=$o(t),typeof i.kty!="string")throw Yr(n,t,o);if(!(o?i.kty==="oct"&&typeof i.k=="string":i.kty!=="oct"&&(a?i.kty==="AKP"&&typeof i.priv=="string"||typeof i.d=="string":i.d===void 0&&i.priv===void 0)))throw new TypeError(o?'JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present':`JSON Web Key for this operation must be a ${a?"private":"public"} JWK`);if(Do(e,i,r),i.kty==="oct")return $e(i.k);if(!Object.isFrozen(t)){let{key_ops:f}=t;Array.isArray(f)&&Object.freeze(f),Object.freeze(t)}}else{if(!No(t))throw Yr(n,t,o);let f=o?"secret":a?"private":"public";if(t.type!==f&&(o||["secret","public","private"].includes(t.type)))throw new TypeError(`${xo(t)} instances must be of type "${f}" for the ${n} algorithm`);if(Xr(t))return t;if(l=t,l.type==="secret")return l.export()}Mt||=new WeakMap;let u=t,d=Mt.get(u);if(d?.[n])return d[n];if(d||Mt.set(u,d={}),l&&typeof l.toCryptoKey=="function"){let f=l.type==="public",m=Oo[l.asymmetricKeyDetails?.namedCurve],c=e.resolve?.({crv:m,asymmetricKeyType:l.asymmetricKeyType})??e.subtle;return d[n]=l.toCryptoKey(c,f,e.usages[f?0:1])}return i??=l.export({format:"jwk"}),i.alg=n,d[n]=await $t(e,i)}s(Qr,"prepareKey");var Mt,Oo={__proto__:null,prime256v1:"P-256",secp384r1:"P-384",secp521r1:"P-521"};var Xr=s(e=>{if(e?.[Symbol.toStringTag]==="CryptoKey")return!0;try{return e instanceof CryptoKey}catch{return!1}},"isCryptoKey"),Lo=s(e=>e?.[Symbol.toStringTag]==="KeyObject","isKeyObject"),No=s(e=>Xr(e)||Lo(e),"isKeyLike");function Uo(e,t,...r){if(r.length>2){let n=r.pop();e+=`one of type ${r.join(", ")}, or ${n}.`}else r.length===2?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return t==null?e+=` Received ${t}`:typeof t=="function"&&t.name?e+=` Received function ${t.name}`:typeof t=="object"&&t!=null&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}s(Uo,"message");function Yr(e,t,r){let n=["CryptoKey","KeyObject","JSON Web Key"];return r&&n.push("Uint8Array"),new TypeError(Uo(`Key for the ${e} algorithm must be `,t,...n))}s(Yr,"invalidKeyType");var ft=s((e,t="algorithm.name")=>new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`),"unusable");function Mo(e,t){if(t&&!e.usages.includes(t))throw new TypeError(`CryptoKey does not support this operation, its usages must include ${t}.`)}s(Mo,"checkUsage");function Zr(e,t){let{modulusLength:r}=t.algorithm;if(typeof r!="number"||r<2048)throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}s(Zr,"checkModulusLength");function Ho(e,t,r){let n=e.algorithm;if(n.name!==t.name)throw ft(t.name);if(t.hash&&n.hash?.name!==t.hash)throw ft(t.hash,"algorithm.hash");if(t.namedCurve&&n.namedCurve!==t.namedCurve)throw ft(t.namedCurve,"algorithm.namedCurve");if(t.length!==void 0&&n.length!==t.length)throw ft(t.length,"algorithm.length");Mo(e,r)}s(Ho,"checkCryptoKey");function Ht(e){return{__proto__:null,...e}}s(Ht,"snapshotJwk");function $o(e){let t=Ht(e);if(t.ext!==void 0&&typeof t.ext!="boolean")throw new TypeError('"ext" (Extractable) Parameter must be a boolean');if(t.key_ops!==void 0){let r=t.key_ops,n=Array.isArray(r)?[...r]:void 0;if(!n||n.some(o=>typeof o!="string")||new Set(n).size!==n.length)throw new TypeError('"key_ops" (Key Operations) Parameter must be an array of unique strings');t.key_ops=n}return t}s($o,"normalizeJwk");async function $t(e,t,r){if(!e.kty.includes(t.kty))throw new Q('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');let n=e.resolve?.({kty:t.kty,crv:t.crv})??e.subtle,o=!!(t.d||t.priv),a={...t,ext:r??t.ext};return a.kty!=="AKP"&&delete a.alg,delete a.use,crypto.subtle.importKey("jwk",a,n,a.ext??!o,t.key_ops??e.usages[o?1:0])}s($t,"jwkToKey");async function en(e,t,r,n=!1){return e instanceof Uint8Array&&(e=await crypto.subtle.importKey("raw",e,t,n,[r])),Ho(e,t,r),e}s(en,"rawKey");function tn(e){let t={__proto__:null};for(let r in e)t[r]={...e[r],alg:r};return t}s(tn,"table");var Fe=[["verify"],["sign"]];function Ft(e){let t={name:"HMAC",hash:`SHA-${e}`};return{kty:["oct"],secret:!0,subtle:t,signing:t,usages:Fe}}s(Ft,"hmac");function Se(e,t){let r={name:t?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:`SHA-${e}`};return{kty:["RSA"],subtle:r,signing:t?{...r,saltLength:t}:r,usages:Fe,minRsaBits:2048}}s(Se,"rsa");function Vt(e,t){return{kty:["EC"],crv:e,subtle:{name:"ECDSA",namedCurve:e},signing:{name:"ECDSA",hash:`SHA-${t}`},usages:Fe}}s(Vt,"ecdsa");function rn(){let e={name:"Ed25519"};return{kty:["OKP"],crv:"Ed25519",subtle:e,signing:e,usages:Fe}}s(rn,"eddsa");function Kt(e){let t={name:`ML-DSA-${e}`};return{kty:["AKP"],subtle:t,signing:t,usages:Fe}}s(Kt,"mldsa");var jt=tn({HS256:Ft(256),HS384:Ft(384),HS512:Ft(512),RS256:Se(256),RS384:Se(384),RS512:Se(512),PS256:Se(256,32),PS384:Se(384,48),PS512:Se(512,64),ES256:Vt("P-256",256),ES384:Vt("P-384",384),ES512:Vt("P-521",512),EdDSA:rn(),Ed25519:rn(),"ML-DSA-44":Kt(44),"ML-DSA-65":Kt(65),"ML-DSA-87":Kt(87)});function nn(e){let t=typeof e=="string"?jt[e]:void 0;if(!t)throw new Q(`alg ${e} is not supported either by JOSE or your javascript runtime`);return t}s(nn,"jwsAlgorithm");function on(e){return[e&&Br("algorithms",e.algorithms),e?.crit]}s(on,"prepareVerify");function Fo(e){return e===void 0?{}:Jr(e,F,"JWS Protected Header is invalid")}s(Fo,"parseProtectedHeader");function Vo(e){try{return be(e)}catch{throw new F("JWS Compact Serialization payload must use only ASCII characters")}}s(Vo,"encodeCompactUnencodedPayload");async function Ko(e,t,r,n,o){let{protected:a,header:i,payload:l}=e,u=o??Fo(a);if(!jr(u,i))throw new F("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let d={...u,...i},f=qr(u,Gr(F,zr,t[1],u,d)),{alg:m}=d;if(typeof m!="string"||!m)throw new F('JWS "alg" (Algorithm) Header Parameter missing or invalid');if(t[0]&&!t[0].has(m))throw new ct('"alg" (Algorithm) Header Parameter value not allowed');if(f){if(typeof l!="string")throw new F("JWS Payload must be a string")}else if(typeof l!="string"&&!(l instanceof Uint8Array))throw new F("JWS Payload must be a string or an Uint8Array instance");let c=f||typeof l!="string"?l:n(l),E=!1;typeof r=="function"&&(r=await r(u,e),E=!0);let p=nn(m),T=Vr(a!==void 0?be(a):new Uint8Array,be("."),typeof c=="string"?t[2]??=Wr(c,"payload",F):c),R=Ut(e.signature,"signature",F),w=await Qr(p,r,"verify"),g=await en(w,p.subtle,"verify");p.minRsaBits&&Zr(p.alg,g);let S=!1;try{S=await crypto.subtle.verify(p.signing,g,R,T)}catch{}if(!S)throw new ut;let H={payload:typeof c=="string"?Ut(c,"payload",F):c};return a!==void 0&&(H.protectedHeader=u),i!==void 0&&(H.unprotectedHeader=i),E?[{...H,key:w},f]:[H,f]}s(Ko,"verifySignature");async function sn(e,t,r){if(e instanceof Uint8Array&&(e=it.decode(e)),typeof e!="string")throw new F("Compact JWS must be a string or Uint8Array");let{0:n,1:o,2:a,length:i}=e.split(".");if(i!==3)throw new F("Invalid Compact JWS");return Ko({payload:o,protected:n,signature:a},t,r,Vo)}s(sn,"verifyCompact");var jo=s(e=>Math.floor(e.getTime()/1e3),"epoch"),Wo={s:1,m:60,h:3600,d:86400,w:604800,y:31557600},Jo=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i,_e="check_failed";function Wt(){throw new TypeError("Invalid time period format")}s(Wt,"invalidDuration");function an(e){typeof e!="string"&&Wt();let t=Jo.exec(e);(!t||t[4]&&t[1])&&Wt();let r=parseFloat(t[2]),n=Math.round(r*Wo[t[3][0].toLowerCase()]);return Number.isFinite(n)||Wt(),t[1]==="-"||t[4]==="ago"?-n:n}s(an,"secs");function Jt(e,t){if(!Number.isFinite(t))throw new TypeError(`Invalid ${e} input`);return t}s(Jt,"validateInput");var cn=s(e=>{let t=e.toLowerCase();return e.includes("/")?t:`application/${t}`},"normalizeTyp"),zo=s((e,t)=>typeof e=="string"?t.includes(e):Array.isArray(e)?t.some(r=>e.includes(r)):!1,"checkAudiencePresence");function zt(e,t,r=!1){let n=e[t];if(!(n===void 0&&!r)){if(typeof n!="number")throw new se(`"${t}" claim must be a number`,e,t,"invalid");return n}}s(zt,"validateNumericDate");function Bt(e,t){throw new se(`unexpected "${t}" claim value`,e,t,_e)}s(Bt,"unexpectedClaim");function ln(e,t,r={}){let n;try{n=JSON.parse(at.decode(t))}catch{}if(!ce(n))throw new Re("JWT Claims Set must be a top-level JSON object");let{typ:o}=r;if(o!==void 0&&(typeof e.typ!="string"||cn(e.typ)!==cn(o)))throw new se('unexpected "typ" JWT header value',n,"typ",_e);let{requiredClaims:a=[],issuer:i,subject:l,audience:u,maxTokenAge:d}=r,f=[...a];d!==void 0&&f.push("iat"),u!==void 0&&f.push("aud"),l!==void 0&&f.push("sub"),i!==void 0&&f.push("iss");for(let g of new Set(f.reverse()))if(!Object.hasOwn(n,g))throw new se(`missing required "${g}" claim`,n,g,"missing");i!==void 0&&!(Array.isArray(i)?i:[i]).includes(n.iss)&&Bt(n,"iss"),l!==void 0&&n.sub!==l&&Bt(n,"sub"),u!==void 0&&!zo(n.aud,typeof u=="string"?[u]:u)&&Bt(n,"aud");let{clockTolerance:m}=r,c=0;if(typeof m=="string")c=an(m);else if(m!==void 0){if(typeof m!="number")throw new TypeError("Invalid clockTolerance option type");c=m}Jt("clockTolerance option",c);let{currentDate:E}=r,p=Jt("currentDate option",jo(E===void 0?new Date:E)),T=zt(n,"iat",d!==void 0),R=zt(n,"nbf");if(R!==void 0&&R>p+c)throw new se('"nbf" claim timestamp check failed',n,"nbf",_e);let w=zt(n,"exp");if(w!==void 0&&w<=p-c)throw new Me('"exp" claim timestamp check failed',n,"exp",_e);if(d!==void 0){let g=p-T,S=Jt("maxTokenAge option",typeof d=="number"?d:an(d));if(g-c>S)throw new Me('"iat" claim timestamp check failed (too far in the past)',n,"iat",_e);if(g<-c)throw new se('"iat" claim timestamp check failed (it should be in the past)',n,"iat",_e)}return n}s(ln,"validateClaimsSet");async function Gt(e,t,r){let[n,o]=await sn(e,on(r),t);if(!o)throw new Re("JWTs MUST NOT use unencoded payload");let a=ln(n.protectedHeader,n.payload,r);return{...n,payload:a}}s(Gt,"jwtVerify");function Bo(e,t,r,n){let{kty:o,key_ops:a,ext:i,kid:l,alg:u,use:d,crv:f}=e;return(i===void 0||typeof i=="boolean")&&(a===void 0||Array.isArray(a)&&a.every((m,c)=>typeof m=="string"&&a.indexOf(m)===c)&&a.includes("verify"))&&t.kty.includes(o)&&(n===void 0||typeof n=="string"&&n===l)&&(u===void 0?o!=="AKP":r===u)&&(d===void 0||d==="sig")&&(!t.crv||f===t.crv)}s(Bo,"isUsableJWK");async function dn(e,t,r){let n=e.get(t)||e.set(t,{}).get(t),{alg:o}=r;if(n[o]===void 0){let a=$t(r,t,!0).then(i=>{if(i.type!=="public")throw new He("JSON Web Key Set members must be public keys");return n[o]=i,i}).catch(i=>{throw n[o]===a&&delete n[o],i});n[o]=a}return n[o]}s(dn,"importWithAlgCache");function qt(e){let t;try{t=structuredClone(e)}catch{}if(!pt(t))throw new He("JSON Web Key Set malformed");let r=t.keys.map(o=>{let a=Ht(o);return Array.isArray(a.key_ops)&&(a.key_ops=[...a.key_ops]),a}),n=new WeakMap;return Object.defineProperty(async(o,a)=>{let{alg:i,kid:l}={...o,...a?.header},u=typeof i=="string"?jt[i]:void 0;if(!u||u.secret)throw new Q('Unsupported "alg" value for a JSON Web Key Set');let d=t.keys.filter((c,E)=>Bo(r[E],u,i,l)),{0:f,length:m}=d;if(!m)throw new Ee;if(m!==1){let c=new lt;throw c[Symbol.asyncIterator]=async function*(){for(let E of d)try{yield await dn(n,E,u)}catch{}},c}return dn(n,f,u)},"jwks",{value:s(()=>structuredClone(t),"value")})}s(qt,"createLocalJWKSet");function Go(){return typeof WebSocketPair<"u"||typeof navigator<"u"&&!0||typeof EdgeRuntime<"u"&&EdgeRuntime==="vercel"}s(Go,"isCloudflareWorkers");var Yt;(typeof navigator>"u"||!"Cloudflare-Workers"?.startsWith?.("Mozilla/5.0 "))&&(Yt="jose/v6.2.12");var mt=Symbol();async function qo(e,t,r,n=fetch){let o=await n(e,{method:"GET",signal:r,redirect:"manual",headers:t}).catch(a=>{throw a.name==="TimeoutError"?new dt:a});if(o.status!==200)throw new V("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await o.json()}catch{throw new V("Failed to parse the JSON Web Key Set HTTP response as JSON")}}s(qo,"fetchJwks");var pn=Symbol();function Ve(e,t){return Number.isFinite(e)&&Date.now()<e+t}s(Ve,"isFreshFor");function un(e,t,r){if(Number.isNaN(e))throw new TypeError(`"${r}" option must not be NaN`);return typeof e=="number"?e:t}s(un,"validateDuration");function Qt(e,t){if(!(e instanceof URL))throw new TypeError("url must be an instance of URL");let r=new URL(e.href).href,n=t??{},o=n.timeoutDuration;if(typeof o=="number"&&(!Number.isInteger(o)||o<0))throw new TypeError('"timeoutDuration" option must be a non-negative integer');let a=typeof o=="number"?o:5e3,i=un(n.cooldownDuration,3e4,"cooldownDuration"),l=un(n.cacheMaxAge,6e5,"cacheMaxAge"),u=new Headers(n.headers);Yt&&!u.has("User-Agent")&&u.set("User-Agent",Yt),u.has("accept")||u.set("accept","application/json, application/jwk-set+json");let d=n[mt],f=n[pn],m,c,E=0,p=0,T;if(f&&typeof f=="object"){let{uat:w,jwks:g}=f;Ve(w,l)&&pt(g)&&(m=w,T=qt(g))}let R=s(async()=>{if(c&&Go()&&(c=void 0),!c){let w=++E,g=c=qo(r,u,AbortSignal.timeout(a),d).then(S=>{let H=qt(S);if(w<=p)return;T=H;let $=Date.now();f&&(f.uat=$,f.jwks=S),m=$,p=w}).finally(()=>{c===g&&(c=void 0)})}await c},"reload");return Object.defineProperties(async(w,g)=>{(!T||!Ve(m,l))&&await R();try{return await T(w,g)}catch(S){if(S instanceof Ee&&!Ve(m,i))return await R(),T(w,g);throw S}},{coolingDown:{get:s(()=>Ve(m,i),"get"),enumerable:!0},fresh:{get:s(()=>Ve(m,l),"get"),enumerable:!0},reload:{value:R,enumerable:!0},reloading:{get:s(()=>!!c,"get"),enumerable:!0},jwks:{value:s(()=>T?.jwks(),"value"),enumerable:!0}})}s(Qt,"createRemoteJWKSet");function fn(e,t){let r=e.toLowerCase(),n=t.toLowerCase(),o=r.indexOf("*");if(o===-1)return r===n;let a=r.slice(0,o),i=r.slice(o+1);if(a.includes(".")||!i.startsWith(".")||i.includes("*")||!n.startsWith(a)||!n.endsWith(i))return!1;let l=n.slice(0,-i.length);return l.length>0&&!l.includes(".")}s(fn,"matchesHostname");function Yo(e,t){let r=t.audiences.find(n=>!n.hostname.includes("*")&&fn(n.hostname,e));return r?r.audience:t.audiences.find(n=>fn(n.hostname,e))?.audience??null}s(Yo,"resolveAccessAudience");var Xt=class{constructor(t=(r,n)=>fetch(r,n)){this.request=t}request;static{s(this,"ProjectAccessVerifier")}keys=new Map;async verify(t,r,n){try{let o=Yo(t,n);if(!o||!r||r.length>32*1024)return!1;let a=n.teamDomain.replace(/\/+$/,""),i=new URL(a);if(i.protocol!=="https:"||!i.hostname.endsWith(".cloudflareaccess.com")||i.origin!==a)return!1;let l=this.keys.get(a);l||(this.keys.size>=16&&this.keys.delete(this.keys.keys().next().value),l=Qt(new URL(`${a}/cdn-cgi/access/certs`),{timeoutDuration:1e4,[mt]:async(d,f)=>{let m=await this.request(d,{...f,redirect:"manual"});if(m.status>=300&&m.status<400)throw await m.body?.cancel(),new Error("Access key endpoint redirected.");return m}}),this.keys.set(a,l));let{payload:u}=await Gt(r,l,{issuer:a,audience:o,algorithms:["RS256"],requiredClaims:["iss","aud","iat","exp","type"]});return u.type==="app"&&typeof u.iat=="number"&&u.iat<=Date.now()/1e3+30}catch{return!1}}},mn=new Xt;function Ke(e){return e.slice(e.lastIndexOf("/")+1).includes(".")}s(Ke,"hasExtension");function X(e){return e==="/api"||e.startsWith("/api/")}s(X,"isApiPath");function Zt(e,t,r=!1){return X(e)?"api":t&&(!Ke(e)||r)?"ssr":null}s(Zt,"classifyDynamicRequestType");var er='system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif';function tr(e){return e.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;")}s(tr,"escapeHtml");function hn(e,t,r=!1){let n=`${e}: ${t}`,o=`${e}: `;return`<!doctype html>
2
2
  <html lang="en">
3
3
  <head>
4
4
  <meta charset="utf-8">