nebulosity 1.0.0 → 1.1.0
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.
- package/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +11 -11
- package/.next/diagnostics/route-bundle-stats.json +10 -10
- package/.next/fallback-build-manifest.json +3 -3
- package/.next/prerender-manifest.json +5 -5
- package/.next/server/app/_global-error/page/build-manifest.json +3 -3
- package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page/build-manifest.json +3 -3
- package/.next/server/app/_not-found/page/next-font-manifest.json +2 -3
- package/.next/server/app/_not-found/page.js +3 -2
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +27 -20
- package/.next/server/app/_not-found.segments/_full.segment.rsc +27 -20
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +34 -26
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +29 -23
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +33 -24
- package/.next/server/app/index.segments/_full.segment.rsc +29 -23
- package/.next/server/app/index.segments/_tree.segment.rsc +4 -5
- package/.next/server/app/page/build-manifest.json +3 -3
- package/.next/server/app/page/next-font-manifest.json +2 -3
- package/.next/server/app/page.js +4 -4
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__06blyow8irfw3._.js +3 -3
- package/.next/server/chunks/[root-of-the-server]__0bmqko-d8fd5k._.js +3 -3
- package/.next/server/chunks/[root-of-the-server]__0cmmlmvta4i0g._.js +3 -3
- package/.next/server/chunks/[root-of-the-server]__0jgr1dt1j95ku._.js +3 -3
- package/.next/server/chunks/[root-of-the-server]__0m0n163465-zb._.js +3 -3
- package/.next/server/chunks/[root-of-the-server]__0p7epsgp2b5m3._.js +3 -3
- package/.next/server/chunks/[root-of-the-server]__1i5e5sqg45ens._.js +3 -3
- package/.next/server/chunks/[root-of-the-server]__1vjt0neva-819._.js +3 -3
- package/.next/server/chunks/_0uqus0ehnijt-._.js +1 -1
- package/.next/server/chunks/lib_background_start_ts_11u_1uu8b9yuy._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0_3l5tdzqy-td._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__10ockmlli-lun._.js +3 -0
- package/.next/server/chunks/ssr/{[root-of-the-server]__0dyligeswbb47._.js → [root-of-the-server]__16-gclvix9mjd._.js} +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__1auodc3c0rppy._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1cf6qt9agg_9-._.js +3 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__1i9r59yk4i69p._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1l3qp8u9yc_ig._.js +3 -0
- package/.next/server/chunks/ssr/_1p-0wsx9qfm68._.js +13 -0
- package/.next/server/chunks/ssr/app_map_18iu6j19jsqmu._.js +3 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_1r3iqtbm45lqp._.js +3 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_global-error_0q-w892nagajq.js +3 -0
- package/.next/server/middleware-build-manifest.js +11 -11
- package/.next/server/next-font-manifest.js +1 -1
- package/.next/server/next-font-manifest.json +4 -6
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/preview-props.json +3 -3
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/{1rljem7o1jtdo.js → 18kfexnrqek07.js} +1 -1
- package/.next/static/chunks/1hwbgd4nvvhg8.js +1 -0
- package/.next/static/chunks/25r4lkkf1shfo.css +3 -0
- package/.next/static/chunks/35ubvk2ivdjgs.js +1 -0
- package/.next/static/chunks/3ieqvmcg3hofj.js +31 -0
- package/.next/static/chunks/3w00e1w2125pp.js +11 -0
- package/.next/static/media/733da6bd8dac84c8-s.3hlisc-pwq13z.woff2 +0 -0
- package/.next/static/media/784318cea1dfcfa4-s.0-oo9_1x_xmvg.woff2 +0 -0
- package/.next/static/media/7e114457660b62ed-s.36fqqi66-3tjb.woff2 +0 -0
- package/.next/static/media/85e86a88f68a624a-s.357dd_6abeqge.woff2 +0 -0
- package/.next/static/media/9a321a2c78eff0b5-s.p.1bkzbscqrt8rl.woff2 +0 -0
- package/.next/static/media/9fecbd3e5ea9bccb-s.3_z45zcoc-xoz.woff2 +0 -0
- package/.next/static/media/c64053b510252f55-s.1kd-r_s9smv5m.woff2 +0 -0
- package/.next/static/media/c6a5c2fdc12da45c-s.p.17-aodiw50953.woff2 +0 -0
- package/.next/static/media/f263782c6a4bddee-s.1gyfqm5yhhzs7.woff2 +0 -0
- package/.next/trace +1 -1
- package/.next/trace-build +1 -1
- package/README.md +13 -4
- package/app/globals.css +91 -54
- package/app/layout.tsx +20 -11
- package/app/map/BackButton.tsx +5 -5
- package/app/map/BoxActions.tsx +20 -12
- package/app/map/Breadcrumb.tsx +132 -46
- package/app/map/DetailPanel.tsx +408 -297
- package/app/map/Explorer.tsx +268 -0
- package/app/map/Header.tsx +105 -0
- package/app/map/HelpDialog.tsx +37 -34
- package/app/map/Legend.tsx +19 -75
- package/app/map/LineCard.tsx +187 -0
- package/app/map/MapBox.tsx +73 -38
- package/app/map/MapCanvas.tsx +344 -115
- package/app/map/MapToolbar.tsx +377 -0
- package/app/map/MapView.tsx +217 -213
- package/app/map/RepoMenu.tsx +13 -12
- package/app/map/RoutedEdge.tsx +48 -16
- package/app/map/SearchPalette.tsx +6 -6
- package/app/map/SourceViewer.tsx +19 -17
- package/app/map/StatusBar.tsx +166 -0
- package/app/map/embed.ts +22 -2
- package/app/map/emphasis.ts +94 -8
- package/app/map/explorerRows.ts +85 -0
- package/app/map/flowNodes.ts +12 -7
- package/app/map/format.ts +2 -2
- package/app/map/history.ts +4 -3
- package/app/map/inspector.ts +113 -0
- package/app/map/labels.ts +66 -7
- package/app/map/narrow.ts +165 -85
- package/app/map/opening.ts +16 -0
- package/app/map/portals.ts +2 -2
- package/app/map/routes.ts +1060 -55
- package/app/map/runs.ts +108 -0
- package/app/map/shell.ts +91 -0
- package/app/map/shortcuts.ts +2 -1
- package/app/map/summaries.ts +41 -5
- package/app/map/text.ts +9 -1
- package/app/map/theme.ts +197 -0
- package/app/map/useDismiss.ts +20 -6
- package/app/map/useEditorBridge.ts +12 -1
- package/app/map/useThemeKind.ts +28 -0
- package/app/map/useWindowSize.ts +37 -0
- package/app/map/viewport.ts +134 -16
- package/app/map/weights.ts +80 -0
- package/app/page.tsx +3 -5
- package/lib/background/child.ts +2 -0
- package/lib/background/service.ts +26 -10
- package/lib/contracts.ts +25 -2
- package/lib/db/migrations/0011_plain_summaries_prompt_version.sql +1 -0
- package/lib/db/migrations/meta/0011_snapshot.json +1498 -0
- package/lib/db/migrations/meta/_journal.json +7 -0
- package/lib/db/schema.ts +2 -1
- package/lib/db/store/map.ts +6 -0
- package/lib/db/store/summaries.ts +14 -8
- package/lib/engine/describe.ts +2 -0
- package/lib/index/summarize/budget.ts +5 -2
- package/lib/index/summarize/claude.ts +19 -4
- package/lib/index/summarize/compare.ts +2 -2
- package/lib/index/summarize/plan.ts +73 -13
- package/lib/index/summarize/preview.ts +12 -9
- package/lib/index/summarize/prompts.ts +122 -25
- package/lib/index/summarize/run.ts +48 -18
- package/lib/index/summarize/snapshot.ts +7 -2
- package/lib/index/summarize/status.ts +3 -2
- package/lib/tools/text.ts +3 -2
- package/mcp/server.ts +1 -1
- package/package.json +4 -2
- package/scripts/commands/summarize-command.ts +27 -9
- package/.next/server/chunks/ssr/[root-of-the-server]__0ekw8p2ramybv._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__0fwbsqt9e2tr-._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__17_rqmx62cz59._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__1zfp6sltse4hf._.js +0 -3
- package/.next/server/chunks/ssr/_1d2woi6toj_0_._.js +0 -3
- package/.next/server/chunks/ssr/_1wfc1zz26g5ji._.js +0 -9
- package/.next/server/chunks/ssr/app_0gw6epmxyea3q._.js +0 -3
- package/.next/server/chunks/ssr/node_modules_@swc_helpers_cjs__interop_require_default_cjs_1ztp13a5szri_._.js +0 -3
- package/.next/server/chunks/ssr/node_modules_next_dist_1c5t_vsn6u8fr._.js +0 -3
- package/.next/static/chunks/02x9pxyl2d8om.css +0 -3
- package/.next/static/chunks/0p-0bv2dzer18.js +0 -7
- package/.next/static/chunks/10u7p2gj02qay.js +0 -1
- package/.next/static/chunks/31qp8jfkw0x2h.js +0 -31
- package/.next/static/media/123d516c9baeb953-s.1qc6dx89jd2qv.woff2 +0 -0
- package/.next/static/media/41ba59f553543ecf-s.3cb5lpr2l6xud.woff2 +0 -0
- package/.next/static/media/44ed10da57ebfb0e-s.2y65deuc30pmy.woff2 +0 -0
- package/.next/static/media/48eea41d8317494f-s.p.0wiir8udbzjvx.woff2 +0 -0
- package/.next/static/media/49b1d53681a91a99-s.1yd4_i3e35931.woff2 +0 -0
- package/.next/static/media/67bba87670b402d1-s.1u30mmyq6lnsd.woff2 +0 -0
- package/.next/static/media/6fca7e74603dd412-s.02z5rrbg5nt92.woff2 +0 -0
- package/.next/static/media/73263b2957b73100-s.2qt3tdwt-y9x_.woff2 +0 -0
- package/.next/static/media/7ac0b1cd3e695dd0-s.1i-sca43-qwng.woff2 +0 -0
- package/.next/static/media/916cd8a3bde3edf8-s.p.0oace-s_gkfks.woff2 +0 -0
- package/.next/static/media/a45aa1001bf9176f-s.2vemzm0itqzfy.woff2 +0 -0
- package/.next/static/media/a74d2542cc4c775f-s.29yke99gs9qpn.woff2 +0 -0
- package/.next/static/media/ab664c0e419cc841-s.3cvcemwuzoywn.woff2 +0 -0
- package/.next/static/media/c1b11b726b36a5e5-s.2rixgazldzomk.woff2 +0 -0
- package/.next/static/media/d6c1ff7e86974212-s.p.40sczeszzbjw1.woff2 +0 -0
- package/.next/static/media/faab88e4be272d29-s.0rgnxg2b64rzs.woff2 +0 -0
- package/app/map/ActivityBar.tsx +0 -81
- package/app/map/StatusPill.tsx +0 -93
- package/app/map/TopBar.tsx +0 -84
- /package/.next/static/{prDi039MhjlFqDOOwZ4aR → of6twfEZ3j95xtfQB_NSL}/_buildManifest.js +0 -0
- /package/.next/static/{prDi039MhjlFqDOOwZ4aR → of6twfEZ3j95xtfQB_NSL}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{prDi039MhjlFqDOOwZ4aR → of6twfEZ3j95xtfQB_NSL}/_ssgManifest.js +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(()=>{"use strict";module.exports=[81864,e=>{var t=e.i(89171),r=e.i(14747),a=e.i(90793),n=e.i(86812),i=e.i(37756),o=e.i(89963),s=e.i(27074),l=e.i(30596),u=e.i(75225),d=e.i(49129),c=e.i(14674);function h(e,t){return e.select({path:c.docs.path,title:c.docs.title}).from(c.docs).where((0,u.u)(c.docs.repoId,t)).orderBy((0,d.M)(c.docs.path)).all()}let p={docPath:c.docLinks.docPath,targetPath:c.docLinks.targetPath,kind:c.docLinks.kind,count:c.docLinks.count,detail:c.docLinks.detail},f=["architecture","design","overview","organization","organisation","structure","contributing","agents","claude","copilot-instructions","conventions","layers"],m={applies:3,readme:2,mentions:1},g=(e,t)=>e<t?-1:+(e>t),w=e=>""===e?0:e.split("/").length,v=e=>{var t;return"applies"===e.kind&&(t=e.detail??"",/^[^*?[{]*\/\*\*$/.test(t))?1:0};function P(e){let t=e.slice(e.lastIndexOf("/")+1).toLowerCase().replace(/\.(md|mdx|mdc)$/,"");return f.some(e=>t.includes(e))}let x=(e,t)=>{for(let r=0;r<e.length;r++)if(e[r]!==t[r])return t[r]-e[r];return 0},R=(e,t)=>({path:e.docPath,title:t,reason:{kind:e.kind,target:e.targetPath,...null!==e.detail?{detail:e.detail}:{},count:e.count}});e.i(98815);var y=e.i(98400),k=e.i(95179);let b=new Map;var E=e.i(14110),C=e.i(8877);e.s(["GET",0,function(e){let f=(0,C.j)();if(null===f)return(0,C.E)();let T=(0,l.L)(e.nextUrl.searchParams.get("path")??"");if(null===T)return(0,C.N)();try{return t.NextResponse.json(function(e,t,f={}){let E=(0,a.$)(),C=(0,l._)(r.default.resolve(e)),T=(0,i.I)(E,C),O=f.summariesOff??!1;return E.transaction(()=>{let e=(0,o.f)(E,T),r=`${T}\0${C}`,a=b.get(r);a&&a.version===e||(a={version:e,answers:new Map},b.set(r,a));let i=`${O?"off":"on"}\0${t}`,f=a.answers.get(i);if(f)return f;let A=function(e,t,r,a,i,o){var f;let b,E=(0,n.O)(e,r,i),C=E?null:(0,n.k)(e,r,i);if(!E&&!C)throw new k.f(i);let T=E?""===i?"repo":"folder":"file",O=(0,n.n)(e,r,T,i),A=(0,k.D)(O,o),{uses:L,usedBy:M}=(0,y.S)(e,r,a,i,T),S="repo"===T?function(e,t,r=5){let a=[],n=e=>{a.length<r&&!a.some(t=>t.path===e.path)&&a.push(e)},i=new Map;for(let e of t)"mentions"===e.kind&&i.set(e.docPath,(i.get(e.docPath)??0)+1);let o=e.find(e=>/^readme\.mdx?$/i.test(e.path));o&&n({path:o.path,title:o.title});let s=new Set(t.filter(e=>"applies"===e.kind&&""!==e.targetPath).map(e=>e.docPath));e.filter(e=>P(e.path)).sort((e,t)=>Number(s.has(t.path))-Number(s.has(e.path))||w(e.path)-w(t.path)||(i.get(t.path)??0)-(i.get(e.path)??0)||g(e.path,t.path)).forEach(e=>n({path:e.path,title:e.title}));let l=new Map(e.map(e=>[e.path,e.title]));return t.filter(e=>"applies"===e.kind).sort((e,t)=>w(e.targetPath)-w(t.targetPath)||v(t)-v(e)||g(e.docPath,t.docPath)).forEach(e=>n(R(e,l.get(e.docPath)??e.docPath))),a}(h(e,r),e.select(p).from(c.docLinks).where((0,u.u)(c.docLinks.repoId,r)).orderBy((0,d.M)(c.docLinks.docPath),(0,d.M)(c.docLinks.targetPath),(0,d.M)(c.docLinks.kind)).all()):0===(b=0===(f=function(e){let t=[];for(let r=e;""!==r;r=(0,l.a)(r))t.push(r);return t}(i)).length?[]:e.select(p).from(c.docLinks).where((0,u.b)((0,u.u)(c.docLinks.repoId,r),(0,u.y)(c.docLinks.targetPath,[...f]))).all()).length?[]:function(e,t,r=5){let a=e=>[m[e.kind],w(e.targetPath),v(e),e.count],n=new Map;for(let t of e){let e=n.get(t.docPath);(!e||0>x(a(t),a(e)))&&n.set(t.docPath,t)}let i=e=>[m[e.kind],w(e.targetPath),v(e),Number(P(e.docPath)),e.count];return[...n.values()].sort((e,t)=>x(i(e),i(t))||g(e.docPath,t.docPath)).slice(0,r).map(e=>R(e,t.get(e.docPath)??e.docPath))}(b,new Map(h(e,r).map(e=>[e.path,e.title])));return{repo:t,path:i,kind:T,...O?.tagline?{tagline:O.tagline,summary:O.summary??""}:{},summaryStatus:A,..."failed"===A&&O?.error?{summaryError:O.error}:{},...S.length>0?{docs:S}:{},stats:E?{fileCount:E.fileCount,lineCount:(0,n.F)(e,r,i)}:{fileCount:1,lineCount:C.lineCount},...E?{children:(0,k.P)(e,r,i,o)}:{symbols:(0,n.o)(e,r,i)},...C&&C.sizeBytes>s.f?{importsOnly:!0}:{},uses:L,usedBy:M,stalePaths:(0,n.H)(e,r,i,T),indexVersion:a}}(E,C,T,e,t,O);return a.answers.size>=2e3&&a.answers.clear(),a.answers.set(i,A),A})}(f,T,{summariesOff:!(0,E.f)()}))}catch(e){return(0,C.i)(e)}},"runtime",0,"nodejs"],81864)},98124,e=>{var t=e.i(47909),r=e.i(74017),a=e.i(96250),n=e.i(59756),i=e.i(61916),o=e.i(74677),s=e.i(69741),l=e.i(16795),u=e.i(87718),d=e.i(95169),c=e.i(47587),h=e.i(66012),p=e.i(70101),f=e.i(26937),m=e.i(10372),g=e.i(93695),w=e.i(9580);e.i(52474);var v=e.i(220);let P=new t.AppRouteRouteModule({definition:{kind:r.f.APP_ROUTE,page:"/api/describe/route",pathname:"/api/describe",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/describe/route.ts",nextConfigOutput:"",userland:()=>e.r(81864),...{}}),{workAsyncStorage:x,workUnitAsyncStorage:R,serverHooks:y}=P;async function k(e,t,r){r.requestMeta&&(0,n.R)(e,r.requestMeta),P.isDev&&(0,n.i)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let a="/api/describe/route";a=a.replace(/\/index$/,"")||"/";let{instrumentation:o}=await P.ensureInstrumentation(e,{deferSpans:!0});return P.traceRequest(e,{tracer:(0,i.v)(),spanName:`${e.method||"GET"} ${a}`,httpTarget:e.url,instrumentation:o},(n,i)=>b(e,t,r,a,!1,n,i))}async function b(e,t,a,x,R,y,k){let b=await P.prepare(e,t,{srcPage:x,multiZoneDraftMode:R});if(!b)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:E,deploymentId:C,params:T,nextConfig:O,parsedUrl:A,isDraftMode:L,prerenderManifest:M,routerServerContext:S,isOnDemandRevalidate:U,revalidateOnlyGenerated:I,resolvedPathname:$,clientReferenceManifest:N,serverActionsManifest:q,previewProps:_}=b,D=(0,s.f)(x),j=!!M.routes[$]&&(P.isDev||(0,w.f)($,P.cacheOwner,M.routes[$])),H=!!(M.dynamicRoutes[D]||j),G=async()=>((null==S?void 0:S.render404)?await S.render404(e,t,A,!1):t.end("This page could not be found"),null);if(H&&!L){let e=M.dynamicRoutes[D];if(e&&!1===e.fallback&&!j){if(O.adapterPath)return await G();throw new g.NoFallbackError}}let B=null;!H||P.isDev||L||(B="/index"===(B=$)?"/":B),q&&N&&(0,o.f)({page:x,clientReferenceManifest:N,serverActionsManifest:q});let F=e.method||"GET",z=(0,i.v)(),K=!!(null==S?void 0:S.isWrappedByNextServer),V=!!(0,n.w)(e,"minimalMode"),J=(0,n.w)(e,"incrementalCache")||await P.getIncrementalCache(e,O,_,M,V);null==J||J.resetRequestCache(),globalThis.__incrementalCache=J;let Q={params:T,previewProps:_,renderOpts:{experimental:{authInterrupts:!!O.experimental.authInterrupts,useCacheTimeout:O.experimental.useCacheTimeout,durableUseCacheEntries:!!O.experimental.durableUseCacheEntries},cacheComponents:!!O.cacheComponents,validationLevel:O.experimental.instantInsights.validationLevel,isDraftMode:L,incrementalCache:J,hmrRefreshHash:(0,n.w)(e,"hmrRefreshHash"),cacheLifeProfiles:O.cacheLife,staticPageGenerationTimeout:O.staticPageGenerationTimeout,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0},sharedContext:{buildId:E,deploymentId:C}},W=new l.x(e),X=new l.e(t),Y=u.k.fromNodeNextRequest(W,(0,u.t)(t)),Z=async({previousCacheEntry:r})=>{try{if(!V&&U&&I&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let n=null===B?await P.handle(Y,Q):await P.prerender(Y,Q);e.fetchMetrics=Q.renderOpts.fetchMetrics;let i=Q.renderOpts.pendingWaitUntil;i&&a.waitUntil&&(a.waitUntil(i),i=void 0);let o=Q.renderOpts.collectedTags;if(!H)return await (0,h.f)(W,X,n,i),null;{let e=await n.blob(),t=(0,p.S)(n.headers);o&&(t[m.M]=o),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==Q.renderOpts.collectedRevalidate&&!(Q.renderOpts.collectedRevalidate>=m.Q)&&Q.renderOpts.collectedRevalidate,a=void 0===Q.renderOpts.collectedExpire||Q.renderOpts.collectedExpire>=m.Q?!1!==r&&r>0?O.expireTime:void 0:Q.renderOpts.collectedExpire;return{value:{kind:v.x.APP_ROUTE,status:n.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await P.onRequestError(e,t,{routerKind:"App Router",routePath:x,routeType:"route",revalidateReason:(0,c.f)({isStaticGeneration:null!==B,isOnDemandRevalidate:U})},!1,S),t}},ee=async n=>{try{var o,s;let n=await P.handleResponse({req:e,nextConfig:O,cacheKey:B,routeKind:r.f.APP_ROUTE,isFallback:!1,previewProps:_,prerenderManifest:M,isRoutePPREnabled:!1,isOnDemandRevalidate:U,revalidateOnlyGenerated:I,responseGenerator:Z,waitUntil:a.waitUntil,isMinimalMode:V});if(null!==n&&"error"in n)throw n.error;if(!H)return;if((null==n||null==(o=n.value)?void 0:o.kind)!==v.x.APP_ROUTE)throw Error(`Invariant: app-route received invalid cache entry ${null==n||null==(s=n.value)?void 0:s.kind}`);V||t.setHeader("x-nextjs-cache",U?"REVALIDATED":n.isMiss?"MISS":n.isStale?"STALE":"HIT"),L&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let i=(0,p.G)(n.value.headers);V&&H||i.delete(m.M),!n.cacheControl||t.getHeader("Cache-Control")||i.get("Cache-Control")||i.set("Cache-Control",(0,f.f)(n.cacheControl)),await (0,h.f)(W,X,new Response(n.value.body,{headers:i,status:n.value.status||200}));return}catch(r){if(r instanceof g.NoFallbackError||await P.onRequestError(e,r,{routerKind:"App Router",routePath:D,routeType:"route",revalidateReason:(0,c.f)({isStaticGeneration:null!==B,isOnDemandRevalidate:U})},!1,S),H)throw r;if(t.headersSent){if(n){let e=r instanceof Error?r:Error("Unknown app route error");n.recordException(e),n.setStatus({code:i.J.ERROR,message:e.message}),n.setAttribute("error.type",e.name)}t.writableEnded||t.destroyed||t.end()}else await (0,h.f)(W,X,new Response(null,{status:500}));return}finally{(()=>{if(!n)return;let e=t.statusCode;n.setAttributes({"http.status_code":e,"next.rsc":!1}),e&&e>=500&&(n.setStatus({code:i.J.ERROR}),n.setAttribute("error.type",e.toString()));let r=z.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==d.q.handleRequest)return console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=r.get("next.route")||D,o=`${F} ${a}`;n.setAttributes({"next.route":a,"http.route":a,"next.span_name":o}),n.updateName(o),k&&k!==n&&(k.setAttribute("http.route",a),k.updateName(o))})()}};K||void 0===e.url||null==y||y.setAttribute("http.target",e.url),await ee(y)}e.s(["handler",0,k,"patchFetch",0,function(){return(0,a.f)({workAsyncStorage:x,workUnitAsyncStorage:R})},"routeModule",0,P,"serverHooks",0,y,"workAsyncStorage",0,x,"workUnitAsyncStorage",0,R])}]})();
|
|
1
|
+
(()=>{"use strict";module.exports=[81864,e=>{var t=e.i(89171),r=e.i(14747),a=e.i(90793),n=e.i(86812),i=e.i(37756),o=e.i(89963),s=e.i(27074),l=e.i(30596),u=e.i(98815),d=e.i(75225),c=e.i(49129),h=e.i(14674);function p(e,t){return e.select({path:h.docs.path,title:h.docs.title}).from(h.docs).where((0,d.u)(h.docs.repoId,t)).orderBy((0,c.M)(h.docs.path)).all()}let f={docPath:h.docLinks.docPath,targetPath:h.docLinks.targetPath,kind:h.docLinks.kind,count:h.docLinks.count,detail:h.docLinks.detail},m=["architecture","design","overview","organization","organisation","structure","contributing","agents","claude","copilot-instructions","conventions","layers"],g={applies:3,readme:2,mentions:1},w=(e,t)=>e<t?-1:+(e>t),v=e=>""===e?0:e.split("/").length,P=e=>{var t;return"applies"===e.kind&&(t=e.detail??"",/^[^*?[{]*\/\*\*$/.test(t))?1:0};function y(e){let t=e.slice(e.lastIndexOf("/")+1).toLowerCase().replace(/\.(md|mdx|mdc)$/,"");return m.some(e=>t.includes(e))}let x=(e,t)=>{for(let r=0;r<e.length;r++)if(e[r]!==t[r])return t[r]-e[r];return 0},R=(e,t)=>({path:e.docPath,title:t,reason:{kind:e.kind,target:e.targetPath,...null!==e.detail?{detail:e.detail}:{},count:e.count}});var k=e.i(98400),b=e.i(95179);let C=new Map;var E=e.i(14110),T=e.i(8877);e.s(["GET",0,function(e){let m=(0,T.j)();if(null===m)return(0,T.E)();let O=(0,l.L)(e.nextUrl.searchParams.get("path")??"");if(null===O)return(0,T.N)();try{return t.NextResponse.json(function(e,t,m={}){let E=(0,a.$)(),T=(0,l._)(r.default.resolve(e)),O=(0,i.I)(E,T),A=m.summariesOff??!1;return E.transaction(()=>{let e=(0,o.f)(E,O),r=`${O}\0${T}`,a=C.get(r);a&&a.version===e||(a={version:e,answers:new Map},C.set(r,a));let i=`${A?"off":"on"}\0${t}`,m=a.answers.get(i);if(m)return m;let L=function(e,t,r,a,i,o){var m;let C,E=(0,n.O)(e,r,i),T=E?null:(0,n.k)(e,r,i);if(!E&&!T)throw new b.f(i);let O=E?""===i?"repo":"folder":"file",A=(0,n.n)(e,r,O,i),L=(0,b.D)(A,o),{uses:M,usedBy:S}=(0,k.S)(e,r,a,i,O),U="repo"===O?function(e,t,r=5){let a=[],n=e=>{a.length<r&&!a.some(t=>t.path===e.path)&&a.push(e)},i=new Map;for(let e of t)"mentions"===e.kind&&i.set(e.docPath,(i.get(e.docPath)??0)+1);let o=e.find(e=>/^readme\.mdx?$/i.test(e.path));o&&n({path:o.path,title:o.title});let s=new Set(t.filter(e=>"applies"===e.kind&&""!==e.targetPath).map(e=>e.docPath));e.filter(e=>y(e.path)).sort((e,t)=>Number(s.has(t.path))-Number(s.has(e.path))||v(e.path)-v(t.path)||(i.get(t.path)??0)-(i.get(e.path)??0)||w(e.path,t.path)).forEach(e=>n({path:e.path,title:e.title}));let l=new Map(e.map(e=>[e.path,e.title]));return t.filter(e=>"applies"===e.kind).sort((e,t)=>v(e.targetPath)-v(t.targetPath)||P(t)-P(e)||w(e.docPath,t.docPath)).forEach(e=>n(R(e,l.get(e.docPath)??e.docPath))),a}(p(e,r),e.select(f).from(h.docLinks).where((0,d.u)(h.docLinks.repoId,r)).orderBy((0,c.M)(h.docLinks.docPath),(0,c.M)(h.docLinks.targetPath),(0,c.M)(h.docLinks.kind)).all()):0===(C=0===(m=function(e){let t=[];for(let r=e;""!==r;r=(0,l.a)(r))t.push(r);return t}(i)).length?[]:e.select(f).from(h.docLinks).where((0,d.b)((0,d.u)(h.docLinks.repoId,r),(0,d.y)(h.docLinks.targetPath,[...m]))).all()).length?[]:function(e,t,r=5){let a=e=>[g[e.kind],v(e.targetPath),P(e),e.count],n=new Map;for(let t of e){let e=n.get(t.docPath);(!e||0>x(a(t),a(e)))&&n.set(t.docPath,t)}let i=e=>[g[e.kind],v(e.targetPath),P(e),Number(y(e.docPath)),e.count];return[...n.values()].sort((e,t)=>x(i(e),i(t))||w(e.docPath,t.docPath)).slice(0,r).map(e=>R(e,t.get(e.docPath)??e.docPath))}(C,new Map(p(e,r).map(e=>[e.path,e.title])));return{repo:t,path:i,kind:O,...A?.tagline?{tagline:A.tagline,summary:A.summary??""}:{},summaryStatus:L,..."failed"===L&&A?.error?{summaryError:A.error}:{},...A&&(0,u.C)(A)?{summaryOlderStyle:!0}:{},...U.length>0?{docs:U}:{},stats:E?{fileCount:E.fileCount,lineCount:(0,n.F)(e,r,i)}:{fileCount:1,lineCount:T.lineCount},...E?{children:(0,b.P)(e,r,i,o)}:{symbols:(0,n.o)(e,r,i)},...T&&T.sizeBytes>s.f?{importsOnly:!0}:{},uses:M,usedBy:S,stalePaths:(0,n.H)(e,r,i,O),indexVersion:a}}(E,T,O,e,t,A);return a.answers.size>=2e3&&a.answers.clear(),a.answers.set(i,L),L})}(m,O,{summariesOff:!(0,E.f)()}))}catch(e){return(0,T.i)(e)}},"runtime",0,"nodejs"],81864)},98124,e=>{var t=e.i(47909),r=e.i(74017),a=e.i(96250),n=e.i(59756),i=e.i(61916),o=e.i(74677),s=e.i(69741),l=e.i(16795),u=e.i(87718),d=e.i(95169),c=e.i(47587),h=e.i(66012),p=e.i(70101),f=e.i(26937),m=e.i(10372),g=e.i(93695),w=e.i(9580);e.i(52474);var v=e.i(220);let P=new t.AppRouteRouteModule({definition:{kind:r.f.APP_ROUTE,page:"/api/describe/route",pathname:"/api/describe",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/describe/route.ts",nextConfigOutput:"",userland:()=>e.r(81864),...{}}),{workAsyncStorage:y,workUnitAsyncStorage:x,serverHooks:R}=P;async function k(e,t,r){r.requestMeta&&(0,n.R)(e,r.requestMeta),P.isDev&&(0,n.i)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let a="/api/describe/route";a=a.replace(/\/index$/,"")||"/";let{instrumentation:o}=await P.ensureInstrumentation(e,{deferSpans:!0});return P.traceRequest(e,{tracer:(0,i.v)(),spanName:`${e.method||"GET"} ${a}`,httpTarget:e.url,instrumentation:o},(n,i)=>b(e,t,r,a,!1,n,i))}async function b(e,t,a,y,x,R,k){let b=await P.prepare(e,t,{srcPage:y,multiZoneDraftMode:x});if(!b)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:C,deploymentId:E,params:T,nextConfig:O,parsedUrl:A,isDraftMode:L,prerenderManifest:M,routerServerContext:S,isOnDemandRevalidate:U,revalidateOnlyGenerated:I,resolvedPathname:$,clientReferenceManifest:N,serverActionsManifest:q,previewProps:_}=b,D=(0,s.f)(y),j=!!M.routes[$]&&(P.isDev||(0,w.f)($,P.cacheOwner,M.routes[$])),H=!!(M.dynamicRoutes[D]||j),G=async()=>((null==S?void 0:S.render404)?await S.render404(e,t,A,!1):t.end("This page could not be found"),null);if(H&&!L){let e=M.dynamicRoutes[D];if(e&&!1===e.fallback&&!j){if(O.adapterPath)return await G();throw new g.NoFallbackError}}let B=null;!H||P.isDev||L||(B="/index"===(B=$)?"/":B),q&&N&&(0,o.f)({page:y,clientReferenceManifest:N,serverActionsManifest:q});let F=e.method||"GET",z=(0,i.v)(),K=!!(null==S?void 0:S.isWrappedByNextServer),V=!!(0,n.w)(e,"minimalMode"),J=(0,n.w)(e,"incrementalCache")||await P.getIncrementalCache(e,O,_,M,V);null==J||J.resetRequestCache(),globalThis.__incrementalCache=J;let Q={params:T,previewProps:_,renderOpts:{experimental:{authInterrupts:!!O.experimental.authInterrupts,useCacheTimeout:O.experimental.useCacheTimeout,durableUseCacheEntries:!!O.experimental.durableUseCacheEntries},cacheComponents:!!O.cacheComponents,validationLevel:O.experimental.instantInsights.validationLevel,isDraftMode:L,incrementalCache:J,hmrRefreshHash:(0,n.w)(e,"hmrRefreshHash"),cacheLifeProfiles:O.cacheLife,staticPageGenerationTimeout:O.staticPageGenerationTimeout,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0},sharedContext:{buildId:C,deploymentId:E}},W=new l.x(e),X=new l.e(t),Y=u.k.fromNodeNextRequest(W,(0,u.t)(t)),Z=async({previousCacheEntry:r})=>{try{if(!V&&U&&I&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let n=null===B?await P.handle(Y,Q):await P.prerender(Y,Q);e.fetchMetrics=Q.renderOpts.fetchMetrics;let i=Q.renderOpts.pendingWaitUntil;i&&a.waitUntil&&(a.waitUntil(i),i=void 0);let o=Q.renderOpts.collectedTags;if(!H)return await (0,h.f)(W,X,n,i),null;{let e=await n.blob(),t=(0,p.S)(n.headers);o&&(t[m.M]=o),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==Q.renderOpts.collectedRevalidate&&!(Q.renderOpts.collectedRevalidate>=m.Q)&&Q.renderOpts.collectedRevalidate,a=void 0===Q.renderOpts.collectedExpire||Q.renderOpts.collectedExpire>=m.Q?!1!==r&&r>0?O.expireTime:void 0:Q.renderOpts.collectedExpire;return{value:{kind:v.x.APP_ROUTE,status:n.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await P.onRequestError(e,t,{routerKind:"App Router",routePath:y,routeType:"route",revalidateReason:(0,c.f)({isStaticGeneration:null!==B,isOnDemandRevalidate:U})},!1,S),t}},ee=async n=>{try{var o,s;let n=await P.handleResponse({req:e,nextConfig:O,cacheKey:B,routeKind:r.f.APP_ROUTE,isFallback:!1,previewProps:_,prerenderManifest:M,isRoutePPREnabled:!1,isOnDemandRevalidate:U,revalidateOnlyGenerated:I,responseGenerator:Z,waitUntil:a.waitUntil,isMinimalMode:V});if(null!==n&&"error"in n)throw n.error;if(!H)return;if((null==n||null==(o=n.value)?void 0:o.kind)!==v.x.APP_ROUTE)throw Error(`Invariant: app-route received invalid cache entry ${null==n||null==(s=n.value)?void 0:s.kind}`);V||t.setHeader("x-nextjs-cache",U?"REVALIDATED":n.isMiss?"MISS":n.isStale?"STALE":"HIT"),L&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let i=(0,p.G)(n.value.headers);V&&H||i.delete(m.M),!n.cacheControl||t.getHeader("Cache-Control")||i.get("Cache-Control")||i.set("Cache-Control",(0,f.f)(n.cacheControl)),await (0,h.f)(W,X,new Response(n.value.body,{headers:i,status:n.value.status||200}));return}catch(r){if(r instanceof g.NoFallbackError||await P.onRequestError(e,r,{routerKind:"App Router",routePath:D,routeType:"route",revalidateReason:(0,c.f)({isStaticGeneration:null!==B,isOnDemandRevalidate:U})},!1,S),H)throw r;if(t.headersSent){if(n){let e=r instanceof Error?r:Error("Unknown app route error");n.recordException(e),n.setStatus({code:i.J.ERROR,message:e.message}),n.setAttribute("error.type",e.name)}t.writableEnded||t.destroyed||t.end()}else await (0,h.f)(W,X,new Response(null,{status:500}));return}finally{(()=>{if(!n)return;let e=t.statusCode;n.setAttributes({"http.status_code":e,"next.rsc":!1}),e&&e>=500&&(n.setStatus({code:i.J.ERROR}),n.setAttribute("error.type",e.toString()));let r=z.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==d.q.handleRequest)return console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=r.get("next.route")||D,o=`${F} ${a}`;n.setAttributes({"next.route":a,"http.route":a,"next.span_name":o}),n.updateName(o),k&&k!==n&&(k.setAttribute("http.route",a),k.updateName(o))})()}};K||void 0===e.url||null==R||R.setAttribute("http.target",e.url),await ee(R)}e.s(["handler",0,k,"patchFetch",0,function(){return(0,a.f)({workAsyncStorage:y,workUnitAsyncStorage:x})},"routeModule",0,P,"serverHooks",0,R,"workAsyncStorage",0,y,"workUnitAsyncStorage",0,x])}]})();
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=_0uqus0ehnijt-._.js.map
|
|
@@ -5,6 +5,6 @@ params: ${t}`),this.query=e,this.params=t,this.cause=i,Error.captureStackTrace(t
|
|
|
5
5
|
hash text NOT NULL,
|
|
6
6
|
created_at numeric
|
|
7
7
|
)
|
|
8
|
-
`;t.run(s);let n=t.values(G`SELECT id, hash, created_at FROM ${G.identifier(r)} ORDER BY created_at DESC LIMIT 1`)[0]??void 0;t.run(G`BEGIN`);try{for(let i of e)if(!n||Number(n[2])<i.folderMillis){for(let e of i.sql)t.run(G.raw(e));t.run(G`INSERT INTO ${G.identifier(r)} ("hash", "created_at") VALUES(${i.hash}, ${i.folderMillis})`)}t.run(G`COMMIT`)}catch(e){throw t.run(G`ROLLBACK`),e}}}class tE{static [c]="TypedQueryBuilder";getSelectedFields(){return this._.selectedFields}}class tP{static [c]="QueryPromise";[Symbol.toStringTag]="QueryPromise";catch(e){return this.then(void 0,e)}finally(e){return this.then(t=>(e?.(),t),t=>{throw e?.(),t})}then(e,t){return this.execute().then(e,t)}}class tR{constructor(e,t){this.name=e,this.unique=t}static [c]="SQLiteIndexBuilderOn";on(...e){return new tK(this.name,e,this.unique)}}class tK{static [c]="SQLiteIndexBuilder";config;constructor(e,t,i){this.config={name:e,columns:t,unique:i,where:void 0}}where(e){return this.config.where=e,this}build(e){return new tM(this.config,e)}}class tM{static [c]="SQLiteIndex";config;constructor(e,t){this.config={...e,table:t}}}function tz(e){return new tR(e,!1)}function tU(e){return new tR(e,!0)}function tV(e){return h(e,tA)?[`${e[_.Symbol.BaseName]}`]:h(e,P)?e._.usedTables??[]:h(e,V)?e.usedTables??[]:[]}class tJ{static [c]="SQLiteSelectBuilder";fields;session;dialect;withList;distinct;constructor(e){this.fields=e.fields,this.session=e.session,this.dialect=e.dialect,this.withList=e.withList,this.distinct=e.distinct}from(e){let t,i=!!this.fields;return t=this.fields?this.fields:h(e,P)?Object.fromEntries(Object.keys(e._.selectedFields).map(t=>[t,e[t]])):h(e,tD)?e[M].selectedFields:h(e,V)?{}:e[_.Symbol.Columns],new tY({table:e,fields:t,isPartialSelect:i,session:this.session,dialect:this.dialect,withList:this.withList,distinct:this.distinct})}}class tW extends tE{static [c]="SQLiteSelectQueryBuilder";_;config;joinsNotNullableMap;tableName;isPartialSelect;session;dialect;cacheConfig=void 0;usedTables=new Set;constructor({table:e,fields:t,isPartialSelect:i,session:r,dialect:s,withList:n,distinct:a}){for(let l of(super(),this.config={withList:n,table:e,fields:{...t},distinct:a,setOperators:[]},this.isPartialSelect=i,this.session=r,this.dialect=s,this._={selectedFields:t,config:this.config},this.tableName=ea(e),this.joinsNotNullableMap="string"==typeof this.tableName?{[this.tableName]:!0}:{},tV(e)))this.usedTables.add(l)}getUsedTables(){return[...this.usedTables]}createJoin(e){return(t,i)=>{let r=this.tableName,s=ea(t);for(let e of tV(t))this.usedTables.add(e);if("string"==typeof s&&this.config.joins?.some(e=>e.alias===s))throw Error(`Alias "${s}" is already used in this query`);if(!this.isPartialSelect&&(1===Object.keys(this.joinsNotNullableMap).length&&"string"==typeof r&&(this.config.fields={[r]:this.config.fields}),"string"==typeof s&&!h(t,V))){let e=h(t,P)?t._.selectedFields:h(t,et)?t[M].selectedFields:t[_.Symbol.Columns];this.config.fields[s]=e}if("function"==typeof i&&(i=i(new Proxy(this.config.fields,new eY({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.joins||(this.config.joins=[]),this.config.joins.push({on:i,table:t,joinType:e,alias:s}),"string"==typeof s)switch(e){case"left":this.joinsNotNullableMap[s]=!1;break;case"right":this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([e])=>[e,!1])),this.joinsNotNullableMap[s]=!0;break;case"cross":case"inner":this.joinsNotNullableMap[s]=!0;break;case"full":this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([e])=>[e,!1])),this.joinsNotNullableMap[s]=!1}return this}}leftJoin=this.createJoin("left");rightJoin=this.createJoin("right");innerJoin=this.createJoin("inner");fullJoin=this.createJoin("full");crossJoin=this.createJoin("cross");createSetOperator(e,t){return i=>{let r="function"==typeof i?i(tG()):i;if(!es(this.getSelectedFields(),r.getSelectedFields()))throw Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");return this.config.setOperators.push({type:e,isAll:t,rightSelect:r}),this}}union=this.createSetOperator("union",!1);unionAll=this.createSetOperator("union",!0);intersect=this.createSetOperator("intersect",!1);except=this.createSetOperator("except",!1);addSetOperators(e){return this.config.setOperators.push(...e),this}where(e){return"function"==typeof e&&(e=e(new Proxy(this.config.fields,new eY({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.where=e,this}having(e){return"function"==typeof e&&(e=e(new Proxy(this.config.fields,new eY({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.having=e,this}groupBy(...e){if("function"==typeof e[0]){let t=e[0](new Proxy(this.config.fields,new eY({sqlAliasedBehavior:"alias",sqlBehavior:"sql"})));this.config.groupBy=Array.isArray(t)?t:[t]}else this.config.groupBy=e;return this}orderBy(...e){if("function"==typeof e[0]){let t=e[0](new Proxy(this.config.fields,new eY({sqlAliasedBehavior:"alias",sqlBehavior:"sql"}))),i=Array.isArray(t)?t:[t];this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=i:this.config.orderBy=i}else this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=e:this.config.orderBy=e;return this}limit(e){return this.config.setOperators.length>0?this.config.setOperators.at(-1).limit=e:this.config.limit=e,this}offset(e){return this.config.setOperators.length>0?this.config.setOperators.at(-1).offset=e:this.config.offset=e,this}getSQL(){return this.dialect.buildSelectQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}as(e){let t=[];if(t.push(...tV(this.config.table)),this.config.joins)for(let e of this.config.joins)t.push(...tV(e.table));return new Proxy(new P(this.getSQL(),this.config.fields,e,!1,[...new Set(t)]),new eY({alias:e,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}getSelectedFields(){return new Proxy(this.config.fields,new eY({alias:this.tableName,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}$dynamic(){return this}}class tY extends tW{static [c]="SQLiteSelect";_prepare(e=!0){if(!this.session)throw Error("Cannot execute a query on a query builder. Please use a database instance instead.");let t=er(this.config.fields),i=this.session[e?"prepareOneTimeQuery":"prepareQuery"](this.dialect.sqlToQuery(this.getSQL()),t,"all",!0,void 0,{type:"select",tables:[...this.usedTables]},this.cacheConfig);return i.joinsNotNullableMap=this.joinsNotNullableMap,i}$withCache(e){return this.cacheConfig=void 0===e?{config:{},enable:!0,autoInvalidate:!0}:!1===e?{enable:!1}:{enable:!0,autoInvalidate:!0,...e},this}prepare(){return this._prepare(!1)}run=e=>this._prepare().run(e);all=e=>this._prepare().all(e);get=e=>this._prepare().get(e);values=e=>this._prepare().values(e);async execute(){return this.all()}}for(let e of[tP])for(let t of Object.getOwnPropertyNames(e.prototype))"constructor"!==t&&Object.defineProperty(tY.prototype,t,Object.getOwnPropertyDescriptor(e.prototype,t)||Object.create(null));function tH(e,t){return(i,r,...s)=>{let n=[r,...s].map(i=>({type:e,isAll:t,rightSelect:i}));for(let e of n)if(!es(i.getSelectedFields(),e.rightSelect.getSelectedFields()))throw Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");return i.addSetOperators(n)}}let tG=()=>({union:tZ,unionAll:tX,intersect:t0,except:t1}),tZ=tH("union",!1),tX=tH("union",!0),t0=tH("intersect",!1),t1=tH("except",!1);class t3{static [c]="SQLiteQueryBuilder";dialect;dialectConfig;constructor(e){this.dialect=h(e,tF)?e:void 0,this.dialectConfig=h(e,tF)?void 0:e}$with=(e,t)=>{let i=this;return{as:r=>("function"==typeof r&&(r=r(i)),new Proxy(new R(r.getSQL(),t??("getSelectedFields"in r?r.getSelectedFields()??{}:{}),e,!0),new eY({alias:e,sqlAliasedBehavior:"alias",sqlBehavior:"error"})))}};with(...e){let t=this;return{select:function(i){return new tJ({fields:i??void 0,session:void 0,dialect:t.getDialect(),withList:e})},selectDistinct:function(i){return new tJ({fields:i??void 0,session:void 0,dialect:t.getDialect(),withList:e,distinct:!0})}}}select(e){return new tJ({fields:e??void 0,session:void 0,dialect:this.getDialect()})}selectDistinct(e){return new tJ({fields:e??void 0,session:void 0,dialect:this.getDialect(),distinct:!0})}getDialect(){return this.dialect||(this.dialect=new tk(this.dialectConfig)),this.dialect}}class t2 extends tP{constructor(e,t,i,r){super(),this.table=e,this.session=t,this.dialect=i,this.config={table:e,withList:r}}static [c]="SQLiteDelete";config;where(e){return this.config.where=e,this}orderBy(...e){if("function"==typeof e[0]){let t=e[0](new Proxy(this.config.table[_.Symbol.Columns],new eY({sqlAliasedBehavior:"alias",sqlBehavior:"sql"}))),i=Array.isArray(t)?t:[t];this.config.orderBy=i}else this.config.orderBy=e;return this}limit(e){return this.config.limit=e,this}returning(e=this.table[tA.Symbol.Columns]){return this.config.returning=er(e),this}getSQL(){return this.dialect.buildDeleteQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}_prepare(e=!0){return this.session[e?"prepareOneTimeQuery":"prepareQuery"](this.dialect.sqlToQuery(this.getSQL()),this.config.returning,this.config.returning?"all":"run",!0,void 0,{type:"delete",tables:tV(this.config.table)})}prepare(){return this._prepare(!1)}run=e=>this._prepare().run(e);all=e=>this._prepare().all(e);get=e=>this._prepare().get(e);values=e=>this._prepare().values(e);async execute(e){return this._prepare().execute(e)}$dynamic(){return this}}class t4{constructor(e,t,i,r){this.table=e,this.session=t,this.dialect=i,this.withList=r}static [c]="SQLiteInsertBuilder";values(e){if(0===(e=Array.isArray(e)?e:[e]).length)throw Error("values() must be called with at least one value");let t=e.map(e=>{let t={},i=this.table[_.Symbol.Columns];for(let r of Object.keys(e)){let s=e[r];t[r]=h(s,V)?s:new H(s,i[r])}return t});return new t5(this.table,t,this.session,this.dialect,this.withList)}select(e){let t="function"==typeof e?e(new t3):e;if(!h(t,V)&&!es(this.table[y],t._.selectedFields))throw Error("Insert select error: selected fields are not the same or are in a different order compared to the table definition");return new t5(this.table,t,this.session,this.dialect,this.withList,!0)}}class t5 extends tP{constructor(e,t,i,r,s,n){super(),this.session=i,this.dialect=r,this.config={table:e,values:t,withList:s,select:n}}static [c]="SQLiteInsert";config;returning(e=this.config.table[tA.Symbol.Columns]){return this.config.returning=er(e),this}onConflictDoNothing(e={}){if(this.config.onConflict||(this.config.onConflict=[]),void 0===e.target)this.config.onConflict.push(G` on conflict do nothing`);else{let t=Array.isArray(e.target)?G`${e.target}`:G`${[e.target]}`,i=e.where?G` where ${e.where}`:G``;this.config.onConflict.push(G` on conflict ${t} do nothing${i}`)}return this}onConflictDoUpdate(e){if(e.where&&(e.targetWhere||e.setWhere))throw Error('You cannot use both "where" and "targetWhere"/"setWhere" at the same time - "where" is deprecated, use "targetWhere" or "setWhere" instead.');this.config.onConflict||(this.config.onConflict=[]);let t=e.where?G` where ${e.where}`:void 0,i=e.targetWhere?G` where ${e.targetWhere}`:void 0,r=e.setWhere?G` where ${e.setWhere}`:void 0,s=Array.isArray(e.target)?G`${e.target}`:G`${[e.target]}`,n=this.dialect.buildUpdateSet(this.config.table,en(this.config.table,e.set));return this.config.onConflict.push(G` on conflict ${s}${i} do update set ${n}${t}${r}`),this}getSQL(){return this.dialect.buildInsertQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}_prepare(e=!0){return this.session[e?"prepareOneTimeQuery":"prepareQuery"](this.dialect.sqlToQuery(this.getSQL()),this.config.returning,this.config.returning?"all":"run",!0,void 0,{type:"insert",tables:tV(this.config.table)})}prepare(){return this._prepare(!1)}run=e=>this._prepare().run(e);all=e=>this._prepare().all(e);get=e=>this._prepare().get(e);values=e=>this._prepare().values(e);async execute(){return this.config.returning?this.all():this.run()}$dynamic(){return this}}class t6{constructor(e,t,i,r){this.table=e,this.session=t,this.dialect=i,this.withList=r}static [c]="SQLiteUpdateBuilder";set(e){return new t8(this.table,en(this.table,e),this.session,this.dialect,this.withList)}}class t8 extends tP{constructor(e,t,i,r,s){super(),this.session=i,this.dialect=r,this.config={set:t,table:e,withList:s,joins:[]}}static [c]="SQLiteUpdate";config;from(e){return this.config.from=e,this}createJoin(e){return(t,i)=>{let r=ea(t);if("string"==typeof r&&this.config.joins.some(e=>e.alias===r))throw Error(`Alias "${r}" is already used in this query`);if("function"==typeof i){let e=this.config.from?h(t,tA)?t[_.Symbol.Columns]:h(t,P)?t._.selectedFields:h(t,tD)?t[M].selectedFields:void 0:void 0;i=i(new Proxy(this.config.table[_.Symbol.Columns],new eY({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})),e&&new Proxy(e,new eY({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))}return this.config.joins.push({on:i,table:t,joinType:e,alias:r}),this}}leftJoin=this.createJoin("left");rightJoin=this.createJoin("right");innerJoin=this.createJoin("inner");fullJoin=this.createJoin("full");where(e){return this.config.where=e,this}orderBy(...e){if("function"==typeof e[0]){let t=e[0](new Proxy(this.config.table[_.Symbol.Columns],new eY({sqlAliasedBehavior:"alias",sqlBehavior:"sql"}))),i=Array.isArray(t)?t:[t];this.config.orderBy=i}else this.config.orderBy=e;return this}limit(e){return this.config.limit=e,this}returning(e=this.config.table[tA.Symbol.Columns]){return this.config.returning=er(e),this}getSQL(){return this.dialect.buildUpdateQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}_prepare(e=!0){return this.session[e?"prepareOneTimeQuery":"prepareQuery"](this.dialect.sqlToQuery(this.getSQL()),this.config.returning,this.config.returning?"all":"run",!0,void 0,{type:"insert",tables:tV(this.config.table)})}prepare(){return this._prepare(!1)}run=e=>this._prepare().run(e);all=e=>this._prepare().all(e);get=e=>this._prepare().get(e);values=e=>this._prepare().values(e);async execute(){return this.config.returning?this.all():this.run()}$dynamic(){return this}}class t9 extends V{constructor(e){super(t9.buildEmbeddedCount(e.source,e.filters).queryChunks),this.params=e,this.session=e.session,this.sql=t9.buildCount(e.source,e.filters)}sql;static [c]="SQLiteCountBuilderAsync";[Symbol.toStringTag]="SQLiteCountBuilderAsync";session;static buildEmbeddedCount(e,t){return G`(select count(*) from ${e}${G.raw(" where ").if(t)}${t})`}static buildCount(e,t){return G`select count(*) from ${e}${G.raw(" where ").if(t)}${t}`}then(e,t){return Promise.resolve(this.session.count(this.sql)).then(e,t)}catch(e){return this.then(void 0,e)}finally(e){return this.then(t=>(e?.(),t),t=>{throw e?.(),t})}}class t7{constructor(e,t,i,r,s,n,a,l){this.mode=e,this.fullSchema=t,this.schema=i,this.tableNamesMap=r,this.table=s,this.tableConfig=n,this.dialect=a,this.session=l}static [c]="SQLiteAsyncRelationalQueryBuilder";findMany(e){return"sync"===this.mode?new it(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,e||{},"many"):new ie(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,e||{},"many")}findFirst(e){return"sync"===this.mode?new it(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,e?{...e,limit:1}:{limit:1},"first"):new ie(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,e?{...e,limit:1}:{limit:1},"first")}}class ie extends tP{constructor(e,t,i,r,s,n,a,l,o){super(),this.fullSchema=e,this.schema=t,this.tableNamesMap=i,this.table=r,this.tableConfig=s,this.dialect=n,this.session=a,this.config=l,this.mode=o}static [c]="SQLiteAsyncRelationalQuery";mode;getSQL(){return this.dialect.buildRelationalQuery({fullSchema:this.fullSchema,schema:this.schema,tableNamesMap:this.tableNamesMap,table:this.table,tableConfig:this.tableConfig,queryConfig:this.config,tableAlias:this.tableConfig.tsName}).sql}_prepare(e=!1){let{query:t,builtQuery:i}=this._toSQL();return this.session[e?"prepareOneTimeQuery":"prepareQuery"](i,void 0,"first"===this.mode?"get":"all",!0,(e,i)=>{let r=e.map(e=>(function e(t,i,r,s,n=e=>e){let a={};for(let[l,o]of s.entries())if(o.isJson){let s=i.relations[o.tsKey],u=r[l],c="string"==typeof u?JSON.parse(u):u;a[o.tsKey]=h(s,eP)?c&&e(t,t[o.relationTableTsKey],c,o.selection,n):c.map(i=>e(t,t[o.relationTableTsKey],i,o.selection,n))}else{let e,t=n(r[l]),i=o.field;e=h(i,Q)?i:h(i,V)?i.decoder:i.sql.decoder,a[o.tsKey]=null===t?null:e.mapFromDriverValue(t)}return a})(this.schema,this.tableConfig,e,t.selection,i));return"first"===this.mode?r[0]:r})}prepare(){return this._prepare(!1)}_toSQL(){let e=this.dialect.buildRelationalQuery({fullSchema:this.fullSchema,schema:this.schema,tableNamesMap:this.tableNamesMap,table:this.table,tableConfig:this.tableConfig,queryConfig:this.config,tableAlias:this.tableConfig.tsName}),t=this.dialect.sqlToQuery(e.sql);return{query:e,builtQuery:t}}toSQL(){return this._toSQL().builtQuery}executeRaw(){return"first"===this.mode?this._prepare(!1).get():this._prepare(!1).all()}async execute(){return this.executeRaw()}}class it extends ie{static [c]="SQLiteSyncRelationalQuery";sync(){return this.executeRaw()}}class ii extends tP{constructor(e,t,i,r,s){super(),this.execute=e,this.getSQL=t,this.dialect=r,this.mapBatchResult=s,this.config={action:i}}static [c]="SQLiteRaw";config;getQuery(){return{...this.dialect.sqlToQuery(this.getSQL()),method:this.config.action}}mapResult(e,t){return t?this.mapBatchResult(e):e}_prepare(){return this}isResponseInArrayMode(){return!1}}class ir{constructor(e,t,i,r){this.resultKind=e,this.dialect=t,this.session=i,this._=r?{schema:r.schema,fullSchema:r.fullSchema,tableNamesMap:r.tableNamesMap}:{schema:void 0,fullSchema:{},tableNamesMap:{}},this.query={};let s=this.query;if(this._.schema)for(let[n,a]of Object.entries(this._.schema))s[n]=new t7(e,r.fullSchema,this._.schema,this._.tableNamesMap,r.fullSchema[n],a,t,i);this.$cache={invalidate:async e=>{}}}static [c]="BaseSQLiteDatabase";query;$with=(e,t)=>{let i=this;return{as:r=>("function"==typeof r&&(r=r(new t3(i.dialect))),new Proxy(new R(r.getSQL(),t??("getSelectedFields"in r?r.getSelectedFields()??{}:{}),e,!0),new eY({alias:e,sqlAliasedBehavior:"alias",sqlBehavior:"error"})))}};$count(e,t){return new t9({source:e,filters:t,session:this.session})}with(...e){let t=this;return{select:function(i){return new tJ({fields:i??void 0,session:t.session,dialect:t.dialect,withList:e})},selectDistinct:function(i){return new tJ({fields:i??void 0,session:t.session,dialect:t.dialect,withList:e,distinct:!0})},update:function(i){return new t6(i,t.session,t.dialect,e)},insert:function(i){return new t4(i,t.session,t.dialect,e)},delete:function(i){return new t2(i,t.session,t.dialect,e)}}}select(e){return new tJ({fields:e??void 0,session:this.session,dialect:this.dialect})}selectDistinct(e){return new tJ({fields:e??void 0,session:this.session,dialect:this.dialect,distinct:!0})}update(e){return new t6(e,this.session,this.dialect)}$cache;insert(e){return new t4(e,this.session,this.dialect)}delete(e){return new t2(e,this.session,this.dialect)}run(e){let t="string"==typeof e?G.raw(e):e.getSQL();return"async"===this.resultKind?new ii(async()=>this.session.run(t),()=>t,"run",this.dialect,this.session.extractRawRunValueFromBatchResult.bind(this.session)):this.session.run(t)}all(e){let t="string"==typeof e?G.raw(e):e.getSQL();return"async"===this.resultKind?new ii(async()=>this.session.all(t),()=>t,"all",this.dialect,this.session.extractRawAllValueFromBatchResult.bind(this.session)):this.session.all(t)}get(e){let t="string"==typeof e?G.raw(e):e.getSQL();return"async"===this.resultKind?new ii(async()=>this.session.get(t),()=>t,"get",this.dialect,this.session.extractRawGetValueFromBatchResult.bind(this.session)):this.session.get(t)}values(e){let t="string"==typeof e?G.raw(e):e.getSQL();return"async"===this.resultKind?new ii(async()=>this.session.values(t),()=>t,"values",this.dialect,this.session.extractRawValuesValueFromBatchResult.bind(this.session)):this.session.values(t)}transaction(e,t){return this.session.transaction(e,t)}}class is{static [c]="Cache"}class ia extends is{strategy(){return"all"}static [c]="NoopCache";async get(e){}async put(e,t,i,r){}async onMutate(e){}}async function il(e,t){let i=`${e}-${JSON.stringify(t)}`,r=new TextEncoder().encode(i);return[...new Uint8Array(await crypto.subtle.digest("SHA-256",r))].map(e=>e.toString(16).padStart(2,"0")).join("")}class io extends tP{constructor(e){super(),this.resultCb=e}static [c]="ExecuteResultSync";async execute(){return this.resultCb()}sync(){return this.resultCb()}}class iu{constructor(e,t,i,r,s,n){this.mode=e,this.executeMethod=t,this.query=i,this.cache=r,this.queryMetadata=s,this.cacheConfig=n,r&&"all"===r.strategy()&&void 0===n&&(this.cacheConfig={enable:!0,autoInvalidate:!0}),this.cacheConfig?.enable||(this.cacheConfig=void 0)}static [c]="PreparedQuery";joinsNotNullableMap;async queryWithCache(e,t,i){if(void 0===this.cache||h(this.cache,ia)||void 0===this.queryMetadata||this.cacheConfig&&!this.cacheConfig.enable)try{return await i()}catch(i){throw new e1(e,t,i)}if(("insert"===this.queryMetadata.type||"update"===this.queryMetadata.type||"delete"===this.queryMetadata.type)&&this.queryMetadata.tables.length>0)try{let[e]=await Promise.all([i(),this.cache.onMutate({tables:this.queryMetadata.tables})]);return e}catch(i){throw new e1(e,t,i)}if(!this.cacheConfig)try{return await i()}catch(i){throw new e1(e,t,i)}if("select"===this.queryMetadata.type){let r=await this.cache.get(this.cacheConfig.tag??await il(e,t),this.queryMetadata.tables,void 0!==this.cacheConfig.tag,this.cacheConfig.autoInvalidate);if(void 0===r){let r;try{r=await i()}catch(i){throw new e1(e,t,i)}return await this.cache.put(this.cacheConfig.tag??await il(e,t),r,this.cacheConfig.autoInvalidate?this.queryMetadata.tables:[],void 0!==this.cacheConfig.tag,this.cacheConfig.config),r}return r}try{return await i()}catch(i){throw new e1(e,t,i)}}getQuery(){return this.query}mapRunResult(e,t){return e}mapAllResult(e,t){throw Error("Not implemented")}mapGetResult(e,t){throw Error("Not implemented")}execute(e){return"async"===this.mode?this[this.executeMethod](e):new io(()=>this[this.executeMethod](e))}mapResult(e,t){switch(this.executeMethod){case"run":return this.mapRunResult(e,t);case"all":return this.mapAllResult(e,t);case"get":return this.mapGetResult(e,t)}}}class ic{constructor(e){this.dialect=e}static [c]="SQLiteSession";prepareOneTimeQuery(e,t,i,r,s,n,a){return this.prepareQuery(e,t,i,r,s,n,a)}run(e){let t=this.dialect.sqlToQuery(e);try{return this.prepareOneTimeQuery(t,void 0,"run",!1).run()}catch(e){throw new e0({cause:e,message:`Failed to run the query '${t.sql}'`})}}extractRawRunValueFromBatchResult(e){return e}all(e){return this.prepareOneTimeQuery(this.dialect.sqlToQuery(e),void 0,"run",!1).all()}extractRawAllValueFromBatchResult(e){throw Error("Not implemented")}get(e){return this.prepareOneTimeQuery(this.dialect.sqlToQuery(e),void 0,"run",!1).get()}extractRawGetValueFromBatchResult(e){throw Error("Not implemented")}values(e){return this.prepareOneTimeQuery(this.dialect.sqlToQuery(e),void 0,"run",!1).values()}async count(e){return(await this.values(e))[0][0]}extractRawValuesValueFromBatchResult(e){throw Error("Not implemented")}}class ih extends ir{constructor(e,t,i,r,s=0){super(e,t,i,r),this.schema=r,this.nestedIndex=s}static [c]="SQLiteTransaction";rollback(){throw new e3}}class id extends ic{constructor(e,t,i,r={}){super(t),this.client=e,this.schema=i,this.logger=r.logger??new m,this.cache=r.cache??new ia}static [c]="BetterSQLiteSession";logger;cache;prepareQuery(e,t,i,r,s,n,a){return new ip(this.client.prepare(e.sql),e,this.logger,this.cache,n,a,t,i,r,s)}transaction(e,t={}){let i=new im("sync",this.dialect,this,this.schema);return this.client.transaction(e)[t.behavior??"deferred"](i)}}class im extends ih{static [c]="BetterSQLiteTransaction";transaction(e){let t=`sp${this.nestedIndex}`,i=new im("sync",this.dialect,this.session,this.schema,this.nestedIndex+1);this.session.run(G.raw(`savepoint ${t}`));try{let r=e(i);return this.session.run(G.raw(`release savepoint ${t}`)),r}catch(e){throw this.session.run(G.raw(`rollback to savepoint ${t}`)),e}}}class ip extends iu{constructor(e,t,i,r,s,n,a,l,o,u){super("sync",l,t,r,s,n),this.stmt=e,this.logger=i,this.fields=a,this._isResponseInArrayMode=o,this.customResultMapper=u}static [c]="BetterSQLitePreparedQuery";run(e){let t=X(this.query.params,e??{});return this.logger.logQuery(this.query.sql,t),this.stmt.run(...t)}all(e){let{fields:t,joinsNotNullableMap:i,query:r,logger:s,stmt:n,customResultMapper:a}=this;if(!t&&!a){let t=X(r.params,e??{});return s.logQuery(r.sql,t),n.all(...t)}let l=this.values(e);return a?a(l):l.map(e=>ei(t,e,i))}get(e){let t=X(this.query.params,e??{});this.logger.logQuery(this.query.sql,t);let{fields:i,stmt:r,joinsNotNullableMap:s,customResultMapper:n}=this;if(!i&&!n)return r.get(...t);let a=r.raw().get(...t);if(a)return n?n([a]):ei(i,a,s)}values(e){let t=X(this.query.params,e??{});return this.logger.logQuery(this.query.sql,t),this.stmt.raw().all(...t)}isResponseInArrayMode(){return this._isResponseInArrayMode}}class ig extends ir{static [c]="BetterSQLite3Database"}function iy(e,t={}){let i,r,s=new tk({casing:t.casing});if(!0===t.logger?i=new f:!1!==t.logger&&(i=t.logger),t.schema){let e=function(e,t){1===Object.keys(e).length&&"default"in e&&!h(e.default,_)&&(e=e.default);let i={},r={},s={};for(let[n,a]of Object.entries(e))if(h(a,_)){let e=x(a),t=r[e];for(let r of(i[e]=n,s[n]={tsName:n,dbName:a[_.Symbol.Name],schema:a[_.Symbol.Schema],columns:a[_.Symbol.Columns],relations:t?.relations??{},primaryKey:t?.primaryKey??[]},Object.values(a[_.Symbol.Columns])))r.primary&&s[n].primaryKey.push(r);let l=a[_.Symbol.ExtraConfigBuilder]?.(a[_.Symbol.ExtraConfigColumns]);if(l)for(let e of Object.values(l))h(e,ed)&&s[n].primaryKey.push(...e.columns)}else if(h(a,eE)){let e,n=x(a.table),l=i[n];for(let[i,o]of Object.entries(a.config(t(a.table))))if(l){let t=s[l];t.relations[i]=o,e&&t.primaryKey.push(...e)}else n in r||(r[n]={relations:{},primaryKey:e}),r[n].relations[i]=o}return{tables:s,tableNamesMap:i}}(t.schema,eK);r={fullSchema:t.schema,schema:e.tables,tableNamesMap:e.tableNamesMap}}let n=new id(e,s,r,{logger:i}),a=new ig("sync",s,n,r);return a.$client=e,a}function ib(...e){if(void 0===e[0]||"string"==typeof e[0])return iy(void 0===e[0]?new u.default:new u.default(e[0]),e[1]);if(function(e){if("object"!=typeof e||null===e||"Object"!==e.constructor.name)return!1;if("logger"in e){let t=typeof e.logger;return"boolean"===t||"object"===t&&"function"==typeof e.logger.logQuery||"undefined"===t}if("schema"in e){let t=typeof e.schema;return"object"===t||"undefined"===t}if("casing"in e){let t=typeof e.casing;return"string"===t||"undefined"===t}if("mode"in e)return"default"===e.mode&&"planetscale"===e.mode&&void 0===e.mode;if("connection"in e){let t=typeof e.connection;return"string"===t||"object"===t||"undefined"===t}if("client"in e){let t=typeof e.client;return"object"===t||"function"===t||"undefined"===t}return 0===Object.keys(e).length}(e[0])){let{connection:t,client:i,...r}=e[0];if(i)return iy(i,r);if("object"==typeof t){let{source:e,...i}=t;return iy(new u.default(e,i),r)}return iy(new u.default(t),r)}return iy(e[0],e[1])}(ib||(ib={})).mock=function(e){return iy({},e)};var iw=e.i(66680),iS=e.i(2157);function iN(e){let t=e.migrationsFolder,i=[],r=`${t}/meta/_journal.json`;if(!iS.default.existsSync(r))throw Error("Can't find meta/_journal.json file");for(let e of JSON.parse(iS.default.readFileSync(`${t}/meta/_journal.json`).toString()).entries){let r=`${t}/${e.tag}.sql`;try{let r=iS.default.readFileSync(`${t}/${e.tag}.sql`).toString(),s=r.split("--> statement-breakpoint").map(e=>e);i.push({sql:s,bps:e.breakpoints,folderMillis:e.when,hash:iw.default.createHash("sha256").update(r).digest("hex")})}catch{throw Error(`No file ${r} found in ${t} folder`)}}return i}let iv=tj("repositories",{id:ty().primaryKey({autoIncrement:!0}),rootPath:tO("root_path").notNull().unique(),lastScanAt:ty("last_scan_at",{mode:"timestamp"}),lastIndexAt:ty("last_index_at",{mode:"timestamp"}),indexedHead:tO("indexed_head")}),i$=tj("files",{id:ty().primaryKey({autoIncrement:!0}),repoId:ty("repo_id").notNull().references(()=>iv.id,{onDelete:"cascade"}),path:tO("path").notNull(),kind:tO("kind",{enum:["component","module"]}).notNull(),contentHash:tO("content_hash").notNull(),language:tO("language").notNull().default("typescript"),sizeBytes:ty("size_bytes").notNull().default(0),lineCount:ty("line_count").notNull().default(0),isTest:ty("is_test",{mode:"boolean"}).notNull().default(!1),importSpecifiers:tO("import_specifiers").notNull().default("[]"),declares:tO("declares").notNull().default("[]")},e=>[tU("files_repo_path_unique").on(e.repoId,e.path)]),i_=tj("imports",{id:ty().primaryKey({autoIncrement:!0}),sourceFileId:ty("source_file_id").notNull().references(()=>i$.id,{onDelete:"cascade"}),targetFileId:ty("target_file_id").notNull().references(()=>i$.id,{onDelete:"cascade"}),specifier:tO("specifier").notNull()},e=>[tU("imports_source_target_unique").on(e.sourceFileId,e.targetFileId),tz("imports_target_idx").on(e.targetFileId)]),ix=tj("chunks",{id:ty().primaryKey({autoIncrement:!0}),fileId:ty("file_id").notNull().references(()=>i$.id,{onDelete:"cascade"}),chunkId:tO("chunk_id").notNull(),kind:tO("kind",{enum:["function","class","component","interface","type","const","enum","namespace","file-summary"]}).notNull(),name:tO("name").notNull(),nameSplit:tO("name_split").notNull().default(""),startLine:ty("start_line").notNull(),endLine:ty("end_line").notNull(),exported:ty("exported",{mode:"boolean"}).notNull().default(!1),partIndex:ty("part_index").notNull().default(0),text:tO("text").notNull(),fileHash:tO("file_hash").notNull(),createdAt:ty("created_at",{mode:"timestamp"}).notNull().$defaultFn(()=>new Date)},e=>[tU("chunks_file_chunk_unique").on(e.fileId,e.chunkId)]),iQ=tj("meta",{id:ty().primaryKey({autoIncrement:!0}),key:tO("key").notNull().unique(),value:tO("value").notNull(),updatedAt:ty("updated_at",{mode:"timestamp"}).notNull().$defaultFn(()=>new Date).$onUpdateFn(()=>new Date)}),iq=["function","class","method","property","accessor","constructor","interface","type","enum","const","namespace","struct","trait"],iC=tj("symbols",{id:ty().primaryKey({autoIncrement:!0}),fileId:ty("file_id").notNull().references(()=>i$.id,{onDelete:"cascade"}),name:tO("name").notNull(),qualifiedName:tO("qualified_name").notNull(),kind:tO("kind",{enum:iq}).notNull(),startLine:ty("start_line").notNull(),endLine:ty("end_line").notNull(),exported:ty("exported",{mode:"boolean"}).notNull().default(!1),parentQualifiedName:tO("parent_qualified_name")},e=>[tz("symbols_file_idx").on(e.fileId),tz("symbols_name_idx").on(e.name)]),iT=tj("folders",{id:ty().primaryKey({autoIncrement:!0}),repoId:ty("repo_id").notNull().references(()=>iv.id,{onDelete:"cascade"}),path:tO("path").notNull(),parentPath:tO("parent_path"),depth:ty("depth").notNull(),name:tO("name").notNull(),fileCount:ty("file_count").notNull(),directFileCount:ty("direct_file_count").notNull()},e=>[tU("folders_repo_path_unique").on(e.repoId,e.path),tz("folders_repo_parent_idx").on(e.repoId,e.parentPath)]),iL=tj("level_edges",{id:ty().primaryKey({autoIncrement:!0}),repoId:ty("repo_id").notNull().references(()=>iv.id,{onDelete:"cascade"}),levelPath:tO("level_path").notNull(),sourceNode:tO("source_node").notNull(),targetNode:tO("target_node").notNull(),count:ty("count").notNull()},e=>[tU("level_edges_unique").on(e.repoId,e.levelPath,e.sourceNode,e.targetNode)]),iB=["file","folder","repo"],iO=["fresh","stale","pending","failed","skipped"],iI=tj("summaries",{id:ty().primaryKey({autoIncrement:!0}),repoId:ty("repo_id").notNull().references(()=>iv.id,{onDelete:"cascade"}),targetKind:tO("target_kind",{enum:iB}).notNull(),targetPath:tO("target_path").notNull(),tagline:tO("tagline"),summary:tO("summary"),model:tO("model"),inputHash:tO("input_hash"),status:tO("status",{enum:iO}).notNull(),error:tO("error"),batchId:tO("batch_id"),pendingHash:tO("pending_hash"),updatedAt:ty("updated_at",{mode:"timestamp"}).notNull().$defaultFn(()=>new Date)},e=>[tU("summaries_target_unique").on(e.repoId,e.targetKind,e.targetPath),tz("summaries_batch_idx").on(e.batchId)]),iA=tj("summary_vectors",{id:ty().primaryKey({autoIncrement:!0}),summaryId:ty("summary_id").notNull().unique().references(()=>iI.id,{onDelete:"cascade"}),embedding:tn("embedding",{mode:"buffer"}).notNull()}),ij=tj("summary_usage",{id:ty().primaryKey({autoIncrement:!0}),repoId:ty("repo_id").notNull().references(()=>iv.id,{onDelete:"cascade"}),model:tO("model").notNull(),transport:tO("transport",{enum:["direct","batch"]}).notNull(),requests:ty("requests").notNull().default(0),inputTokens:ty("input_tokens").notNull().default(0),outputTokens:ty("output_tokens").notNull().default(0)},e=>[tU("summary_usage_unique").on(e.repoId,e.model,e.transport)]),iD=tj("entry_points",{id:ty().primaryKey({autoIncrement:!0}),repoId:ty("repo_id").notNull().references(()=>iv.id,{onDelete:"cascade"}),path:tO("path").notNull(),declaredBy:tO("declared_by").notNull()},e=>[tU("entry_points_repo_path_unique").on(e.repoId,e.path)]),iF=tj("docs",{id:ty().primaryKey({autoIncrement:!0}),repoId:ty("repo_id").notNull().references(()=>iv.id,{onDelete:"cascade"}),path:tO("path").notNull(),title:tO("title").notNull()},e=>[tU("docs_repo_path_unique").on(e.repoId,e.path)]),ik=["applies","readme","mentions"],iE=tj("doc_links",{id:ty().primaryKey({autoIncrement:!0}),repoId:ty("repo_id").notNull().references(()=>iv.id,{onDelete:"cascade"}),docPath:tO("doc_path").notNull(),targetPath:tO("target_path").notNull(),kind:tO("kind",{enum:ik}).notNull(),count:ty("count").notNull(),detail:tO("detail")},e=>[tz("doc_links_repo_target_idx").on(e.repoId,e.targetPath)]),iP=["param","local","destructure","constraint","cast","provider","new","alias","field","this","ctor-param","inject-field","super","return","member"],iR=tj("type_decls",{id:ty().primaryKey({autoIncrement:!0}),fileId:ty("file_id").notNull().references(()=>i$.id,{onDelete:"cascade"}),name:tO("name"),kind:tO("kind",{enum:["class","interface"]}).notNull(),line:ty("line").notNull(),exported:ty("exported",{mode:"boolean"}).notNull().default(!1),nested:ty("nested",{mode:"boolean"}).notNull().default(!1),extendsRefs:tO("extends_refs").notNull().default("[]"),implementsRefs:tO("implements_refs").notNull().default("[]"),testDoubleOf:tO("test_double_of"),members:tO("members").notNull().default("[]"),fields:tO("fields").notNull().default("{}")},e=>[tz("type_decls_file_idx").on(e.fileId),tz("type_decls_name_idx").on(e.name)]),iK=tj("call_bindings",{id:ty().primaryKey({autoIncrement:!0}),fileId:ty("file_id").notNull().references(()=>i$.id,{onDelete:"cascade"}),kind:tO("kind",{enum:["import","reexport","export"]}).notNull(),local:tO("local").notNull(),imported:tO("imported").notNull(),specifier:tO("specifier")},e=>[tz("call_bindings_file_idx").on(e.fileId)]),iM=tj("typed_calls",{id:ty().primaryKey({autoIncrement:!0}),fileId:ty("file_id").notNull().references(()=>i$.id,{onDelete:"cascade"}),line:ty("line").notNull(),member:tO("member"),receiver:tO("receiver",{enum:["type","field","this"]}).notNull(),ref:tO("ref"),inClass:tO("in_class"),how:tO("how",{enum:iP}).notNull()},e=>[tz("typed_calls_file_idx").on(e.fileId),tz("typed_calls_member_idx").on(e.member)]);e.s(["CALL_RULES",0,iP,"DOC_LINK_KINDS",0,ik,"META_KEYS",0,{INDEXING_LOCK:"indexing",SUMMARIZING_LOCK:"summarizing"},"SUMMARY_STATUSES",0,iO,"SUMMARY_TARGET_KINDS",0,iB,"SYMBOL_KINDS",0,iq,"callBindings",0,iK,"chunks",0,ix,"docLinks",0,iE,"docs",0,iF,"entryPoints",0,iD,"files",0,i$,"folders",0,iT,"imports",0,i_,"levelEdges",0,iL,"meta",0,iQ,"repositories",0,iv,"summaries",0,iI,"summaryUsage",0,ij,"summaryVectors",0,iA,"symbols",0,iC,"typeDecls",0,iR,"typedCalls",0,iM],93342);var iz=e.i(93342);function iU(e,t){return`nebulosity ${e} ${t} (in a checkout: npm run ${e} -- ${t})`}class iV extends Error{constructor(e){super(`No repository indexed yet: there's no index at ${e}. Run ${iU("index","<path-to-repo>")}.`),this.name="DatabaseMissingError"}}class iJ extends Error{constructor(){super(`Nebulosity's index is older than this version of Nebulosity. Run ${iU("index","<path-to-repo>")} once, or start the Map (nebulosity map; in a checkout, npm run dev), to update it, then try again.`),this.name="DatabaseOutdatedError"}}let iW=()=>(0,l.L)("lib","db","migrations"),iY=e=>ib(e,{schema:iz});function iH(e,t="readwrite"){var i;let r;if("readonly"===t)return function(e){if(!n.default.existsSync(e))throw new iV(e);let t=new u.default(e,{readonly:!0,fileMustExist:!0});try{var i=t;let e=Math.max(...iN({migrationsFolder:iW()}).map(e=>e.folderMillis)),r=null;try{let e=i.prepare("select max(created_at) as at from __drizzle_migrations").get();r=null===e.at?null:Number(e.at)}catch(e){if(!/no such table/.test(e instanceof Error?e.message:String(e)))throw e}if(null===r||r<e)throw new iJ}catch(e){throw t.close(),e}return iY(t)}(e);":memory:"!==e&&n.default.mkdirSync(a.default.dirname(e),{recursive:!0});let s=new u.default(e);s.pragma("journal_mode = WAL"),s.pragma("synchronous = NORMAL"),s.pragma("foreign_keys = ON");let l=iY(s);return r=iN(i={migrationsFolder:iW()}),l.dialect.migrate(r,l.session,i),l}let iG=globalThis,iZ=[1e3,2e3,5e3,1e4,3e4],iX={code:"INTERNAL",message:"The background worker isn't running right now (it restarts on its own); try again in a moment."},i0={code:"INTERNAL",message:"The background worker stopped before answering; try again."},i1=globalThis,i3={code:"INTERNAL",message:"This server was started with NEBULOSITY_WORKER=off, so it has no background worker."},i2={setRepo(){},summarize:async()=>({ok:!1,error:i3}),index:async()=>({ok:!1,error:i3}),stop(){}};function i4(){let e=(0,s.fork)((0,l.L)("scripts","background.ts"),[],{cwd:(0,l.W)(),execArgv:["--import","tsx"],stdio:["ignore","inherit","inherit","ipc"]}),t=[],i=!1,r=e=>{if(!i)for(let r of(i=!0,t))r(e)};return e.on("exit",e=>r(e)),e.on("error",e=>{console.error(`[background] the worker failed: ${e.message}`),r(null)}),{send:t=>e.connected&&e.send(t),onMessage:t=>{e.on("message",e=>t(e))},onExit:e=>{t.push(e)},kill:()=>{e.kill()}}}e.s(["backgroundSupervisor",0,function(){if("off"===process.env.NEBULOSITY_WORKER)return i2;if(!i1.nebulosityBackground){let e;iG.db||(iG.db=process.env.VITEST?iH(":memory:"):iH((0,l.Q)("nebulosity.db"),iG.readOnly?"readonly":"readwrite")),iG.db;let t=function(e,t={}){let i=t.log??(e=>console.log(`[background] ${e}`)),r=new Map,s=null,n=null,a=1,l=0,o=!1,u=null,c=()=>{let t=e();s=t,t.onMessage(e=>{if("ready"===e.type){l=0;return}if("index-progress"===e.type)return void r.get(e.id)?.onProgress?.(e.progress);let t=r.get(e.id);t&&(r.delete(e.id),t.settle(e))}),t.onExit(e=>{if(s!==t)return;for(let e of(s=null,r.values()))e.fail(i0);if(r.clear(),o)return;let n=iZ[Math.min(l,iZ.length-1)];l++,i(`the worker stopped (exit code ${e}); starting a new one in ${n/1e3} s`),u=setTimeout(()=>{u=null,o||c()},n)}),t.send({type:"repo",root:n})},h=(e,t)=>{let i=s;if(!i)return Promise.resolve({ok:!1,error:iX});let n=a++;return new Promise(s=>{r.set(n,{settle:s,fail:e=>s({ok:!1,error:e}),onProgress:t}),i.send(e(n))||(r.delete(n),s({ok:!1,error:iX}))})};return{setRepo(e){e===n&&(null!==s||null!==u)||(n=e,o||(s?s.send({type:"repo",root:e}):null===u&&c()))},async summarize(e,t){let i=await h(i=>({type:"summarize",id:i,path:e,root:t}));return"type"in i?"summarized"===i.type?i.outcome:{ok:!1,error:i0}:i},async index(e,t){let i=await h(e=>({type:"index",id:e,root:t}),e);return"type"in i?"indexed"===i.type?i.outcome:{ok:!1,error:i0}:i},stop(){o=!0,u&&clearTimeout(u),u=null,s?.kill()}}}(i4);t.setRepo(function(e,t){let i,r=(e=null)=>({config:{activeRepo:null,port:3e3},problem:e});if("missing"===t.kind)return r();if("error"===t.kind)return r(`${e} couldn't be read (${o(t.error)})`);let s=function(e){if(255===e[0]&&254===e[1])return new TextDecoder("utf-16le").decode(e);if(254===e[0]&&255===e[1]){let t=Buffer.from(e.subarray(0,e.length-e.length%2)).swap16();return new TextDecoder("utf-16le").decode(t)}return new TextDecoder("utf-8").decode(e)}(t.bytes);if(""===s.trim())return r();try{i=JSON.parse(s)}catch(t){return r(`${e} isn't valid JSON (${o(t)})`)}if("object"!=typeof i||null===i||Array.isArray(i))return r(`${e} holds ${null===i?"null":Array.isArray(i)?"an array":`a ${typeof i}`}, not one JSON object of settings`);let n=i,a="number"==typeof n.port&&Number.isInteger(n.port)&&n.port>0&&n.port<65536?n.port:3e3;return{config:{...n,activeRepo:"string"==typeof n.activeRepo?n.activeRepo:null,port:a},problem:null}}(e=(0,l.Q)("config.json"),function(e){try{return{kind:"bytes",bytes:n.default.readFileSync(e)}}catch(e){var t;return"ENOENT"===(t=e,t?.code)?{kind:"missing"}:{kind:"error",error:e}}}(e)).config.activeRepo),i1.nebulosityBackground=t}return i1.nebulosityBackground}],41031)}];
|
|
8
|
+
`;t.run(s);let n=t.values(G`SELECT id, hash, created_at FROM ${G.identifier(r)} ORDER BY created_at DESC LIMIT 1`)[0]??void 0;t.run(G`BEGIN`);try{for(let i of e)if(!n||Number(n[2])<i.folderMillis){for(let e of i.sql)t.run(G.raw(e));t.run(G`INSERT INTO ${G.identifier(r)} ("hash", "created_at") VALUES(${i.hash}, ${i.folderMillis})`)}t.run(G`COMMIT`)}catch(e){throw t.run(G`ROLLBACK`),e}}}class tE{static [c]="TypedQueryBuilder";getSelectedFields(){return this._.selectedFields}}class tP{static [c]="QueryPromise";[Symbol.toStringTag]="QueryPromise";catch(e){return this.then(void 0,e)}finally(e){return this.then(t=>(e?.(),t),t=>{throw e?.(),t})}then(e,t){return this.execute().then(e,t)}}class tR{constructor(e,t){this.name=e,this.unique=t}static [c]="SQLiteIndexBuilderOn";on(...e){return new tK(this.name,e,this.unique)}}class tK{static [c]="SQLiteIndexBuilder";config;constructor(e,t,i){this.config={name:e,columns:t,unique:i,where:void 0}}where(e){return this.config.where=e,this}build(e){return new tM(this.config,e)}}class tM{static [c]="SQLiteIndex";config;constructor(e,t){this.config={...e,table:t}}}function tz(e){return new tR(e,!1)}function tU(e){return new tR(e,!0)}function tV(e){return h(e,tA)?[`${e[_.Symbol.BaseName]}`]:h(e,P)?e._.usedTables??[]:h(e,V)?e.usedTables??[]:[]}class tJ{static [c]="SQLiteSelectBuilder";fields;session;dialect;withList;distinct;constructor(e){this.fields=e.fields,this.session=e.session,this.dialect=e.dialect,this.withList=e.withList,this.distinct=e.distinct}from(e){let t,i=!!this.fields;return t=this.fields?this.fields:h(e,P)?Object.fromEntries(Object.keys(e._.selectedFields).map(t=>[t,e[t]])):h(e,tD)?e[M].selectedFields:h(e,V)?{}:e[_.Symbol.Columns],new tY({table:e,fields:t,isPartialSelect:i,session:this.session,dialect:this.dialect,withList:this.withList,distinct:this.distinct})}}class tW extends tE{static [c]="SQLiteSelectQueryBuilder";_;config;joinsNotNullableMap;tableName;isPartialSelect;session;dialect;cacheConfig=void 0;usedTables=new Set;constructor({table:e,fields:t,isPartialSelect:i,session:r,dialect:s,withList:n,distinct:a}){for(let l of(super(),this.config={withList:n,table:e,fields:{...t},distinct:a,setOperators:[]},this.isPartialSelect=i,this.session=r,this.dialect=s,this._={selectedFields:t,config:this.config},this.tableName=ea(e),this.joinsNotNullableMap="string"==typeof this.tableName?{[this.tableName]:!0}:{},tV(e)))this.usedTables.add(l)}getUsedTables(){return[...this.usedTables]}createJoin(e){return(t,i)=>{let r=this.tableName,s=ea(t);for(let e of tV(t))this.usedTables.add(e);if("string"==typeof s&&this.config.joins?.some(e=>e.alias===s))throw Error(`Alias "${s}" is already used in this query`);if(!this.isPartialSelect&&(1===Object.keys(this.joinsNotNullableMap).length&&"string"==typeof r&&(this.config.fields={[r]:this.config.fields}),"string"==typeof s&&!h(t,V))){let e=h(t,P)?t._.selectedFields:h(t,et)?t[M].selectedFields:t[_.Symbol.Columns];this.config.fields[s]=e}if("function"==typeof i&&(i=i(new Proxy(this.config.fields,new eY({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.joins||(this.config.joins=[]),this.config.joins.push({on:i,table:t,joinType:e,alias:s}),"string"==typeof s)switch(e){case"left":this.joinsNotNullableMap[s]=!1;break;case"right":this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([e])=>[e,!1])),this.joinsNotNullableMap[s]=!0;break;case"cross":case"inner":this.joinsNotNullableMap[s]=!0;break;case"full":this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([e])=>[e,!1])),this.joinsNotNullableMap[s]=!1}return this}}leftJoin=this.createJoin("left");rightJoin=this.createJoin("right");innerJoin=this.createJoin("inner");fullJoin=this.createJoin("full");crossJoin=this.createJoin("cross");createSetOperator(e,t){return i=>{let r="function"==typeof i?i(tG()):i;if(!es(this.getSelectedFields(),r.getSelectedFields()))throw Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");return this.config.setOperators.push({type:e,isAll:t,rightSelect:r}),this}}union=this.createSetOperator("union",!1);unionAll=this.createSetOperator("union",!0);intersect=this.createSetOperator("intersect",!1);except=this.createSetOperator("except",!1);addSetOperators(e){return this.config.setOperators.push(...e),this}where(e){return"function"==typeof e&&(e=e(new Proxy(this.config.fields,new eY({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.where=e,this}having(e){return"function"==typeof e&&(e=e(new Proxy(this.config.fields,new eY({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.having=e,this}groupBy(...e){if("function"==typeof e[0]){let t=e[0](new Proxy(this.config.fields,new eY({sqlAliasedBehavior:"alias",sqlBehavior:"sql"})));this.config.groupBy=Array.isArray(t)?t:[t]}else this.config.groupBy=e;return this}orderBy(...e){if("function"==typeof e[0]){let t=e[0](new Proxy(this.config.fields,new eY({sqlAliasedBehavior:"alias",sqlBehavior:"sql"}))),i=Array.isArray(t)?t:[t];this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=i:this.config.orderBy=i}else this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=e:this.config.orderBy=e;return this}limit(e){return this.config.setOperators.length>0?this.config.setOperators.at(-1).limit=e:this.config.limit=e,this}offset(e){return this.config.setOperators.length>0?this.config.setOperators.at(-1).offset=e:this.config.offset=e,this}getSQL(){return this.dialect.buildSelectQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}as(e){let t=[];if(t.push(...tV(this.config.table)),this.config.joins)for(let e of this.config.joins)t.push(...tV(e.table));return new Proxy(new P(this.getSQL(),this.config.fields,e,!1,[...new Set(t)]),new eY({alias:e,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}getSelectedFields(){return new Proxy(this.config.fields,new eY({alias:this.tableName,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}$dynamic(){return this}}class tY extends tW{static [c]="SQLiteSelect";_prepare(e=!0){if(!this.session)throw Error("Cannot execute a query on a query builder. Please use a database instance instead.");let t=er(this.config.fields),i=this.session[e?"prepareOneTimeQuery":"prepareQuery"](this.dialect.sqlToQuery(this.getSQL()),t,"all",!0,void 0,{type:"select",tables:[...this.usedTables]},this.cacheConfig);return i.joinsNotNullableMap=this.joinsNotNullableMap,i}$withCache(e){return this.cacheConfig=void 0===e?{config:{},enable:!0,autoInvalidate:!0}:!1===e?{enable:!1}:{enable:!0,autoInvalidate:!0,...e},this}prepare(){return this._prepare(!1)}run=e=>this._prepare().run(e);all=e=>this._prepare().all(e);get=e=>this._prepare().get(e);values=e=>this._prepare().values(e);async execute(){return this.all()}}for(let e of[tP])for(let t of Object.getOwnPropertyNames(e.prototype))"constructor"!==t&&Object.defineProperty(tY.prototype,t,Object.getOwnPropertyDescriptor(e.prototype,t)||Object.create(null));function tH(e,t){return(i,r,...s)=>{let n=[r,...s].map(i=>({type:e,isAll:t,rightSelect:i}));for(let e of n)if(!es(i.getSelectedFields(),e.rightSelect.getSelectedFields()))throw Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");return i.addSetOperators(n)}}let tG=()=>({union:tZ,unionAll:tX,intersect:t0,except:t1}),tZ=tH("union",!1),tX=tH("union",!0),t0=tH("intersect",!1),t1=tH("except",!1);class t3{static [c]="SQLiteQueryBuilder";dialect;dialectConfig;constructor(e){this.dialect=h(e,tF)?e:void 0,this.dialectConfig=h(e,tF)?void 0:e}$with=(e,t)=>{let i=this;return{as:r=>("function"==typeof r&&(r=r(i)),new Proxy(new R(r.getSQL(),t??("getSelectedFields"in r?r.getSelectedFields()??{}:{}),e,!0),new eY({alias:e,sqlAliasedBehavior:"alias",sqlBehavior:"error"})))}};with(...e){let t=this;return{select:function(i){return new tJ({fields:i??void 0,session:void 0,dialect:t.getDialect(),withList:e})},selectDistinct:function(i){return new tJ({fields:i??void 0,session:void 0,dialect:t.getDialect(),withList:e,distinct:!0})}}}select(e){return new tJ({fields:e??void 0,session:void 0,dialect:this.getDialect()})}selectDistinct(e){return new tJ({fields:e??void 0,session:void 0,dialect:this.getDialect(),distinct:!0})}getDialect(){return this.dialect||(this.dialect=new tk(this.dialectConfig)),this.dialect}}class t2 extends tP{constructor(e,t,i,r){super(),this.table=e,this.session=t,this.dialect=i,this.config={table:e,withList:r}}static [c]="SQLiteDelete";config;where(e){return this.config.where=e,this}orderBy(...e){if("function"==typeof e[0]){let t=e[0](new Proxy(this.config.table[_.Symbol.Columns],new eY({sqlAliasedBehavior:"alias",sqlBehavior:"sql"}))),i=Array.isArray(t)?t:[t];this.config.orderBy=i}else this.config.orderBy=e;return this}limit(e){return this.config.limit=e,this}returning(e=this.table[tA.Symbol.Columns]){return this.config.returning=er(e),this}getSQL(){return this.dialect.buildDeleteQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}_prepare(e=!0){return this.session[e?"prepareOneTimeQuery":"prepareQuery"](this.dialect.sqlToQuery(this.getSQL()),this.config.returning,this.config.returning?"all":"run",!0,void 0,{type:"delete",tables:tV(this.config.table)})}prepare(){return this._prepare(!1)}run=e=>this._prepare().run(e);all=e=>this._prepare().all(e);get=e=>this._prepare().get(e);values=e=>this._prepare().values(e);async execute(e){return this._prepare().execute(e)}$dynamic(){return this}}class t4{constructor(e,t,i,r){this.table=e,this.session=t,this.dialect=i,this.withList=r}static [c]="SQLiteInsertBuilder";values(e){if(0===(e=Array.isArray(e)?e:[e]).length)throw Error("values() must be called with at least one value");let t=e.map(e=>{let t={},i=this.table[_.Symbol.Columns];for(let r of Object.keys(e)){let s=e[r];t[r]=h(s,V)?s:new H(s,i[r])}return t});return new t5(this.table,t,this.session,this.dialect,this.withList)}select(e){let t="function"==typeof e?e(new t3):e;if(!h(t,V)&&!es(this.table[y],t._.selectedFields))throw Error("Insert select error: selected fields are not the same or are in a different order compared to the table definition");return new t5(this.table,t,this.session,this.dialect,this.withList,!0)}}class t5 extends tP{constructor(e,t,i,r,s,n){super(),this.session=i,this.dialect=r,this.config={table:e,values:t,withList:s,select:n}}static [c]="SQLiteInsert";config;returning(e=this.config.table[tA.Symbol.Columns]){return this.config.returning=er(e),this}onConflictDoNothing(e={}){if(this.config.onConflict||(this.config.onConflict=[]),void 0===e.target)this.config.onConflict.push(G` on conflict do nothing`);else{let t=Array.isArray(e.target)?G`${e.target}`:G`${[e.target]}`,i=e.where?G` where ${e.where}`:G``;this.config.onConflict.push(G` on conflict ${t} do nothing${i}`)}return this}onConflictDoUpdate(e){if(e.where&&(e.targetWhere||e.setWhere))throw Error('You cannot use both "where" and "targetWhere"/"setWhere" at the same time - "where" is deprecated, use "targetWhere" or "setWhere" instead.');this.config.onConflict||(this.config.onConflict=[]);let t=e.where?G` where ${e.where}`:void 0,i=e.targetWhere?G` where ${e.targetWhere}`:void 0,r=e.setWhere?G` where ${e.setWhere}`:void 0,s=Array.isArray(e.target)?G`${e.target}`:G`${[e.target]}`,n=this.dialect.buildUpdateSet(this.config.table,en(this.config.table,e.set));return this.config.onConflict.push(G` on conflict ${s}${i} do update set ${n}${t}${r}`),this}getSQL(){return this.dialect.buildInsertQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}_prepare(e=!0){return this.session[e?"prepareOneTimeQuery":"prepareQuery"](this.dialect.sqlToQuery(this.getSQL()),this.config.returning,this.config.returning?"all":"run",!0,void 0,{type:"insert",tables:tV(this.config.table)})}prepare(){return this._prepare(!1)}run=e=>this._prepare().run(e);all=e=>this._prepare().all(e);get=e=>this._prepare().get(e);values=e=>this._prepare().values(e);async execute(){return this.config.returning?this.all():this.run()}$dynamic(){return this}}class t6{constructor(e,t,i,r){this.table=e,this.session=t,this.dialect=i,this.withList=r}static [c]="SQLiteUpdateBuilder";set(e){return new t8(this.table,en(this.table,e),this.session,this.dialect,this.withList)}}class t8 extends tP{constructor(e,t,i,r,s){super(),this.session=i,this.dialect=r,this.config={set:t,table:e,withList:s,joins:[]}}static [c]="SQLiteUpdate";config;from(e){return this.config.from=e,this}createJoin(e){return(t,i)=>{let r=ea(t);if("string"==typeof r&&this.config.joins.some(e=>e.alias===r))throw Error(`Alias "${r}" is already used in this query`);if("function"==typeof i){let e=this.config.from?h(t,tA)?t[_.Symbol.Columns]:h(t,P)?t._.selectedFields:h(t,tD)?t[M].selectedFields:void 0:void 0;i=i(new Proxy(this.config.table[_.Symbol.Columns],new eY({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})),e&&new Proxy(e,new eY({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))}return this.config.joins.push({on:i,table:t,joinType:e,alias:r}),this}}leftJoin=this.createJoin("left");rightJoin=this.createJoin("right");innerJoin=this.createJoin("inner");fullJoin=this.createJoin("full");where(e){return this.config.where=e,this}orderBy(...e){if("function"==typeof e[0]){let t=e[0](new Proxy(this.config.table[_.Symbol.Columns],new eY({sqlAliasedBehavior:"alias",sqlBehavior:"sql"}))),i=Array.isArray(t)?t:[t];this.config.orderBy=i}else this.config.orderBy=e;return this}limit(e){return this.config.limit=e,this}returning(e=this.config.table[tA.Symbol.Columns]){return this.config.returning=er(e),this}getSQL(){return this.dialect.buildUpdateQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}_prepare(e=!0){return this.session[e?"prepareOneTimeQuery":"prepareQuery"](this.dialect.sqlToQuery(this.getSQL()),this.config.returning,this.config.returning?"all":"run",!0,void 0,{type:"insert",tables:tV(this.config.table)})}prepare(){return this._prepare(!1)}run=e=>this._prepare().run(e);all=e=>this._prepare().all(e);get=e=>this._prepare().get(e);values=e=>this._prepare().values(e);async execute(){return this.config.returning?this.all():this.run()}$dynamic(){return this}}class t9 extends V{constructor(e){super(t9.buildEmbeddedCount(e.source,e.filters).queryChunks),this.params=e,this.session=e.session,this.sql=t9.buildCount(e.source,e.filters)}sql;static [c]="SQLiteCountBuilderAsync";[Symbol.toStringTag]="SQLiteCountBuilderAsync";session;static buildEmbeddedCount(e,t){return G`(select count(*) from ${e}${G.raw(" where ").if(t)}${t})`}static buildCount(e,t){return G`select count(*) from ${e}${G.raw(" where ").if(t)}${t}`}then(e,t){return Promise.resolve(this.session.count(this.sql)).then(e,t)}catch(e){return this.then(void 0,e)}finally(e){return this.then(t=>(e?.(),t),t=>{throw e?.(),t})}}class t7{constructor(e,t,i,r,s,n,a,l){this.mode=e,this.fullSchema=t,this.schema=i,this.tableNamesMap=r,this.table=s,this.tableConfig=n,this.dialect=a,this.session=l}static [c]="SQLiteAsyncRelationalQueryBuilder";findMany(e){return"sync"===this.mode?new it(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,e||{},"many"):new ie(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,e||{},"many")}findFirst(e){return"sync"===this.mode?new it(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,e?{...e,limit:1}:{limit:1},"first"):new ie(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,e?{...e,limit:1}:{limit:1},"first")}}class ie extends tP{constructor(e,t,i,r,s,n,a,l,o){super(),this.fullSchema=e,this.schema=t,this.tableNamesMap=i,this.table=r,this.tableConfig=s,this.dialect=n,this.session=a,this.config=l,this.mode=o}static [c]="SQLiteAsyncRelationalQuery";mode;getSQL(){return this.dialect.buildRelationalQuery({fullSchema:this.fullSchema,schema:this.schema,tableNamesMap:this.tableNamesMap,table:this.table,tableConfig:this.tableConfig,queryConfig:this.config,tableAlias:this.tableConfig.tsName}).sql}_prepare(e=!1){let{query:t,builtQuery:i}=this._toSQL();return this.session[e?"prepareOneTimeQuery":"prepareQuery"](i,void 0,"first"===this.mode?"get":"all",!0,(e,i)=>{let r=e.map(e=>(function e(t,i,r,s,n=e=>e){let a={};for(let[l,o]of s.entries())if(o.isJson){let s=i.relations[o.tsKey],u=r[l],c="string"==typeof u?JSON.parse(u):u;a[o.tsKey]=h(s,eP)?c&&e(t,t[o.relationTableTsKey],c,o.selection,n):c.map(i=>e(t,t[o.relationTableTsKey],i,o.selection,n))}else{let e,t=n(r[l]),i=o.field;e=h(i,Q)?i:h(i,V)?i.decoder:i.sql.decoder,a[o.tsKey]=null===t?null:e.mapFromDriverValue(t)}return a})(this.schema,this.tableConfig,e,t.selection,i));return"first"===this.mode?r[0]:r})}prepare(){return this._prepare(!1)}_toSQL(){let e=this.dialect.buildRelationalQuery({fullSchema:this.fullSchema,schema:this.schema,tableNamesMap:this.tableNamesMap,table:this.table,tableConfig:this.tableConfig,queryConfig:this.config,tableAlias:this.tableConfig.tsName}),t=this.dialect.sqlToQuery(e.sql);return{query:e,builtQuery:t}}toSQL(){return this._toSQL().builtQuery}executeRaw(){return"first"===this.mode?this._prepare(!1).get():this._prepare(!1).all()}async execute(){return this.executeRaw()}}class it extends ie{static [c]="SQLiteSyncRelationalQuery";sync(){return this.executeRaw()}}class ii extends tP{constructor(e,t,i,r,s){super(),this.execute=e,this.getSQL=t,this.dialect=r,this.mapBatchResult=s,this.config={action:i}}static [c]="SQLiteRaw";config;getQuery(){return{...this.dialect.sqlToQuery(this.getSQL()),method:this.config.action}}mapResult(e,t){return t?this.mapBatchResult(e):e}_prepare(){return this}isResponseInArrayMode(){return!1}}class ir{constructor(e,t,i,r){this.resultKind=e,this.dialect=t,this.session=i,this._=r?{schema:r.schema,fullSchema:r.fullSchema,tableNamesMap:r.tableNamesMap}:{schema:void 0,fullSchema:{},tableNamesMap:{}},this.query={};let s=this.query;if(this._.schema)for(let[n,a]of Object.entries(this._.schema))s[n]=new t7(e,r.fullSchema,this._.schema,this._.tableNamesMap,r.fullSchema[n],a,t,i);this.$cache={invalidate:async e=>{}}}static [c]="BaseSQLiteDatabase";query;$with=(e,t)=>{let i=this;return{as:r=>("function"==typeof r&&(r=r(new t3(i.dialect))),new Proxy(new R(r.getSQL(),t??("getSelectedFields"in r?r.getSelectedFields()??{}:{}),e,!0),new eY({alias:e,sqlAliasedBehavior:"alias",sqlBehavior:"error"})))}};$count(e,t){return new t9({source:e,filters:t,session:this.session})}with(...e){let t=this;return{select:function(i){return new tJ({fields:i??void 0,session:t.session,dialect:t.dialect,withList:e})},selectDistinct:function(i){return new tJ({fields:i??void 0,session:t.session,dialect:t.dialect,withList:e,distinct:!0})},update:function(i){return new t6(i,t.session,t.dialect,e)},insert:function(i){return new t4(i,t.session,t.dialect,e)},delete:function(i){return new t2(i,t.session,t.dialect,e)}}}select(e){return new tJ({fields:e??void 0,session:this.session,dialect:this.dialect})}selectDistinct(e){return new tJ({fields:e??void 0,session:this.session,dialect:this.dialect,distinct:!0})}update(e){return new t6(e,this.session,this.dialect)}$cache;insert(e){return new t4(e,this.session,this.dialect)}delete(e){return new t2(e,this.session,this.dialect)}run(e){let t="string"==typeof e?G.raw(e):e.getSQL();return"async"===this.resultKind?new ii(async()=>this.session.run(t),()=>t,"run",this.dialect,this.session.extractRawRunValueFromBatchResult.bind(this.session)):this.session.run(t)}all(e){let t="string"==typeof e?G.raw(e):e.getSQL();return"async"===this.resultKind?new ii(async()=>this.session.all(t),()=>t,"all",this.dialect,this.session.extractRawAllValueFromBatchResult.bind(this.session)):this.session.all(t)}get(e){let t="string"==typeof e?G.raw(e):e.getSQL();return"async"===this.resultKind?new ii(async()=>this.session.get(t),()=>t,"get",this.dialect,this.session.extractRawGetValueFromBatchResult.bind(this.session)):this.session.get(t)}values(e){let t="string"==typeof e?G.raw(e):e.getSQL();return"async"===this.resultKind?new ii(async()=>this.session.values(t),()=>t,"values",this.dialect,this.session.extractRawValuesValueFromBatchResult.bind(this.session)):this.session.values(t)}transaction(e,t){return this.session.transaction(e,t)}}class is{static [c]="Cache"}class ia extends is{strategy(){return"all"}static [c]="NoopCache";async get(e){}async put(e,t,i,r){}async onMutate(e){}}async function il(e,t){let i=`${e}-${JSON.stringify(t)}`,r=new TextEncoder().encode(i);return[...new Uint8Array(await crypto.subtle.digest("SHA-256",r))].map(e=>e.toString(16).padStart(2,"0")).join("")}class io extends tP{constructor(e){super(),this.resultCb=e}static [c]="ExecuteResultSync";async execute(){return this.resultCb()}sync(){return this.resultCb()}}class iu{constructor(e,t,i,r,s,n){this.mode=e,this.executeMethod=t,this.query=i,this.cache=r,this.queryMetadata=s,this.cacheConfig=n,r&&"all"===r.strategy()&&void 0===n&&(this.cacheConfig={enable:!0,autoInvalidate:!0}),this.cacheConfig?.enable||(this.cacheConfig=void 0)}static [c]="PreparedQuery";joinsNotNullableMap;async queryWithCache(e,t,i){if(void 0===this.cache||h(this.cache,ia)||void 0===this.queryMetadata||this.cacheConfig&&!this.cacheConfig.enable)try{return await i()}catch(i){throw new e1(e,t,i)}if(("insert"===this.queryMetadata.type||"update"===this.queryMetadata.type||"delete"===this.queryMetadata.type)&&this.queryMetadata.tables.length>0)try{let[e]=await Promise.all([i(),this.cache.onMutate({tables:this.queryMetadata.tables})]);return e}catch(i){throw new e1(e,t,i)}if(!this.cacheConfig)try{return await i()}catch(i){throw new e1(e,t,i)}if("select"===this.queryMetadata.type){let r=await this.cache.get(this.cacheConfig.tag??await il(e,t),this.queryMetadata.tables,void 0!==this.cacheConfig.tag,this.cacheConfig.autoInvalidate);if(void 0===r){let r;try{r=await i()}catch(i){throw new e1(e,t,i)}return await this.cache.put(this.cacheConfig.tag??await il(e,t),r,this.cacheConfig.autoInvalidate?this.queryMetadata.tables:[],void 0!==this.cacheConfig.tag,this.cacheConfig.config),r}return r}try{return await i()}catch(i){throw new e1(e,t,i)}}getQuery(){return this.query}mapRunResult(e,t){return e}mapAllResult(e,t){throw Error("Not implemented")}mapGetResult(e,t){throw Error("Not implemented")}execute(e){return"async"===this.mode?this[this.executeMethod](e):new io(()=>this[this.executeMethod](e))}mapResult(e,t){switch(this.executeMethod){case"run":return this.mapRunResult(e,t);case"all":return this.mapAllResult(e,t);case"get":return this.mapGetResult(e,t)}}}class ic{constructor(e){this.dialect=e}static [c]="SQLiteSession";prepareOneTimeQuery(e,t,i,r,s,n,a){return this.prepareQuery(e,t,i,r,s,n,a)}run(e){let t=this.dialect.sqlToQuery(e);try{return this.prepareOneTimeQuery(t,void 0,"run",!1).run()}catch(e){throw new e0({cause:e,message:`Failed to run the query '${t.sql}'`})}}extractRawRunValueFromBatchResult(e){return e}all(e){return this.prepareOneTimeQuery(this.dialect.sqlToQuery(e),void 0,"run",!1).all()}extractRawAllValueFromBatchResult(e){throw Error("Not implemented")}get(e){return this.prepareOneTimeQuery(this.dialect.sqlToQuery(e),void 0,"run",!1).get()}extractRawGetValueFromBatchResult(e){throw Error("Not implemented")}values(e){return this.prepareOneTimeQuery(this.dialect.sqlToQuery(e),void 0,"run",!1).values()}async count(e){return(await this.values(e))[0][0]}extractRawValuesValueFromBatchResult(e){throw Error("Not implemented")}}class ih extends ir{constructor(e,t,i,r,s=0){super(e,t,i,r),this.schema=r,this.nestedIndex=s}static [c]="SQLiteTransaction";rollback(){throw new e3}}class id extends ic{constructor(e,t,i,r={}){super(t),this.client=e,this.schema=i,this.logger=r.logger??new m,this.cache=r.cache??new ia}static [c]="BetterSQLiteSession";logger;cache;prepareQuery(e,t,i,r,s,n,a){return new ip(this.client.prepare(e.sql),e,this.logger,this.cache,n,a,t,i,r,s)}transaction(e,t={}){let i=new im("sync",this.dialect,this,this.schema);return this.client.transaction(e)[t.behavior??"deferred"](i)}}class im extends ih{static [c]="BetterSQLiteTransaction";transaction(e){let t=`sp${this.nestedIndex}`,i=new im("sync",this.dialect,this.session,this.schema,this.nestedIndex+1);this.session.run(G.raw(`savepoint ${t}`));try{let r=e(i);return this.session.run(G.raw(`release savepoint ${t}`)),r}catch(e){throw this.session.run(G.raw(`rollback to savepoint ${t}`)),e}}}class ip extends iu{constructor(e,t,i,r,s,n,a,l,o,u){super("sync",l,t,r,s,n),this.stmt=e,this.logger=i,this.fields=a,this._isResponseInArrayMode=o,this.customResultMapper=u}static [c]="BetterSQLitePreparedQuery";run(e){let t=X(this.query.params,e??{});return this.logger.logQuery(this.query.sql,t),this.stmt.run(...t)}all(e){let{fields:t,joinsNotNullableMap:i,query:r,logger:s,stmt:n,customResultMapper:a}=this;if(!t&&!a){let t=X(r.params,e??{});return s.logQuery(r.sql,t),n.all(...t)}let l=this.values(e);return a?a(l):l.map(e=>ei(t,e,i))}get(e){let t=X(this.query.params,e??{});this.logger.logQuery(this.query.sql,t);let{fields:i,stmt:r,joinsNotNullableMap:s,customResultMapper:n}=this;if(!i&&!n)return r.get(...t);let a=r.raw().get(...t);if(a)return n?n([a]):ei(i,a,s)}values(e){let t=X(this.query.params,e??{});return this.logger.logQuery(this.query.sql,t),this.stmt.raw().all(...t)}isResponseInArrayMode(){return this._isResponseInArrayMode}}class ig extends ir{static [c]="BetterSQLite3Database"}function iy(e,t={}){let i,r,s=new tk({casing:t.casing});if(!0===t.logger?i=new f:!1!==t.logger&&(i=t.logger),t.schema){let e=function(e,t){1===Object.keys(e).length&&"default"in e&&!h(e.default,_)&&(e=e.default);let i={},r={},s={};for(let[n,a]of Object.entries(e))if(h(a,_)){let e=x(a),t=r[e];for(let r of(i[e]=n,s[n]={tsName:n,dbName:a[_.Symbol.Name],schema:a[_.Symbol.Schema],columns:a[_.Symbol.Columns],relations:t?.relations??{},primaryKey:t?.primaryKey??[]},Object.values(a[_.Symbol.Columns])))r.primary&&s[n].primaryKey.push(r);let l=a[_.Symbol.ExtraConfigBuilder]?.(a[_.Symbol.ExtraConfigColumns]);if(l)for(let e of Object.values(l))h(e,ed)&&s[n].primaryKey.push(...e.columns)}else if(h(a,eE)){let e,n=x(a.table),l=i[n];for(let[i,o]of Object.entries(a.config(t(a.table))))if(l){let t=s[l];t.relations[i]=o,e&&t.primaryKey.push(...e)}else n in r||(r[n]={relations:{},primaryKey:e}),r[n].relations[i]=o}return{tables:s,tableNamesMap:i}}(t.schema,eK);r={fullSchema:t.schema,schema:e.tables,tableNamesMap:e.tableNamesMap}}let n=new id(e,s,r,{logger:i}),a=new ig("sync",s,n,r);return a.$client=e,a}function ib(...e){if(void 0===e[0]||"string"==typeof e[0])return iy(void 0===e[0]?new u.default:new u.default(e[0]),e[1]);if(function(e){if("object"!=typeof e||null===e||"Object"!==e.constructor.name)return!1;if("logger"in e){let t=typeof e.logger;return"boolean"===t||"object"===t&&"function"==typeof e.logger.logQuery||"undefined"===t}if("schema"in e){let t=typeof e.schema;return"object"===t||"undefined"===t}if("casing"in e){let t=typeof e.casing;return"string"===t||"undefined"===t}if("mode"in e)return"default"===e.mode&&"planetscale"===e.mode&&void 0===e.mode;if("connection"in e){let t=typeof e.connection;return"string"===t||"object"===t||"undefined"===t}if("client"in e){let t=typeof e.client;return"object"===t||"function"===t||"undefined"===t}return 0===Object.keys(e).length}(e[0])){let{connection:t,client:i,...r}=e[0];if(i)return iy(i,r);if("object"==typeof t){let{source:e,...i}=t;return iy(new u.default(e,i),r)}return iy(new u.default(t),r)}return iy(e[0],e[1])}(ib||(ib={})).mock=function(e){return iy({},e)};var iw=e.i(66680),iS=e.i(2157);function iN(e){let t=e.migrationsFolder,i=[],r=`${t}/meta/_journal.json`;if(!iS.default.existsSync(r))throw Error("Can't find meta/_journal.json file");for(let e of JSON.parse(iS.default.readFileSync(`${t}/meta/_journal.json`).toString()).entries){let r=`${t}/${e.tag}.sql`;try{let r=iS.default.readFileSync(`${t}/${e.tag}.sql`).toString(),s=r.split("--> statement-breakpoint").map(e=>e);i.push({sql:s,bps:e.breakpoints,folderMillis:e.when,hash:iw.default.createHash("sha256").update(r).digest("hex")})}catch{throw Error(`No file ${r} found in ${t} folder`)}}return i}let iv=tj("repositories",{id:ty().primaryKey({autoIncrement:!0}),rootPath:tO("root_path").notNull().unique(),lastScanAt:ty("last_scan_at",{mode:"timestamp"}),lastIndexAt:ty("last_index_at",{mode:"timestamp"}),indexedHead:tO("indexed_head")}),i$=tj("files",{id:ty().primaryKey({autoIncrement:!0}),repoId:ty("repo_id").notNull().references(()=>iv.id,{onDelete:"cascade"}),path:tO("path").notNull(),kind:tO("kind",{enum:["component","module"]}).notNull(),contentHash:tO("content_hash").notNull(),language:tO("language").notNull().default("typescript"),sizeBytes:ty("size_bytes").notNull().default(0),lineCount:ty("line_count").notNull().default(0),isTest:ty("is_test",{mode:"boolean"}).notNull().default(!1),importSpecifiers:tO("import_specifiers").notNull().default("[]"),declares:tO("declares").notNull().default("[]")},e=>[tU("files_repo_path_unique").on(e.repoId,e.path)]),i_=tj("imports",{id:ty().primaryKey({autoIncrement:!0}),sourceFileId:ty("source_file_id").notNull().references(()=>i$.id,{onDelete:"cascade"}),targetFileId:ty("target_file_id").notNull().references(()=>i$.id,{onDelete:"cascade"}),specifier:tO("specifier").notNull()},e=>[tU("imports_source_target_unique").on(e.sourceFileId,e.targetFileId),tz("imports_target_idx").on(e.targetFileId)]),ix=tj("chunks",{id:ty().primaryKey({autoIncrement:!0}),fileId:ty("file_id").notNull().references(()=>i$.id,{onDelete:"cascade"}),chunkId:tO("chunk_id").notNull(),kind:tO("kind",{enum:["function","class","component","interface","type","const","enum","namespace","file-summary"]}).notNull(),name:tO("name").notNull(),nameSplit:tO("name_split").notNull().default(""),startLine:ty("start_line").notNull(),endLine:ty("end_line").notNull(),exported:ty("exported",{mode:"boolean"}).notNull().default(!1),partIndex:ty("part_index").notNull().default(0),text:tO("text").notNull(),fileHash:tO("file_hash").notNull(),createdAt:ty("created_at",{mode:"timestamp"}).notNull().$defaultFn(()=>new Date)},e=>[tU("chunks_file_chunk_unique").on(e.fileId,e.chunkId)]),iQ=tj("meta",{id:ty().primaryKey({autoIncrement:!0}),key:tO("key").notNull().unique(),value:tO("value").notNull(),updatedAt:ty("updated_at",{mode:"timestamp"}).notNull().$defaultFn(()=>new Date).$onUpdateFn(()=>new Date)}),iq=["function","class","method","property","accessor","constructor","interface","type","enum","const","namespace","struct","trait"],iC=tj("symbols",{id:ty().primaryKey({autoIncrement:!0}),fileId:ty("file_id").notNull().references(()=>i$.id,{onDelete:"cascade"}),name:tO("name").notNull(),qualifiedName:tO("qualified_name").notNull(),kind:tO("kind",{enum:iq}).notNull(),startLine:ty("start_line").notNull(),endLine:ty("end_line").notNull(),exported:ty("exported",{mode:"boolean"}).notNull().default(!1),parentQualifiedName:tO("parent_qualified_name")},e=>[tz("symbols_file_idx").on(e.fileId),tz("symbols_name_idx").on(e.name)]),iT=tj("folders",{id:ty().primaryKey({autoIncrement:!0}),repoId:ty("repo_id").notNull().references(()=>iv.id,{onDelete:"cascade"}),path:tO("path").notNull(),parentPath:tO("parent_path"),depth:ty("depth").notNull(),name:tO("name").notNull(),fileCount:ty("file_count").notNull(),directFileCount:ty("direct_file_count").notNull()},e=>[tU("folders_repo_path_unique").on(e.repoId,e.path),tz("folders_repo_parent_idx").on(e.repoId,e.parentPath)]),iL=tj("level_edges",{id:ty().primaryKey({autoIncrement:!0}),repoId:ty("repo_id").notNull().references(()=>iv.id,{onDelete:"cascade"}),levelPath:tO("level_path").notNull(),sourceNode:tO("source_node").notNull(),targetNode:tO("target_node").notNull(),count:ty("count").notNull()},e=>[tU("level_edges_unique").on(e.repoId,e.levelPath,e.sourceNode,e.targetNode)]),iB=["file","folder","repo"],iO=["fresh","stale","pending","failed","skipped"],iI=tj("summaries",{id:ty().primaryKey({autoIncrement:!0}),repoId:ty("repo_id").notNull().references(()=>iv.id,{onDelete:"cascade"}),targetKind:tO("target_kind",{enum:iB}).notNull(),targetPath:tO("target_path").notNull(),tagline:tO("tagline"),summary:tO("summary"),model:tO("model"),inputHash:tO("input_hash"),promptVersion:ty("prompt_version"),status:tO("status",{enum:iO}).notNull(),error:tO("error"),batchId:tO("batch_id"),pendingHash:tO("pending_hash"),updatedAt:ty("updated_at",{mode:"timestamp"}).notNull().$defaultFn(()=>new Date)},e=>[tU("summaries_target_unique").on(e.repoId,e.targetKind,e.targetPath),tz("summaries_batch_idx").on(e.batchId)]),iA=tj("summary_vectors",{id:ty().primaryKey({autoIncrement:!0}),summaryId:ty("summary_id").notNull().unique().references(()=>iI.id,{onDelete:"cascade"}),embedding:tn("embedding",{mode:"buffer"}).notNull()}),ij=tj("summary_usage",{id:ty().primaryKey({autoIncrement:!0}),repoId:ty("repo_id").notNull().references(()=>iv.id,{onDelete:"cascade"}),model:tO("model").notNull(),transport:tO("transport",{enum:["direct","batch"]}).notNull(),requests:ty("requests").notNull().default(0),inputTokens:ty("input_tokens").notNull().default(0),outputTokens:ty("output_tokens").notNull().default(0)},e=>[tU("summary_usage_unique").on(e.repoId,e.model,e.transport)]),iD=tj("entry_points",{id:ty().primaryKey({autoIncrement:!0}),repoId:ty("repo_id").notNull().references(()=>iv.id,{onDelete:"cascade"}),path:tO("path").notNull(),declaredBy:tO("declared_by").notNull()},e=>[tU("entry_points_repo_path_unique").on(e.repoId,e.path)]),iF=tj("docs",{id:ty().primaryKey({autoIncrement:!0}),repoId:ty("repo_id").notNull().references(()=>iv.id,{onDelete:"cascade"}),path:tO("path").notNull(),title:tO("title").notNull()},e=>[tU("docs_repo_path_unique").on(e.repoId,e.path)]),ik=["applies","readme","mentions"],iE=tj("doc_links",{id:ty().primaryKey({autoIncrement:!0}),repoId:ty("repo_id").notNull().references(()=>iv.id,{onDelete:"cascade"}),docPath:tO("doc_path").notNull(),targetPath:tO("target_path").notNull(),kind:tO("kind",{enum:ik}).notNull(),count:ty("count").notNull(),detail:tO("detail")},e=>[tz("doc_links_repo_target_idx").on(e.repoId,e.targetPath)]),iP=["param","local","destructure","constraint","cast","provider","new","alias","field","this","ctor-param","inject-field","super","return","member"],iR=tj("type_decls",{id:ty().primaryKey({autoIncrement:!0}),fileId:ty("file_id").notNull().references(()=>i$.id,{onDelete:"cascade"}),name:tO("name"),kind:tO("kind",{enum:["class","interface"]}).notNull(),line:ty("line").notNull(),exported:ty("exported",{mode:"boolean"}).notNull().default(!1),nested:ty("nested",{mode:"boolean"}).notNull().default(!1),extendsRefs:tO("extends_refs").notNull().default("[]"),implementsRefs:tO("implements_refs").notNull().default("[]"),testDoubleOf:tO("test_double_of"),members:tO("members").notNull().default("[]"),fields:tO("fields").notNull().default("{}")},e=>[tz("type_decls_file_idx").on(e.fileId),tz("type_decls_name_idx").on(e.name)]),iK=tj("call_bindings",{id:ty().primaryKey({autoIncrement:!0}),fileId:ty("file_id").notNull().references(()=>i$.id,{onDelete:"cascade"}),kind:tO("kind",{enum:["import","reexport","export"]}).notNull(),local:tO("local").notNull(),imported:tO("imported").notNull(),specifier:tO("specifier")},e=>[tz("call_bindings_file_idx").on(e.fileId)]),iM=tj("typed_calls",{id:ty().primaryKey({autoIncrement:!0}),fileId:ty("file_id").notNull().references(()=>i$.id,{onDelete:"cascade"}),line:ty("line").notNull(),member:tO("member"),receiver:tO("receiver",{enum:["type","field","this"]}).notNull(),ref:tO("ref"),inClass:tO("in_class"),how:tO("how",{enum:iP}).notNull()},e=>[tz("typed_calls_file_idx").on(e.fileId),tz("typed_calls_member_idx").on(e.member)]);e.s(["CALL_RULES",0,iP,"DOC_LINK_KINDS",0,ik,"META_KEYS",0,{INDEXING_LOCK:"indexing",SUMMARIZING_LOCK:"summarizing"},"SUMMARY_STATUSES",0,iO,"SUMMARY_TARGET_KINDS",0,iB,"SYMBOL_KINDS",0,iq,"callBindings",0,iK,"chunks",0,ix,"docLinks",0,iE,"docs",0,iF,"entryPoints",0,iD,"files",0,i$,"folders",0,iT,"imports",0,i_,"levelEdges",0,iL,"meta",0,iQ,"repositories",0,iv,"summaries",0,iI,"summaryUsage",0,ij,"summaryVectors",0,iA,"symbols",0,iC,"typeDecls",0,iR,"typedCalls",0,iM],93342);var iz=e.i(93342);function iU(e,t){return`nebulosity ${e} ${t} (in a checkout: npm run ${e} -- ${t})`}class iV extends Error{constructor(e){super(`No repository indexed yet: there's no index at ${e}. Run ${iU("index","<path-to-repo>")}.`),this.name="DatabaseMissingError"}}class iJ extends Error{constructor(){super(`Nebulosity's index is older than this version of Nebulosity. Run ${iU("index","<path-to-repo>")} once, or start the Map (nebulosity map; in a checkout, npm run dev), to update it, then try again.`),this.name="DatabaseOutdatedError"}}let iW=()=>(0,l.L)("lib","db","migrations"),iY=e=>ib(e,{schema:iz});function iH(e,t="readwrite"){var i;let r;if("readonly"===t)return function(e){if(!n.default.existsSync(e))throw new iV(e);let t=new u.default(e,{readonly:!0,fileMustExist:!0});try{var i=t;let e=Math.max(...iN({migrationsFolder:iW()}).map(e=>e.folderMillis)),r=null;try{let e=i.prepare("select max(created_at) as at from __drizzle_migrations").get();r=null===e.at?null:Number(e.at)}catch(e){if(!/no such table/.test(e instanceof Error?e.message:String(e)))throw e}if(null===r||r<e)throw new iJ}catch(e){throw t.close(),e}return iY(t)}(e);":memory:"!==e&&n.default.mkdirSync(a.default.dirname(e),{recursive:!0});let s=new u.default(e);s.pragma("journal_mode = WAL"),s.pragma("synchronous = NORMAL"),s.pragma("foreign_keys = ON");let l=iY(s);return r=iN(i={migrationsFolder:iW()}),l.dialect.migrate(r,l.session,i),l}let iG=globalThis,iZ=[1e3,2e3,5e3,1e4,3e4],iX={code:"INTERNAL",message:"The background worker isn't running right now (it restarts on its own); try again in a moment."},i0={code:"INTERNAL",message:"The background worker stopped before answering; try again."},i1=globalThis,i3={code:"INTERNAL",message:"This server was started with NEBULOSITY_WORKER=off, so it has no background worker."},i2={setRepo(){},summarize:async()=>({ok:!1,error:i3}),index:async()=>({ok:!1,error:i3}),stop(){}};function i4(){let e=(0,s.fork)((0,l.L)("scripts","background.ts"),[],{cwd:(0,l.W)(),execArgv:["--import","tsx"],stdio:["ignore","inherit","inherit","ipc"]}),t=[],i=!1,r=e=>{if(!i)for(let r of(i=!0,t))r(e)};return e.on("exit",e=>r(e)),e.on("error",e=>{console.error(`[background] the worker failed: ${e.message}`),r(null)}),{send:t=>e.connected&&e.send(t),onMessage:t=>{e.on("message",e=>t(e))},onExit:e=>{t.push(e)},kill:()=>{e.kill()}}}e.s(["backgroundSupervisor",0,function(){if("off"===process.env.NEBULOSITY_WORKER)return i2;if(!i1.nebulosityBackground){let e;iG.db||(iG.db=process.env.VITEST?iH(":memory:"):iH((0,l.Q)("nebulosity.db"),iG.readOnly?"readonly":"readwrite")),iG.db;let t=function(e,t={}){let i=t.log??(e=>console.log(`[background] ${e}`)),r=new Map,s=null,n=null,a=1,l=0,o=!1,u=null,c=()=>{let t=e();s=t,t.onMessage(e=>{if("ready"===e.type){l=0;return}if("index-progress"===e.type)return void r.get(e.id)?.onProgress?.(e.progress);let t=r.get(e.id);t&&(r.delete(e.id),t.settle(e))}),t.onExit(e=>{if(s!==t)return;for(let e of(s=null,r.values()))e.fail(i0);if(r.clear(),o)return;let n=iZ[Math.min(l,iZ.length-1)];l++,i(`the worker stopped (exit code ${e}); starting a new one in ${n/1e3} s`),u=setTimeout(()=>{u=null,o||c()},n)}),t.send({type:"repo",root:n})},h=(e,t)=>{let i=s;if(!i)return Promise.resolve({ok:!1,error:iX});let n=a++;return new Promise(s=>{r.set(n,{settle:s,fail:e=>s({ok:!1,error:e}),onProgress:t}),i.send(e(n))||(r.delete(n),s({ok:!1,error:iX}))})};return{setRepo(e){e===n&&(null!==s||null!==u)||(n=e,o||(s?s.send({type:"repo",root:e}):null===u&&c()))},async summarize(e,t){let i=await h(i=>({type:"summarize",id:i,path:e,root:t}));return"type"in i?"summarized"===i.type?i.outcome:{ok:!1,error:i0}:i},async index(e,t){let i=await h(e=>({type:"index",id:e,root:t}),e);return"type"in i?"indexed"===i.type?i.outcome:{ok:!1,error:i0}:i},stop(){o=!0,u&&clearTimeout(u),u=null,s?.kill()}}}(i4);t.setRepo(function(e,t){let i,r=(e=null)=>({config:{activeRepo:null,port:3e3},problem:e});if("missing"===t.kind)return r();if("error"===t.kind)return r(`${e} couldn't be read (${o(t.error)})`);let s=function(e){if(255===e[0]&&254===e[1])return new TextDecoder("utf-16le").decode(e);if(254===e[0]&&255===e[1]){let t=Buffer.from(e.subarray(0,e.length-e.length%2)).swap16();return new TextDecoder("utf-16le").decode(t)}return new TextDecoder("utf-8").decode(e)}(t.bytes);if(""===s.trim())return r();try{i=JSON.parse(s)}catch(t){return r(`${e} isn't valid JSON (${o(t)})`)}if("object"!=typeof i||null===i||Array.isArray(i))return r(`${e} holds ${null===i?"null":Array.isArray(i)?"an array":`a ${typeof i}`}, not one JSON object of settings`);let n=i,a="number"==typeof n.port&&Number.isInteger(n.port)&&n.port>0&&n.port<65536?n.port:3e3;return{config:{...n,activeRepo:"string"==typeof n.activeRepo?n.activeRepo:null,port:a},problem:null}}(e=(0,l.Q)("config.json"),function(e){try{return{kind:"bytes",bytes:n.default.readFileSync(e)}}catch(e){var t;return"ENOENT"===(t=e,t?.code)?{kind:"missing"}:{kind:"error",error:e}}}(e)).config.activeRepo),i1.nebulosityBackground=t}return i1.nebulosityBackground}],41031)}];
|
|
9
9
|
|
|
10
10
|
//# sourceMappingURL=lib_background_start_ts_11u_1uu8b9yuy._.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
module.exports=[63893,a=>{a.v({className:"F-r4tG_className",variable:"F-r4tG_variable"})},87775,a=>{a.v({className:"lwViEW_className",variable:"lwViEW_variable"})},33290,a=>{"use strict";var b=a.i(7997),c=a.i(63893);let d={className:c.default.className,style:{fontFamily:"'Archivo', 'Archivo Fallback'",fontStyle:"normal"}};null!=c.default.variable&&(d.variable=c.default.variable);var e=a.i(87775);let f={className:e.default.className,style:{fontFamily:"'JetBrains Mono', 'JetBrains Mono Fallback'",fontStyle:"normal"}};null!=e.default.variable&&(f.variable=e.default.variable);var g=a.i(71618);let h=a=>[1,3,5].map(b=>parseInt(a.slice(b,b+2),16));function i(a,b,c){let[d,e]=[h(a),h(b)];return"#"+d.map((a,b)=>a+(e[b]-a)*c).map(a=>Math.round(Math.min(255,Math.max(0,a))).toString(16).padStart(2,"0")).join("").toUpperCase()}let j={light:{kind:"light",editor:"#FFFFFF",side:"#FAFAFD",border:"#E2E2E5",fg:"#202020",desc:"#606060"},hc:{kind:"hc",editor:"#000000",side:"#000000",border:"#6FC3DF",fg:"#FFFFFF",desc:"#FFFFFF"},"hc-light":{kind:"hc-light",editor:"#FFFFFF",side:"#FFFFFF",border:"#0F4A85",fg:"#292929"}};a.s(["default",0,function({children:a}){let c;return(0,b.jsx)("html",{lang:"en",className:`${d.variable} ${f.variable} h-full antialiased`,suppressHydrationWarning:!0,children:(0,b.jsxs)("body",{className:"min-h-full flex flex-col",children:[(0,b.jsx)(g.default,{id:"nebulosity-theme",strategy:"beforeInteractive",children:(c=Object.fromEntries(Object.entries(j).map(([a,b])=>{let c,d,e,f,g,h,j,k;return[a,(c="light"===b.kind||"hc-light"===b.kind,d="hc"===b.kind||"hc-light"===b.kind,e=b.editor,f=b.fg,g=c?"#9333EA":"#A855F7",j=i(e,f,(h={node:c?.05:.09,line:c?.28:.3,linked:.75,edge:.3,glyph:c?.4:.45}).line),k="hc-light"===b.kind?"#A16207":c?"#CA8A04":"#FCD34D",{canvas:e,panel:b.side,node:d?e:i(e,f,h.node),"node-sel":i(e,g,c?.1:.16),"row-sel":i(b.side,g,c?.12:.18),divider:b.border??i(e,f,.12),border:d?b.border??j:j,"linked-border":d?c?"#7E22CE":"#C084FC":i(e,g,h.linked),text:f,"text-2":i(f,e,.22),"text-3":b.desc??i(f,e,.3),"edge-dim":i(e,f,d?.5:h.edge),"edge-strong":c?"#7E22CE":"#E9D5FF","glyph-dim":i(e,f,d?.6:h.glyph),"linked-glyph":c?"#A855F7":"#C084FC","used-by-edge":k,accent:g,"on-accent":c?"#FFFFFF":"#120C1C",core:c?g:"#F0FDFF",agent:c?"#C2410C":"#F08A4B",danger:c?"#B91C1C":"#F07A7A",ok:c?"#0E7490":"#5FC9D9",focus:b.focus??(c?"#0E7490":"#67E8F9"),fade:d?"70%":"50%"})]})),`(function(){try{var q=new URLSearchParams(location.search);if(q.get("embed")!=="vscode")return;var k=q.get("kind"),P=${JSON.stringify(c)},p=Object.prototype.hasOwnProperty.call(P,k)?P[k]:null;if(!p)return;var r=document.documentElement;for(var n in p)r.style.setProperty("--"+n,p[n]);r.setAttribute("data-kind",k);}catch(e){}})();`)}),a]})})},"metadata",0,{title:"Nebulosity",description:"The dependency-structure layer for Claude Code"}],33290)},70864,function(a){a.n(a.i(33290))},44536,(a,b,c)=>{let{createClientModuleProxy:d}=a.r(11857);a.n(d("[project]/node_modules/next/dist/client/script.js"))},11153,a=>{"use strict";var b=a.i(44536);a.n(b)},71618,(a,b,c)=>{b.exports=a.r(11153)}];
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=%5Broot-of-the-server%5D__0_3l5tdzqy-td._.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
module.exports=[[33354,(a,b,c)=>{c._=function(a){return a&&a.__esModule?a:{default:a}}},46058,(a,b,c)=>{function d(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(d=function(a){return a?c:b})(a)}c._=function(a,b){if(!b&&a&&a.__esModule)return a;if(null===a||"object"!=typeof a&&"function"!=typeof a)return{default:a};var c=d(b);if(c&&c.has(a))return c.get(a);var e={__proto__:null},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in a)if("default"!==g&&Object.prototype.hasOwnProperty.call(a,g)){var h=f?Object.getOwnPropertyDescriptor(a,g):null;h&&(h.get||h.set)?Object.defineProperty(e,g,h):e[g]=a[g]}return e.default=a,c&&c.set(a,e),e}},42602,(a,b,c)=>{b.exports=a.r(18622)},92966,(a,b,c)=>{b.exports=a.r(42602).vendored.contexts.HeadManagerContext},35112,(a,b,c)=>{b.exports=a.r(42602).vendored["react-ssr"].ReactDOM},87924,(a,b,c)=>{b.exports=a.r(42602).vendored["react-ssr"].ReactJsxRuntime},72131,(a,b,c)=>{b.exports=a.r(42602).vendored["react-ssr"].React}],18622,(a,b,c)=>{b.exports=a.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},20635,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/action-async-storage.external.js",()=>require("next/dist/server/app-render/action-async-storage.external.js"))},24725,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},43285,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/dynamic-access-async-storage.external.js",()=>require("next/dist/server/app-render/dynamic-access-async-storage.external.js"))},56704,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},59043,(a,b,c)=>{b.exports=a.x("next/dist/server/runtime-reacts.external.js",()=>require("next/dist/server/runtime-reacts.external.js"))}];
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=%5Broot-of-the-server%5D__10ockmlli-lun._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
module.exports=[[33354,(a,b,c)=>{c._=function(a){return a&&a.__esModule?a:{default:a}}},42602,(a,b,c)=>{b.exports=a.r(18622)},35112,(a,b,c)=>{b.exports=a.r(42602).vendored["react-ssr"].ReactDOM},87924,(a,b,c)=>{b.exports=a.r(42602).vendored["react-ssr"].ReactJsxRuntime},72131,(a,b,c)=>{b.exports=a.r(42602).vendored["react-ssr"].React}],18622,(a,b,c)=>{b.exports=a.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},20635,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/action-async-storage.external.js",()=>require("next/dist/server/app-render/action-async-storage.external.js"))},24725,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},43285,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/dynamic-access-async-storage.external.js",()=>require("next/dist/server/app-render/dynamic-access-async-storage.external.js"))},56704,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},59043,(a,b,c)=>{b.exports=a.x("next/dist/server/runtime-reacts.external.js",()=>require("next/dist/server/runtime-reacts.external.js"))}];
|
|
2
2
|
|
|
3
|
-
//# sourceMappingURL=%5Broot-of-the-server%
|
|
3
|
+
//# sourceMappingURL=%5Broot-of-the-server%5D__16-gclvix9mjd._.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
module.exports=[[38872,a=>{let b={src:a.i(26758).default,width:256,height:256};a.s(["default",0,b])},48760,a=>{let b={src:a.i(71385).default,width:680,height:680};a.s(["default",0,b])},66114,a=>{var b=a.i(82509);a.n(b)},717,(a,b,c)=>{b.exports=a.r(24951).vendored["react-rsc"].React}],54799,(a,b,c)=>{b.exports=a.x("crypto",()=>require("crypto"))},70406,(a,b,c)=>{b.exports=a.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},20635,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/action-async-storage.external.js",()=>require("next/dist/server/app-render/action-async-storage.external.js"))},24725,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},43285,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/dynamic-access-async-storage.external.js",()=>require("next/dist/server/app-render/dynamic-access-async-storage.external.js"))},56704,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},59043,(a,b,c)=>{b.exports=a.x("next/dist/server/runtime-reacts.external.js",()=>require("next/dist/server/runtime-reacts.external.js"))},93695,(a,b,c)=>{b.exports=a.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},81111,(a,b,c)=>{b.exports=a.x("node:stream",()=>require("node:stream"))},14747,(a,b,c)=>{b.exports=a.x("path",()=>require("path"))},26758,a=>{a.v("/_next/static/media/favicon.2vob68tjqpejf.ico"+(globalThis.NEXT_CLIENT_ASSET_SUFFIX||""))},71385,a=>{a.v("/_next/static/media/icon.0absiuod-8x8n.svg"+(globalThis.NEXT_CLIENT_ASSET_SUFFIX||""))},82509,(a,b,c)=>{let{createClientModuleProxy:d}=a.r(11857);a.n(d("[project]/node_modules/next/dist/client/components/builtin/global-error.js"))},62212,function(a){a.n(a.i(66114))},14465,(a,b,c)=>{(()=>{"use strict";var a={86:a=>{a.exports=function(a,b){return"string"==typeof a?g(a):"number"==typeof a?f(a,b):null},a.exports.format=f,a.exports.parse=g;var b=/\B(?=(\d{3})+(?!\d))/g,c=/(?:\.0*|(\.[^0]+)0+)$/,d={b:1,kb:1024,mb:1048576,gb:0x40000000,tb:0x10000000000,pb:0x4000000000000},e=/^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;function f(a,e){if(!Number.isFinite(a))return null;var f=Math.abs(a),g=e&&e.thousandsSeparator||"",h=e&&e.unitSeparator||"",i=e&&void 0!==e.decimalPlaces?e.decimalPlaces:2,j=!!(e&&e.fixedDecimals),k=e&&e.unit||"";k&&d[k.toLowerCase()]||(k=f>=d.pb?"PB":f>=d.tb?"TB":f>=d.gb?"GB":f>=d.mb?"MB":f>=d.kb?"KB":"B");var l=(a/d[k.toLowerCase()]).toFixed(i);return j||(l=l.replace(c,"$1")),g&&(l=l.split(".").map(function(a,c){return 0===c?a.replace(b,g):a}).join(".")),l+h+k}function g(a){if("number"==typeof a&&!isNaN(a))return a;if("string"!=typeof a)return null;var b,c=e.exec(a),f="b";return c?(b=parseFloat(c[1]),f=c[4].toLowerCase()):(b=parseInt(a,10),f="b"),Math.floor(d[f]*b)}}},c={};function d(b){var e=c[b];if(void 0!==e)return e.exports;var f=c[b]={exports:{}},g=!0;try{a[b](f,f.exports,d),g=!1}finally{g&&delete c[b]}return f.exports}d.ab="/ROOT/node_modules/next/dist/compiled/bytes/",b.exports=d(86)})()}];
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=%5Broot-of-the-server%5D__1auodc3c0rppy._.js.map
|