gemi 0.120.0 → 0.120.1

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,5 +1,5 @@
1
1
  // @bun
2
- import{S as q,T as KJ,U as OJ}from"./chunk-dbx3g5ck.js";import{oa as B,sa as L,ta as UJ}from"./chunk-a22h5cby.js";import"./chunk-kk18xqgc.js";import{De as QJ,Ee as A,Vc as a}from"./chunk-hhymaj0m.js";import"./chunk-65beps2q.js";import"./chunk-m53fgf20.js";import{Ef as o,Ff as n,If as i}from"./chunk-4acpw92g.js";import{Jg as HJ}from"./chunk-cca0grq3.js";import"./chunk-m83zm86m.js";import"./chunk-1xdrs2hx.js";import"./chunk-19dpzp4y.js";import"./chunk-yds7zwc3.js";import"./chunk-meg8rtr6.js";import"./chunk-h43jp8ws.js";import"./chunk-s07v65x6.js";import"./chunk-gc2dz11k.js";import"./chunk-cskqet01.js";import"./chunk-fenc5tpv.js";import"./chunk-nz8z8jr1.js";import"./chunk-4fx8p02c.js";import{Ui as e}from"./chunk-er8acmch.js";import"./chunk-2n3pgfnb.js";import{fj as YJ}from"./chunk-d5f1m3d2.js";import{gj as N}from"./chunk-rhvc1axc.js";import"./chunk-tewhms9w.js";import{createHash as X2}from"crypto";import{join as w,resolve as VJ,sep as zJ}from"path";import{Duplex as TJ}from"stream";import{constants as P,createBrotliCompress as RJ,createGzip as bJ}from"zlib";var kJ=["br","gzip"],SJ=1024,wJ=5,vJ=19,EJ=6;function yJ(J){if(J===void 0)return 1;if(!/^\d+(\.\d{0,3})?$/.test(J.trim()))return 1;let $=Number(J.trim());return Number.isFinite($)?Math.min($,1):1}function gJ(J){if(J===null||J===void 0)return null;let $=new Map;for(let Z of J.split(",")){let[X,...Q]=Z.split(";"),H=X.trim().toLowerCase();if(H==="")continue;let j=1;for(let Y of Q){let K=Y.indexOf("=");if(K===-1)continue;if(Y.slice(0,K).trim().toLowerCase()==="q"){j=yJ(Y.slice(K+1));break}}$.set(H,j)}return $}function b(J,$=kJ){let Z=gJ(J);if(!Z)return null;let X=Z.get("*"),Q=null,H=0;for(let j of $){let Y=Z.get(j)??X??0;if(Y>H)Q=j,H=Y}return Q}function fJ(J,$){if(!J)return!1;return J.split(",").some((Z)=>Z.trim().toLowerCase().split("=")[0].trim()===$)}function mJ(J,$){if(J==="HEAD")return!1;if($.status<200||$.status===204||$.status===206||$.status===304)return!1;if($.headers.has("Content-Range"))return!1;let Z=$.headers.get("Content-Type");if(!Z||!/^\s*text\/html\s*(;|$)/i.test(Z))return!1;if(!$.body)return!1;let X=$.headers.get("Content-Encoding");if(X&&X.trim().toLowerCase()!=="identity")return!1;if(fJ($.headers.get("Cache-Control"),"no-transform"))return!1;let Q=$.headers.get("Content-Length");if(Q!==null&&Number(Q)<SJ)return!1;return!0}function uJ(J){let $=J==="br"?RJ({params:{[P.BROTLI_PARAM_QUALITY]:wJ,[P.BROTLI_PARAM_LGWIN]:vJ},flush:P.BROTLI_OPERATION_FLUSH}):bJ({level:EJ,flush:P.Z_SYNC_FLUSH});return TJ.toWeb($)}function hJ(J){let $=J.get("Vary");if(!$){J.set("Vary","Accept-Encoding");return}let Z=$.split(",").map((X)=>X.trim().toLowerCase());if(Z.includes("*")||Z.includes("accept-encoding"))return;J.append("Vary","Accept-Encoding")}function c(J,$){if(!mJ(J.method,$))return $;let Z=new Headers($.headers);hJ(Z);let X=b(J.headers.get("Accept-Encoding"));if(!X)return new Response($.body,{status:$.status,statusText:$.statusText,headers:Z});let Q;try{Q=uJ(X)}catch{return new Response($.body,{status:$.status,statusText:$.statusText,headers:Z})}return Z.set("Content-Encoding",X),Z.delete("Content-Length"),new Response($.body.pipeThrough(Q),{status:$.status,statusText:$.statusText,headers:Z})}import{readdir as iJ,stat as t}from"fs/promises";import{join as aJ}from"path";import{mkdir as O2,readFile as cJ,stat as V2,writeFile as z2}from"fs/promises";import{dirname as L2,join as pJ}from"path";import{promisify as p}from"util";import{brotliCompress as dJ,constants as I2,gzip as lJ}from"zlib";var oJ=".vite/static-assets.json";var d={br:".br",gzip:".gz"},nJ=["br","gzip"],P2=p(dJ),_2=p(lJ);async function l(J){let $;try{$=await cJ(pJ(J,oJ),"utf8")}catch{return null}let Z;try{Z=JSON.parse($)?.files}catch{return null}if(!Z||typeof Z!=="object")return null;let X={files:{}};for(let[Q,H]of Object.entries(Z)){if(!Array.isArray(H))continue;X.files[Q]=nJ.filter((j)=>H.includes(j))}return X}function k(J){let $=J.toString(),Z=new Bun.CryptoHasher("sha1");return Z.update($),Z.digest("hex")}async function r(J){let $=new Set;async function Z(X,Q){let H;try{H=await iJ(X,{withFileTypes:!0})}catch{return}for(let j of H){if(j.name.startsWith("."))continue;if(Q&&j.name==="assets")continue;let Y=aJ(X,j.name),K=j.isDirectory(),V=j.isFile();if(j.isSymbolicLink())try{let F=await t(Y);K=F.isDirectory(),V=F.isFile()}catch{continue}if(V)$.add(Y);else if(K&&!j.isSymbolicLink())await Z(Y,!1)}}return await Z(J,!0),$}var tJ="public, max-age=31536000, must-revalidate",rJ="public, max-age=31536000, immutable";async function sJ(J,$,Z){if(Z.length===0||J.headers.has("Range"))return null;let X=b(J.headers.get("Accept-Encoding"),Z);if(!X)return null;let Q=$+d[X];try{let H=await t(Q);return H.isFile()?{encoding:X,path:Q,size:H.size}:null}catch{return null}}async function s(J,$,Z={}){let X=Bun.file($),Q=Z.encodings??[],H={"Content-Type":X.type||"application/octet-stream","Cache-Control":Z.immutable?rJ:tJ,"Accept-Ranges":"bytes"};if(Q.length>0)H.Vary="Accept-Encoding";let j=await sJ(J,$,Q);if(j){let V=Bun.file(j.path);return new Response(V.stream(),{headers:{...H,"Content-Encoding":j.encoding,"Content-Length":String(j.size),ETag:`${k(V.lastModified)}-${j.encoding}`}})}let Y=X.size;H.ETag=k(X.lastModified);let K=o(J.headers.get("Range"));if(K){let V=n(K,Y);if(!V)return a(Y);return new Response(X.slice(V.start,V.end+1).stream(),{status:206,headers:{...H,"Content-Range":i(V.start,V.end,Y),"Content-Length":String(V.length)}})}return new Response(X.stream(),{headers:{...H,"Content-Length":String(Y)}})}import{stat as Q2}from"fs/promises";var _="app/client.tsx";function JJ(J,$=B){let Z=J[_]?.file;if(!Z)return;return{module:L(Z,$),preload:M(J,_,$)}}function M(J,$,Z=B){let X=[],Q=new Set,H=(j)=>{if(Q.has(j))return;Q.add(j);let Y=J[j];if(!Y?.file)return;X.push(L(Y.file,Z));for(let K of Y.imports??[])H(K)};return H($),X}function $J(J,$){let Z=[],X=new Set,Q=new Set,H=(j)=>{if(Q.has(j))return;Q.add(j);let Y=J[j];if(!Y)return;for(let K of Y.imports??[])H(K);for(let K of Y.css??[])if(!X.has(K))X.add(K),Z.push(K)};return H($),Z}function ZJ(J,$=B){let Z=new Map;return(X)=>{if(!Z.has(X)){let Q=`${X}${e}`,H=J[Q]?.file;Z.set(X,H?{src:L(H,$),preload:M(J,Q,$)}:void 0)}return Z.get(X)}}function XJ(J,$=30000){let Z=JSON.stringify("gemi:chunk-reload"),X=JSON.stringify(`Failed to fetch dynamically imported module: ${J}`);return`var r=!1;try{var s=window.sessionStorage,m=JSON.parse(s.getItem(${Z})||"null");var d=m?Date.now()-m.at:NaN;if(navigator.onLine!==!1&&!(d>=0&&d<${$})){s.setItem(${Z},JSON.stringify({url:window.location.href,at:Date.now()}));r=!0}}catch(e){}if(r)window.location.reload();else throw new Error(${X});export {}`}var eJ=new RegExp(`^${QJ}/.+\\.m?js$`);function J2(J){return eJ.test(J)}function WJ(J){if(J2(J))return new Response(XJ(J),{headers:{"Content-Type":"application/javascript","Cache-Control":"no-store"}});if(A(J))return new Response("Not found",{status:404});return}var $2=`<!DOCTYPE html>
2
+ import{S as q,T as KJ,U as OJ}from"./chunk-qphjhpad.js";import{oa as B,sa as L,ta as UJ}from"./chunk-a22h5cby.js";import"./chunk-kk18xqgc.js";import{De as QJ,Ee as A,Vc as a}from"./chunk-b5a5vvkk.js";import"./chunk-65beps2q.js";import"./chunk-m53fgf20.js";import{Ef as o,Ff as n,If as i}from"./chunk-4acpw92g.js";import{Jg as HJ}from"./chunk-cca0grq3.js";import"./chunk-m83zm86m.js";import"./chunk-1xdrs2hx.js";import"./chunk-19dpzp4y.js";import"./chunk-yds7zwc3.js";import"./chunk-meg8rtr6.js";import"./chunk-h43jp8ws.js";import"./chunk-s07v65x6.js";import"./chunk-gc2dz11k.js";import"./chunk-cskqet01.js";import"./chunk-fenc5tpv.js";import"./chunk-nz8z8jr1.js";import"./chunk-4fx8p02c.js";import{Ui as e}from"./chunk-er8acmch.js";import"./chunk-2n3pgfnb.js";import{fj as YJ}from"./chunk-d5f1m3d2.js";import{gj as N}from"./chunk-rhvc1axc.js";import"./chunk-tewhms9w.js";import{createHash as X2}from"crypto";import{join as w,resolve as VJ,sep as zJ}from"path";import{Duplex as TJ}from"stream";import{constants as P,createBrotliCompress as RJ,createGzip as bJ}from"zlib";var kJ=["br","gzip"],SJ=1024,wJ=5,vJ=19,EJ=6;function yJ(J){if(J===void 0)return 1;if(!/^\d+(\.\d{0,3})?$/.test(J.trim()))return 1;let $=Number(J.trim());return Number.isFinite($)?Math.min($,1):1}function gJ(J){if(J===null||J===void 0)return null;let $=new Map;for(let Z of J.split(",")){let[X,...Q]=Z.split(";"),H=X.trim().toLowerCase();if(H==="")continue;let j=1;for(let Y of Q){let K=Y.indexOf("=");if(K===-1)continue;if(Y.slice(0,K).trim().toLowerCase()==="q"){j=yJ(Y.slice(K+1));break}}$.set(H,j)}return $}function b(J,$=kJ){let Z=gJ(J);if(!Z)return null;let X=Z.get("*"),Q=null,H=0;for(let j of $){let Y=Z.get(j)??X??0;if(Y>H)Q=j,H=Y}return Q}function fJ(J,$){if(!J)return!1;return J.split(",").some((Z)=>Z.trim().toLowerCase().split("=")[0].trim()===$)}function mJ(J,$){if(J==="HEAD")return!1;if($.status<200||$.status===204||$.status===206||$.status===304)return!1;if($.headers.has("Content-Range"))return!1;let Z=$.headers.get("Content-Type");if(!Z||!/^\s*text\/html\s*(;|$)/i.test(Z))return!1;if(!$.body)return!1;let X=$.headers.get("Content-Encoding");if(X&&X.trim().toLowerCase()!=="identity")return!1;if(fJ($.headers.get("Cache-Control"),"no-transform"))return!1;let Q=$.headers.get("Content-Length");if(Q!==null&&Number(Q)<SJ)return!1;return!0}function uJ(J){let $=J==="br"?RJ({params:{[P.BROTLI_PARAM_QUALITY]:wJ,[P.BROTLI_PARAM_LGWIN]:vJ},flush:P.BROTLI_OPERATION_FLUSH}):bJ({level:EJ,flush:P.Z_SYNC_FLUSH});return TJ.toWeb($)}function hJ(J){let $=J.get("Vary");if(!$){J.set("Vary","Accept-Encoding");return}let Z=$.split(",").map((X)=>X.trim().toLowerCase());if(Z.includes("*")||Z.includes("accept-encoding"))return;J.append("Vary","Accept-Encoding")}function c(J,$){if(!mJ(J.method,$))return $;let Z=new Headers($.headers);hJ(Z);let X=b(J.headers.get("Accept-Encoding"));if(!X)return new Response($.body,{status:$.status,statusText:$.statusText,headers:Z});let Q;try{Q=uJ(X)}catch{return new Response($.body,{status:$.status,statusText:$.statusText,headers:Z})}return Z.set("Content-Encoding",X),Z.delete("Content-Length"),new Response($.body.pipeThrough(Q),{status:$.status,statusText:$.statusText,headers:Z})}import{readdir as iJ,stat as t}from"fs/promises";import{join as aJ}from"path";import{mkdir as O2,readFile as cJ,stat as V2,writeFile as z2}from"fs/promises";import{dirname as L2,join as pJ}from"path";import{promisify as p}from"util";import{brotliCompress as dJ,constants as I2,gzip as lJ}from"zlib";var oJ=".vite/static-assets.json";var d={br:".br",gzip:".gz"},nJ=["br","gzip"],P2=p(dJ),_2=p(lJ);async function l(J){let $;try{$=await cJ(pJ(J,oJ),"utf8")}catch{return null}let Z;try{Z=JSON.parse($)?.files}catch{return null}if(!Z||typeof Z!=="object")return null;let X={files:{}};for(let[Q,H]of Object.entries(Z)){if(!Array.isArray(H))continue;X.files[Q]=nJ.filter((j)=>H.includes(j))}return X}function k(J){let $=J.toString(),Z=new Bun.CryptoHasher("sha1");return Z.update($),Z.digest("hex")}async function r(J){let $=new Set;async function Z(X,Q){let H;try{H=await iJ(X,{withFileTypes:!0})}catch{return}for(let j of H){if(j.name.startsWith("."))continue;if(Q&&j.name==="assets")continue;let Y=aJ(X,j.name),K=j.isDirectory(),V=j.isFile();if(j.isSymbolicLink())try{let F=await t(Y);K=F.isDirectory(),V=F.isFile()}catch{continue}if(V)$.add(Y);else if(K&&!j.isSymbolicLink())await Z(Y,!1)}}return await Z(J,!0),$}var tJ="public, max-age=31536000, must-revalidate",rJ="public, max-age=31536000, immutable";async function sJ(J,$,Z){if(Z.length===0||J.headers.has("Range"))return null;let X=b(J.headers.get("Accept-Encoding"),Z);if(!X)return null;let Q=$+d[X];try{let H=await t(Q);return H.isFile()?{encoding:X,path:Q,size:H.size}:null}catch{return null}}async function s(J,$,Z={}){let X=Bun.file($),Q=Z.encodings??[],H={"Content-Type":X.type||"application/octet-stream","Cache-Control":Z.immutable?rJ:tJ,"Accept-Ranges":"bytes"};if(Q.length>0)H.Vary="Accept-Encoding";let j=await sJ(J,$,Q);if(j){let V=Bun.file(j.path);return new Response(V.stream(),{headers:{...H,"Content-Encoding":j.encoding,"Content-Length":String(j.size),ETag:`${k(V.lastModified)}-${j.encoding}`}})}let Y=X.size;H.ETag=k(X.lastModified);let K=o(J.headers.get("Range"));if(K){let V=n(K,Y);if(!V)return a(Y);return new Response(X.slice(V.start,V.end+1).stream(),{status:206,headers:{...H,"Content-Range":i(V.start,V.end,Y),"Content-Length":String(V.length)}})}return new Response(X.stream(),{headers:{...H,"Content-Length":String(Y)}})}import{stat as Q2}from"fs/promises";var _="app/client.tsx";function JJ(J,$=B){let Z=J[_]?.file;if(!Z)return;return{module:L(Z,$),preload:M(J,_,$)}}function M(J,$,Z=B){let X=[],Q=new Set,H=(j)=>{if(Q.has(j))return;Q.add(j);let Y=J[j];if(!Y?.file)return;X.push(L(Y.file,Z));for(let K of Y.imports??[])H(K)};return H($),X}function $J(J,$){let Z=[],X=new Set,Q=new Set,H=(j)=>{if(Q.has(j))return;Q.add(j);let Y=J[j];if(!Y)return;for(let K of Y.imports??[])H(K);for(let K of Y.css??[])if(!X.has(K))X.add(K),Z.push(K)};return H($),Z}function ZJ(J,$=B){let Z=new Map;return(X)=>{if(!Z.has(X)){let Q=`${X}${e}`,H=J[Q]?.file;Z.set(X,H?{src:L(H,$),preload:M(J,Q,$)}:void 0)}return Z.get(X)}}function XJ(J,$=30000){let Z=JSON.stringify("gemi:chunk-reload"),X=JSON.stringify(`Failed to fetch dynamically imported module: ${J}`);return`var r=!1;try{var s=window.sessionStorage,m=JSON.parse(s.getItem(${Z})||"null");var d=m?Date.now()-m.at:NaN;if(navigator.onLine!==!1&&!(d>=0&&d<${$})){s.setItem(${Z},JSON.stringify({url:window.location.href,at:Date.now()}));r=!0}}catch(e){}if(r)window.location.reload();else throw new Error(${X});export {}`}var eJ=new RegExp(`^${QJ}/.+\\.m?js$`);function J2(J){return eJ.test(J)}function WJ(J){if(J2(J))return new Response(XJ(J),{headers:{"Content-Type":"application/javascript","Cache-Control":"no-store"}});if(A(J))return new Response("Not found",{status:404});return}var $2=`<!DOCTYPE html>
3
3
  <html lang="en">
4
4
  <head>
5
5
  <meta charset="UTF-8" />
@@ -1,6 +1,6 @@
1
1
  // @bun
2
- import{Ba as y}from"./chunk-kk18xqgc.js";import{createElement as q}from"react";function z(i,n){let p=Object.keys(n).sort((s,g)=>g.length-s.length).map((s)=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),b=new RegExp(p.join("|"),"g");return i.replace(b,(s)=>n[s])}async function L(i,n,p=[],b){let s=[...p.map((t)=>`${i}/views/${t}.tsx`),b?`${i}/views/${b}.tsx`:`${i}/views/RootLayout.tsx`],g=new Set;for(let t of s){let u=n.moduleGraph.getModulesByFile(t);if(u)for(let x of u)g.add(x)}let e=[],l=[],r={};for(let t of g)if(t)for(let u of t.importedModules){if(u.file.includes("module.css"))r[u.file]=u.ssrTransformResult.map.sourcesContent.join("");if(u.file.includes(".css"))l.push(u.file)}for(let t of l){let u=await n.transformRequest(t+"?direct"),x=t.includes("module.css"),k="";if(x)k=z(r[t],u.default);e.push({isDev:!0,id:t,content:x?k:u.code})}return e.map((t,u)=>{return q("style",{key:u,type:"text/css","data-vite-dev-id":t.id,dangerouslySetInnerHTML:{__html:t.content}})})}async function _(i=[]){return i.map((n,p)=>{return q("style",{key:p,id:n?.id,type:"text/css",dangerouslySetInnerHTML:{__html:n.content}})})}import{existsSync as J}from"fs";import{basename as N}from"path";import{networkInterfaces as O}from"os";var v={name:"gemi",version:"0.120.0",private:!1,license:"MIT",author:"Enes Tufekci <enes@gemijs.dev>",repository:{type:"git",url:"git+https://github.com/nstfkc/gemi.git",directory:"packages/gemi"},bin:{gemi:"./dist/bin/gemi.js","gemi-orm-generator":"./dist/bin/orm-generator.js"},files:["dist/**/*","ide/typescript-plugin/package.json","skills/**/*"],module:!0,exports:{"./http":"./http/index.ts","./client":"./client/index.ts","./ai":"./ai/index.ts","./ai/client":"./ai/client/index.ts","./testing":"./testing/index.ts","./app":"./app/index.ts","./facades":"./facades/index.ts","./email":"./email/index.ts","./vite":"./dist/vite/index.mjs","./kernel":"./kernel/index.ts","./services":"./services/index.ts","./i18n":"./i18n/index.ts","./dictionary":"./i18n/dictionaryRuntime.ts","./server":"./server/index.ts","./config":"./config/index.ts","./container":"./container/index.ts","./foundation":"./foundation/index.ts","./database":"./database/index.ts","./orm":"./orm/index.ts","./support":"./support/index.ts","./console/run":"./console/run.ts","./queue/work":"./services/queue/work.ts","./stats/route-table":"./stats/route-table.ts","./ide/typescript-plugin":"./ide/typescript-plugin/index.ts","./bun/preload":"./bun/preload.ts","./bun/plugin":"./bun/plugin.ts","./vitest":"./vitest/index.ts"},scripts:{lint:"oxlint",typecheck:"tsc --noEmit -p tsconfig.json && tsc --noEmit -p tsconfig.browser.json && tsc --noEmit -p ide/typescript-plugin/tsconfig.json",build:"NODE_ENV=production bun run build:core && bun run build:bin && bun run build:types && bun run build:client && bun run build:plugin && bun run build:ts-plugin && bun run build:client-types && bun run build:augmentation","build:core":"bun ./scripts/build.ts","build:bin":"bun build --outdir=./dist/bin --target=bun --external=vite --external=react-dom --external=react/jsx-runtime --external=bun --external=sharp --external=@azure/storage-blob --external=typescript --sourcemap ./bin/gemi.ts ./bin/orm-generator.ts && bun ./scripts/prepare-bin.ts","build:client":"rm -rf dist/client dist/testing dist/ai/client dist/chunks && vite build -c vite.client.config.mts","build:plugin":"vite build -c vite.plugin.config.mts","build:ts-plugin":"bun ./scripts/build-ts-plugin.ts","build:types":"tsc -p tsconfig.build.json","build:client-types":"tsc -p tsconfig.browser.json",test:"bun --bun x vitest","test:types":"vitest run --typecheck.only","test:live":"bun --bun x vitest run ai/live","test:packaging":"bun --bun x vitest run --config vitest.packaging.config.ts","build:publish":"bun scripts/build-publish.ts",prepublishOnly:"echo 'Do not publish from this directory \u2014 its exports point at TS source. Run: bun run build:publish, then publish from .publish/' && exit 1","build:augmentation":"bun ./scripts/wire-augmentation.ts"},dependencies:{"@aws-sdk/client-s3":"^3.629.0","@aws-sdk/s3-request-presigner":"^3.629.0","ast-types":"^0.14.2",commander:"^12.1.0",history:"^5.3.0","jsx-email":"2.0.0-rc2.1","magic-string":"^0.30.17",open:"^10.1.0","react-error-boundary":"^6.0.0",recast:"^0.23.9",resend:"^6.12.3",satori:"^0.12.2","temporal-polyfill":"^0.2.5","twitter-api-v2":"^1.20.2","urlpattern-polyfill":"^10.0.0",uuid:"^9.0.1"},devDependencies:{"@babel/parser":"^7.25.4","@prisma/generator-helper":"^6.5.0","@repo/typescript-config":"*","@testing-library/react":"^16.3.2","@types/bun":"^1.3.14","@types/eslint":"^8.56.5","@types/node":"^20.11.24","@types/react":"^19.0.2","@types/react-dom":"^19.0.2",eslint:"^8.57.0",jsdom:"^30.0.1",oxlint:"^1.39.0",postgres:"^3.4.5",react:"19.2.3","react-dom":"19.2.3",typescript:"^5.7.3",vitest:"^4.0.0"},peerDependencies:{"@azure/storage-blob":"^12.28.0",react:">=19","react-dom":">=19",sharp:"^0.34.2",typescript:">=5",vite:"^8.0.0",postgres:"^3.4.0"},peerDependenciesMeta:{"@azure/storage-blob":{optional:!0},typescript:{optional:!0},postgres:{optional:!0}}};var Q=[" \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2557\u2588\u2588\u2557","\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D \u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2551","\u2588\u2588\u2551 \u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2554\u2588\u2588\u2588\u2588\u2554\u2588\u2588\u2551\u2588\u2588\u2551","\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u255D \u2588\u2588\u2551\u255A\u2588\u2588\u2554\u255D\u2588\u2588\u2551\u2588\u2588\u2551","\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2551 \u255A\u2550\u255D \u2588\u2588\u2551\u2588\u2588\u2551"," \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D"],W=Boolean(process.stdout.isTTY)&&!process.env.NO_COLOR,c=(i,n)=>W?`\x1B[${i}m${n}\x1B[0m`:n,X=(i)=>c("1",i),d=(i)=>c("2",i),j=(i)=>c("36",i),Y=(i)=>c("32",i),Z=(i)=>c("35",i);function $(){return v.version??"?"}function f(i){for(let n of Object.values(O()))for(let p of n??[])if((p.family==="IPv4"||p.family===4)&&!p.internal)return`http://${p.address}:${i}`;return null}function H(i){return y(i).filter((n)=>J(n)).map((n)=>N(n))}function T(i){let{port:n,rootDir:p}=i,b=`http://localhost:${n}`,s=f(n),g=H(p),e=(r,t)=>` ${Y("\u279C")} ${X(r.padEnd(9))}${t}`,l=["",...Q.map((r)=>Z(r)),"",` ${d("gemi")} ${j(`v${$()}`)}`,"",e("Local:",j(b)),e("Network:",s?j(s):d("unavailable")),e("Env:",g.length?g.join(", "):d("none")),""];console.log(l.join(`
2
+ import{Ba as y}from"./chunk-kk18xqgc.js";import{createElement as q}from"react";function z(i,n){let p=Object.keys(n).sort((s,g)=>g.length-s.length).map((s)=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),b=new RegExp(p.join("|"),"g");return i.replace(b,(s)=>n[s])}async function L(i,n,p=[],b){let s=[...p.map((t)=>`${i}/views/${t}.tsx`),b?`${i}/views/${b}.tsx`:`${i}/views/RootLayout.tsx`],g=new Set;for(let t of s){let u=n.moduleGraph.getModulesByFile(t);if(u)for(let x of u)g.add(x)}let e=[],l=[],r={};for(let t of g)if(t)for(let u of t.importedModules){if(u.file.includes("module.css"))r[u.file]=u.ssrTransformResult.map.sourcesContent.join("");if(u.file.includes(".css"))l.push(u.file)}for(let t of l){let u=await n.transformRequest(t+"?direct"),x=t.includes("module.css"),k="";if(x)k=z(r[t],u.default);e.push({isDev:!0,id:t,content:x?k:u.code})}return e.map((t,u)=>{return q("style",{key:u,type:"text/css","data-vite-dev-id":t.id,dangerouslySetInnerHTML:{__html:t.content}})})}async function _(i=[]){return i.map((n,p)=>{return q("style",{key:p,id:n?.id,type:"text/css",dangerouslySetInnerHTML:{__html:n.content}})})}import{existsSync as J}from"fs";import{basename as N}from"path";import{networkInterfaces as O}from"os";var v={name:"gemi",version:"0.120.1",private:!1,license:"MIT",author:"Enes Tufekci <enes@gemijs.dev>",repository:{type:"git",url:"git+https://github.com/nstfkc/gemi.git",directory:"packages/gemi"},bin:{gemi:"./dist/bin/gemi.js","gemi-orm-generator":"./dist/bin/orm-generator.js"},files:["dist/**/*","ide/typescript-plugin/package.json","skills/**/*"],module:!0,exports:{"./http":"./http/index.ts","./client":"./client/index.ts","./ai":"./ai/index.ts","./ai/client":"./ai/client/index.ts","./testing":"./testing/index.ts","./app":"./app/index.ts","./facades":"./facades/index.ts","./email":"./email/index.ts","./vite":"./dist/vite/index.mjs","./kernel":"./kernel/index.ts","./services":"./services/index.ts","./i18n":"./i18n/index.ts","./dictionary":"./i18n/dictionaryRuntime.ts","./server":"./server/index.ts","./config":"./config/index.ts","./container":"./container/index.ts","./foundation":"./foundation/index.ts","./database":"./database/index.ts","./orm":"./orm/index.ts","./support":"./support/index.ts","./console/run":"./console/run.ts","./queue/work":"./services/queue/work.ts","./stats/route-table":"./stats/route-table.ts","./ide/typescript-plugin":"./ide/typescript-plugin/index.ts","./bun/preload":"./bun/preload.ts","./bun/plugin":"./bun/plugin.ts","./vitest":"./vitest/index.ts"},scripts:{lint:"oxlint",typecheck:"tsc --noEmit -p tsconfig.json && tsc --noEmit -p tsconfig.browser.json && tsc --noEmit -p ide/typescript-plugin/tsconfig.json",build:"NODE_ENV=production bun run build:core && bun run build:bin && bun run build:types && bun run build:client && bun run build:plugin && bun run build:ts-plugin && bun run build:client-types && bun run build:augmentation","build:core":"bun ./scripts/build.ts","build:bin":"bun build --outdir=./dist/bin --target=bun --external=vite --external=react-dom --external=react/jsx-runtime --external=bun --external=sharp --external=@azure/storage-blob --external=typescript --sourcemap ./bin/gemi.ts ./bin/orm-generator.ts && bun ./scripts/prepare-bin.ts","build:client":"rm -rf dist/client dist/testing dist/ai/client dist/chunks && vite build -c vite.client.config.mts","build:plugin":"vite build -c vite.plugin.config.mts","build:ts-plugin":"bun ./scripts/build-ts-plugin.ts","build:types":"tsc -p tsconfig.build.json","build:client-types":"tsc -p tsconfig.browser.json",test:"bun --bun x vitest","test:types":"vitest run --typecheck.only","test:live":"bun --bun x vitest run ai/live","test:packaging":"bun --bun x vitest run --config vitest.packaging.config.ts","build:publish":"bun scripts/build-publish.ts",prepublishOnly:"echo 'Do not publish from this directory \u2014 its exports point at TS source. Run: bun run build:publish, then publish from .publish/' && exit 1","build:augmentation":"bun ./scripts/wire-augmentation.ts"},dependencies:{"@aws-sdk/client-s3":"^3.629.0","@aws-sdk/s3-request-presigner":"^3.629.0","ast-types":"^0.14.2",commander:"^12.1.0",history:"^5.3.0","jsx-email":"2.0.0-rc2.1","magic-string":"^0.30.17",open:"^10.1.0","react-error-boundary":"^6.0.0",recast:"^0.23.9",resend:"^6.12.3",satori:"^0.12.2","temporal-polyfill":"^0.2.5","twitter-api-v2":"^1.20.2","urlpattern-polyfill":"^10.0.0",uuid:"^9.0.1"},devDependencies:{"@babel/parser":"^7.25.4","@prisma/generator-helper":"^6.5.0","@repo/typescript-config":"*","@testing-library/react":"^16.3.2","@types/bun":"^1.3.14","@types/eslint":"^8.56.5","@types/node":"^20.11.24","@types/react":"^19.0.2","@types/react-dom":"^19.0.2",eslint:"^8.57.0",jsdom:"^30.0.1",oxlint:"^1.39.0",postgres:"^3.4.5",react:"19.2.3","react-dom":"19.2.3",typescript:"^5.7.3",vitest:"^4.0.0"},peerDependencies:{"@azure/storage-blob":"^12.28.0",react:">=19","react-dom":">=19",sharp:"^0.34.2",typescript:">=5",vite:"^8.0.0",postgres:"^3.4.0"},peerDependenciesMeta:{"@azure/storage-blob":{optional:!0},typescript:{optional:!0},postgres:{optional:!0}}};var Q=[" \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2557\u2588\u2588\u2557","\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D \u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2551","\u2588\u2588\u2551 \u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2554\u2588\u2588\u2588\u2588\u2554\u2588\u2588\u2551\u2588\u2588\u2551","\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u255D \u2588\u2588\u2551\u255A\u2588\u2588\u2554\u255D\u2588\u2588\u2551\u2588\u2588\u2551","\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2551 \u255A\u2550\u255D \u2588\u2588\u2551\u2588\u2588\u2551"," \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D"],W=Boolean(process.stdout.isTTY)&&!process.env.NO_COLOR,c=(i,n)=>W?`\x1B[${i}m${n}\x1B[0m`:n,X=(i)=>c("1",i),d=(i)=>c("2",i),j=(i)=>c("36",i),Y=(i)=>c("32",i),Z=(i)=>c("35",i);function $(){return v.version??"?"}function f(i){for(let n of Object.values(O()))for(let p of n??[])if((p.family==="IPv4"||p.family===4)&&!p.internal)return`http://${p.address}:${i}`;return null}function H(i){return y(i).filter((n)=>J(n)).map((n)=>N(n))}function T(i){let{port:n,rootDir:p}=i,b=`http://localhost:${n}`,s=f(n),g=H(p),e=(r,t)=>` ${Y("\u279C")} ${X(r.padEnd(9))}${t}`,l=["",...Q.map((r)=>Z(r)),"",` ${d("gemi")} ${j(`v${$()}`)}`,"",e("Local:",j(b)),e("Network:",s?j(s):d("unavailable")),e("Env:",g.length?g.join(", "):d("none")),""];console.log(l.join(`
3
3
  `))}function I(i=process.env.SERVER_IDLE_TIMEOUT){if(i===void 0||i.trim()==="")return 10;let n=Number(i.trim());if(!Number.isInteger(n)||n<0||n>255)throw Error(`SERVER_IDLE_TIMEOUT must be a whole number of seconds from 0 to 255 (0 disables the timeout), got ${JSON.stringify(i)}.`);return n}
4
4
  export{L as R,_ as S,T,I as U};
5
5
 
6
- //# debugId=ED3B875D1A3F63F764756E2164756E21
6
+ //# debugId=FCD4109D0D976AD564756E2164756E21
@@ -7,6 +7,6 @@
7
7
  "/**\n * Bun's default, and what both servers use when `SERVER_IDLE_TIMEOUT` is unset.\n */\nexport const DEFAULT_SERVER_IDLE_TIMEOUT = 10;\n\n/**\n * The `idleTimeout` (seconds) both `gemi dev` and `gemi start` pass to\n * `Bun.serve`, from `SERVER_IDLE_TIMEOUT` (#787).\n *\n * One reader for both servers, so a long-poll that works under `gemi start`\n * also works under `gemi dev`. Before this, only `httpProd` read the variable\n * and the dev server always ran at Bun's 10 seconds.\n *\n * It is the time a connection may stay silent, a response that has not started\n * included, before Bun closes it; `0` disables it. It does not apply to an\n * upgraded websocket (the HMR relay included), which has its own\n * `websocket.idleTimeout`.\n *\n * Unset or blank means the default. Anything that is not a whole number from 0\n * to 255 (Bun's own limits) fails the boot with the variable's name, instead\n * of Bun's \"expects idleTimeout to be an integer\", which does not say where the\n * value came from.\n */\nexport function serverIdleTimeout(raw: string | undefined = process.env.SERVER_IDLE_TIMEOUT): number {\n if (raw === undefined || raw.trim() === \"\") return DEFAULT_SERVER_IDLE_TIMEOUT;\n\n const seconds = Number(raw.trim());\n if (!Number.isInteger(seconds) || seconds < 0 || seconds > 255) {\n throw new Error(\n `SERVER_IDLE_TIMEOUT must be a whole number of seconds from 0 to 255 ` +\n `(0 disables the timeout), got ${JSON.stringify(raw)}.`,\n );\n }\n return seconds;\n}\n"
8
8
  ],
9
9
  "mappings": ";yCAAA,wBAAS,cAGT,SAAS,CAAc,CAAC,EAAc,EAAwC,CAC5E,IAAM,EAAc,OAAO,KAAK,CAAM,EACnC,KAAK,CAAC,EAAG,IAAM,EAAE,OAAS,EAAE,MAAM,EAClC,IAAI,CAAC,IAAQ,EAAI,QAAQ,sBAAuB,MAAM,CAAC,EAGpD,EAAQ,IAAI,OAAO,EAAY,KAAK,GAAG,EAAG,GAAG,EAEnD,OAAO,EAAK,QAAQ,EAAO,CAAC,IAAU,EAAO,EAAM,EAGrD,eAAsB,CAAe,CACnC,EACA,EACA,EAAyB,CAAC,EAE1B,EACA,CACA,IAAM,EAAQ,CACZ,GAAG,EAAa,IAAI,CAAC,IAAS,GAAG,WAAgB,OAAU,EAC3D,EAAS,GAAG,WAAgB,QAAe,GAAG,wBAChD,EAEM,EAAU,IAAI,IACpB,QAAW,KAAQ,EAAO,CACxB,IAAM,EAAM,EAAK,YAAY,iBAAiB,CAAI,EAClD,GAAI,EACF,QAAW,KAAK,EAAK,EAAQ,IAAI,CAAC,EAItC,IAAM,EAAS,CAAC,EACV,EAAa,CAAC,EACd,EAA2C,CAAC,EAClD,QAAW,KAAO,EAChB,GAAI,EACF,QAAW,KAAY,EAAI,gBAAiB,CAC1C,GAAI,EAAS,KAAK,SAAS,YAAY,EACrC,EAAiB,EAAS,MAAQ,EAAS,mBAAmB,IAAI,eAAe,KAAK,EAAE,EAE1F,GAAI,EAAS,KAAK,SAAS,MAAM,EAC/B,EAAW,KAAK,EAAS,IAAI,EAMrC,QAAW,KAAiB,EAAY,CACtC,IAAM,EAAY,MAAM,EAAK,iBAAiB,EAAgB,SAAS,EAEjE,EAAc,EAAc,SAAS,YAAY,EAEnD,EAAuB,GAE3B,GAAI,EACF,EAAuB,EACrB,EAAiB,GAGhB,EAA6D,OAChE,EAGF,EAAO,KAAK,CACV,MAAO,GACP,GAAI,EACJ,QAAS,EAAc,EAAuB,EAAU,IAC1D,CAAC,EAGH,OAAO,EAAO,IAAI,CAAC,EAAO,IAAM,CAC9B,OAAO,EAAc,QAAS,CAC5B,IAAK,EACL,KAAM,WACN,mBAAoB,EAAM,GAC1B,wBAAyB,CAAE,OAAQ,EAAM,OAAQ,CACnD,CAAC,EACF,EAGH,eAAsB,CAAY,CAAC,EAAS,CAAC,EAAG,CAC9C,OAAO,EAAO,IAAI,CAAC,EAAO,IAAM,CAC9B,OAAO,EAAc,QAAS,CAC5B,IAAK,EACL,GAAI,GAAO,GACX,KAAM,WACN,wBAAyB,CAAE,OAAQ,EAAM,OAAQ,CACnD,CAAC,EACF,EC3FH,qBAAS,WACT,mBAAS,aACT,4BAAS,gyHAKT,IAAM,EAAM,CACV,oKACA,mLACA,yKACA,oKACA,mLACA,yJACF,EAEM,EAAW,QAAQ,QAAQ,OAAO,KAAK,GAAK,CAAC,QAAQ,IAAI,SACzD,EAAQ,CAAC,EAAc,IAC3B,EAAW,QAAQ,KAAQ,WAAgB,EACvC,EAAO,CAAC,IAAc,EAAM,IAAK,CAAC,EAClC,EAAM,CAAC,IAAc,EAAM,IAAK,CAAC,EACjC,EAAO,CAAC,IAAc,EAAM,KAAM,CAAC,EACnC,EAAQ,CAAC,IAAc,EAAM,KAAM,CAAC,EACpC,EAAU,CAAC,IAAc,EAAM,KAAM,CAAC,EAE5C,SAAS,CAAW,EAAW,CAC7B,OAAQ,EAA6B,SAAW,IAGlD,SAAS,CAAU,CAAC,EAAsC,CACxD,QAAW,KAAU,OAAO,OAAO,EAAkB,CAAC,EACpD,QAAW,KAAS,GAAU,CAAC,EAG7B,IADa,EAAM,SAAW,QAAW,EAAM,SAAuB,IAC1D,CAAC,EAAM,SAAU,MAAO,UAAU,EAAM,WAAW,IAGnE,OAAO,KAGT,SAAS,CAAc,CAAC,EAA2B,CACjD,OAAO,EAAS,CAAO,EACpB,OAAO,CAAC,IAAS,EAAW,CAAI,CAAC,EACjC,IAAI,CAAC,IAAS,EAAS,CAAI,CAAC,EAG1B,SAAS,CAAkB,CAAC,EAGhC,CACD,IAAQ,OAAM,WAAY,EACpB,EAAQ,oBAAoB,IAC5B,EAAU,EAAW,CAAI,EACzB,EAAM,EAAe,CAAO,EAE5B,EAAM,CAAC,EAAe,IAC1B,KAAK,EAAM,QAAE,MAAM,EAAK,EAAM,OAAO,CAAC,CAAC,IAAI,IAEvC,EAAM,CACV,GACA,GAAG,EAAI,IAAI,CAAC,IAAS,EAAQ,CAAI,CAAC,EAClC,GACA,KAAK,EAAI,MAAM,KAAK,EAAK,IAAI,EAAY,GAAG,IAC5C,GACA,EAAI,SAAU,EAAK,CAAK,CAAC,EACzB,EAAI,WAAY,EAAU,EAAK,CAAO,EAAI,EAAI,aAAa,CAAC,EAC5D,EAAI,OAAQ,EAAI,OAAS,EAAI,KAAK,IAAI,EAAI,EAAI,MAAM,CAAC,EACrD,EACF,EAEA,QAAQ,IAAI,EAAI,KAAK;AAAA,CAAI,CAAC,EC/CrB,SAAS,CAAiB,CAAC,EAA0B,QAAQ,IAAI,oBAA6B,CACnG,GAAI,IAAQ,QAAa,EAAI,KAAK,IAAM,GAAI,MArBH,IAuBzC,IAAM,EAAU,OAAO,EAAI,KAAK,CAAC,EACjC,GAAI,CAAC,OAAO,UAAU,CAAO,GAAK,EAAU,GAAK,EAAU,IACzD,MAAU,MACR,qGACmC,KAAK,UAAU,CAAG,IACvD,EAEF,OAAO",
10
- "debugId": "ED3B875D1A3F63F764756E2164756E21",
10
+ "debugId": "FCD4109D0D976AD564756E2164756E21",
11
11
  "names": []
12
12
  }
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{R as C,T as h,U as m}from"./chunk-dbx3g5ck.js";import{ma as w,na as q}from"./chunk-zg6hmc48.js";import"./chunk-a22h5cby.js";import"./chunk-epvpmakp.js";import"./chunk-r3v2cnrj.js";import"./chunk-c0v61fp5.js";import"./chunk-kk18xqgc.js";import"./chunk-krtybgz1.js";import{Jg as _}from"./chunk-cca0grq3.js";import{Ui as y}from"./chunk-er8acmch.js";import{gj as N}from"./chunk-rhvc1axc.js";import"./chunk-tewhms9w.js";import{join as $J}from"path";import{createServer as zJ}from"vite";import{join as l}from"path";import{IncomingMessage as d,ServerResponse as p}from"http";import{Socket as i}from"net";function v(J){return J.replace(/\x1b\[[0-9;]*m/g,"").replace(/\[[0-9;]*m/g,"").replace(/\n\s*\n/g,`
2
+ import{R as C,T as h,U as m}from"./chunk-qphjhpad.js";import{ma as w,na as q}from"./chunk-zg6hmc48.js";import"./chunk-a22h5cby.js";import"./chunk-epvpmakp.js";import"./chunk-r3v2cnrj.js";import"./chunk-c0v61fp5.js";import"./chunk-kk18xqgc.js";import"./chunk-krtybgz1.js";import{Jg as _}from"./chunk-cca0grq3.js";import{Ui as y}from"./chunk-er8acmch.js";import{gj as N}from"./chunk-rhvc1axc.js";import"./chunk-tewhms9w.js";import{join as $J}from"path";import{createServer as zJ}from"vite";import{join as l}from"path";import{IncomingMessage as d,ServerResponse as p}from"http";import{Socket as i}from"net";function v(J){return J.replace(/\x1b\[[0-9;]*m/g,"").replace(/\[[0-9;]*m/g,"").replace(/\n\s*\n/g,`
3
3
  `).split(`
4
4
  `).map((W)=>W.trim()).filter((W)=>W.length>0).join(`
5
5
  `).trim()}function D(J){return`
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{Dd as c,Ed as d,Fd as f,Gd as g,Hd as i,Id as j,Jd as k,Kd as l,Ld as m,Md as n,Nd as o,Xd as p,bd as a,je as q,ke as r,le as s}from"../chunk-hhymaj0m.js";import"../chunk-65beps2q.js";import"../chunk-m53fgf20.js";import{_f as b,xg as e,zg as h}from"../chunk-4acpw92g.js";import"../chunk-cca0grq3.js";import"../chunk-m83zm86m.js";import"../chunk-1xdrs2hx.js";import"../chunk-19dpzp4y.js";import"../chunk-yds7zwc3.js";import"../chunk-meg8rtr6.js";import"../chunk-h43jp8ws.js";import"../chunk-s07v65x6.js";import"../chunk-gc2dz11k.js";import"../chunk-cskqet01.js";import"../chunk-fenc5tpv.js";import"../chunk-nz8z8jr1.js";import"../chunk-4fx8p02c.js";import"../chunk-er8acmch.js";import"../chunk-2n3pgfnb.js";import"../chunk-d5f1m3d2.js";import"../chunk-rhvc1axc.js";import"../chunk-tewhms9w.js";export{g as Url,e as Storage,k as Redis,a as Redirect,l as RateLimiter,f as Query,i as Meta,h as Log,m as Lock,d as Lang,q as Features,b as Facade,s as DB,n as Crypt,j as Cookie,o as Connections,r as ConnectionQueries,p as ChangeFeed,c as Auth};
2
+ import{Dd as c,Ed as d,Fd as f,Gd as g,Hd as i,Id as j,Jd as k,Kd as l,Ld as m,Md as n,Nd as o,Xd as p,bd as a,je as q,ke as r,le as s}from"../chunk-b5a5vvkk.js";import"../chunk-65beps2q.js";import"../chunk-m53fgf20.js";import{_f as b,xg as e,zg as h}from"../chunk-4acpw92g.js";import"../chunk-cca0grq3.js";import"../chunk-m83zm86m.js";import"../chunk-1xdrs2hx.js";import"../chunk-19dpzp4y.js";import"../chunk-yds7zwc3.js";import"../chunk-meg8rtr6.js";import"../chunk-h43jp8ws.js";import"../chunk-s07v65x6.js";import"../chunk-gc2dz11k.js";import"../chunk-cskqet01.js";import"../chunk-fenc5tpv.js";import"../chunk-nz8z8jr1.js";import"../chunk-4fx8p02c.js";import"../chunk-er8acmch.js";import"../chunk-2n3pgfnb.js";import"../chunk-d5f1m3d2.js";import"../chunk-rhvc1axc.js";import"../chunk-tewhms9w.js";export{g as Url,e as Storage,k as Redis,a as Redirect,l as RateLimiter,f as Query,i as Meta,h as Log,m as Lock,d as Lang,q as Features,b as Facade,s as DB,n as Crypt,j as Cookie,o as Connections,r as ConnectionQueries,p as ChangeFeed,c as Auth};
3
3
 
4
4
  //# debugId=5365EC3F2E88CB7564756E2164756E21
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{$c as A,Bd as M,Cd as N,Oe as ba,Pe as ca,Qe as da,Re as ea,Se as fa,Te as ga,Uc as n,Ue as ha,Vc as o,Ve as ia,Wc as p,We as ja,Xc as q,Xe as ka,Yc as r,Ye as la,Zc as y,Ze as ma,_c as z,ad as B,cd as C,dd as D,ed as E,fd as F,gd as G,hd as H,id as I,nd as J,od as K,pd as L,te as aa}from"../chunk-hhymaj0m.js";import"../chunk-65beps2q.js";import"../chunk-m53fgf20.js";import{Ef as e,Ff as f,Gf as g,Hf as h,If as i,Jf as j,Of as k,Pf as l,Tf as m,Uf as s,Vf as t,Wf as u,Xf as v,Yf as w,Zf as x,hg as O,ig as P,jg as Q,kg as R,lg as S,mg as T,ng as U,og as V,pg as W,qg as X,rg as Y,sg as Z,tg as _,ug as $,xf as a,yf as b,zf as d}from"../chunk-4acpw92g.js";import{Hg as c}from"../chunk-cca0grq3.js";import"../chunk-m83zm86m.js";import"../chunk-1xdrs2hx.js";import"../chunk-19dpzp4y.js";import"../chunk-yds7zwc3.js";import"../chunk-meg8rtr6.js";import"../chunk-h43jp8ws.js";import"../chunk-s07v65x6.js";import"../chunk-gc2dz11k.js";import"../chunk-cskqet01.js";import"../chunk-fenc5tpv.js";import"../chunk-nz8z8jr1.js";import"../chunk-4fx8p02c.js";import"../chunk-er8acmch.js";import"../chunk-2n3pgfnb.js";import"../chunk-d5f1m3d2.js";import"../chunk-rhvc1axc.js";import"../chunk-tewhms9w.js";export{g as toRangeHeaderValue,n as toMiddlewareList,$ as safeFetch,f as resolveRange,e as parseRangeHeader,h as parseContentRange,r as parseByteSize,I as middlewareConfigDefaults,D as httpError,d as getCookies,j as formatUnsatisfiedContentRange,i as formatContentRange,ia as defineResourcePolicy,H as defineMiddlewareConfig,o as createUnsatisfiableResponse,p as createStreamResponse,E as createFileResponse,L as clientIp,Z as classifyAddress,F as ViewRouter,k as ValidationError,W as TooManyRedirectsError,U as TooLargeError,T as TimeoutError,ja as SitemapError,ka as Sitemap,N as SameSiteBounceMiddleware,_ as SafeResponse,O as SafeFetchError,M as SAME_SITE_BOUNCE_PARAM,la as RobotsTxt,ma as Robots,ha as ResourcePolicy,b as ResourceController,c as RequestBreakerError,K as RateLimitMiddleware,J as RateLimitExceededError,u as RangeNotSatisfiableError,fa as PoliciesServiceProvider,ga as Policies,q as PayloadTooLargeError,v as NotFoundError,X as NetworkError,G as Middleware,B as McpRouter,A as McpRouteDeclaration,z as McpModelParam,l as InvalidValidationRuleError,P as InvalidUrlError,t as InsufficientPermissionsError,Y as HttpStatusError,C as HttpResponse,m as HttpRequest,w as FileNotFoundError,S as DnsError,da as CorsMiddleware,a as Controller,V as ContentTypeError,ca as CacheMiddleware,ea as CSRFMiddleware,aa as BodyLimitMiddleware,Q as BlockedHostError,R as BlockedAddressError,s as AuthorizationError,ba as AuthenticationMiddleware,x as AuthenticationError,y as ApiRouter};
2
+ import{$c as A,Bd as M,Cd as N,Oe as ba,Pe as ca,Qe as da,Re as ea,Se as fa,Te as ga,Uc as n,Ue as ha,Vc as o,Ve as ia,Wc as p,We as ja,Xc as q,Xe as ka,Yc as r,Ye as la,Zc as y,Ze as ma,_c as z,ad as B,cd as C,dd as D,ed as E,fd as F,gd as G,hd as H,id as I,nd as J,od as K,pd as L,te as aa}from"../chunk-b5a5vvkk.js";import"../chunk-65beps2q.js";import"../chunk-m53fgf20.js";import{Ef as e,Ff as f,Gf as g,Hf as h,If as i,Jf as j,Of as k,Pf as l,Tf as m,Uf as s,Vf as t,Wf as u,Xf as v,Yf as w,Zf as x,hg as O,ig as P,jg as Q,kg as R,lg as S,mg as T,ng as U,og as V,pg as W,qg as X,rg as Y,sg as Z,tg as _,ug as $,xf as a,yf as b,zf as d}from"../chunk-4acpw92g.js";import{Hg as c}from"../chunk-cca0grq3.js";import"../chunk-m83zm86m.js";import"../chunk-1xdrs2hx.js";import"../chunk-19dpzp4y.js";import"../chunk-yds7zwc3.js";import"../chunk-meg8rtr6.js";import"../chunk-h43jp8ws.js";import"../chunk-s07v65x6.js";import"../chunk-gc2dz11k.js";import"../chunk-cskqet01.js";import"../chunk-fenc5tpv.js";import"../chunk-nz8z8jr1.js";import"../chunk-4fx8p02c.js";import"../chunk-er8acmch.js";import"../chunk-2n3pgfnb.js";import"../chunk-d5f1m3d2.js";import"../chunk-rhvc1axc.js";import"../chunk-tewhms9w.js";export{g as toRangeHeaderValue,n as toMiddlewareList,$ as safeFetch,f as resolveRange,e as parseRangeHeader,h as parseContentRange,r as parseByteSize,I as middlewareConfigDefaults,D as httpError,d as getCookies,j as formatUnsatisfiedContentRange,i as formatContentRange,ia as defineResourcePolicy,H as defineMiddlewareConfig,o as createUnsatisfiableResponse,p as createStreamResponse,E as createFileResponse,L as clientIp,Z as classifyAddress,F as ViewRouter,k as ValidationError,W as TooManyRedirectsError,U as TooLargeError,T as TimeoutError,ja as SitemapError,ka as Sitemap,N as SameSiteBounceMiddleware,_ as SafeResponse,O as SafeFetchError,M as SAME_SITE_BOUNCE_PARAM,la as RobotsTxt,ma as Robots,ha as ResourcePolicy,b as ResourceController,c as RequestBreakerError,K as RateLimitMiddleware,J as RateLimitExceededError,u as RangeNotSatisfiableError,fa as PoliciesServiceProvider,ga as Policies,q as PayloadTooLargeError,v as NotFoundError,X as NetworkError,G as Middleware,B as McpRouter,A as McpRouteDeclaration,z as McpModelParam,l as InvalidValidationRuleError,P as InvalidUrlError,t as InsufficientPermissionsError,Y as HttpStatusError,C as HttpResponse,m as HttpRequest,w as FileNotFoundError,S as DnsError,da as CorsMiddleware,a as Controller,V as ContentTypeError,ca as CacheMiddleware,ea as CSRFMiddleware,aa as BodyLimitMiddleware,Q as BlockedHostError,R as BlockedAddressError,s as AuthorizationError,ba as AuthenticationMiddleware,x as AuthenticationError,y as ApiRouter};
3
3
 
4
4
  //# debugId=61D42EE3DDB4162764756E2164756E21
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{ca as T}from"../chunk-7ftj43vp.js";import"../chunk-epvpmakp.js";import{ab as D}from"../chunk-htgmy3x7.js";import{Rc as b,Sc as w}from"../chunk-tk135gmj.js";import"../chunk-9xyxbxgk.js";import{Ed as j}from"../chunk-hhymaj0m.js";import"../chunk-65beps2q.js";import"../chunk-m53fgf20.js";import"../chunk-4acpw92g.js";import"../chunk-cca0grq3.js";import"../chunk-m83zm86m.js";import"../chunk-1xdrs2hx.js";import"../chunk-19dpzp4y.js";import"../chunk-yds7zwc3.js";import"../chunk-meg8rtr6.js";import"../chunk-h43jp8ws.js";import"../chunk-s07v65x6.js";import"../chunk-gc2dz11k.js";import"../chunk-cskqet01.js";import{Gi as V,Hi as X,Ii as E,Ji as L,Ki as R,Li as S}from"../chunk-fenc5tpv.js";import"../chunk-nz8z8jr1.js";import"../chunk-4fx8p02c.js";import"../chunk-er8acmch.js";import"../chunk-2n3pgfnb.js";import"../chunk-d5f1m3d2.js";import"../chunk-rhvc1axc.js";import"../chunk-tewhms9w.js";import{createElement as J,Fragment as M,isValidElement as U}from"react";function $(q,B){let G=Object.values(B).some((z)=>typeof z==="function"&&U(z(""))),Q=/{{([^{}]+?)(?::([^{}\[\]]+?))?(?:\[(.*?)\])?}}/g;if(!G)return q.replace(Q,(W,O,_,Z)=>{let C=O.includes(":")?O.split(":")[0]:O,H=B[C];if(H===void 0)return W;if(typeof H==="function"){let K=H(Z!==void 0?Z:"");if(U(K))throw Error("JSX returned in string context");return String(K)}if(_)switch(_.toLowerCase()){case"number":return Number(H).toString();case"string":return String(H);case"boolean":return Boolean(H).toString();default:return String(H)}return String(H)});else{let z=[],W=0,O=null;while((O=Q.exec(q))!==null){let[_,Z,C,H]=O,F=O.index,K=Z.includes(":")?Z.split(":")[0]:Z;if(F>W)z.push(q.substring(W,F));let Y=B[K];if(Y===void 0)z.push(_);else if(typeof Y==="function"){let A=Y(H!==void 0?H:"");z.push(A)}else if(C)switch(C.toLowerCase()){case"number":z.push(Number(Y).toString());break;case"string":z.push(String(Y));break;case"boolean":z.push(Boolean(Y).toString());break;default:z.push(String(Y))}else z.push(String(Y));W=F+_.length}if(W<q.length)z.push(q.substring(W));return J(M,{},...z)}}class P{name;dictionary;constructor(q,B){this.name=q;this.dictionary=B}reference(q){if(typeof window<"u")throw Error("Cannot use reference in the browser");if(!this.dictionary?.[q])throw Error(`Translation not found for ${String(q)}`);return this.dictionary[q]}render(q,...B){let{locale:G=j.locale(),params:Q}={params:{},...B[0]};if(typeof window<"u")throw Error("Cannot use render in the browser");if(!this.dictionary?.[q]?.[G])throw Error(`Translation not found for ${String(q)} in ${String(G)}`);return $(this.dictionary[q][G],Q??{})}static create(q,B){return new P(q,B)}static text(q,...B){let{locale:G=j.locale(),params:Q}={params:{},...B?.[0]};if(!q?.[G])throw Error(`Translation not found for ${String(G)}`);return $(q[G],Q??{})}}async function N(q,B,...G){let{locale:Q=j.locale(),params:z}={params:{},...G[0]},O=(await q.load(String(Q)))[B];if(typeof O!=="string")throw Error(`Translation not found for "${B}" in "${String(Q)}" (dictionary ${q.id})`);return $(O,z??{})}export{w as translationConfigDefaults,N as translate,V as resolveLocale,X as negotiateLocale,L as isValidTimeZone,b as defineTranslationConfig,T as defineDictionary,R as createFormatter,S as Translator,D as TranslationServiceProvider,P as Dictionary,E as DEFAULT_TIME_ZONE};
2
+ import{ca as T}from"../chunk-7ftj43vp.js";import"../chunk-epvpmakp.js";import{ab as D}from"../chunk-htgmy3x7.js";import{Rc as b,Sc as w}from"../chunk-tk135gmj.js";import"../chunk-9xyxbxgk.js";import{Ed as j}from"../chunk-b5a5vvkk.js";import"../chunk-65beps2q.js";import"../chunk-m53fgf20.js";import"../chunk-4acpw92g.js";import"../chunk-cca0grq3.js";import"../chunk-m83zm86m.js";import"../chunk-1xdrs2hx.js";import"../chunk-19dpzp4y.js";import"../chunk-yds7zwc3.js";import"../chunk-meg8rtr6.js";import"../chunk-h43jp8ws.js";import"../chunk-s07v65x6.js";import"../chunk-gc2dz11k.js";import"../chunk-cskqet01.js";import{Gi as V,Hi as X,Ii as E,Ji as L,Ki as R,Li as S}from"../chunk-fenc5tpv.js";import"../chunk-nz8z8jr1.js";import"../chunk-4fx8p02c.js";import"../chunk-er8acmch.js";import"../chunk-2n3pgfnb.js";import"../chunk-d5f1m3d2.js";import"../chunk-rhvc1axc.js";import"../chunk-tewhms9w.js";import{createElement as J,Fragment as M,isValidElement as U}from"react";function $(q,B){let G=Object.values(B).some((z)=>typeof z==="function"&&U(z(""))),Q=/{{([^{}]+?)(?::([^{}\[\]]+?))?(?:\[(.*?)\])?}}/g;if(!G)return q.replace(Q,(W,O,_,Z)=>{let C=O.includes(":")?O.split(":")[0]:O,H=B[C];if(H===void 0)return W;if(typeof H==="function"){let K=H(Z!==void 0?Z:"");if(U(K))throw Error("JSX returned in string context");return String(K)}if(_)switch(_.toLowerCase()){case"number":return Number(H).toString();case"string":return String(H);case"boolean":return Boolean(H).toString();default:return String(H)}return String(H)});else{let z=[],W=0,O=null;while((O=Q.exec(q))!==null){let[_,Z,C,H]=O,F=O.index,K=Z.includes(":")?Z.split(":")[0]:Z;if(F>W)z.push(q.substring(W,F));let Y=B[K];if(Y===void 0)z.push(_);else if(typeof Y==="function"){let A=Y(H!==void 0?H:"");z.push(A)}else if(C)switch(C.toLowerCase()){case"number":z.push(Number(Y).toString());break;case"string":z.push(String(Y));break;case"boolean":z.push(Boolean(Y).toString());break;default:z.push(String(Y))}else z.push(String(Y));W=F+_.length}if(W<q.length)z.push(q.substring(W));return J(M,{},...z)}}class P{name;dictionary;constructor(q,B){this.name=q;this.dictionary=B}reference(q){if(typeof window<"u")throw Error("Cannot use reference in the browser");if(!this.dictionary?.[q])throw Error(`Translation not found for ${String(q)}`);return this.dictionary[q]}render(q,...B){let{locale:G=j.locale(),params:Q}={params:{},...B[0]};if(typeof window<"u")throw Error("Cannot use render in the browser");if(!this.dictionary?.[q]?.[G])throw Error(`Translation not found for ${String(q)} in ${String(G)}`);return $(this.dictionary[q][G],Q??{})}static create(q,B){return new P(q,B)}static text(q,...B){let{locale:G=j.locale(),params:Q}={params:{},...B?.[0]};if(!q?.[G])throw Error(`Translation not found for ${String(G)}`);return $(q[G],Q??{})}}async function N(q,B,...G){let{locale:Q=j.locale(),params:z}={params:{},...G[0]},O=(await q.load(String(Q)))[B];if(typeof O!=="string")throw Error(`Translation not found for "${B}" in "${String(Q)}" (dictionary ${q.id})`);return $(O,z??{})}export{w as translationConfigDefaults,N as translate,V as resolveLocale,X as negotiateLocale,L as isValidTimeZone,b as defineTranslationConfig,T as defineDictionary,R as createFormatter,S as Translator,D as TranslationServiceProvider,P as Dictionary,E as DEFAULT_TIME_ZONE};
3
3
 
4
4
  //# debugId=C4E0D7821CC396B264756E2164756E21
@@ -1,8 +1,8 @@
1
1
  /** The sha-256 of the source this was built from, so a test can tell it is stale. */
2
- export declare const STATIC_NAVIGATION_SOURCE_HASH = "0a7425eb046f290e83ec8441ef6df27cd3eea9dd68c2a71bd6908a4a9cf6e4f3";
2
+ export declare const STATIC_NAVIGATION_SOURCE_HASH = "38d6cb0484aa686a8b39adf41de1992d084fe0e504fbc0a1da2f066187451bce";
3
3
  /**
4
4
  * The navigation runtime (with the island loader) a static view with
5
5
  * `.static({ navigation })` inlines. Byte-for-byte constant.
6
6
  */
7
- export declare const STATIC_NAVIGATION_SOURCE = "var r=document,i=window,a=history;i.__gemi_nav?.d();var C=new AbortController,h=(t,e,n,s)=>t.addEventListener(e,n,{signal:C.signal,...s}),q=i.__gemi_nav={d:()=>C.abort()},y=(t,e)=>{if(!t.g)t.g=1,import(e.s).then((n)=>{if(t.isConnected)t.r=n.h(t,n.m[e.e])}).catch((n)=>console.error(n))},L=(t)=>{let e=t.getElementById(\"gemi-islands\");return e?JSON.parse(e.textContent):{i:[]}},D=(t,e)=>{for(let n of t.querySelectorAll(\"gemi-island\")){let s=e.i[n.dataset.island];if(!s||n.o)continue;if(s.l==\"eager\")y(n,s);else if(s.l==\"idle\"||!i.IntersectionObserver||!n.children.length)(i.requestIdleCallback||setTimeout)(()=>y(n,s));else{let l=new IntersectionObserver((m)=>{if(m.some((d)=>d.isIntersecting))l.disconnect(),y(n,s)});for(let m of n.children)l.observe(m)}}},R='meta[name=\"gemi-static\"]',A=\"style:not([data-gemi-fonts]),link[rel=stylesheet]\",I='meta[name]:not([name=viewport]),meta[property],link[rel~=canonical],link[rel~=alternate],link[rel~=icon],link[rel=preload][as=font],style[data-gemi-fonts],script[type=\"application/ld+json\"]',w=(t)=>t.querySelector(R)?.content,T=(t)=>[...t.querySelectorAll(A)].map((e)=>e.outerHTML).join(),c=(t)=>t.href.split(\"#\")[0],p=r.createElement(\"div\");p.setAttribute(\"aria-live\",\"polite\");p.style.cssText=\"position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap\";r.body.append(p);var _=(t)=>{q.p={url:location.href,title:r.title,initial:t},r.dispatchEvent(new CustomEvent(\"gemi:page-load\",{detail:q.p}))},f=new Map,O=(t)=>{let e=f.get(t);if(!e||Date.now()-e[0]>30000){let n=fetch(t,{headers:{accept:\"text/html\",\"x-gemi-navigate\":\"1\"},signal:AbortSignal.timeout(1e4)}).then((s)=>{if(!s.ok||!/^text\\/html/.test(s.headers.get(\"content-type\"))||new URL(s.url||t).origin!=location.origin)throw s;return s.text().then((l)=>[s.url||t,l])});e=[Date.now(),n],n.catch(()=>f.get(t)==e&&f.delete(t))}if(f.delete(t),f.set(t,e),f.size>10)f.delete(f.keys().next().value);return e[1]},U=(t)=>{let e=t.target.closest?.(\"a[href]\"),n=e?.getAttribute(\"target\");if(!e||n&&n!=\"_self\"||e.hasAttribute(\"download\")||/(^|\\s)external(\\s|$)/i.test(e.getAttribute(\"rel\"))||e.closest(\"[data-gemi-reload]\"))return;let s=new URL(e.getAttribute(\"href\"),r.baseURI);if(s.origin==location.origin&&!(s.href.includes(\"#\")&&c(s)==c(location)))return s},v={},k=()=>Math.random().toString(36).slice(2),x=()=>a.state?.g||a.replaceState({...a.state,g:k()},\"\"),M=c(location),b=0,K=(t)=>{if(!t.hasAttribute(\"tabindex\"))t.setAttribute(\"tabindex\",\"-1\"),t.addEventListener(\"blur\",()=>t.removeAttribute(\"tabindex\"),{once:!0});t.focus({preventScroll:!0})},N=(t)=>{let e=r.body,n=t.body,s=L(t),l=r.documentElement;r.title=t.title;for(let o of[\"lang\",\"dir\"]){let u=t.documentElement.getAttribute(o);if(u==null)l.removeAttribute(o);else l.setAttribute(o,u)}for(let o of r.head.querySelectorAll(I))o.remove();let m=new Set([...r.querySelectorAll(\"link[rel=modulepreload]\")].map((o)=>o.getAttribute(\"href\")));r.head.append(...t.head.querySelectorAll(I),...[...t.head.querySelectorAll(\"link[rel=modulepreload]\")].filter((o)=>!m.has(o.getAttribute(\"href\"))));let d=new Map([...e.querySelectorAll(\"[data-gemi-persist]\")].map((o)=>[o.dataset.gemiPersist,o])),g=[...n.querySelectorAll(\"[data-gemi-persist]\")].map((o)=>[o,d.get(o.dataset.gemiPersist)]).filter((o)=>o[1]);for(let o of[...e.querySelectorAll(\"gemi-island\")].reverse())if(o.o=1,!g.some((u)=>u[1].contains(o)))try{o.r?.unmount()}catch(u){console.error(u)}for(let[o,u]of g)o.replaceWith(u);for(let o of[...e.childNodes])if(!o.matches?.(A))o.remove();for(let o of[...n.children])if(o.matches(A))o.remove();for(let o of[...e.attributes])e.removeAttribute(o.name);for(let o of n.attributes)e.setAttribute(o.name,o.value);e.append(...n.childNodes,p),D(e,s)},H=async(t,e)=>{let n=++b,s=!e&&v[a.state?.g];a.scrollRestoration=\"manual\";try{let[l,m]=await O(c(t));if(n!=b)return;let d=new DOMParser().parseFromString(m,\"text/html\");if(w(d)==null||w(d)!=w(r)||T(d)!=T(r))throw 0;if(e){let o=new URL(l);o.hash=t.hash,a.pushState({g:k()},\"\",o.href)}M=c(location),N(d);let g=e&&t.hash&&r.getElementById(decodeURIComponent(t.hash.slice(1)));if(g)g.scrollIntoView({behavior:\"instant\"});else i.scrollTo({left:s?.[0]||0,top:s?.[1]||0,behavior:\"instant\"});if(e)K(g||r.querySelector(\"h1\")||r.querySelector(\"main\")||r.body);p.textContent=r.title,_(!1)}catch{if(n!=b)return;if(e)location.assign(t.href);else location.reload()}};h(r,\"click\",(t)=>{if(t.defaultPrevented||t.button||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey)return;let e=U(t);if(e&&r.dispatchEvent(new CustomEvent(\"gemi:before-navigate\",{cancelable:!0,detail:{url:e.href}})))t.preventDefault(),x(),v[a.state.g]=[i.scrollX,i.scrollY],H(e,1)});h(i,\"popstate\",()=>{if(b++,c(location)==M){let t=v[a.state?.g];if(t)i.scrollTo({left:t[0],top:t[1],behavior:\"instant\"})}else if(a.state?.g)H(new URL(location.href),0);else location.reload()});h(i,\"hashchange\",x);h(i,\"scroll\",()=>a.state?.g&&(v[a.state.g]=[i.scrollX,i.scrollY]),{passive:!0});var S,E=(t)=>{if(r.querySelector(R)?.dataset.prefetch==\"none\"||navigator.connection?.saveData)return;let e=U(t);if(e&&c(e)!=c(location))O(c(e))};h(r,\"pointerover\",(t)=>{clearTimeout(S),S=setTimeout(()=>E(t),65)});h(r,\"pointerout\",()=>clearTimeout(S));h(r,\"focusin\",E);h(r,\"touchstart\",E,{passive:!0});x();D(r,L(r));_(!0);";
7
+ export declare const STATIC_NAVIGATION_SOURCE = "var r=document,i=window,a=history;i.__gemi_nav?.d();var L=new AbortController,h=(t,e,n,s)=>t.addEventListener(e,n,{signal:L.signal,...s}),q=i.__gemi_nav={d:()=>L.abort()},v=(t,e)=>{if(!t.g)t.g=1,import(e.s).then((n)=>{if(t.isConnected)t.r=n.h(t,n.m[e.e])}).catch((n)=>console.error(n))},D=(t)=>{let e=t.getElementById(\"gemi-islands\");return e?JSON.parse(e.textContent):{i:[]}},R=(t,e)=>{for(let n of t.querySelectorAll(\"gemi-island\")){let s=e.i[n.dataset.island];if(!s||n.o)continue;if(s.l==\"eager\")v(n,s);else if(s.l==\"idle\"||!i.IntersectionObserver||!n.children.length)(i.requestIdleCallback||setTimeout)(()=>v(n,s));else{let l=new IntersectionObserver((m)=>{if(m.some((d)=>d.isIntersecting))l.disconnect(),v(n,s)});for(let m of n.children)l.observe(m)}}},O='meta[name=\"gemi-static\"]',A=\"style:not([data-gemi-fonts])\",T=A+\",link[rel=stylesheet]\",K=`head>${A},body>${A},link[rel=stylesheet]`,I='meta[name]:not([name=viewport]),meta[property],link[rel~=canonical],link[rel~=alternate],link[rel~=icon],link[rel=preload][as=font],style[data-gemi-fonts],script[type=\"application/ld+json\"]',w=(t)=>t.querySelector(O)?.content,C=(t)=>[...t.querySelectorAll(K)].map((e)=>e.outerHTML).join(),c=(t)=>t.href.split(\"#\")[0],p=r.createElement(\"div\");p.setAttribute(\"aria-live\",\"polite\");p.style.cssText=\"position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap\";r.body.append(p);var _=(t)=>{q.p={url:location.href,title:r.title,initial:t},r.dispatchEvent(new CustomEvent(\"gemi:page-load\",{detail:q.p}))},f=new Map,k=(t)=>{let e=f.get(t);if(!e||Date.now()-e[0]>30000){let n=fetch(t,{headers:{accept:\"text/html\",\"x-gemi-navigate\":\"1\"},signal:AbortSignal.timeout(1e4)}).then((s)=>{if(!s.ok||!/^text\\/html/.test(s.headers.get(\"content-type\"))||new URL(s.url||t).origin!=location.origin)throw s;return s.text().then((l)=>[s.url||t,l])});e=[Date.now(),n],n.catch(()=>f.get(t)==e&&f.delete(t))}if(f.delete(t),f.set(t,e),f.size>10)f.delete(f.keys().next().value);return e[1]},M=(t)=>{let e=t.target.closest?.(\"a[href]\"),n=e?.getAttribute(\"target\");if(!e||n&&n!=\"_self\"||e.hasAttribute(\"download\")||/(^|\\s)external(\\s|$)/i.test(e.getAttribute(\"rel\"))||e.closest(\"[data-gemi-reload]\"))return;let s=new URL(e.getAttribute(\"href\"),r.baseURI);if(s.origin==location.origin&&!(s.href.includes(\"#\")&&c(s)==c(location)))return s},y={},U=()=>Math.random().toString(36).slice(2),E=()=>a.state?.g||a.replaceState({...a.state,g:U()},\"\"),P=c(location),b=0,N=(t)=>{if(!t.hasAttribute(\"tabindex\"))t.setAttribute(\"tabindex\",\"-1\"),t.addEventListener(\"blur\",()=>t.removeAttribute(\"tabindex\"),{once:!0});t.focus({preventScroll:!0})},Y=(t)=>{let e=r.body,n=t.body,s=D(t),l=r.documentElement;r.title=t.title;for(let o of[\"lang\",\"dir\"]){let u=t.documentElement.getAttribute(o);if(u==null)l.removeAttribute(o);else l.setAttribute(o,u)}for(let o of r.head.querySelectorAll(I))o.remove();let m=new Set([...r.querySelectorAll(\"link[rel=modulepreload]\")].map((o)=>o.getAttribute(\"href\")));r.head.append(...t.head.querySelectorAll(I),...[...t.head.querySelectorAll(\"link[rel=modulepreload]\")].filter((o)=>!m.has(o.getAttribute(\"href\"))));let d=new Map([...e.querySelectorAll(\"[data-gemi-persist]\")].map((o)=>[o.dataset.gemiPersist,o])),g=[...n.querySelectorAll(\"[data-gemi-persist]\")].map((o)=>[o,d.get(o.dataset.gemiPersist)]).filter((o)=>o[1]);for(let o of[...e.querySelectorAll(\"gemi-island\")].reverse())if(o.o=1,!g.some((u)=>u[1].contains(o)))try{o.r?.unmount()}catch(u){console.error(u)}for(let[o,u]of g)o.replaceWith(u);for(let o of[...e.childNodes])if(!o.matches?.(T))o.remove();for(let o of[...n.children])if(o.matches(T))o.remove();for(let o of[...e.attributes])e.removeAttribute(o.name);for(let o of n.attributes)e.setAttribute(o.name,o.value);e.append(...n.childNodes,p),R(e,s)},H=async(t,e)=>{let n=++b,s=!e&&y[a.state?.g];a.scrollRestoration=\"manual\";try{let[l,m]=await k(c(t));if(n!=b)return;let d=new DOMParser().parseFromString(m,\"text/html\");if(w(d)==null||w(d)!=w(r)||C(d)!=C(r))throw 0;if(e){let o=new URL(l);o.hash=t.hash,a.pushState({g:U()},\"\",o.href)}P=c(location),Y(d);let g=e&&t.hash&&r.getElementById(decodeURIComponent(t.hash.slice(1)));if(g)g.scrollIntoView({behavior:\"instant\"});else i.scrollTo({left:s?.[0]||0,top:s?.[1]||0,behavior:\"instant\"});if(e)N(g||r.querySelector(\"h1\")||r.querySelector(\"main\")||r.body);p.textContent=r.title,_(!1)}catch{if(n!=b)return;if(e)location.assign(t.href);else location.reload()}};h(r,\"click\",(t)=>{if(t.defaultPrevented||t.button||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey)return;let e=M(t);if(e&&r.dispatchEvent(new CustomEvent(\"gemi:before-navigate\",{cancelable:!0,detail:{url:e.href}})))t.preventDefault(),E(),y[a.state.g]=[i.scrollX,i.scrollY],H(e,1)});h(i,\"popstate\",()=>{if(b++,c(location)==P){let t=y[a.state?.g];if(t)i.scrollTo({left:t[0],top:t[1],behavior:\"instant\"})}else if(a.state?.g)H(new URL(location.href),0);else location.reload()});h(i,\"hashchange\",E);h(i,\"scroll\",()=>a.state?.g&&(y[a.state.g]=[i.scrollX,i.scrollY]),{passive:!0});var S,x=(t)=>{if(r.querySelector(O)?.dataset.prefetch==\"none\"||navigator.connection?.saveData)return;let e=M(t);if(e&&c(e)!=c(location))k(c(e))};h(r,\"pointerover\",(t)=>{clearTimeout(S),S=setTimeout(()=>x(t),65)});h(r,\"pointerout\",()=>clearTimeout(S));h(r,\"focusin\",x);h(r,\"touchstart\",x,{passive:!0});E();R(r,D(r));_(!0);";
8
8
  //# sourceMappingURL=staticNavigationRuntime.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"staticNavigationRuntime.d.ts","sourceRoot":"","sources":["../../internal/staticNavigationRuntime.ts"],"names":[],"mappings":"AAIA,qFAAqF;AACrF,eAAO,MAAM,6BAA6B,qEAAqE,CAAC;AAEhH;;;GAGG;AACH,eAAO,MAAM,wBAAwB,mxKAC6uK,CAAC"}
1
+ {"version":3,"file":"staticNavigationRuntime.d.ts","sourceRoot":"","sources":["../../internal/staticNavigationRuntime.ts"],"names":[],"mappings":"AAIA,qFAAqF;AACrF,eAAO,MAAM,6BAA6B,qEAAqE,CAAC;AAEhH;;;GAGG;AACH,eAAO,MAAM,wBAAwB,y0KACmyK,CAAC"}
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Ea as g}from"../chunk-51w5ktv2.js";import{$a as jj}from"../chunk-6yhpprzs.js";import{ab as w}from"../chunk-htgmy3x7.js";import{Ab as u,Bb as l,Cb as v,Db as d,Gb as c,Hb as p,Kb as n,Nb as a,Ob as s,mb as e,nb as T,ob as D,pb as Jj,qb as A,rb as y,sb as P,wb as S,xb as h,yb as R}from"../chunk-wnj7q0th.js";import"../chunk-mr94nfp1.js";import"../chunk-9rr5h818.js";import"../chunk-7mmw0jr2.js";import{Mc as zj}from"../chunk-dwedx1jb.js";import"../chunk-tk135gmj.js";import"../chunk-9xyxbxgk.js";import{Ae as q,Fe as K,Ge as E,He as o,Ie as m,Je as C,Ke as Q,Le as i,Me as r,ud as Nj,ue as x,vd as Oj,yd as Hj,zd as Lj,ze as I}from"../chunk-hhymaj0m.js";import"../chunk-65beps2q.js";import"../chunk-m53fgf20.js";import{Tf as b}from"../chunk-4acpw92g.js";import{Gg as B}from"../chunk-cca0grq3.js";import{Mg as L}from"../chunk-m83zm86m.js";import"../chunk-1xdrs2hx.js";import{Xg as t}from"../chunk-19dpzp4y.js";import{ph as V,uh as f}from"../chunk-yds7zwc3.js";import"../chunk-meg8rtr6.js";import"../chunk-h43jp8ws.js";import"../chunk-s07v65x6.js";import"../chunk-gc2dz11k.js";import"../chunk-cskqet01.js";import"../chunk-1wnnkde0.js";import"../chunk-fenc5tpv.js";import{Mi as _,Oi as O,Pi as F}from"../chunk-nz8z8jr1.js";import"../chunk-4fx8p02c.js";import"../chunk-er8acmch.js";import"../chunk-2n3pgfnb.js";import"../chunk-d5f1m3d2.js";import{gj as M}from"../chunk-rhvc1axc.js";import"../chunk-tewhms9w.js";function Yj(j){let X=j.headers.get("Cache-Control")?.toLowerCase()??"";return/(^|[\s,])(public|s-maxage)\b/.test(X)}var Zj=new Set,$j={refusal:null,apply:(j)=>j,carried:null};async function k(j){let X=F(x);if(X.config.global.length===0)return $j;let{pathname:Z}=new URL(j.url),W=M(Z),z=new b(j,{},W?"api":"view","");return await L.run(z,async()=>{let $=L.getStore(),{headers:N,cookies:Xj}=$,Y=(J)=>{if(!Yj(J))return Q(J,N,Xj);let G=new Headers(N);return G.delete("Set-Cookie"),Q(J,G,Zj)};try{return await X.runGlobalMiddleware(),{refusal:null,apply:Y,carried:{user:$.user}}}catch(J){let G=!W&&Z.endsWith(".json");if(J?.kind===B){let H=W?C(J.payload.api):G?E(J.payload.viewData??J.payload.api):K(J.payload.view);return{refusal:Y(H),apply:Y,carried:null}}if(V(J)&&(W||G))return{refusal:Y(m()),apply:Y,carried:null};if(f(J)){console.error(J);let H=W||G?I():K(q());return{refusal:Y(H),apply:Y,carried:null}}throw J}finally{$.destroy()}})}var U=[d,p,g,R,S,s,y,h,c,l,D,u,a,v,w,n,P,A];class Wj{config={};providers=[];services=[];serviceInstances=[];serviceTokens=new Set;servicesBooted=!1;models=[];app=new O;boot(){if(this.models.length>0)jj(...this.models);else Gj();this.app.config.merge(this.config),O.setInstance(this.app),this.app.registerMany([...U,...this.providers]),this.registerServices()}registerServices(){let j=this.serviceTokens;this.serviceInstances=[],this.serviceTokens=new Set,this.servicesBooted=!1;let X=new Map;for(let Z of this.services){let W=typeof Z==="function"?new Z:Z,z=W.constructor;if(!z.token)throw Error(`Service [${z.name}] is listed in \`services\` but does not declare a \`static token\`.`);let $=X.get(z.token);if($)throw Error(`Services [${$}] and [${z.name}] both declare the token "${z.token}". Tokens are the container's keys, so they must be unique.`);X.set(z.token,z.name);let N=z;if(!j.has(z.token)&&this.app.bound(N))throw Error(`Service [${z.name}] declares the token "${z.token}", which is already bound in the container by the framework or a provider. Binding it would replace that service everywhere, so pick a token nothing else owns.`);this.app.instance(N,W),this.serviceInstances.push(W),this.serviceTokens.add(z.token)}}async waitForBoot(){await this.app.boot(),await this.bootServices(),Jj(this.app)}async bootServices(){if(this.servicesBooted)return;for(let j of this.serviceInstances)await j.boot();this.servicesBooted=!0}shutdown(j){return this.run(()=>this.app.shutdown(j))}run(j){return _.run(this.app,j)}resolve(j){return this.app.make(j)}apiRoutes(){return this.app.make(i)}viewRoutes(){return this.app.make(o)}domains(){return this.app.make(r)}queue(){return this.app.make(zj)}mcpHttp(){return this.app.config.get("route.mcp.remote.enabled")===!0?this.app.make(e):null}globalMiddleware(j){return k(j)}destroy(){if(this.app.resolved(T))this.app.make(T).stop();if(this.app.flush(),O.getInstance()===this.app)O.setInstance(void 0);_.disable()}}function Gj(){if(Bun.env.NODE_ENV==="production")return;let j=t();if(j.length===0)return;console.warn(`[gemi] ${j.length} model${j.length===1?" is":"s are"} registered, but Kernel.models is empty.
2
+ import{Ea as g}from"../chunk-51w5ktv2.js";import{$a as jj}from"../chunk-6yhpprzs.js";import{ab as w}from"../chunk-htgmy3x7.js";import{Ab as u,Bb as l,Cb as v,Db as d,Gb as c,Hb as p,Kb as n,Nb as a,Ob as s,mb as e,nb as T,ob as D,pb as Jj,qb as A,rb as y,sb as P,wb as S,xb as h,yb as R}from"../chunk-ar4d3vmr.js";import"../chunk-mr94nfp1.js";import"../chunk-9rr5h818.js";import"../chunk-7mmw0jr2.js";import{Mc as zj}from"../chunk-dwedx1jb.js";import"../chunk-tk135gmj.js";import"../chunk-9xyxbxgk.js";import{Ae as q,Fe as K,Ge as E,He as o,Ie as m,Je as C,Ke as Q,Le as i,Me as r,ud as Nj,ue as x,vd as Oj,yd as Hj,zd as Lj,ze as I}from"../chunk-b5a5vvkk.js";import"../chunk-65beps2q.js";import"../chunk-m53fgf20.js";import{Tf as b}from"../chunk-4acpw92g.js";import{Gg as B}from"../chunk-cca0grq3.js";import{Mg as L}from"../chunk-m83zm86m.js";import"../chunk-1xdrs2hx.js";import{Xg as t}from"../chunk-19dpzp4y.js";import{ph as V,uh as f}from"../chunk-yds7zwc3.js";import"../chunk-meg8rtr6.js";import"../chunk-h43jp8ws.js";import"../chunk-s07v65x6.js";import"../chunk-gc2dz11k.js";import"../chunk-cskqet01.js";import"../chunk-1wnnkde0.js";import"../chunk-fenc5tpv.js";import{Mi as _,Oi as O,Pi as F}from"../chunk-nz8z8jr1.js";import"../chunk-4fx8p02c.js";import"../chunk-er8acmch.js";import"../chunk-2n3pgfnb.js";import"../chunk-d5f1m3d2.js";import{gj as M}from"../chunk-rhvc1axc.js";import"../chunk-tewhms9w.js";function Yj(j){let X=j.headers.get("Cache-Control")?.toLowerCase()??"";return/(^|[\s,])(public|s-maxage)\b/.test(X)}var Zj=new Set,$j={refusal:null,apply:(j)=>j,carried:null};async function k(j){let X=F(x);if(X.config.global.length===0)return $j;let{pathname:Z}=new URL(j.url),W=M(Z),z=new b(j,{},W?"api":"view","");return await L.run(z,async()=>{let $=L.getStore(),{headers:N,cookies:Xj}=$,Y=(J)=>{if(!Yj(J))return Q(J,N,Xj);let G=new Headers(N);return G.delete("Set-Cookie"),Q(J,G,Zj)};try{return await X.runGlobalMiddleware(),{refusal:null,apply:Y,carried:{user:$.user}}}catch(J){let G=!W&&Z.endsWith(".json");if(J?.kind===B){let H=W?C(J.payload.api):G?E(J.payload.viewData??J.payload.api):K(J.payload.view);return{refusal:Y(H),apply:Y,carried:null}}if(V(J)&&(W||G))return{refusal:Y(m()),apply:Y,carried:null};if(f(J)){console.error(J);let H=W||G?I():K(q());return{refusal:Y(H),apply:Y,carried:null}}throw J}finally{$.destroy()}})}var U=[d,p,g,R,S,s,y,h,c,l,D,u,a,v,w,n,P,A];class Wj{config={};providers=[];services=[];serviceInstances=[];serviceTokens=new Set;servicesBooted=!1;models=[];app=new O;boot(){if(this.models.length>0)jj(...this.models);else Gj();this.app.config.merge(this.config),O.setInstance(this.app),this.app.registerMany([...U,...this.providers]),this.registerServices()}registerServices(){let j=this.serviceTokens;this.serviceInstances=[],this.serviceTokens=new Set,this.servicesBooted=!1;let X=new Map;for(let Z of this.services){let W=typeof Z==="function"?new Z:Z,z=W.constructor;if(!z.token)throw Error(`Service [${z.name}] is listed in \`services\` but does not declare a \`static token\`.`);let $=X.get(z.token);if($)throw Error(`Services [${$}] and [${z.name}] both declare the token "${z.token}". Tokens are the container's keys, so they must be unique.`);X.set(z.token,z.name);let N=z;if(!j.has(z.token)&&this.app.bound(N))throw Error(`Service [${z.name}] declares the token "${z.token}", which is already bound in the container by the framework or a provider. Binding it would replace that service everywhere, so pick a token nothing else owns.`);this.app.instance(N,W),this.serviceInstances.push(W),this.serviceTokens.add(z.token)}}async waitForBoot(){await this.app.boot(),await this.bootServices(),Jj(this.app)}async bootServices(){if(this.servicesBooted)return;for(let j of this.serviceInstances)await j.boot();this.servicesBooted=!0}shutdown(j){return this.run(()=>this.app.shutdown(j))}run(j){return _.run(this.app,j)}resolve(j){return this.app.make(j)}apiRoutes(){return this.app.make(i)}viewRoutes(){return this.app.make(o)}domains(){return this.app.make(r)}queue(){return this.app.make(zj)}mcpHttp(){return this.app.config.get("route.mcp.remote.enabled")===!0?this.app.make(e):null}globalMiddleware(j){return k(j)}destroy(){if(this.app.resolved(T))this.app.make(T).stop();if(this.app.flush(),O.getInstance()===this.app)O.setInstance(void 0);_.disable()}}function Gj(){if(Bun.env.NODE_ENV==="production")return;let j=t();if(j.length===0)return;console.warn(`[gemi] ${j.length} model${j.length===1?" is":"s are"} registered, but Kernel.models is empty.
3
3
  Nested relation reads resolve a model by name, so a policy on a subclass that does not own its
4
4
  `+" name is skipped inside every include \u2014 scoped at the root, "+`unscoped in an include, with nothing
5
5
  to notice it. Declaring the modules registers each class under its own name and audits the set:
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{Ca as I}from"../chunk-kk18xqgc.js";import{Da as W}from"../chunk-krtybgz1.js";import{$i as A,Yi as b,_i as V,aj as H,bj as O}from"../chunk-2n3pgfnb.js";import{fj as k}from"../chunk-d5f1m3d2.js";import"../chunk-rhvc1axc.js";import{mj as $}from"../chunk-tewhms9w.js";var X=Symbol.for("gemi.server.devGeneration"),L={graceMs:1e4,providerTimeoutMs:5000};class Q{app;inFlight=0;waiters=new Set;constructor(z){this.app=z}track(z){return async(B,J)=>{this.inFlight++;try{return await z(B,J)}finally{if(this.inFlight--,this.inFlight===0)this.wake()}}}get pending(){return this.inFlight}async retire({graceMs:z,providerTimeoutMs:B}){try{await this.idle(z),await Promise.resolve().then(()=>this.app.shutdown({timeoutMs:B}))}catch(J){Z(J)}}idle(z){if(this.inFlight===0)return Promise.resolve();return new Promise((B)=>{let J=()=>{clearTimeout(K),this.waiters.delete(J),B()},K=setTimeout(J,z);this.waiters.add(J)})}wake(){for(let z of this.waiters)z()}}function Y(z,B=L){let J=globalThis,K=J[X];if(J[X]=z,!K||K===z||typeof K.retire!=="function")return Promise.resolve();let _=K.retire.bind(K);return Promise.resolve().then(()=>_(B)).catch(Z)}function Z(z){console.error("[gemi] Shutting down the application a reload replaced failed:",z)}class P{app;instrumentation;handleSignals;server;stopping;settings;constructor(z){this.app=new W({kernel:z.kernel}),this.handleSignals=z.handleSignals??!0,this.instrumentation=H(z.instrumentation??((B,J)=>J(B)))}async start(){process.env.ROOT_DIR=k();let z=Bun.env.NODE_ENV==="production";if(z){if(this.handleSignals)O(()=>this.stop());this.settings=V()}try{await this.app.waitForBoot()}catch(B){if(!z)this.app.shutdown({timeoutMs:L.providerTimeoutMs});throw B}if(z){let{httpProd:B}=await import("../chunk-dc8gyybt.js");this.server=await B(this.app,this.instrumentation.bind(this))}else{I();let{httpDev:B}=await import("../chunk-231a9920.js"),J=new Q(this.app);this.server=await B(this.app,J.track(this.instrumentation.bind(this))),Y(J)}return this.server}stop(z={}){return this.stopping??=A({server:this.server,shutdownProviders:(B)=>this.app.shutdown(B),settings:{...this.settings??V(),...z}}),this.stopping}}export{b as isShuttingDown,P as Server};
2
+ import{Ca as I}from"../chunk-kk18xqgc.js";import{Da as W}from"../chunk-krtybgz1.js";import{$i as A,Yi as b,_i as V,aj as H,bj as O}from"../chunk-2n3pgfnb.js";import{fj as k}from"../chunk-d5f1m3d2.js";import"../chunk-rhvc1axc.js";import{mj as $}from"../chunk-tewhms9w.js";var X=Symbol.for("gemi.server.devGeneration"),L={graceMs:1e4,providerTimeoutMs:5000};class Q{app;inFlight=0;waiters=new Set;constructor(z){this.app=z}track(z){return async(B,J)=>{this.inFlight++;try{return await z(B,J)}finally{if(this.inFlight--,this.inFlight===0)this.wake()}}}get pending(){return this.inFlight}async retire({graceMs:z,providerTimeoutMs:B}){try{await this.idle(z),await Promise.resolve().then(()=>this.app.shutdown({timeoutMs:B}))}catch(J){Z(J)}}idle(z){if(this.inFlight===0)return Promise.resolve();return new Promise((B)=>{let J=()=>{clearTimeout(K),this.waiters.delete(J),B()},K=setTimeout(J,z);this.waiters.add(J)})}wake(){for(let z of this.waiters)z()}}function Y(z,B=L){let J=globalThis,K=J[X];if(J[X]=z,!K||K===z||typeof K.retire!=="function")return Promise.resolve();let _=K.retire.bind(K);return Promise.resolve().then(()=>_(B)).catch(Z)}function Z(z){console.error("[gemi] Shutting down the application a reload replaced failed:",z)}class P{app;instrumentation;handleSignals;server;stopping;settings;constructor(z){this.app=new W({kernel:z.kernel}),this.handleSignals=z.handleSignals??!0,this.instrumentation=H(z.instrumentation??((B,J)=>J(B)))}async start(){process.env.ROOT_DIR=k();let z=Bun.env.NODE_ENV==="production";if(z){if(this.handleSignals)O(()=>this.stop());this.settings=V()}try{await this.app.waitForBoot()}catch(B){if(!z)this.app.shutdown({timeoutMs:L.providerTimeoutMs});throw B}if(z){let{httpProd:B}=await import("../chunk-cytq2msw.js");this.server=await B(this.app,this.instrumentation.bind(this))}else{I();let{httpDev:B}=await import("../chunk-s6vvqsd0.js"),J=new Q(this.app);this.server=await B(this.app,J.track(this.instrumentation.bind(this))),Y(J)}return this.server}stop(z={}){return this.stopping??=A({server:this.server,shutdownProviders:(B)=>this.app.shutdown(B),settings:{...this.settings??V(),...z}}),this.stopping}}export{b as isShuttingDown,P as Server};
3
3
 
4
4
  //# debugId=260E765562F9B8D664756E2164756E21
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{cb as b8}from"../chunk-fcqx2t0p.js";import{Ab as N8,Bb as x8,Cb as L8,Db as D8,Eb as F8,Fb as H8,Gb as U8,Hb as S8,Ib as O8,Jb as R8,Kb as f8,Lb as _8,Mb as k8,Nb as C8,Ob as I8,db as x5,eb as L5,fb as D5,gb as F5,hb as z4,ib as H5,jb as Q4,kb as Y4,lb as I1,mb as U5,nb as O5,ob as J8,qb as Z8,rb as $8,sb as G8,tb as K8,ub as z8,vb as X8,wb as B8,xb as M8,yb as j8,zb as k}from"../chunk-wnj7q0th.js";import"../chunk-mr94nfp1.js";import{fc as g5,gc as E5,hc as m5,ic as c5,jc as u5,kc as p5,lc as l5,mc as n5,nc as i5,oc as o5,pc as s5,qc as a5,rc as t5,sc as r5,tc as e5,uc as W8}from"../chunk-9rr5h818.js";import{vc as d5}from"../chunk-7mmw0jr2.js";import{Ac as k5,Bc as C5,Cc as I5,Dc as b5,Ec as T5,Fc as v5,Gc as P5,Hc as w5,Ic as V5,Jc as q5,Kc as y5,Lc as A5,Mc as h5,wc as S5,xc as R5,yc as f5,zc as _5}from"../chunk-dwedx1jb.js";import{Rc as Q8,Sc as Y8}from"../chunk-tk135gmj.js";import"../chunk-9xyxbxgk.js";import{$d as mW,Ad as A0,Be as Y5,Ce as G5,He as K5,Le as z5,Ne as b1,Od as bW,Pd as TW,Qd as vW,Rd as PW,Sd as wW,Td as VW,Ud as qW,Vd as yW,Wd as AW,Yd as hW,Zd as gW,_d as EW,ae as cW,be as uW,ce as dW,de as x0,ee as pW,fe as lW,ge as nW,hd as e6,he as iW,id as WW,ie as oW,jd as JW,kd as ZW,ld as $W,md as QW,me as q,ne as j1,oe as sW,pd as y0,pe as aW,qd as S0,qe as tW,rd as O0,re as rW,sd as t1,se as eW,td as YW,ue as W5,ve as J5,wd as GW,we as Z5,xd as KW,xe as $5,ye as Q5}from"../chunk-hhymaj0m.js";import"../chunk-65beps2q.js";import"../chunk-m53fgf20.js";import{Ag as _1,Ff as a1,Gf as i1,Hf as K1,Tf as $4,Wf as i,Yf as c,ag as o1,bg as z1,cg as f1,dg as zW,eg as XW,fg as BW,gg as MW,vg as jW,wg as NW,yg as xW}from"../chunk-4acpw92g.js";import"../chunk-cca0grq3.js";import"../chunk-m83zm86m.js";import{Ng as OW,Og as RW,Pg as fW,Qg as _W,Rg as kW,Sg as CW,Tg as IW}from"../chunk-1xdrs2hx.js";import{$g as SW,Zg as HW,_g as UW}from"../chunk-19dpzp4y.js";import"../chunk-yds7zwc3.js";import{Ih as LW,Jh as DW,Kh as FW}from"../chunk-meg8rtr6.js";import"../chunk-h43jp8ws.js";import"../chunk-s07v65x6.js";import"../chunk-gc2dz11k.js";import"../chunk-cskqet01.js";import{Ai as X5,Bi as B5,Ci as M5,Di as j5,Fi as N5}from"../chunk-1wnnkde0.js";import"../chunk-fenc5tpv.js";import{Pi as v}from"../chunk-nz8z8jr1.js";import"../chunk-4fx8p02c.js";import"../chunk-er8acmch.js";import"../chunk-2n3pgfnb.js";import"../chunk-d5f1m3d2.js";import"../chunk-rhvc1axc.js";import{mj as D0}from"../chunk-tewhms9w.js";import{Buffer as L0}from"buffer";class F0 extends z1{client;config;constructor(...W){super();this.config=W}async connect(){let W=await import("../chunk-5nj94s66.js");return this.client??=new W.S3Client(...this.config),{sdk:W,client:this.client}}async put(W,{signal:J}={}){J?.throwIfAborted();let Z,$,Q,Y=process.env.BUCKET_NAME;if(W instanceof Blob)Z=W,Q=`${Bun.randomUUIDv7()}.${W.type.split("/")[1].split(";")[0]}`,$=W.type;else Z=W.body,Q=W.name,Y=W.bucket??Y,$=W.contentType||(Z instanceof Blob||Z instanceof File?Z.type:void 0);$=$||void 0;let G=Z instanceof L0?Z:Z instanceof Blob||Z instanceof File?L0.from(await Z.arrayBuffer()):"",{sdk:K,client:z}=await this.connect();return J?.throwIfAborted(),await z.send(new K.PutObjectCommand({Bucket:Y,Key:Q,Body:G,ContentType:$}),{abortSignal:J}),Q}async delete(W){let J=typeof W==="string"?W:W.name,Z=(typeof W==="string"?void 0:W.bucket)??process.env.BUCKET_NAME;if(!J)throw Error("Object name has to be specified");let{sdk:$,client:Q}=await this.connect();try{await Q.send(new $.DeleteObjectCommand({Bucket:Z,Key:J}))}catch(Y){if(Y?.name==="NoSuchKey"||Y?.$metadata?.httpStatusCode===404)return;throw Y}}async*pages(W,{bucket:J,signal:Z}){let{sdk:$,client:Q}=await this.connect(),Y;do{Z?.throwIfAborted();let G=await Q.send(new $.ListObjectsV2Command({Bucket:J??process.env.BUCKET_NAME,Prefix:W,ContinuationToken:Y}),{abortSignal:Z});yield(G.Contents??[]).map((K)=>({name:K.Key,size:K.Size??0,lastModified:K.LastModified??new Date(0)})),Y=G.IsTruncated?G.NextContinuationToken:void 0}while(Y)}async*objects(W,J={}){for await(let Z of this.pages(W,J))yield*Z}async deletePrefix(W,J={}){o1(W);let Z=J.bucket??process.env.BUCKET_NAME,{sdk:$,client:Q}=await this.connect(),Y=0;for await(let G of this.pages(W,{...J,bucket:Z})){if(G.length===0)continue;J.signal?.throwIfAborted();let z=(await Q.send(new $.DeleteObjectsCommand({Bucket:Z,Delete:{Objects:G.map((X)=>({Key:X.name})),Quiet:!0}}),{abortSignal:J.signal}))?.Errors??[];if(z.length>0){let X=z[0];throw Error(`S3 could not delete ${z.length} object(s) under "${W}", e.g. "${X.Key}": ${X.Code??"unknown"} ${X.Message??""}`.trim())}Y+=G.length}return Y}async list(W){let{sdk:J,client:Z}=await this.connect();return await Z.send(new J.ListObjectsV2Command({Bucket:process.env.BUCKET_NAME,Prefix:W}))}async fetch(W,{signal:J}={}){J?.throwIfAborted();let Z=process.env.BUCKET_NAME,$;if(typeof W==="string")$=W;else Z=W.bucket??Z,$=W.name;if(!$)throw Error("Object name has to be specified");let{sdk:Q,client:Y}=await this.connect();J?.throwIfAborted();let G=await Y.send(new Q.GetObjectCommand({Bucket:Z,Key:$}),{abortSignal:J}),K=f1(G.Body.transformToWebStream(),J);return J?.throwIfAborted(),new Response(K,{headers:{"Content-Type":G.ContentType,"Content-Length":G.ContentLength.toString(),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":G.LastModified?.toUTCString()||"",ETag:G.ETag||""}})}async read(W){let J=typeof W==="string"?{name:W}:W,Z=J.bucket??process.env.BUCKET_NAME,{name:$,range:Q=null}=J;if(!$)throw Error("Object name has to be specified");let{sdk:Y,client:G}=await this.connect(),K;try{K=await G.send(new Y.GetObjectCommand({Bucket:Z,Key:$,Range:Q?i1(Q):void 0}))}catch(M){if(M?.name==="InvalidRange"||M?.$metadata?.httpStatusCode===416)throw new i(await this.size({name:$,bucket:Z}));if(M?.name==="NoSuchKey"||M?.$metadata?.httpStatusCode===404)throw new c($);throw M}let z=K1(K.ContentRange),X=Boolean(z)&&K.$metadata?.httpStatusCode===206,B=z?.total??K.ContentLength??0;return{body:K.Body.transformToWebStream(),start:z?.start??0,end:z?.end??B-1,total:B,partial:X,type:K.ContentType??"application/octet-stream",etag:K.ETag||void 0,lastModified:K.LastModified,name:$}}async size(W){let J=typeof W==="string"?W:W.name,Z=(typeof W==="string"?void 0:W.bucket)??process.env.BUCKET_NAME,{sdk:$,client:Q}=await this.connect();try{return(await Q.send(new $.HeadObjectCommand({Bucket:Z,Key:J}))).ContentLength??0}catch(Y){if(Y?.name==="NotFound"||Y?.$metadata?.httpStatusCode===404)throw new c(J);throw Y}}}import{Buffer as H0}from"buffer";import{Readable as H6}from"stream";function s1(W){return W?.statusCode===404||W?.details?.errorCode==="BlobNotFound"||W?.code==="BlobNotFound"}function U6(W){return W?.statusCode===416||W?.details?.errorCode==="InvalidRange"||W?.code==="InvalidRange"}class U0 extends z1{config;serviceClientPromise=null;constructor(W={}){super();this.config=W}async serviceClient(){if(this.config.serviceClient)return this.config.serviceClient;return this.serviceClientPromise??=(async()=>{let W;try{W=await import("@azure/storage-blob")}catch{throw Error("AzureBlobDriver requires the '@azure/storage-blob' package. Install it with `bun add @azure/storage-blob`, or pass a pre-built `serviceClient`.")}let J=this.config.connectionString??process.env.AZURE_STORAGE_CONNECTION_STRING;if(this.config.url)return new W.BlobServiceClient(this.config.url,this.config.credential);if(J)return W.BlobServiceClient.fromConnectionString(J);throw Error("AzureBlobDriver needs a connection string (AZURE_STORAGE_CONNECTION_STRING), a `url`, or a `serviceClient`.")})(),this.serviceClientPromise}async blob(W,J){if(!W)throw Error("Object name has to be specified");let Z=J??this.config.container??process.env.BUCKET_NAME;if(!Z)throw Error("AzureBlobDriver needs a container name, from `bucket`, the `container` config, or BUCKET_NAME.");return(await this.serviceClient()).getContainerClient(Z).getBlockBlobClient(W)}async put(W,{signal:J}={}){J?.throwIfAborted();let Z,$,Q,Y;if(W instanceof Blob)Z=W,Q=`${Bun.randomUUIDv7()}.${W.type.split("/")[1].split(";")[0]}`,$=W.type;else Z=W.body,Q=W.name,Y=W.bucket,$=W.contentType??(Z instanceof Blob||Z instanceof File?Z.type:void 0);let G=Z instanceof H0?Z:H0.from(await Z.arrayBuffer()),K=await this.blob(Q,Y);return J?.throwIfAborted(),await K.uploadData(G,{blobHTTPHeaders:$?{blobContentType:$}:void 0,abortSignal:J}),Q}async*objects(W,{bucket:J,signal:Z}={}){Z?.throwIfAborted();let $=J??this.config.container??process.env.BUCKET_NAME;if(!$)throw Error("AzureBlobDriver needs a container name, from `bucket`, the `container` config, or BUCKET_NAME.");let Y=(await this.serviceClient()).getContainerClient($);for await(let G of Y.listBlobsFlat({prefix:W}))Z?.throwIfAborted(),yield{name:G.name,size:G.properties?.contentLength??0,lastModified:G.properties?.lastModified??new Date(0)}}async list(W){let J=this.config.container??process.env.BUCKET_NAME,$=(await this.serviceClient()).getContainerClient(J),Q=[];for await(let Y of $.listBlobsFlat({prefix:W}))Q.push(Y.name);return Q}async fetch(W,{signal:J}={}){J?.throwIfAborted();let Z=await this.download(typeof W==="string"?{name:W}:{name:W.name,bucket:W.bucket},J);return new Response(Z.body,{headers:{"Content-Type":Z.type,"Content-Length":String(Z.total),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":Z.lastModified?.toUTCString()??"",ETag:Z.etag??""}})}async read(W){return this.download(typeof W==="string"?{name:W}:W)}async download(W,J){let{name:Z,bucket:$,range:Q=null}=W,Y=await this.blob(Z,$);J?.throwIfAborted();let G,K,z=Q?.kind==="suffix"||Q?.kind==="offset"&&Q.end===null&&Q.start===0;if(Q&&z){let H=await this.size({name:Z,bucket:$}),m=a1(Q,H);if(!m)throw new i(H);G=m.start,K=m.length}else if(Q?.kind==="offset")G=Q.start,K=Q.end===null?void 0:Q.end-Q.start+1;let X;try{X=await Y.download(G,K,J?{abortSignal:J}:void 0)}catch(H){if(U6(H))throw new i(await this.size({name:Z,bucket:$}));if(s1(H))throw new c(Z);throw H}let B=K1(X.contentRange),M=Boolean(B),D=B?.total??X.contentLength??0,S=await S6(X);if(S instanceof ReadableStream)S=f1(S,J);return J?.throwIfAborted(),{body:S,start:B?.start??0,end:B?.end??D-1,total:D,partial:M,type:X.contentType??"application/octet-stream",etag:X.etag||void 0,lastModified:X.lastModified,name:Z}}async size(W){let J=typeof W==="string"?W:W.name,Z=typeof W==="string"?void 0:W.bucket,$=await this.blob(J,Z);try{return(await $.getProperties()).contentLength??0}catch(Q){if(s1(Q))throw new c(J);throw Q}}async delete(W){let J=typeof W==="string"?W:W.name,Z=typeof W==="string"?void 0:W.bucket,$=await this.blob(J,Z);try{await $.delete()}catch(Q){if(s1(Q))return;throw Q}}}async function S6(W){if(W.blobBody)return await W.blobBody;if(W.readableStreamBody)return H6.toWeb(W.readableStreamBody);return null}function O6(W){return W}var R6=`
2
+ import{cb as b8}from"../chunk-fcqx2t0p.js";import{Ab as N8,Bb as x8,Cb as L8,Db as D8,Eb as F8,Fb as H8,Gb as U8,Hb as S8,Ib as O8,Jb as R8,Kb as f8,Lb as _8,Mb as k8,Nb as C8,Ob as I8,db as x5,eb as L5,fb as D5,gb as F5,hb as z4,ib as H5,jb as Q4,kb as Y4,lb as I1,mb as U5,nb as O5,ob as J8,qb as Z8,rb as $8,sb as G8,tb as K8,ub as z8,vb as X8,wb as B8,xb as M8,yb as j8,zb as k}from"../chunk-ar4d3vmr.js";import"../chunk-mr94nfp1.js";import{fc as g5,gc as E5,hc as m5,ic as c5,jc as u5,kc as p5,lc as l5,mc as n5,nc as i5,oc as o5,pc as s5,qc as a5,rc as t5,sc as r5,tc as e5,uc as W8}from"../chunk-9rr5h818.js";import{vc as d5}from"../chunk-7mmw0jr2.js";import{Ac as k5,Bc as C5,Cc as I5,Dc as b5,Ec as T5,Fc as v5,Gc as P5,Hc as w5,Ic as V5,Jc as q5,Kc as y5,Lc as A5,Mc as h5,wc as S5,xc as R5,yc as f5,zc as _5}from"../chunk-dwedx1jb.js";import{Rc as Q8,Sc as Y8}from"../chunk-tk135gmj.js";import"../chunk-9xyxbxgk.js";import{$d as mW,Ad as A0,Be as Y5,Ce as G5,He as K5,Le as z5,Ne as b1,Od as bW,Pd as TW,Qd as vW,Rd as PW,Sd as wW,Td as VW,Ud as qW,Vd as yW,Wd as AW,Yd as hW,Zd as gW,_d as EW,ae as cW,be as uW,ce as dW,de as x0,ee as pW,fe as lW,ge as nW,hd as e6,he as iW,id as WW,ie as oW,jd as JW,kd as ZW,ld as $W,md as QW,me as q,ne as j1,oe as sW,pd as y0,pe as aW,qd as S0,qe as tW,rd as O0,re as rW,sd as t1,se as eW,td as YW,ue as W5,ve as J5,wd as GW,we as Z5,xd as KW,xe as $5,ye as Q5}from"../chunk-b5a5vvkk.js";import"../chunk-65beps2q.js";import"../chunk-m53fgf20.js";import{Ag as _1,Ff as a1,Gf as i1,Hf as K1,Tf as $4,Wf as i,Yf as c,ag as o1,bg as z1,cg as f1,dg as zW,eg as XW,fg as BW,gg as MW,vg as jW,wg as NW,yg as xW}from"../chunk-4acpw92g.js";import"../chunk-cca0grq3.js";import"../chunk-m83zm86m.js";import{Ng as OW,Og as RW,Pg as fW,Qg as _W,Rg as kW,Sg as CW,Tg as IW}from"../chunk-1xdrs2hx.js";import{$g as SW,Zg as HW,_g as UW}from"../chunk-19dpzp4y.js";import"../chunk-yds7zwc3.js";import{Ih as LW,Jh as DW,Kh as FW}from"../chunk-meg8rtr6.js";import"../chunk-h43jp8ws.js";import"../chunk-s07v65x6.js";import"../chunk-gc2dz11k.js";import"../chunk-cskqet01.js";import{Ai as X5,Bi as B5,Ci as M5,Di as j5,Fi as N5}from"../chunk-1wnnkde0.js";import"../chunk-fenc5tpv.js";import{Pi as v}from"../chunk-nz8z8jr1.js";import"../chunk-4fx8p02c.js";import"../chunk-er8acmch.js";import"../chunk-2n3pgfnb.js";import"../chunk-d5f1m3d2.js";import"../chunk-rhvc1axc.js";import{mj as D0}from"../chunk-tewhms9w.js";import{Buffer as L0}from"buffer";class F0 extends z1{client;config;constructor(...W){super();this.config=W}async connect(){let W=await import("../chunk-5nj94s66.js");return this.client??=new W.S3Client(...this.config),{sdk:W,client:this.client}}async put(W,{signal:J}={}){J?.throwIfAborted();let Z,$,Q,Y=process.env.BUCKET_NAME;if(W instanceof Blob)Z=W,Q=`${Bun.randomUUIDv7()}.${W.type.split("/")[1].split(";")[0]}`,$=W.type;else Z=W.body,Q=W.name,Y=W.bucket??Y,$=W.contentType||(Z instanceof Blob||Z instanceof File?Z.type:void 0);$=$||void 0;let G=Z instanceof L0?Z:Z instanceof Blob||Z instanceof File?L0.from(await Z.arrayBuffer()):"",{sdk:K,client:z}=await this.connect();return J?.throwIfAborted(),await z.send(new K.PutObjectCommand({Bucket:Y,Key:Q,Body:G,ContentType:$}),{abortSignal:J}),Q}async delete(W){let J=typeof W==="string"?W:W.name,Z=(typeof W==="string"?void 0:W.bucket)??process.env.BUCKET_NAME;if(!J)throw Error("Object name has to be specified");let{sdk:$,client:Q}=await this.connect();try{await Q.send(new $.DeleteObjectCommand({Bucket:Z,Key:J}))}catch(Y){if(Y?.name==="NoSuchKey"||Y?.$metadata?.httpStatusCode===404)return;throw Y}}async*pages(W,{bucket:J,signal:Z}){let{sdk:$,client:Q}=await this.connect(),Y;do{Z?.throwIfAborted();let G=await Q.send(new $.ListObjectsV2Command({Bucket:J??process.env.BUCKET_NAME,Prefix:W,ContinuationToken:Y}),{abortSignal:Z});yield(G.Contents??[]).map((K)=>({name:K.Key,size:K.Size??0,lastModified:K.LastModified??new Date(0)})),Y=G.IsTruncated?G.NextContinuationToken:void 0}while(Y)}async*objects(W,J={}){for await(let Z of this.pages(W,J))yield*Z}async deletePrefix(W,J={}){o1(W);let Z=J.bucket??process.env.BUCKET_NAME,{sdk:$,client:Q}=await this.connect(),Y=0;for await(let G of this.pages(W,{...J,bucket:Z})){if(G.length===0)continue;J.signal?.throwIfAborted();let z=(await Q.send(new $.DeleteObjectsCommand({Bucket:Z,Delete:{Objects:G.map((X)=>({Key:X.name})),Quiet:!0}}),{abortSignal:J.signal}))?.Errors??[];if(z.length>0){let X=z[0];throw Error(`S3 could not delete ${z.length} object(s) under "${W}", e.g. "${X.Key}": ${X.Code??"unknown"} ${X.Message??""}`.trim())}Y+=G.length}return Y}async list(W){let{sdk:J,client:Z}=await this.connect();return await Z.send(new J.ListObjectsV2Command({Bucket:process.env.BUCKET_NAME,Prefix:W}))}async fetch(W,{signal:J}={}){J?.throwIfAborted();let Z=process.env.BUCKET_NAME,$;if(typeof W==="string")$=W;else Z=W.bucket??Z,$=W.name;if(!$)throw Error("Object name has to be specified");let{sdk:Q,client:Y}=await this.connect();J?.throwIfAborted();let G=await Y.send(new Q.GetObjectCommand({Bucket:Z,Key:$}),{abortSignal:J}),K=f1(G.Body.transformToWebStream(),J);return J?.throwIfAborted(),new Response(K,{headers:{"Content-Type":G.ContentType,"Content-Length":G.ContentLength.toString(),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":G.LastModified?.toUTCString()||"",ETag:G.ETag||""}})}async read(W){let J=typeof W==="string"?{name:W}:W,Z=J.bucket??process.env.BUCKET_NAME,{name:$,range:Q=null}=J;if(!$)throw Error("Object name has to be specified");let{sdk:Y,client:G}=await this.connect(),K;try{K=await G.send(new Y.GetObjectCommand({Bucket:Z,Key:$,Range:Q?i1(Q):void 0}))}catch(M){if(M?.name==="InvalidRange"||M?.$metadata?.httpStatusCode===416)throw new i(await this.size({name:$,bucket:Z}));if(M?.name==="NoSuchKey"||M?.$metadata?.httpStatusCode===404)throw new c($);throw M}let z=K1(K.ContentRange),X=Boolean(z)&&K.$metadata?.httpStatusCode===206,B=z?.total??K.ContentLength??0;return{body:K.Body.transformToWebStream(),start:z?.start??0,end:z?.end??B-1,total:B,partial:X,type:K.ContentType??"application/octet-stream",etag:K.ETag||void 0,lastModified:K.LastModified,name:$}}async size(W){let J=typeof W==="string"?W:W.name,Z=(typeof W==="string"?void 0:W.bucket)??process.env.BUCKET_NAME,{sdk:$,client:Q}=await this.connect();try{return(await Q.send(new $.HeadObjectCommand({Bucket:Z,Key:J}))).ContentLength??0}catch(Y){if(Y?.name==="NotFound"||Y?.$metadata?.httpStatusCode===404)throw new c(J);throw Y}}}import{Buffer as H0}from"buffer";import{Readable as H6}from"stream";function s1(W){return W?.statusCode===404||W?.details?.errorCode==="BlobNotFound"||W?.code==="BlobNotFound"}function U6(W){return W?.statusCode===416||W?.details?.errorCode==="InvalidRange"||W?.code==="InvalidRange"}class U0 extends z1{config;serviceClientPromise=null;constructor(W={}){super();this.config=W}async serviceClient(){if(this.config.serviceClient)return this.config.serviceClient;return this.serviceClientPromise??=(async()=>{let W;try{W=await import("@azure/storage-blob")}catch{throw Error("AzureBlobDriver requires the '@azure/storage-blob' package. Install it with `bun add @azure/storage-blob`, or pass a pre-built `serviceClient`.")}let J=this.config.connectionString??process.env.AZURE_STORAGE_CONNECTION_STRING;if(this.config.url)return new W.BlobServiceClient(this.config.url,this.config.credential);if(J)return W.BlobServiceClient.fromConnectionString(J);throw Error("AzureBlobDriver needs a connection string (AZURE_STORAGE_CONNECTION_STRING), a `url`, or a `serviceClient`.")})(),this.serviceClientPromise}async blob(W,J){if(!W)throw Error("Object name has to be specified");let Z=J??this.config.container??process.env.BUCKET_NAME;if(!Z)throw Error("AzureBlobDriver needs a container name, from `bucket`, the `container` config, or BUCKET_NAME.");return(await this.serviceClient()).getContainerClient(Z).getBlockBlobClient(W)}async put(W,{signal:J}={}){J?.throwIfAborted();let Z,$,Q,Y;if(W instanceof Blob)Z=W,Q=`${Bun.randomUUIDv7()}.${W.type.split("/")[1].split(";")[0]}`,$=W.type;else Z=W.body,Q=W.name,Y=W.bucket,$=W.contentType??(Z instanceof Blob||Z instanceof File?Z.type:void 0);let G=Z instanceof H0?Z:H0.from(await Z.arrayBuffer()),K=await this.blob(Q,Y);return J?.throwIfAborted(),await K.uploadData(G,{blobHTTPHeaders:$?{blobContentType:$}:void 0,abortSignal:J}),Q}async*objects(W,{bucket:J,signal:Z}={}){Z?.throwIfAborted();let $=J??this.config.container??process.env.BUCKET_NAME;if(!$)throw Error("AzureBlobDriver needs a container name, from `bucket`, the `container` config, or BUCKET_NAME.");let Y=(await this.serviceClient()).getContainerClient($);for await(let G of Y.listBlobsFlat({prefix:W}))Z?.throwIfAborted(),yield{name:G.name,size:G.properties?.contentLength??0,lastModified:G.properties?.lastModified??new Date(0)}}async list(W){let J=this.config.container??process.env.BUCKET_NAME,$=(await this.serviceClient()).getContainerClient(J),Q=[];for await(let Y of $.listBlobsFlat({prefix:W}))Q.push(Y.name);return Q}async fetch(W,{signal:J}={}){J?.throwIfAborted();let Z=await this.download(typeof W==="string"?{name:W}:{name:W.name,bucket:W.bucket},J);return new Response(Z.body,{headers:{"Content-Type":Z.type,"Content-Length":String(Z.total),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":Z.lastModified?.toUTCString()??"",ETag:Z.etag??""}})}async read(W){return this.download(typeof W==="string"?{name:W}:W)}async download(W,J){let{name:Z,bucket:$,range:Q=null}=W,Y=await this.blob(Z,$);J?.throwIfAborted();let G,K,z=Q?.kind==="suffix"||Q?.kind==="offset"&&Q.end===null&&Q.start===0;if(Q&&z){let H=await this.size({name:Z,bucket:$}),m=a1(Q,H);if(!m)throw new i(H);G=m.start,K=m.length}else if(Q?.kind==="offset")G=Q.start,K=Q.end===null?void 0:Q.end-Q.start+1;let X;try{X=await Y.download(G,K,J?{abortSignal:J}:void 0)}catch(H){if(U6(H))throw new i(await this.size({name:Z,bucket:$}));if(s1(H))throw new c(Z);throw H}let B=K1(X.contentRange),M=Boolean(B),D=B?.total??X.contentLength??0,S=await S6(X);if(S instanceof ReadableStream)S=f1(S,J);return J?.throwIfAborted(),{body:S,start:B?.start??0,end:B?.end??D-1,total:D,partial:M,type:X.contentType??"application/octet-stream",etag:X.etag||void 0,lastModified:X.lastModified,name:Z}}async size(W){let J=typeof W==="string"?W:W.name,Z=typeof W==="string"?void 0:W.bucket,$=await this.blob(J,Z);try{return(await $.getProperties()).contentLength??0}catch(Q){if(s1(Q))throw new c(J);throw Q}}async delete(W){let J=typeof W==="string"?W:W.name,Z=typeof W==="string"?void 0:W.bucket,$=await this.blob(J,Z);try{await $.delete()}catch(Q){if(s1(Q))return;throw Q}}}async function S6(W){if(W.blobBody)return await W.blobBody;if(W.readableStreamBody)return H6.toWeb(W.readableStreamBody);return null}function O6(W){return W}var R6=`
3
3
  local currentKey = KEYS[1]
4
4
  local previousKey = KEYS[2]
5
5
  local limit = tonumber(ARGV[1])
@@ -409,7 +409,7 @@ var ISLAND_HYDRATE_SOURCE = `function h(marker, Component) {
409
409
  * The navigation runtime (with the island loader) a static view with
410
410
  * `.static({ navigation })` inlines. Byte-for-byte constant.
411
411
  */
412
- var STATIC_NAVIGATION_SOURCE = "var r=document,i=window,a=history;i.__gemi_nav?.d();var C=new AbortController,h=(t,e,n,s)=>t.addEventListener(e,n,{signal:C.signal,...s}),q=i.__gemi_nav={d:()=>C.abort()},y=(t,e)=>{if(!t.g)t.g=1,import(e.s).then((n)=>{if(t.isConnected)t.r=n.h(t,n.m[e.e])}).catch((n)=>console.error(n))},L=(t)=>{let e=t.getElementById(\"gemi-islands\");return e?JSON.parse(e.textContent):{i:[]}},D=(t,e)=>{for(let n of t.querySelectorAll(\"gemi-island\")){let s=e.i[n.dataset.island];if(!s||n.o)continue;if(s.l==\"eager\")y(n,s);else if(s.l==\"idle\"||!i.IntersectionObserver||!n.children.length)(i.requestIdleCallback||setTimeout)(()=>y(n,s));else{let l=new IntersectionObserver((m)=>{if(m.some((d)=>d.isIntersecting))l.disconnect(),y(n,s)});for(let m of n.children)l.observe(m)}}},R='meta[name=\"gemi-static\"]',A=\"style:not([data-gemi-fonts]),link[rel=stylesheet]\",I='meta[name]:not([name=viewport]),meta[property],link[rel~=canonical],link[rel~=alternate],link[rel~=icon],link[rel=preload][as=font],style[data-gemi-fonts],script[type=\"application/ld+json\"]',w=(t)=>t.querySelector(R)?.content,T=(t)=>[...t.querySelectorAll(A)].map((e)=>e.outerHTML).join(),c=(t)=>t.href.split(\"#\")[0],p=r.createElement(\"div\");p.setAttribute(\"aria-live\",\"polite\");p.style.cssText=\"position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap\";r.body.append(p);var _=(t)=>{q.p={url:location.href,title:r.title,initial:t},r.dispatchEvent(new CustomEvent(\"gemi:page-load\",{detail:q.p}))},f=new Map,O=(t)=>{let e=f.get(t);if(!e||Date.now()-e[0]>30000){let n=fetch(t,{headers:{accept:\"text/html\",\"x-gemi-navigate\":\"1\"},signal:AbortSignal.timeout(1e4)}).then((s)=>{if(!s.ok||!/^text\\/html/.test(s.headers.get(\"content-type\"))||new URL(s.url||t).origin!=location.origin)throw s;return s.text().then((l)=>[s.url||t,l])});e=[Date.now(),n],n.catch(()=>f.get(t)==e&&f.delete(t))}if(f.delete(t),f.set(t,e),f.size>10)f.delete(f.keys().next().value);return e[1]},U=(t)=>{let e=t.target.closest?.(\"a[href]\"),n=e?.getAttribute(\"target\");if(!e||n&&n!=\"_self\"||e.hasAttribute(\"download\")||/(^|\\s)external(\\s|$)/i.test(e.getAttribute(\"rel\"))||e.closest(\"[data-gemi-reload]\"))return;let s=new URL(e.getAttribute(\"href\"),r.baseURI);if(s.origin==location.origin&&!(s.href.includes(\"#\")&&c(s)==c(location)))return s},v={},k=()=>Math.random().toString(36).slice(2),x=()=>a.state?.g||a.replaceState({...a.state,g:k()},\"\"),M=c(location),b=0,K=(t)=>{if(!t.hasAttribute(\"tabindex\"))t.setAttribute(\"tabindex\",\"-1\"),t.addEventListener(\"blur\",()=>t.removeAttribute(\"tabindex\"),{once:!0});t.focus({preventScroll:!0})},N=(t)=>{let e=r.body,n=t.body,s=L(t),l=r.documentElement;r.title=t.title;for(let o of[\"lang\",\"dir\"]){let u=t.documentElement.getAttribute(o);if(u==null)l.removeAttribute(o);else l.setAttribute(o,u)}for(let o of r.head.querySelectorAll(I))o.remove();let m=new Set([...r.querySelectorAll(\"link[rel=modulepreload]\")].map((o)=>o.getAttribute(\"href\")));r.head.append(...t.head.querySelectorAll(I),...[...t.head.querySelectorAll(\"link[rel=modulepreload]\")].filter((o)=>!m.has(o.getAttribute(\"href\"))));let d=new Map([...e.querySelectorAll(\"[data-gemi-persist]\")].map((o)=>[o.dataset.gemiPersist,o])),g=[...n.querySelectorAll(\"[data-gemi-persist]\")].map((o)=>[o,d.get(o.dataset.gemiPersist)]).filter((o)=>o[1]);for(let o of[...e.querySelectorAll(\"gemi-island\")].reverse())if(o.o=1,!g.some((u)=>u[1].contains(o)))try{o.r?.unmount()}catch(u){console.error(u)}for(let[o,u]of g)o.replaceWith(u);for(let o of[...e.childNodes])if(!o.matches?.(A))o.remove();for(let o of[...n.children])if(o.matches(A))o.remove();for(let o of[...e.attributes])e.removeAttribute(o.name);for(let o of n.attributes)e.setAttribute(o.name,o.value);e.append(...n.childNodes,p),D(e,s)},H=async(t,e)=>{let n=++b,s=!e&&v[a.state?.g];a.scrollRestoration=\"manual\";try{let[l,m]=await O(c(t));if(n!=b)return;let d=new DOMParser().parseFromString(m,\"text/html\");if(w(d)==null||w(d)!=w(r)||T(d)!=T(r))throw 0;if(e){let o=new URL(l);o.hash=t.hash,a.pushState({g:k()},\"\",o.href)}M=c(location),N(d);let g=e&&t.hash&&r.getElementById(decodeURIComponent(t.hash.slice(1)));if(g)g.scrollIntoView({behavior:\"instant\"});else i.scrollTo({left:s?.[0]||0,top:s?.[1]||0,behavior:\"instant\"});if(e)K(g||r.querySelector(\"h1\")||r.querySelector(\"main\")||r.body);p.textContent=r.title,_(!1)}catch{if(n!=b)return;if(e)location.assign(t.href);else location.reload()}};h(r,\"click\",(t)=>{if(t.defaultPrevented||t.button||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey)return;let e=U(t);if(e&&r.dispatchEvent(new CustomEvent(\"gemi:before-navigate\",{cancelable:!0,detail:{url:e.href}})))t.preventDefault(),x(),v[a.state.g]=[i.scrollX,i.scrollY],H(e,1)});h(i,\"popstate\",()=>{if(b++,c(location)==M){let t=v[a.state?.g];if(t)i.scrollTo({left:t[0],top:t[1],behavior:\"instant\"})}else if(a.state?.g)H(new URL(location.href),0);else location.reload()});h(i,\"hashchange\",x);h(i,\"scroll\",()=>a.state?.g&&(v[a.state.g]=[i.scrollX,i.scrollY]),{passive:!0});var S,E=(t)=>{if(r.querySelector(R)?.dataset.prefetch==\"none\"||navigator.connection?.saveData)return;let e=U(t);if(e&&c(e)!=c(location))O(c(e))};h(r,\"pointerover\",(t)=>{clearTimeout(S),S=setTimeout(()=>E(t),65)});h(r,\"pointerout\",()=>clearTimeout(S));h(r,\"focusin\",E);h(r,\"touchstart\",E,{passive:!0});x();D(r,L(r));_(!0);";
412
+ var STATIC_NAVIGATION_SOURCE = "var r=document,i=window,a=history;i.__gemi_nav?.d();var L=new AbortController,h=(t,e,n,s)=>t.addEventListener(e,n,{signal:L.signal,...s}),q=i.__gemi_nav={d:()=>L.abort()},v=(t,e)=>{if(!t.g)t.g=1,import(e.s).then((n)=>{if(t.isConnected)t.r=n.h(t,n.m[e.e])}).catch((n)=>console.error(n))},D=(t)=>{let e=t.getElementById(\"gemi-islands\");return e?JSON.parse(e.textContent):{i:[]}},R=(t,e)=>{for(let n of t.querySelectorAll(\"gemi-island\")){let s=e.i[n.dataset.island];if(!s||n.o)continue;if(s.l==\"eager\")v(n,s);else if(s.l==\"idle\"||!i.IntersectionObserver||!n.children.length)(i.requestIdleCallback||setTimeout)(()=>v(n,s));else{let l=new IntersectionObserver((m)=>{if(m.some((d)=>d.isIntersecting))l.disconnect(),v(n,s)});for(let m of n.children)l.observe(m)}}},O='meta[name=\"gemi-static\"]',A=\"style:not([data-gemi-fonts])\",T=A+\",link[rel=stylesheet]\",K=`head>${A},body>${A},link[rel=stylesheet]`,I='meta[name]:not([name=viewport]),meta[property],link[rel~=canonical],link[rel~=alternate],link[rel~=icon],link[rel=preload][as=font],style[data-gemi-fonts],script[type=\"application/ld+json\"]',w=(t)=>t.querySelector(O)?.content,C=(t)=>[...t.querySelectorAll(K)].map((e)=>e.outerHTML).join(),c=(t)=>t.href.split(\"#\")[0],p=r.createElement(\"div\");p.setAttribute(\"aria-live\",\"polite\");p.style.cssText=\"position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap\";r.body.append(p);var _=(t)=>{q.p={url:location.href,title:r.title,initial:t},r.dispatchEvent(new CustomEvent(\"gemi:page-load\",{detail:q.p}))},f=new Map,k=(t)=>{let e=f.get(t);if(!e||Date.now()-e[0]>30000){let n=fetch(t,{headers:{accept:\"text/html\",\"x-gemi-navigate\":\"1\"},signal:AbortSignal.timeout(1e4)}).then((s)=>{if(!s.ok||!/^text\\/html/.test(s.headers.get(\"content-type\"))||new URL(s.url||t).origin!=location.origin)throw s;return s.text().then((l)=>[s.url||t,l])});e=[Date.now(),n],n.catch(()=>f.get(t)==e&&f.delete(t))}if(f.delete(t),f.set(t,e),f.size>10)f.delete(f.keys().next().value);return e[1]},M=(t)=>{let e=t.target.closest?.(\"a[href]\"),n=e?.getAttribute(\"target\");if(!e||n&&n!=\"_self\"||e.hasAttribute(\"download\")||/(^|\\s)external(\\s|$)/i.test(e.getAttribute(\"rel\"))||e.closest(\"[data-gemi-reload]\"))return;let s=new URL(e.getAttribute(\"href\"),r.baseURI);if(s.origin==location.origin&&!(s.href.includes(\"#\")&&c(s)==c(location)))return s},y={},U=()=>Math.random().toString(36).slice(2),E=()=>a.state?.g||a.replaceState({...a.state,g:U()},\"\"),P=c(location),b=0,N=(t)=>{if(!t.hasAttribute(\"tabindex\"))t.setAttribute(\"tabindex\",\"-1\"),t.addEventListener(\"blur\",()=>t.removeAttribute(\"tabindex\"),{once:!0});t.focus({preventScroll:!0})},Y=(t)=>{let e=r.body,n=t.body,s=D(t),l=r.documentElement;r.title=t.title;for(let o of[\"lang\",\"dir\"]){let u=t.documentElement.getAttribute(o);if(u==null)l.removeAttribute(o);else l.setAttribute(o,u)}for(let o of r.head.querySelectorAll(I))o.remove();let m=new Set([...r.querySelectorAll(\"link[rel=modulepreload]\")].map((o)=>o.getAttribute(\"href\")));r.head.append(...t.head.querySelectorAll(I),...[...t.head.querySelectorAll(\"link[rel=modulepreload]\")].filter((o)=>!m.has(o.getAttribute(\"href\"))));let d=new Map([...e.querySelectorAll(\"[data-gemi-persist]\")].map((o)=>[o.dataset.gemiPersist,o])),g=[...n.querySelectorAll(\"[data-gemi-persist]\")].map((o)=>[o,d.get(o.dataset.gemiPersist)]).filter((o)=>o[1]);for(let o of[...e.querySelectorAll(\"gemi-island\")].reverse())if(o.o=1,!g.some((u)=>u[1].contains(o)))try{o.r?.unmount()}catch(u){console.error(u)}for(let[o,u]of g)o.replaceWith(u);for(let o of[...e.childNodes])if(!o.matches?.(T))o.remove();for(let o of[...n.children])if(o.matches(T))o.remove();for(let o of[...e.attributes])e.removeAttribute(o.name);for(let o of n.attributes)e.setAttribute(o.name,o.value);e.append(...n.childNodes,p),R(e,s)},H=async(t,e)=>{let n=++b,s=!e&&y[a.state?.g];a.scrollRestoration=\"manual\";try{let[l,m]=await k(c(t));if(n!=b)return;let d=new DOMParser().parseFromString(m,\"text/html\");if(w(d)==null||w(d)!=w(r)||C(d)!=C(r))throw 0;if(e){let o=new URL(l);o.hash=t.hash,a.pushState({g:U()},\"\",o.href)}P=c(location),Y(d);let g=e&&t.hash&&r.getElementById(decodeURIComponent(t.hash.slice(1)));if(g)g.scrollIntoView({behavior:\"instant\"});else i.scrollTo({left:s?.[0]||0,top:s?.[1]||0,behavior:\"instant\"});if(e)N(g||r.querySelector(\"h1\")||r.querySelector(\"main\")||r.body);p.textContent=r.title,_(!1)}catch{if(n!=b)return;if(e)location.assign(t.href);else location.reload()}};h(r,\"click\",(t)=>{if(t.defaultPrevented||t.button||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey)return;let e=M(t);if(e&&r.dispatchEvent(new CustomEvent(\"gemi:before-navigate\",{cancelable:!0,detail:{url:e.href}})))t.preventDefault(),E(),y[a.state.g]=[i.scrollX,i.scrollY],H(e,1)});h(i,\"popstate\",()=>{if(b++,c(location)==P){let t=y[a.state?.g];if(t)i.scrollTo({left:t[0],top:t[1],behavior:\"instant\"})}else if(a.state?.g)H(new URL(location.href),0);else location.reload()});h(i,\"hashchange\",E);h(i,\"scroll\",()=>a.state?.g&&(y[a.state.g]=[i.scrollX,i.scrollY]),{passive:!0});var S,x=(t)=>{if(r.querySelector(O)?.dataset.prefetch==\"none\"||navigator.connection?.saveData)return;let e=M(t);if(e&&c(e)!=c(location))k(c(e))};h(r,\"pointerover\",(t)=>{clearTimeout(S),S=setTimeout(()=>x(t),65)});h(r,\"pointerout\",()=>clearTimeout(S));h(r,\"focusin\",x);h(r,\"touchstart\",x,{passive:!0});E();R(r,D(r));_(!0);";
413
413
  //#endregion
414
414
  //#region testing/staticDocument.ts
415
415
  var hydrate = new Function("createElement", "hydrateRoot", `${ISLAND_HYDRATE_SOURCE};return h;`)(createElement, hydrateRoot);