wiki-viewer 2.16.0 → 2.17.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/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/app-path-routes-manifest.json +3 -0
- package/.next/standalone/.next/build-manifest.json +3 -3
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/required-server-files.json +1 -1
- package/.next/standalone/.next/routes-manifest.json +23 -0
- package/.next/standalone/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/agent/activity/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/agent/events/[...path]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/agent/files/[...path]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/agent/fs/file/[...path]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/agent/fs/file/[...path]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/agent/fs/ls/[[...path]]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/agent/fs/move/route.js +1 -1
- package/.next/standalone/.next/server/app/api/agent/fs/move/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/agent/fs/search/route.js +1 -1
- package/.next/standalone/.next/server/app/api/agent/fs/search/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/agent/settings/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/agent/sidecar/[...path]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/app-proxy/[...path]/route.js +11 -9
- package/.next/standalone/.next/server/app/api/app-proxy/[...path]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/assets/[...path]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/pdf/save/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/share/[token]/asset/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/share/[token]/route.js +4 -3
- package/.next/standalone/.next/server/app/api/share/[token]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/share/route.js +1 -1
- package/.next/standalone/.next/server/app/api/share/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/system/browse/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/system/reveal/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/system/workspaces/[id]/branch/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/system/workspaces/[id]/open/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/system/workspaces/[id]/refresh/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/system/workspaces/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/system/workspaces/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/upload/[...path]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/app/route.js +8 -6
- package/.next/standalone/.next/server/app/api/wiki/app/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/backlinks/route.js +1 -1
- package/.next/standalone/.next/server/app/api/wiki/backlinks/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/content/route.js +1 -1
- package/.next/standalone/.next/server/app/api/wiki/content/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/download/route.js +1 -1
- package/.next/standalone/.next/server/app/api/wiki/download/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/folder/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/git-branches/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/git-checkout/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/git-diff/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/git-file-info/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/git-history/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/git-pull/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/hosted-apps/[slug]/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/wiki/hosted-apps/[slug]/route/build-manifest.json +9 -0
- package/.next/standalone/.next/server/app/api/wiki/hosted-apps/[slug]/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/wiki/hosted-apps/[slug]/route.js +17 -0
- package/.next/standalone/.next/server/app/api/wiki/hosted-apps/[slug]/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/wiki/hosted-apps/[slug]/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/wiki/hosted-apps/[slug]/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/wiki/hosted-apps/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/wiki/hosted-apps/route/build-manifest.json +9 -0
- package/.next/standalone/.next/server/app/api/wiki/hosted-apps/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/wiki/hosted-apps/route.js +18 -0
- package/.next/standalone/.next/server/app/api/wiki/hosted-apps/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/wiki/hosted-apps/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/wiki/hosted-apps/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/wiki/move/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/new-file/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/outlinks/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/page/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/presence/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/scratch/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/search/route.js +1 -1
- package/.next/standalone/.next/server/app/api/wiki/search/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/slugs/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/upload/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/watch/route.js +8 -7
- package/.next/standalone/.next/server/app/api/wiki/watch/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/app/[slug]/[[...rest]]/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/app/[slug]/[[...rest]]/route/build-manifest.json +9 -0
- package/.next/standalone/.next/server/app/app/[slug]/[[...rest]]/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/app/[slug]/[[...rest]]/route.js +18 -0
- package/.next/standalone/.next/server/app/app/[slug]/[[...rest]]/route.js.map +5 -0
- package/.next/standalone/.next/server/app/app/[slug]/[[...rest]]/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/app/[slug]/[[...rest]]/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/page/react-loadable-manifest.json +3 -4
- package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/s/[token]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/s/[token]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/signin/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/chunks/0.u4_next_dist_esm_build_templates_app-route_0kj1.1o.js +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__09vw_yd._.js +4 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0ah~dki._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__092dqjh._.js → [root-of-the-server]__0b7h2ot._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__02fa11p._.js → [root-of-the-server]__0bzyv11._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0sylq_1._.js → [root-of-the-server]__0ian9~8._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__112h-ck._.js → [root-of-the-server]__0jsp839._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0bfh5vs._.js → [root-of-the-server]__0khd8u0._.js} +20 -20
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0ltsov-._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0pftyle._.js +4 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__03q4s.e._.js → [root-of-the-server]__0pru66p._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0qicj__._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0qwikxp._.js +4 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0_beprj._.js → [root-of-the-server]__0tl7-s6._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__028nij-._.js → [root-of-the-server]__0veby1x._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0yqf3ec._.js +4 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0~q~4xc._.js +4 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0_tk-41._.js → [root-of-the-server]__101dr96._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0c2x-~s._.js → [root-of-the-server]__10i6erq._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__11ltgmp._.js +20 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_wiki_hosted-apps_[slug]_route_actions_11v9hxc.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_wiki_hosted-apps_route_actions_0v234uk.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_app_[slug]_[[___rest]]_route_actions_0w2a.9t.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{0~w0_katex_dist_katex_mjs_0xzjko-._.js → 0~w0_katex_dist_katex_mjs_0xy09r4._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0tzc7v8._.js → [root-of-the-server]__0hs37r-._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0_0pyx2._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0k6g8yo._.js +18 -18
- package/.next/standalone/.next/server/chunks/ssr/_0q~d8b~._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0sr4wj.._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0bu2dgl._.js → node_modules__pnpm_0.0y8dg._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0a5sxi_._.js → node_modules__pnpm_03rdaxh._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0hzuxm7._.js → node_modules__pnpm_042hoyi._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0fhf5x4._.js → node_modules__pnpm_04nkgqx._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_060xsml._.js → node_modules__pnpm_07z6xgj._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_00~a731._.js → node_modules__pnpm_0883dhq._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_00~jzwc._.js → node_modules__pnpm_08qpul6._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0pe1~kx._.js → node_modules__pnpm_09g45.a._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0qix0pb._.js → node_modules__pnpm_09nd60w._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0kcg69-._.js → node_modules__pnpm_0_dnupf._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0~s_k7m._.js → node_modules__pnpm_0asm~29._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0l7d83j._.js → node_modules__pnpm_0cgmua_._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0~ej02a._.js → node_modules__pnpm_0e09a-z._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_09al-ho._.js → node_modules__pnpm_0fby.xx._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_001.y5w._.js → node_modules__pnpm_0hn06p6._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_11jj9fz._.js → node_modules__pnpm_0izpuu-._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0_q.~_7._.js → node_modules__pnpm_0k3~.84._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0gn2-4t._.js → node_modules__pnpm_0o~aj4l._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0y.f9wx._.js → node_modules__pnpm_0r.hmrh._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_00vy.j_._.js → node_modules__pnpm_0sa2k.e._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0jf-4l.._.js → node_modules__pnpm_0sq.-3j._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0z-f4u~._.js → node_modules__pnpm_0sz5dcp._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0z5~pmj._.js → node_modules__pnpm_0x-5nk_._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0ov77qd._.js → node_modules__pnpm_10f188s._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0ekyo6p._.js → node_modules__pnpm_12sg_v9._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0-n2gwk._.js → node_modules__pnpm_133r6o8._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_016a47p._.js → node_modules__pnpm_13hc3_.._.js} +1 -1
- package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/static/chunks/02d_ok-cqd.4a.js +1 -0
- package/.next/standalone/.next/static/chunks/{0tjcc1wg-57l1.js → 065s1_n.1k11t.js} +1 -1
- package/.next/standalone/.next/static/chunks/09r.txqh5meou.js +1 -0
- package/.next/standalone/.next/static/chunks/{0y~5s_skz1l9a.js → 0ccw-uc_3ao.w.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0ii.akeq7k4pf.js → 0f8kfd9d6kq0b.js} +1 -1
- package/.next/standalone/.next/static/chunks/0k-oaty6nz49y.js +1 -0
- package/.next/standalone/.next/static/chunks/0lsw6lsaj7lby.js +1 -0
- package/.next/standalone/.next/static/chunks/0n~dazst~sc7s.js +12 -0
- package/.next/standalone/.next/static/chunks/0v32snen~_e9n.css +1 -0
- package/.next/standalone/.next/static/chunks/{0enm-3xy21jcx.js → 17bpqqaflajl~.js} +24 -24
- package/.next/standalone/.next/static/chunks/17rekydn5fgy4.js +12 -0
- package/.next/standalone/.test-floor +1 -1
- package/.next/standalone/isometric-codebase-map.html +4 -1
- package/.next/standalone/isometric-codebase-map.json +4 -1
- package/.next/standalone/package.json +1 -1
- package/.next/standalone/server.js +1 -1
- package/package.json +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__05qoy-2._.js +0 -20
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0h.0l-2._.js +0 -4
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0ou7hai._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__12x8v2r._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/_01eqklo._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0858xdh._.js +0 -3
- package/.next/standalone/.next/static/chunks/02t77azzz-jp-.js +0 -1
- package/.next/standalone/.next/static/chunks/04jvwlttwa_sw.js +0 -12
- package/.next/standalone/.next/static/chunks/0_j_xobbe4f4t.css +0 -1
- package/.next/standalone/.next/static/chunks/0d_~.9eee~ebo.js +0 -1
- package/.next/standalone/.next/static/chunks/161kgz.8h.3iq.js +0 -1
- package/.next/standalone/.next/static/chunks/16kzqur8~yg6b.js +0 -12
- /package/.next/standalone/.next/static/{7EbGXTo8ObPhr7UobKARQ → KRKPuzz8vrMWZ0HNKmF4W}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{7EbGXTo8ObPhr7UobKARQ → KRKPuzz8vrMWZ0HNKmF4W}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{7EbGXTo8ObPhr7UobKARQ → KRKPuzz8vrMWZ0HNKmF4W}/_ssgManifest.js +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[536654,e=>{"use strict";var t=e.i(912714),a=e.i(750227);function r(e){return!!(a.default.isAbsolute(e)||".."===e||e.startsWith(".."+a.default.sep)||e.startsWith("../"))}async function s(e,n,i={}){let o;if(!e)return null;let l=function(e){if(e.includes("\0")||a.default.isAbsolute(e))return null;let t=e.replace(/\\/g,"/");return(("."===(t=a.default.posix.normalize(t))||"./"===t)&&(t=""),".."===t||t.startsWith("../")||/^[a-zA-Z]:\//.test(t)||t.startsWith("/"))?null:t}(n);if(null===l)return null;if(i.deniedSegments?.length){for(let e of l.split("/").filter(Boolean))if(i.deniedSegments.includes(e))return null}try{o=await (0,t.realpath)(e)}catch{return null}let u=l?a.default.join(o,l):o;try{let e=await (0,t.realpath)(u),s=a.default.relative(o,e);if(r(s))return null;return{relPath:l,absolutePath:e}}catch{if(!i.allowMissing)return null;let e=u;for(;;){let s=a.default.dirname(e);if(s===e)break;try{let e=await (0,t.realpath)(s),n=a.default.relative(o,e);if(r(n))return null;return{relPath:l,absolutePath:u}}catch{e=s}}return null}}e.s(["resolveWorkspacePath",0,s])},848475,e=>{"use strict";var t=e.i(750227);let a={".md":"text/markdown; charset=utf-8",".markdown":"text/markdown; charset=utf-8",".txt":"text/plain; charset=utf-8",".json":"application/json; charset=utf-8",".jsonc":"application/json; charset=utf-8",".ts":"text/typescript; charset=utf-8",".tsx":"text/typescript; charset=utf-8",".mts":"text/typescript; charset=utf-8",".js":"text/javascript; charset=utf-8",".jsx":"text/javascript; charset=utf-8",".mjs":"text/javascript; charset=utf-8",".html":"text/html; charset=utf-8",".htm":"text/html; charset=utf-8",".css":"text/css; charset=utf-8",".yaml":"text/yaml; charset=utf-8",".yml":"text/yaml; charset=utf-8",".toml":"text/toml; charset=utf-8",".xml":"application/xml; charset=utf-8",".svg":"image/svg+xml",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".avif":"image/avif",".ico":"image/x-icon",".bmp":"image/bmp",".pdf":"application/pdf",".zip":"application/zip",".tar":"application/x-tar",".gz":"application/gzip",".py":"text/x-python; charset=utf-8",".rs":"text/x-rustsrc; charset=utf-8",".go":"text/x-go; charset=utf-8",".sh":"text/x-shellscript; charset=utf-8",".csv":"text/csv; charset=utf-8",".tsv":"text/tab-separated-values; charset=utf-8",".env":"text/plain; charset=utf-8",".log":"text/plain; charset=utf-8",".ini":"text/plain; charset=utf-8",".conf":"text/plain; charset=utf-8",".mmd":"text/plain; charset=utf-8",".ipynb":"application/json; charset=utf-8",".docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",".xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".pptx":"application/vnd.openxmlformats-officedocument.presentationml.presentation",".doc":"application/msword",".xls":"application/vnd.ms-excel",".ppt":"application/vnd.ms-powerpoint",".mp4":"video/mp4",".webm":"video/webm",".mov":"video/quicktime",".m4v":"video/mp4",".mp3":"audio/mpeg",".wav":"audio/wav",".ogg":"audio/ogg",".m4a":"audio/mp4",".aac":"audio/aac"};e.s(["contentTypeForPath",0,function(e){return a[t.default.extname(e).toLowerCase()]??"application/octet-stream"}])},763459,e=>{"use strict";var t=e.i(985426),a=e.i(257574),r=e.i(507835),s=e.i(457789),n=e.i(119791),i=e.i(141062),o=e.i(957291),l=e.i(535899),u=e.i(610241),p=e.i(62749),c=e.i(624891),d=e.i(725836),h=e.i(532736),m=e.i(257858),f=e.i(487476),v=e.i(193695);e.i(484264);var x=e.i(315709),g=e.i(912714),w=e.i(351216),R=e.i(660038),_=e.i(536654),y=e.i(848475),E=e.i(716234);async function b(e,{params:t}){let a=await (0,R.resolveWorkspaceForUser)(e);if(!a.ok)return w.NextResponse.json({error:a.code},{status:a.status});let{rootDir:r}=a,s=(await t).path.join("/"),n=await (0,_.resolveWorkspacePath)(r,s,{deniedSegments:E.DENIED_SEGMENTS});if(!n)return w.NextResponse.json({error:"Invalid path"},{status:400});try{if((await (0,g.stat)(n.absolutePath)).isDirectory())return w.NextResponse.json({error:"Not a file"},{status:400});let e=(0,y.contentTypeForPath)(n.absolutePath),t=await (0,g.readFile)(n.absolutePath);return new Response(t,{headers:{"Content-Type":e,"Cache-Control":"private, max-age=60"}})}catch{return w.NextResponse.json({error:"File not found"},{status:404})}}e.s(["GET",0,b],667292);var P=e.i(667292);let C=new t.AppRouteRouteModule({definition:{kind:a.RouteKind.APP_ROUTE,page:"/api/assets/[...path]/route",pathname:"/api/assets/[...path]",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/assets/[...path]/route.ts",nextConfigOutput:"standalone",userland:P,...{}}),{workAsyncStorage:j,workUnitAsyncStorage:A,serverHooks:N}=C;async function k(e,t,r){r.requestMeta&&(0,s.setRequestMeta)(e,r.requestMeta),C.isDev&&(0,s.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let g="/api/assets/[...path]/route";g=g.replace(/\/index$/,"")||"/";let w=await C.prepare(e,t,{srcPage:g,multiZoneDraftMode:!1});if(!w)return t.statusCode=400,t.end("Bad Request"),null==r.waitUntil||r.waitUntil.call(r,Promise.resolve()),null;let{buildId:R,params:_,nextConfig:y,parsedUrl:E,isDraftMode:b,prerenderManifest:P,routerServerContext:j,isOnDemandRevalidate:A,revalidateOnlyGenerated:N,resolvedPathname:k,clientReferenceManifest:T,serverActionsManifest:q}=w,S=(0,o.normalizeAppPath)(g),O=!!(P.dynamicRoutes[S]||P.routes[k]),I=async()=>((null==j?void 0:j.render404)?await j.render404(e,t,E,!1):t.end("This page could not be found"),null);if(O&&!b){let e=!!P.routes[k],t=P.dynamicRoutes[S];if(t&&!1===t.fallback&&!e){if(y.adapterPath)return await I();throw new v.NoFallbackError}}let D=null;!O||C.isDev||b||(D="/index"===(D=k)?"/":D);let H=!0===C.isDev||!O,M=O&&!H;q&&T&&(0,i.setManifestsSingleton)({page:g,clientReferenceManifest:T,serverActionsManifest:q});let U=e.method||"GET",F=(0,n.getTracer)(),z=F.getActiveScopeSpan(),W=!!(null==j?void 0:j.isWrappedByNextServer),K=!!(0,s.getRequestMeta)(e,"minimalMode"),$=(0,s.getRequestMeta)(e,"incrementalCache")||await C.getIncrementalCache(e,y,P,K);null==$||$.resetRequestCache(),globalThis.__incrementalCache=$;let B={params:_,previewProps:P.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts},cacheComponents:!!y.cacheComponents,supportsDynamicResponse:H,incrementalCache:$,cacheLifeProfiles:y.cacheLife,waitUntil:r.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,a,r,s)=>C.onRequestError(e,t,r,s,j)},sharedContext:{buildId:R}},L=new l.NodeNextRequest(e),G=new l.NodeNextResponse(t),V=u.NextRequestAdapter.fromNodeNextRequest(L,(0,u.signalFromNodeResponse)(t));try{let s,i=async e=>C.handle(V,B).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let a=F.getRootSpanAttributes();if(!a)return;if(a.get("next.span_type")!==p.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${a.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let r=a.get("next.route");if(r){let t=`${U} ${r}`;e.setAttributes({"next.route":r,"http.route":r,"next.span_name":t}),e.updateName(t),s&&s!==e&&(s.setAttribute("http.route",r),s.updateName(t))}else e.updateName(`${U} ${g}`)}),o=async s=>{var n,o;let l=async({previousCacheEntry:a})=>{try{if(!K&&A&&N&&!a)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let n=await i(s);e.fetchMetrics=B.renderOpts.fetchMetrics;let o=B.renderOpts.pendingWaitUntil;o&&r.waitUntil&&(r.waitUntil(o),o=void 0);let l=B.renderOpts.collectedTags;if(!O)return await (0,d.sendResponse)(L,G,n,B.renderOpts.pendingWaitUntil),null;{let e=await n.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(n.headers);l&&(t[f.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let a=void 0!==B.renderOpts.collectedRevalidate&&!(B.renderOpts.collectedRevalidate>=f.INFINITE_CACHE)&&B.renderOpts.collectedRevalidate,r=void 0===B.renderOpts.collectedExpire||B.renderOpts.collectedExpire>=f.INFINITE_CACHE?void 0:B.renderOpts.collectedExpire;return{value:{kind:x.CachedRouteKind.APP_ROUTE,status:n.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:a,expire:r}}}}catch(t){throw(null==a?void 0:a.isStale)&&await C.onRequestError(e,t,{routerKind:"App Router",routePath:g,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:A})},!1,j),t}},u=await C.handleResponse({req:e,nextConfig:y,cacheKey:D,routeKind:a.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:P,isRoutePPREnabled:!1,isOnDemandRevalidate:A,revalidateOnlyGenerated:N,responseGenerator:l,waitUntil:r.waitUntil,isMinimalMode:K});if(!O)return null;if((null==u||null==(n=u.value)?void 0:n.kind)!==x.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==u||null==(o=u.value)?void 0:o.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});K||t.setHeader("x-nextjs-cache",A?"REVALIDATED":u.isMiss?"MISS":u.isStale?"STALE":"HIT"),b&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let p=(0,h.fromNodeOutgoingHttpHeaders)(u.value.headers);return K&&O||p.delete(f.NEXT_CACHE_TAGS_HEADER),!u.cacheControl||t.getHeader("Cache-Control")||p.get("Cache-Control")||p.set("Cache-Control",(0,m.getCacheControlHeader)(u.cacheControl)),await (0,d.sendResponse)(L,G,new Response(u.value.body,{headers:p,status:u.value.status||200})),null};W&&z?await o(z):(s=F.getActiveScopeSpan(),await F.withPropagatedContext(e.headers,()=>F.trace(p.BaseServerSpan.handleRequest,{spanName:`${U} ${g}`,kind:n.SpanKind.SERVER,attributes:{"http.method":U,"http.target":e.url}},o),void 0,!W))}catch(t){if(t instanceof v.NoFallbackError||await C.onRequestError(e,t,{routerKind:"App Router",routePath:S,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:A})},!1,j),O)throw t;return await (0,d.sendResponse)(L,G,new Response(null,{status:500})),null}}e.s(["handler",0,k,"patchFetch",0,function(){return(0,r.patchFetch)({workAsyncStorage:j,workUnitAsyncStorage:A})},"routeModule",0,C,"serverHooks",0,N,"workAsyncStorage",0,j,"workUnitAsyncStorage",0,A],763459)},168315,e=>{e.v(t=>Promise.all(["server/chunks/0sag_@better-auth_memory-adapter_dist_index_mjs_0pvj6im._.js"].map(t=>e.l(t))).then(()=>t(862112)))},769787,e=>{e.v(t=>Promise.all(["server/chunks/01er_better-auth_dist_adapters_kysely-adapter_index_mjs_0s~-4gu._.js"].map(t=>e.l(t))).then(()=>t(717789)))},580632,e=>{e.v(e=>Promise.resolve().then(()=>e(270406)))},947559,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_bun-sqlite-dialect-DzNwOpKv_mjs_0z1z6m4._.js"].map(t=>e.l(t))).then(()=>t(495181)))},715018,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_node-sqlite-dialect_mjs_0qqlvhl._.js"].map(t=>e.l(t))).then(()=>t(698370)))},146843,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_d1-sqlite-dialect-C2B7YsIT_mjs_0wynrz3._.js"].map(t=>e.l(t))).then(()=>t(143740)))},697743,e=>{e.v(t=>Promise.all(["server/chunks/0.u4_next_05jevxw._.js"].map(t=>e.l(t))).then(()=>t(428325)))},99243,e=>{e.v(e=>Promise.resolve().then(()=>e(313414)))},893412,e=>{e.v(e=>Promise.resolve().then(()=>e(499465)))},687903,e=>{e.v(e=>Promise.resolve().then(()=>e(912714)))}];
|
|
1
|
+
module.exports=[536654,e=>{"use strict";var t=e.i(912714),a=e.i(750227);function r(e){return!!(a.default.isAbsolute(e)||".."===e||e.startsWith(".."+a.default.sep)||e.startsWith("../"))}async function s(e,n,i={}){let o;if(!e)return null;let l=function(e){if(e.includes("\0")||a.default.isAbsolute(e))return null;let t=e.replace(/\\/g,"/");return(("."===(t=a.default.posix.normalize(t))||"./"===t)&&(t=""),".."===t||t.startsWith("../")||/^[a-zA-Z]:\//.test(t)||t.startsWith("/"))?null:t}(n);if(null===l)return null;if(i.deniedSegments?.length){for(let e of l.split("/").filter(Boolean))if(i.deniedSegments.includes(e))return null}try{o=await (0,t.realpath)(e)}catch{return null}let u=l?a.default.join(o,l):o;try{let e=await (0,t.realpath)(u),s=a.default.relative(o,e);if(r(s))return null;return{relPath:l,absolutePath:e}}catch{if(!i.allowMissing)return null;let e=u;for(;;){let s=a.default.dirname(e);if(s===e)break;try{let e=await (0,t.realpath)(s),n=a.default.relative(o,e);if(r(n))return null;return{relPath:l,absolutePath:u}}catch{e=s}}return null}}e.s(["resolveWorkspacePath",0,s])},848475,e=>{"use strict";var t=e.i(750227);let a={".md":"text/markdown; charset=utf-8",".markdown":"text/markdown; charset=utf-8",".txt":"text/plain; charset=utf-8",".json":"application/json; charset=utf-8",".jsonc":"application/json; charset=utf-8",".ts":"text/typescript; charset=utf-8",".tsx":"text/typescript; charset=utf-8",".mts":"text/typescript; charset=utf-8",".js":"text/javascript; charset=utf-8",".jsx":"text/javascript; charset=utf-8",".mjs":"text/javascript; charset=utf-8",".html":"text/html; charset=utf-8",".htm":"text/html; charset=utf-8",".css":"text/css; charset=utf-8",".yaml":"text/yaml; charset=utf-8",".yml":"text/yaml; charset=utf-8",".toml":"text/toml; charset=utf-8",".xml":"application/xml; charset=utf-8",".svg":"image/svg+xml",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".avif":"image/avif",".ico":"image/x-icon",".bmp":"image/bmp",".pdf":"application/pdf",".zip":"application/zip",".tar":"application/x-tar",".gz":"application/gzip",".py":"text/x-python; charset=utf-8",".rs":"text/x-rustsrc; charset=utf-8",".go":"text/x-go; charset=utf-8",".sh":"text/x-shellscript; charset=utf-8",".csv":"text/csv; charset=utf-8",".tsv":"text/tab-separated-values; charset=utf-8",".env":"text/plain; charset=utf-8",".log":"text/plain; charset=utf-8",".ini":"text/plain; charset=utf-8",".conf":"text/plain; charset=utf-8",".mmd":"text/plain; charset=utf-8",".ipynb":"application/json; charset=utf-8",".docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",".xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".pptx":"application/vnd.openxmlformats-officedocument.presentationml.presentation",".doc":"application/msword",".xls":"application/vnd.ms-excel",".ppt":"application/vnd.ms-powerpoint",".mp4":"video/mp4",".webm":"video/webm",".mov":"video/quicktime",".m4v":"video/mp4",".mp3":"audio/mpeg",".wav":"audio/wav",".ogg":"audio/ogg",".m4a":"audio/mp4",".aac":"audio/aac"};e.s(["contentTypeForPath",0,function(e){return a[t.default.extname(e).toLowerCase()]??"application/octet-stream"}])},763459,e=>{"use strict";var t=e.i(985426),a=e.i(257574),r=e.i(507835),s=e.i(457789),n=e.i(119791),i=e.i(141062),o=e.i(957291),l=e.i(535899),u=e.i(610241),p=e.i(62749),c=e.i(624891),d=e.i(725836),h=e.i(532736),m=e.i(257858),f=e.i(487476),v=e.i(193695);e.i(484264);var x=e.i(315709),g=e.i(912714),w=e.i(351216),R=e.i(660038),_=e.i(536654),y=e.i(848475),E=e.i(716234);function b(e,t,a){let r=new URL(e.url);return r.searchParams.set(t,a),new Request(r.toString(),e)}async function P(e,{params:t}){let a=(await t).path,r=e,s=a;if(a.length>=2&&"_ws"===a[0])r=b(e,"ws",a[1]),s=a.slice(2);else if(a.length>=2&&"_root"===a[0]){let t;r=b(e,"root",(t=a[1].replace(/-/g,"+").replace(/_/g,"/"),Buffer.from(t,"base64").toString("utf8"))),s=a.slice(2)}let n=await (0,R.resolveWorkspaceForUser)(r);if(!n.ok)return w.NextResponse.json({error:n.code},{status:n.status});let{rootDir:i}=n,o=s.join("/"),l=await (0,_.resolveWorkspacePath)(i,o,{deniedSegments:E.DENIED_SEGMENTS});if(!l)return w.NextResponse.json({error:"Invalid path"},{status:400});try{if((await (0,g.stat)(l.absolutePath)).isDirectory())return w.NextResponse.json({error:"Not a file"},{status:400});let e=(0,y.contentTypeForPath)(l.absolutePath),t=await (0,g.readFile)(l.absolutePath);return new Response(t,{headers:{"Content-Type":e,"Cache-Control":"private, max-age=60"}})}catch{return w.NextResponse.json({error:"File not found"},{status:404})}}e.s(["GET",0,P],667292);var C=e.i(667292);let j=new t.AppRouteRouteModule({definition:{kind:a.RouteKind.APP_ROUTE,page:"/api/assets/[...path]/route",pathname:"/api/assets/[...path]",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/assets/[...path]/route.ts",nextConfigOutput:"standalone",userland:C,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:N,serverHooks:k}=j;async function T(e,t,r){r.requestMeta&&(0,s.setRequestMeta)(e,r.requestMeta),j.isDev&&(0,s.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let g="/api/assets/[...path]/route";g=g.replace(/\/index$/,"")||"/";let w=await j.prepare(e,t,{srcPage:g,multiZoneDraftMode:!1});if(!w)return t.statusCode=400,t.end("Bad Request"),null==r.waitUntil||r.waitUntil.call(r,Promise.resolve()),null;let{buildId:R,params:_,nextConfig:y,parsedUrl:E,isDraftMode:b,prerenderManifest:P,routerServerContext:C,isOnDemandRevalidate:A,revalidateOnlyGenerated:N,resolvedPathname:k,clientReferenceManifest:T,serverActionsManifest:S}=w,q=(0,o.normalizeAppPath)(g),O=!!(P.dynamicRoutes[q]||P.routes[k]),I=async()=>((null==C?void 0:C.render404)?await C.render404(e,t,E,!1):t.end("This page could not be found"),null);if(O&&!b){let e=!!P.routes[k],t=P.dynamicRoutes[q];if(t&&!1===t.fallback&&!e){if(y.adapterPath)return await I();throw new v.NoFallbackError}}let U=null;!O||j.isDev||b||(U="/index"===(U=k)?"/":U);let D=!0===j.isDev||!O,H=O&&!D;S&&T&&(0,i.setManifestsSingleton)({page:g,clientReferenceManifest:T,serverActionsManifest:S});let M=e.method||"GET",F=(0,n.getTracer)(),z=F.getActiveScopeSpan(),W=!!(null==C?void 0:C.isWrappedByNextServer),B=!!(0,s.getRequestMeta)(e,"minimalMode"),K=(0,s.getRequestMeta)(e,"incrementalCache")||await j.getIncrementalCache(e,y,P,B);null==K||K.resetRequestCache(),globalThis.__incrementalCache=K;let $={params:_,previewProps:P.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts},cacheComponents:!!y.cacheComponents,supportsDynamicResponse:D,incrementalCache:K,cacheLifeProfiles:y.cacheLife,waitUntil:r.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,a,r,s)=>j.onRequestError(e,t,r,s,C)},sharedContext:{buildId:R}},L=new l.NodeNextRequest(e),G=new l.NodeNextResponse(t),V=u.NextRequestAdapter.fromNodeNextRequest(L,(0,u.signalFromNodeResponse)(t));try{let s,i=async e=>j.handle(V,$).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let a=F.getRootSpanAttributes();if(!a)return;if(a.get("next.span_type")!==p.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${a.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let r=a.get("next.route");if(r){let t=`${M} ${r}`;e.setAttributes({"next.route":r,"http.route":r,"next.span_name":t}),e.updateName(t),s&&s!==e&&(s.setAttribute("http.route",r),s.updateName(t))}else e.updateName(`${M} ${g}`)}),o=async s=>{var n,o;let l=async({previousCacheEntry:a})=>{try{if(!B&&A&&N&&!a)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let n=await i(s);e.fetchMetrics=$.renderOpts.fetchMetrics;let o=$.renderOpts.pendingWaitUntil;o&&r.waitUntil&&(r.waitUntil(o),o=void 0);let l=$.renderOpts.collectedTags;if(!O)return await (0,d.sendResponse)(L,G,n,$.renderOpts.pendingWaitUntil),null;{let e=await n.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(n.headers);l&&(t[f.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let a=void 0!==$.renderOpts.collectedRevalidate&&!($.renderOpts.collectedRevalidate>=f.INFINITE_CACHE)&&$.renderOpts.collectedRevalidate,r=void 0===$.renderOpts.collectedExpire||$.renderOpts.collectedExpire>=f.INFINITE_CACHE?void 0:$.renderOpts.collectedExpire;return{value:{kind:x.CachedRouteKind.APP_ROUTE,status:n.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:a,expire:r}}}}catch(t){throw(null==a?void 0:a.isStale)&&await j.onRequestError(e,t,{routerKind:"App Router",routePath:g,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:H,isOnDemandRevalidate:A})},!1,C),t}},u=await j.handleResponse({req:e,nextConfig:y,cacheKey:U,routeKind:a.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:P,isRoutePPREnabled:!1,isOnDemandRevalidate:A,revalidateOnlyGenerated:N,responseGenerator:l,waitUntil:r.waitUntil,isMinimalMode:B});if(!O)return null;if((null==u||null==(n=u.value)?void 0:n.kind)!==x.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==u||null==(o=u.value)?void 0:o.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});B||t.setHeader("x-nextjs-cache",A?"REVALIDATED":u.isMiss?"MISS":u.isStale?"STALE":"HIT"),b&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let p=(0,h.fromNodeOutgoingHttpHeaders)(u.value.headers);return B&&O||p.delete(f.NEXT_CACHE_TAGS_HEADER),!u.cacheControl||t.getHeader("Cache-Control")||p.get("Cache-Control")||p.set("Cache-Control",(0,m.getCacheControlHeader)(u.cacheControl)),await (0,d.sendResponse)(L,G,new Response(u.value.body,{headers:p,status:u.value.status||200})),null};W&&z?await o(z):(s=F.getActiveScopeSpan(),await F.withPropagatedContext(e.headers,()=>F.trace(p.BaseServerSpan.handleRequest,{spanName:`${M} ${g}`,kind:n.SpanKind.SERVER,attributes:{"http.method":M,"http.target":e.url}},o),void 0,!W))}catch(t){if(t instanceof v.NoFallbackError||await j.onRequestError(e,t,{routerKind:"App Router",routePath:q,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:H,isOnDemandRevalidate:A})},!1,C),O)throw t;return await (0,d.sendResponse)(L,G,new Response(null,{status:500})),null}}e.s(["handler",0,T,"patchFetch",0,function(){return(0,r.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:N})},"routeModule",0,j,"serverHooks",0,k,"workAsyncStorage",0,A,"workUnitAsyncStorage",0,N],763459)},168315,e=>{e.v(t=>Promise.all(["server/chunks/0sag_@better-auth_memory-adapter_dist_index_mjs_0pvj6im._.js"].map(t=>e.l(t))).then(()=>t(862112)))},769787,e=>{e.v(t=>Promise.all(["server/chunks/01er_better-auth_dist_adapters_kysely-adapter_index_mjs_0s~-4gu._.js"].map(t=>e.l(t))).then(()=>t(717789)))},580632,e=>{e.v(e=>Promise.resolve().then(()=>e(270406)))},947559,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_bun-sqlite-dialect-DzNwOpKv_mjs_0z1z6m4._.js"].map(t=>e.l(t))).then(()=>t(495181)))},715018,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_node-sqlite-dialect_mjs_0qqlvhl._.js"].map(t=>e.l(t))).then(()=>t(698370)))},146843,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_d1-sqlite-dialect-C2B7YsIT_mjs_0wynrz3._.js"].map(t=>e.l(t))).then(()=>t(143740)))},697743,e=>{e.v(t=>Promise.all(["server/chunks/0.u4_next_05jevxw._.js"].map(t=>e.l(t))).then(()=>t(428325)))},99243,e=>{e.v(e=>Promise.resolve().then(()=>e(313414)))},893412,e=>{e.v(e=>Promise.resolve().then(()=>e(499465)))},687903,e=>{e.v(e=>Promise.resolve().then(()=>e(912714)))}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=%5Broot-of-the-server%5D__0ltsov-._.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
module.exports=[583627,e=>{"use strict";var t=e.i(798003),r=e.i(254226);function s(){return(process.env.WIKI_ADMIN_EMAILS??"").split(",").map(e=>e.trim().toLowerCase()).filter(Boolean)}async function n(e,r){if(r){let e=s();if(e.length>0&&e.includes(r.toLowerCase()))return!0}return((await (0,t.readConfig)()).adminUserIds??[]).includes(e)}async function a(){return(await (0,t.readConfig)()).adminUserIds??[]}async function i(e){await (0,t.updateConfig)(t=>{let r=t.adminUserIds??[];return r.includes(e)?t:{...t,adminUserIds:[...r,e]}})}async function o(e){let r=s().length>0,n=!1;if(await (0,t.updateConfig)(t=>{let s=(t.adminUserIds??[]).filter(t=>t!==e);return 0!==s.length||r?{...t,adminUserIds:s}:(n=!0,t)}),n)throw Error("LAST_ADMIN: cannot remove the last admin with no WIKI_ADMIN_EMAILS configured")}async function l(e){if(s().length>0||r.SYNTHETIC_USER_IDS.has(e)||((await (0,t.readConfig)()).adminUserIds??[]).length>0)return;let n=!1;await (0,t.updateConfig)(t=>(t.adminUserIds??[]).length>0?t:(n=!0,{...t,adminUserIds:[e]})),n&&console.log(`[wiki-viewer] Bootstrap: first user ${e} promoted to admin`)}async function u(e){if("1"===process.env.WIKI_NO_AUTH)return{ok:!0,user:{id:"local",email:"local@localhost",name:"local"}};let t=await (0,r.requireUser)(e);return t.ok?await n(t.user.id,t.user.email)?{ok:!0,user:t.user}:{ok:!1,status:403,code:"ADMIN_REQUIRED"}:{ok:!1,status:401,code:"UNAUTHORIZED"}}e.s(["addAdmin",0,i,"ensureBootstrapAdmin",0,l,"isAdmin",0,n,"listAdmins",0,a,"removeAdmin",0,o,"requireAdmin",0,u])},874533,(e,t,r)=>{t.exports=e.x("node:child_process",()=>require("node:child_process"))},812057,(e,t,r)=>{t.exports=e.x("node:util",()=>require("node:util"))},256294,296555,e=>{"use strict";let t;var r=e.i(874533),s=e.i(812057),n=e.i(912714),a=e.i(750227),i=e.i(660526);e.i(902157);let o=RegExp("[;|&$`<>(){}\\n\\r\\0]");function l(e){let{target:t,mountpoint:r,port:s}=e,n=t.user?`${t.user}@`:"",a=[`${n}${t.host}:${t.remotePath}`,r];s&&Number.isInteger(Number(s))&&Number(s)>0&&65536>Number(s)&&a.push("-p",String(s));let i=e.authMethod??"agent";!e.authMethod&&(null!=e.password?i="password":e.keyPath&&(i="keyfile"));let o=["reconnect","ServerAliveInterval=15","ServerAliveCountMax=3","compression=yes","cache=yes","kernel_cache","StrictHostKeyChecking=accept-new","BatchMode=yes"];if(e.readOnly&&o.push("ro"),"keyfile"===i&&e.keyPath&&(o.push(`IdentityFile=${e.keyPath}`),o.push("IdentitiesOnly=yes")),"password"===i){let e=o.indexOf("BatchMode=yes");e>=0&&o.splice(e,1),o.push("password_stdin"),o.push("PreferredAuthentications=password,keyboard-interactive"),o.push("PubkeyAuthentication=no"),o.push("NumberOfPasswordPrompts=1")}return e.extraOptions&&o.push(...e.extraOptions),a.push("-o",o.join(",")),a}e.s(["buildSshfsArgs",0,l,"isValidKeyPath",0,function(e){return!(!e||o.test(e)||e.includes(".."))&&(e.startsWith("/")||e.startsWith("~/"))},"parseSshTarget",0,function(e){let t;if(!e||o.test(e))return null;let r=e.trim(),s=r.indexOf(":");if(s<=0)return null;let n=r.slice(0,s),a=r.slice(s+1);if(!a.startsWith("/")||a.includes(".."))return null;let i=n,l=n.indexOf("@");return l>=0&&(t=n.slice(0,l),i=n.slice(l+1),!t)?null:i&&/^[a-zA-Z0-9.\-]+$/.test(i)&&(!t||/^[a-zA-Z0-9._\-]+$/.test(t))?{user:t,host:i,remotePath:a}:null}],296555);let u=(0,s.promisify)(r.execFile);function p(){return a.default.join(i.default.homedir(),".wiki-viewer","mounts")}async function c(){if(!0!==t)try{await u("sshfs",["--version"]),t=!0}catch{throw Error("sshfs binary not found. Install sshfs + FUSE (e.g. `apt install sshfs`, `brew install macfuse sshfs`) and ensure it is on PATH.")}}async function d(t){var r;let s=a.default.resolve(t),i=!1;try{i=(await (0,n.readFile)("/proc/mounts","utf8")).split("\n").some(e=>{let t=e.split(" ");return t[1]===s&&/fuse/.test(t[2]??"")})}catch{i=!1}return!!i&&(r=s,new Promise(t=>{let s=!1,n=setTimeout(()=>{s||(s=!0,t(!1))},4e3);e.A(687903).then(({readdir:e})=>e(r)).then(()=>{s||(s=!0,clearTimeout(n),t(!0))}).catch(()=>{s||(s=!0,clearTimeout(n),t(!1))})}))}async function h(e){await c(),await (0,n.mkdir)(e.mountpoint,{recursive:!0});let t=l(e);if(await new Promise((s,n)=>{let a=(0,r.spawn)("sshfs",t,{stdio:["pipe","ignore","pipe"]}),i="",o=setTimeout(()=>{a.kill("SIGKILL"),n(Error("sshfs mount timed out after 25s."))},25e3);a.stderr?.on("data",e=>{i+=e.toString()}),a.on("error",e=>{clearTimeout(o),n(e.message.includes("ENOENT")?Error("sshfs binary not found on PATH."):e)}),a.on("close",e=>{clearTimeout(o),0===e?s():n(Error(`sshfs exited ${e}: ${i.trim()||"mount failed"}`))}),"password"===e.authMethod&&a.stdin?.write((e.password??"")+"\n"),a.stdin?.end()}),!await d(e.mountpoint))throw Error("sshfs reported success but the mount is not live.")}async function f(e){let t=a.default.resolve(e);for(let[e,r]of[["fusermount",["-u","-z",t]],["umount",[t]]])try{await u(e,r);break}catch{}try{await (0,n.rmdir)(t)}catch{}}e.s(["assertSshfsAvailable",0,c,"isMounted",0,d,"mountSshfs",0,h,"mountpointFor",0,function(e){return a.default.join(p(),e)},"mountsDir",0,p,"unmountSshfs",0,f],256294)},402662,e=>{"use strict";var t=e.i(351216);e.s(["checkOrigin",0,function(e){let r=e.method.toUpperCase();if("GET"===r||"HEAD"===r||"OPTIONS"===r)return null;let s=e.headers.get("origin"),n=e.headers.get("referer");if(!s&&!n)return null;let a=function(e){let t=Array.from(new Set(["localhost","127.0.0.1",e.split(":")[0],...(process.env.WIKI_OWNER_HOSTS??"").split(",").map(e=>e.trim()).filter(Boolean)])),r=["",":3000",":3003"];e.includes(":")&&r.push(":"+e.split(":")[1]);let s=new Set;for(let e of t)for(let t of["http","https"])for(let n of r)s.add(`${t}://${e}${n}`);return s}(e.headers.get("host")??"");if(s)return a.has(s)?null:t.NextResponse.json({error:"FORBIDDEN",message:"Bad origin"},{status:403});if(n){try{let{protocol:e,host:t}=new URL(n);if(a.has(`${e}//${t}`))return null}catch{}return t.NextResponse.json({error:"FORBIDDEN",message:"Bad referer"},{status:403})}return null}])},814747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},224361,(e,t,r)=>{t.exports=e.x("util",()=>require("util"))},688947,(e,t,r)=>{t.exports=e.x("stream",()=>require("stream"))},427699,(e,t,r)=>{t.exports=e.x("events",()=>require("events"))},81111,(e,t,r)=>{t.exports=e.x("node:stream",()=>require("node:stream"))},761095,(e,t,r)=>{t.exports=e.x("node:net",()=>require("node:net"))},345212,762512,e=>{"use strict";var t=e.i(874533),r=e.i(902157),s=e.i(427597),n=e.i(761095),a=e.i(750227);function i(e,t,r=5){switch(t.type){case"started":return{state:{...e,status:"running",crashCount:0,lastError:void 0},action:"none"};case"manual-restart":return{state:{...e,status:"restarting",crashCount:0,lastError:void 0},action:"restart"};case"file-change":if("error"===e.status)return{state:{...e,fileWatchRestartCount:e.fileWatchRestartCount+1},action:"none"};return{state:{...e,status:"restarting",fileWatchRestartCount:e.fileWatchRestartCount+1},action:"restart"};case"crash":{if("error"===e.status)return{state:e,action:"none"};let t=e.crashCount+1;if(t>r)return{state:{...e,crashCount:t,status:"error",lastError:`Auto-restart gave up after ${t} crash restarts (cap ${r}). Fix the app and restart manually.`},action:"none"};return{state:{...e,crashCount:t,status:"restarting"},action:"restart"}}case"stop":return{state:{...e,status:"stopped"},action:"none"}}}var o=e.i(912714),l=e.i(660526),u=e.i(832852);let p="__hosted_apps__",c=/^[a-z0-9][a-z0-9-]*$/,d=new Set(["api","app","apps","s","signin","signout","_next","assets","upload","owner","share","static","public","favicon.ico"]);function h(){let e=process.env.HOME??l.default.homedir();return a.default.join(e,".wiki-viewer")}function f(){return a.default.join(h(),"hosted-apps.json")}async function m(){try{let e=await (0,o.readFile)(f(),"utf8"),t=JSON.parse(e);return{version:1,apps:Array.isArray(t.apps)?t.apps:[]}}catch{return null}}async function g(e){await (0,o.mkdir)(h(),{recursive:!0});let t=f()+".tmp";await (0,o.writeFile)(t,JSON.stringify(e,null,2),{encoding:"utf8",mode:384});try{await (0,o.chmod)(t,384)}catch{}await (0,o.rename)(t,f())}async function w(){let e=await m();if(e)return e;let t={version:1,apps:[]};return await g(t),t}async function v(){let e=await m();return e?.apps??[]}async function y(e){let t=await m();return t?t.apps.find(t=>t.slug===e)??null:null}async function _(e){var t;let r="string"!=typeof(t=e.slug)||0===t.length?{ok:!1,code:"SLUG_REQUIRED"}:c.test(t)?d.has(t)?{ok:!1,code:"SLUG_RESERVED"}:{ok:!0}:{ok:!1,code:"SLUG_INVALID"};return r.ok?(0,u.withFileMutex)(p,async()=>{let t=await w(),r=t.apps.find(t=>t.slug===e.slug);if(r)return{ok:!1,code:"SLUG_TAKEN",ownerWorkspaceId:r.workspaceId};let s={slug:e.slug,type:e.type,workspaceId:e.workspaceId,relPath:e.relPath,..."node"===e.type&&e.script?{script:e.script}:{},..."node"===e.type&&e.persist?{persist:!0}:{},createdAt:new Date().toISOString()};return t.apps.push(s),await g(t),{ok:!0,app:s}}):{ok:!1,code:r.code}}async function R(e,t){return(0,u.withFileMutex)(p,async()=>{let r=await m();if(!r)return null;let s=r.apps.find(t=>t.slug===e);return s&&"node"===s.type?(t?s.persist=!0:delete s.persist,await g(r),s):null})}async function I(e){return(0,u.withFileMutex)(p,async()=>{let t=await m();if(!t)return!1;let r=t.apps.length;return t.apps=t.apps.filter(t=>t.slug!==e),t.apps.length!==r&&(await g(t),!0)})}e.s(["createHostedApp",0,_,"deleteHostedApp",0,I,"getBySlug",0,y,"listHostedApps",0,v,"setHostedAppPersist",0,R],762512);var A=e.i(359211);let P=new Map,k=new Set,x=new Map;function E(e){return`${e.workspaceId}\0${e.relPath}`}function N(e){let t=e.watcher;e.watcher=null,t&&t.close()}function S(e){let t=e.process;if(e.process=null,!t)return;try{!t.killed&&t.pid&&t.kill("SIGTERM")}catch{}let r=setTimeout(()=>{try{!t.killed&&t.pid&&t.kill("SIGKILL")}catch{}},2e3);t.once("exit",()=>clearTimeout(r))}function b(e,t){return new Promise(r=>{let s=(0,n.createConnection)(e,t);s.setTimeout(800),s.on("connect",()=>{s.destroy(),r(!0)}),s.on("error",()=>{s.destroy(),r(!1)}),s.on("timeout",()=>{s.destroy(),r(!1)})})}async function T(e){let[t,r]=await Promise.all([b(e,"127.0.0.1"),b(e,"::1")]);return t||r}async function O(e,t=3e4){let r=Date.now()+t;for(;Date.now()<r&&!e.abort.signal.aborted;){if(await T(e.port))return e.port;await new Promise(e=>setTimeout(e,400))}return null}function C(e){let t=a.default.join(e,"package.json");if(!(0,r.existsSync)(t))return null;try{return JSON.parse((0,r.readFileSync)(t,"utf-8"))}catch{return null}}function j(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function U(e,t){return j(t,"start")?"start":j(t,"preview")&&(0,r.existsSync)(a.default.join(e,"dist"))?"preview":j(t,"dev")?"dev":null}function D(){let e=a.default.dirname(process.execPath),t=process.env.PATH??"";return t.split(a.default.delimiter).includes(e)?t:`${e}${a.default.delimiter}${t}`}function $(e,t){e.restartTimer||e.abort.signal.aborted||(x.set(t,e.supervision),e.restartTimer=setTimeout(()=>{e.restartTimer=null,P.get(t)!==e||e.abort.signal.aborted||"error"===e.supervision.status||M(e.workspaceId,e.relPath,e.absPath,e.script,{persist:!0}).catch(()=>{})},250))}function H(e,t){e.persist&&!e.watcher&&(e.watcher=(0,s.watch)(e.absPath,{ignoreInitial:!0,ignored:t=>a.default.relative(e.absPath,t).split(a.default.sep).some(e=>["node_modules",".git",".next"].includes(e)),awaitWriteFinish:{stabilityThreshold:250,pollInterval:100}}),e.watcher.on("all",()=>{if(P.get(t)!==e||e.abort.signal.aborted)return;let r=i(e.supervision,{type:"file-change"});e.supervision=r.state,"restart"===r.action&&(S(e),e.status="restarting",$(e,t))}))}async function M(e,s,o,l,u){var p;let c=E({workspaceId:e,relPath:s}),d=u?.persist===!0,h=P.get(c);if(h&&"stopped"!==h.status&&"error"!==h.status&&"missing"!==h.status&&h.process)return d&&(h.persist=!0),{port:h.port};h&&(h.abort.abort(),h.restartTimer&&clearTimeout(h.restartTimer),N(h),S(h),P.delete(c)),k.delete(c);let f=await new Promise((e,t)=>{let r=(0,n.createServer)();r.listen(0,"127.0.0.1",()=>{let t=r.address(),s="object"==typeof t&&t?t.port:0;r.close(()=>e(s))}),r.on("error",t)}),m=(0,r.existsSync)(a.default.join(o,"pnpm-lock.yaml"))?"pnpm":(0,r.existsSync)(a.default.join(o,"yarn.lock"))?"yarn":(0,r.existsSync)(a.default.join(o,"bun.lockb"))||(0,r.existsSync)(a.default.join(o,"bun.lock"))?"bun":"npm",g=function(e,t,r,s){let n=C(e);if(!n)return null;let a=n.scripts??{},i=Object.keys({...n.dependencies,...n.devDependencies}).some(e=>"vite"===e||e.includes("vite")),o=["--port",String(r)],l=e=>({bin:t,args:"npm"===t?["run",e,"--",...o]:["run",e,...o],isVite:i});if(s)return j(a,s)?l(s):null;let u=U(e,a);return u?l(u):n.main?{bin:"node",args:[n.main,...o],isVite:!1}:null}(o,m,f,l);if(!g)throw Error("No runnable script found in package.json (need start, preview, or dev)");let w=x.get(c);x.delete(c);let v={workspaceId:e,relPath:s,absPath:o,script:l,port:f,process:null,status:"installing",logs:[],generation:1,abort:new AbortController,persist:!1,supervision:w??{crashCount:0,fileWatchRestartCount:0,status:"stopped"},watcher:null,restartTimer:null};P.set(c,v);let y=e=>{v.logs.push(e),v.logs.length>200&&v.logs.shift()};try{(0,r.existsSync)(a.default.join(o,"node_modules"))||(y(`[wiki-viewer] Running ${m} install…`),await (p=v.abort.signal,new Promise((e,r)=>{if(p.aborted)return void r(Error("Install aborted"));let s=[],n=e=>{y(e),s.push(e)},a=(0,t.spawn)(m,["install"],{cwd:o,stdio:"pipe",env:{...process.env,PATH:D()}}),i=()=>{try{a.kill("SIGTERM")}catch{}};p.addEventListener("abort",i,{once:!0});let l=e=>{for(let t of e.toString().split("\n")){let e=t.trim();e&&n(e)}};a.stdout?.on("data",l),a.stderr?.on("data",l),a.on("error",e=>{p.removeEventListener("abort",i),r(e)}),a.on("exit",t=>{if(p.removeEventListener("abort",i),0===t)e();else{let e=s.slice(-20).join("\n");r(Error(`${m} install failed (exit ${t}):
|
|
2
|
+
${e}`))}})}))),v.status="starting",y(`[wiki-viewer] Starting on port ${f}: ${g.bin} ${g.args.join(" ")}`);let e=(0,t.spawn)(g.bin,g.args,{cwd:o,stdio:"pipe",env:{...process.env,PATH:D(),PORT:String(f),VITE_PORT:String(f)}});v.process=e;let s=e=>{for(let t of e.toString().split("\n")){let e=t.trim();e&&y(e)}};return e.stdout?.on("data",s),e.stderr?.on("data",s),e.on("exit",e=>{if(P.get(c)===v&&"stopped"!==v.status&&!v.abort.signal.aborted){if(v.process=null,v.persist&&0!==e&&null!==e){let t=i(v.supervision,{type:"crash",detail:`exit ${e}`});v.supervision=t.state,"restart"===t.action?(v.status="restarting",$(v,c)):(v.status="error",v.error=v.supervision.lastError);return}v.status=0===e||null===e?"stopped":"error",v.error=e?`Process exited with code ${e}`:void 0}}),O(v).then(t=>{if(P.get(c)===v&&!v.abort.signal.aborted)if(t)v.status="running",v.supervision={...v.supervision,status:"running"},H(v,c);else if(v.persist){let t=i(v.supervision,{type:"crash",detail:"readiness timeout"});v.supervision=t.state,"restart"===t.action?(v.status="restarting",$(v,c)):(v.status="error",v.error=v.supervision.lastError);try{e.kill("SIGTERM")}catch{}}else{v.status="error",v.error="Port never became reachable (30 s timeout)";try{e.kill("SIGTERM")}catch{}}}),{port:f}}catch(e){throw P.get(c)===v&&(v.status="error",v.error=e instanceof Error?e.message:String(e)),e}}async function W(e,t,r,s,n=!0){let a=E({workspaceId:e,relPath:t}),o=P.get(a);return o?(o.supervision=i(o.supervision,{type:"manual-restart"}).state,o.persist=n,o.absPath=r,o.script=s,o.restartTimer&&clearTimeout(o.restartTimer),o.restartTimer=null,S(o),o.status="restarting",$(o,a),{port:o.port}):M(e,t,r,s,{persist:n})}async function q(){if("1"===process.env.WIKI_NO_AUTH||"1"===process.env.WIKI_ALLOW_APP_RUNNER)for(let e of(await v()).filter(e=>"node"===e.type&&!0===e.persist)){let t=E({workspaceId:e.workspaceId,relPath:e.relPath}),s=await (0,A.getWorkspace)(e.workspaceId),n=s?(0,A.safeWorkspacePath)(s.rootDir,e.relPath):null;if(!n||!(0,r.existsSync)(n)){k.add(t);continue}try{await M(e.workspaceId,e.relPath,n,e.script,{persist:!0})}catch{}}}("1"===process.env.WIKI_NO_AUTH||"1"===process.env.WIKI_ALLOW_APP_RUNNER)&&q(),e.s(["getScripts",0,function(e){let t=C(e);if(!t)return{scripts:[],defaultScript:null};let r=t.scripts??{};return{scripts:Object.keys(r),defaultScript:U(e,r)}},"getStatus",0,function(e,t){let r=P.get(E({workspaceId:e,relPath:t}));return r?{status:r.status,port:r.port||void 0,error:r.error,lastError:r.supervision.lastError??r.error,restartCount:r.supervision.crashCount,fileWatchRestartCount:r.supervision.fileWatchRestartCount,logs:r.logs}:k.has(E({workspaceId:e,relPath:t}))?{status:"missing",error:"Hosted app source directory is missing",logs:[]}:{status:"stopped",logs:[]}},"resolveByPrefix",0,function(e,t){for(let r=t.length;r>0;r--){let s=t.slice(0,r).join("/"),n=P.get(E({workspaceId:e,relPath:s}));if(n&&"running"===n.status&&n.port){let e="/"+t.slice(r).join("/");return{relPath:s,port:n.port,rest:e}}}return null},"restartApp",0,W,"setAppPersistence",0,function(e,t,r,s){let n=E({workspaceId:e,relPath:t}),a=P.get(n);a&&(a.persist=s,a.absPath=r,s?H(a,n):N(a))},"startApp",0,M,"stopApp",0,function(e,t){let r=E({workspaceId:e,relPath:t}),s=P.get(r);s&&(s.abort.abort(),s.restartTimer&&clearTimeout(s.restartTimer),s.restartTimer=null,N(s),s.status="stopped",P.delete(r),S(s))}],345212)},249567,e=>{"use strict";var t=e.i(985426),r=e.i(257574),s=e.i(507835),n=e.i(457789),a=e.i(119791),i=e.i(141062),o=e.i(957291),l=e.i(535899),u=e.i(610241),p=e.i(62749),c=e.i(624891),d=e.i(725836),h=e.i(532736),f=e.i(257858),m=e.i(487476),g=e.i(193695);e.i(484264);var w=e.i(315709),v=e.i(902157),y=e.i(351216),_=e.i(402662),R=e.i(345212),I=e.i(762512),A=e.i(583627),P=e.i(254226),k=e.i(359211);async function x(e,{params:t}){var r;let s=(0,_.checkOrigin)(e);if(s)return s;let n="local",a=!0;if("1"!==process.env.WIKI_NO_AUTH){let t=await (0,P.requireUser)(e);if(!t.ok)return y.NextResponse.json({error:"UNAUTHORIZED"},{status:401});n=t.user.id,a=await (0,A.isAdmin)(t.user.id,t.user.email)}if(r=a,"1"!==process.env.WIKI_NO_AUTH&&"1"!==process.env.WIKI_ALLOW_APP_RUNNER&&!r)return y.NextResponse.json({error:"ADMIN_REQUIRED"},{status:403});let{slug:i}=await t,o=await (0,I.getBySlug)(i);if(!o)return y.NextResponse.json({error:"NOT_FOUND"},{status:404});if("node"!==o.type)return y.NextResponse.json({error:"NOT_A_NODE_APP"},{status:400});let l=await (0,k.getWorkspace)(o.workspaceId);if(!l)return y.NextResponse.json({error:"WORKSPACE_NOT_FOUND"},{status:404});if("1"!==process.env.WIKI_NO_AUTH&&!(0,k.userCanAccess)(l,n,a))return y.NextResponse.json({error:"WORKSPACE_FORBIDDEN"},{status:403});let u=(await e.json().catch(()=>({}))).action;if("stop"===u)return(0,R.stopApp)(o.workspaceId,o.relPath),y.NextResponse.json({ok:!0,status:"stopped"});if("pin"===u||"unpin"===u){if("node"!==o.type)return y.NextResponse.json({error:"NOT_A_NODE_APP"},{status:400});let e="pin"===u;if(!await (0,I.setHostedAppPersist)(o.slug,e))return y.NextResponse.json({error:"NOT_FOUND"},{status:404});let t=(0,k.safeWorkspacePath)(l.rootDir,o.relPath);return t&&(0,R.setAppPersistence)(o.workspaceId,o.relPath,t,e),y.NextResponse.json({ok:!0,persist:e})}if("restart"===u){let e=(0,k.safeWorkspacePath)(l.rootDir,o.relPath);if(!e||!(0,v.existsSync)(e))return y.NextResponse.json({error:"MISSING_DIR"},{status:409});try{let t=await (0,R.restartApp)(o.workspaceId,o.relPath,e,o.script,!0===o.persist);return y.NextResponse.json({ok:!0,status:"restarting",port:t.port})}catch(e){return y.NextResponse.json({error:String(e)},{status:500})}}if("start"===u){let e=(0,k.safeWorkspacePath)(l.rootDir,o.relPath);if(!e||!(0,v.existsSync)(e))return y.NextResponse.json({error:"MISSING_DIR"},{status:409});try{let t=await (0,R.startApp)(o.workspaceId,o.relPath,e,o.script,{persist:!0===o.persist});return y.NextResponse.json({ok:!0,status:"starting",port:t.port})}catch(e){return y.NextResponse.json({error:String(e)},{status:500})}}return y.NextResponse.json({error:"INVALID_ACTION"},{status:400})}e.s(["POST",0,x],4065);var E=e.i(4065);let N=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/wiki/hosted-apps/[slug]/route",pathname:"/api/wiki/hosted-apps/[slug]",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/wiki/hosted-apps/[slug]/route.ts",nextConfigOutput:"standalone",userland:E,...{}}),{workAsyncStorage:S,workUnitAsyncStorage:b,serverHooks:T}=N;async function O(e,t,s){s.requestMeta&&(0,n.setRequestMeta)(e,s.requestMeta),N.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let v="/api/wiki/hosted-apps/[slug]/route";v=v.replace(/\/index$/,"")||"/";let y=await N.prepare(e,t,{srcPage:v,multiZoneDraftMode:!1});if(!y)return t.statusCode=400,t.end("Bad Request"),null==s.waitUntil||s.waitUntil.call(s,Promise.resolve()),null;let{buildId:_,params:R,nextConfig:I,parsedUrl:A,isDraftMode:P,prerenderManifest:k,routerServerContext:x,isOnDemandRevalidate:E,revalidateOnlyGenerated:S,resolvedPathname:b,clientReferenceManifest:T,serverActionsManifest:O}=y,C=(0,o.normalizeAppPath)(v),j=!!(k.dynamicRoutes[C]||k.routes[b]),U=async()=>((null==x?void 0:x.render404)?await x.render404(e,t,A,!1):t.end("This page could not be found"),null);if(j&&!P){let e=!!k.routes[b],t=k.dynamicRoutes[C];if(t&&!1===t.fallback&&!e){if(I.adapterPath)return await U();throw new g.NoFallbackError}}let D=null;!j||N.isDev||P||(D="/index"===(D=b)?"/":D);let $=!0===N.isDev||!j,H=j&&!$;O&&T&&(0,i.setManifestsSingleton)({page:v,clientReferenceManifest:T,serverActionsManifest:O});let M=e.method||"GET",W=(0,a.getTracer)(),q=W.getActiveScopeSpan(),L=!!(null==x?void 0:x.isWrappedByNextServer),K=!!(0,n.getRequestMeta)(e,"minimalMode"),F=(0,n.getRequestMeta)(e,"incrementalCache")||await N.getIncrementalCache(e,I,k,K);null==F||F.resetRequestCache(),globalThis.__incrementalCache=F;let B={params:R,previewProps:k.preview,renderOpts:{experimental:{authInterrupts:!!I.experimental.authInterrupts},cacheComponents:!!I.cacheComponents,supportsDynamicResponse:$,incrementalCache:F,cacheLifeProfiles:I.cacheLife,waitUntil:s.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,s,n)=>N.onRequestError(e,t,s,n,x)},sharedContext:{buildId:_}},G=new l.NodeNextRequest(e),z=new l.NodeNextResponse(t),V=u.NextRequestAdapter.fromNodeNextRequest(G,(0,u.signalFromNodeResponse)(t));try{let n,i=async e=>N.handle(V,B).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=W.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==p.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let s=r.get("next.route");if(s){let t=`${M} ${s}`;e.setAttributes({"next.route":s,"http.route":s,"next.span_name":t}),e.updateName(t),n&&n!==e&&(n.setAttribute("http.route",s),n.updateName(t))}else e.updateName(`${M} ${v}`)}),o=async n=>{var a,o;let l=async({previousCacheEntry:r})=>{try{if(!K&&E&&S&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let a=await i(n);e.fetchMetrics=B.renderOpts.fetchMetrics;let o=B.renderOpts.pendingWaitUntil;o&&s.waitUntil&&(s.waitUntil(o),o=void 0);let l=B.renderOpts.collectedTags;if(!j)return await (0,d.sendResponse)(G,z,a,B.renderOpts.pendingWaitUntil),null;{let e=await a.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(a.headers);l&&(t[m.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==B.renderOpts.collectedRevalidate&&!(B.renderOpts.collectedRevalidate>=m.INFINITE_CACHE)&&B.renderOpts.collectedRevalidate,s=void 0===B.renderOpts.collectedExpire||B.renderOpts.collectedExpire>=m.INFINITE_CACHE?void 0:B.renderOpts.collectedExpire;return{value:{kind:w.CachedRouteKind.APP_ROUTE,status:a.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:s}}}}catch(t){throw(null==r?void 0:r.isStale)&&await N.onRequestError(e,t,{routerKind:"App Router",routePath:v,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:H,isOnDemandRevalidate:E})},!1,x),t}},u=await N.handleResponse({req:e,nextConfig:I,cacheKey:D,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:k,isRoutePPREnabled:!1,isOnDemandRevalidate:E,revalidateOnlyGenerated:S,responseGenerator:l,waitUntil:s.waitUntil,isMinimalMode:K});if(!j)return null;if((null==u||null==(a=u.value)?void 0:a.kind)!==w.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==u||null==(o=u.value)?void 0:o.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});K||t.setHeader("x-nextjs-cache",E?"REVALIDATED":u.isMiss?"MISS":u.isStale?"STALE":"HIT"),P&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let p=(0,h.fromNodeOutgoingHttpHeaders)(u.value.headers);return K&&j||p.delete(m.NEXT_CACHE_TAGS_HEADER),!u.cacheControl||t.getHeader("Cache-Control")||p.get("Cache-Control")||p.set("Cache-Control",(0,f.getCacheControlHeader)(u.cacheControl)),await (0,d.sendResponse)(G,z,new Response(u.value.body,{headers:p,status:u.value.status||200})),null};L&&q?await o(q):(n=W.getActiveScopeSpan(),await W.withPropagatedContext(e.headers,()=>W.trace(p.BaseServerSpan.handleRequest,{spanName:`${M} ${v}`,kind:a.SpanKind.SERVER,attributes:{"http.method":M,"http.target":e.url}},o),void 0,!L))}catch(t){if(t instanceof g.NoFallbackError||await N.onRequestError(e,t,{routerKind:"App Router",routePath:C,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:H,isOnDemandRevalidate:E})},!1,x),j)throw t;return await (0,d.sendResponse)(G,z,new Response(null,{status:500})),null}}e.s(["handler",0,O,"patchFetch",0,function(){return(0,s.patchFetch)({workAsyncStorage:S,workUnitAsyncStorage:b})},"routeModule",0,N,"serverHooks",0,T,"workAsyncStorage",0,S,"workUnitAsyncStorage",0,b],249567)},687903,e=>{e.v(e=>Promise.resolve().then(()=>e(912714)))},168315,e=>{e.v(t=>Promise.all(["server/chunks/0sag_@better-auth_memory-adapter_dist_index_mjs_0pvj6im._.js"].map(t=>e.l(t))).then(()=>t(862112)))},769787,e=>{e.v(t=>Promise.all(["server/chunks/01er_better-auth_dist_adapters_kysely-adapter_index_mjs_0s~-4gu._.js"].map(t=>e.l(t))).then(()=>t(717789)))},580632,e=>{e.v(e=>Promise.resolve().then(()=>e(270406)))},947559,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_bun-sqlite-dialect-DzNwOpKv_mjs_0z1z6m4._.js"].map(t=>e.l(t))).then(()=>t(495181)))},715018,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_node-sqlite-dialect_mjs_0qqlvhl._.js"].map(t=>e.l(t))).then(()=>t(698370)))},146843,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_d1-sqlite-dialect-C2B7YsIT_mjs_0wynrz3._.js"].map(t=>e.l(t))).then(()=>t(143740)))},697743,e=>{e.v(t=>Promise.all(["server/chunks/0.u4_next_05jevxw._.js"].map(t=>e.l(t))).then(()=>t(428325)))},99243,e=>{e.v(e=>Promise.resolve().then(()=>e(313414)))},893412,e=>{e.v(t=>Promise.all(["server/chunks/src_lib_auth_api-key_ts_0t_ma-t._.js"].map(t=>e.l(t))).then(()=>t(499465)))}];
|
|
3
|
+
|
|
4
|
+
//# sourceMappingURL=%5Broot-of-the-server%5D__0pftyle._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[536654,t=>{"use strict";var e=t.i(912714),a=t.i(750227);function r(t){return!!(a.default.isAbsolute(t)||".."===t||t.startsWith(".."+a.default.sep)||t.startsWith("../"))}async function n(t,s,i={}){let l;if(!t)return null;let o=function(t){if(t.includes("\0")||a.default.isAbsolute(t))return null;let e=t.replace(/\\/g,"/");return(("."===(e=a.default.posix.normalize(e))||"./"===e)&&(e=""),".."===e||e.startsWith("../")||/^[a-zA-Z]:\//.test(e)||e.startsWith("/"))?null:e}(s);if(null===o)return null;if(i.deniedSegments?.length){for(let t of o.split("/").filter(Boolean))if(i.deniedSegments.includes(t))return null}try{l=await (0,e.realpath)(t)}catch{return null}let u=o?a.default.join(l,o):l;try{let t=await (0,e.realpath)(u),n=a.default.relative(l,t);if(r(n))return null;return{relPath:o,absolutePath:t}}catch{if(!i.allowMissing)return null;let t=u;for(;;){let n=a.default.dirname(t);if(n===t)break;try{let t=await (0,e.realpath)(n),s=a.default.relative(l,t);if(r(s))return null;return{relPath:o,absolutePath:u}}catch{t=n}}return null}}t.s(["resolveWorkspacePath",0,n])},848475,t=>{"use strict";var e=t.i(750227);let a={".md":"text/markdown; charset=utf-8",".markdown":"text/markdown; charset=utf-8",".txt":"text/plain; charset=utf-8",".json":"application/json; charset=utf-8",".jsonc":"application/json; charset=utf-8",".ts":"text/typescript; charset=utf-8",".tsx":"text/typescript; charset=utf-8",".mts":"text/typescript; charset=utf-8",".js":"text/javascript; charset=utf-8",".jsx":"text/javascript; charset=utf-8",".mjs":"text/javascript; charset=utf-8",".html":"text/html; charset=utf-8",".htm":"text/html; charset=utf-8",".css":"text/css; charset=utf-8",".yaml":"text/yaml; charset=utf-8",".yml":"text/yaml; charset=utf-8",".toml":"text/toml; charset=utf-8",".xml":"application/xml; charset=utf-8",".svg":"image/svg+xml",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".avif":"image/avif",".ico":"image/x-icon",".bmp":"image/bmp",".pdf":"application/pdf",".zip":"application/zip",".tar":"application/x-tar",".gz":"application/gzip",".py":"text/x-python; charset=utf-8",".rs":"text/x-rustsrc; charset=utf-8",".go":"text/x-go; charset=utf-8",".sh":"text/x-shellscript; charset=utf-8",".csv":"text/csv; charset=utf-8",".tsv":"text/tab-separated-values; charset=utf-8",".env":"text/plain; charset=utf-8",".log":"text/plain; charset=utf-8",".ini":"text/plain; charset=utf-8",".conf":"text/plain; charset=utf-8",".mmd":"text/plain; charset=utf-8",".ipynb":"application/json; charset=utf-8",".docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",".xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".pptx":"application/vnd.openxmlformats-officedocument.presentationml.presentation",".doc":"application/msword",".xls":"application/vnd.ms-excel",".ppt":"application/vnd.ms-powerpoint",".mp4":"video/mp4",".webm":"video/webm",".mov":"video/quicktime",".m4v":"video/mp4",".mp3":"audio/mpeg",".wav":"audio/wav",".ogg":"audio/ogg",".m4a":"audio/mp4",".aac":"audio/aac"};t.s(["contentTypeForPath",0,function(t){return a[e.default.extname(t).toLowerCase()]??"application/octet-stream"}])},719126,t=>{"use strict";var e=t.i(666680),a=t.i(912714),r=t.i(750227),n=t.i(716234),s=t.i(536654),i=t.i(848475);async function l(t,e){if(!t)return null;let a=await (0,s.resolveWorkspacePath)(t,e,{allowMissing:!0,deniedSegments:n.DENIED_SEGMENTS});return a?.absolutePath??null}async function o(t,e){let r=420;try{let e=await (0,a.stat)(t);r=511&e.mode}catch{}let n=t+".~"+process.pid+"."+Date.now()+".tmp",s=await (0,a.open)(n,"w",r);try{await s.write(e),await s.datasync()}finally{await s.close()}await (0,a.rename)(n,t)}async function u(t,e){let n=r.default.dirname(t);if(e)return await (0,a.mkdir)(n,{recursive:!0}),!0;try{return await (0,a.stat)(n),!0}catch{return!1}}t.s(["atomicWrite",0,o,"ensureParentDir",0,u,"extractShaHex",0,function(t){return t.replace(/^"/,"").replace(/"$/,"").replace(/^sha256:/,"")},"isDeniedRelPath",0,function(t){let e=t.replace(/\\/g,"/");return n.DENIED_SEGMENTS.some(t=>e===t||e.startsWith(t+"/"))},"isMarkdown",0,function(t){return t.endsWith(".md")||t.endsWith(".markdown")},"looksLikeBinary",0,function(t){return t.slice(0,Math.min(t.length,8192)).includes(0)},"mimeByExt",0,function(t){return(0,i.contentTypeForPath)(t)},"safeAbsPath",0,l,"sha256ofBuf",0,function(t){return"sha256:"+(0,e.createHash)("sha256").update(t).digest("hex")}])},81111,(t,e,a)=>{e.exports=t.x("node:stream",()=>require("node:stream"))},
|
|
1
|
+
module.exports=[536654,t=>{"use strict";var e=t.i(912714),a=t.i(750227);function r(t){return!!(a.default.isAbsolute(t)||".."===t||t.startsWith(".."+a.default.sep)||t.startsWith("../"))}async function n(t,s,i={}){let l;if(!t)return null;let o=function(t){if(t.includes("\0")||a.default.isAbsolute(t))return null;let e=t.replace(/\\/g,"/");return(("."===(e=a.default.posix.normalize(e))||"./"===e)&&(e=""),".."===e||e.startsWith("../")||/^[a-zA-Z]:\//.test(e)||e.startsWith("/"))?null:e}(s);if(null===o)return null;if(i.deniedSegments?.length){for(let t of o.split("/").filter(Boolean))if(i.deniedSegments.includes(t))return null}try{l=await (0,e.realpath)(t)}catch{return null}let u=o?a.default.join(l,o):l;try{let t=await (0,e.realpath)(u),n=a.default.relative(l,t);if(r(n))return null;return{relPath:o,absolutePath:t}}catch{if(!i.allowMissing)return null;let t=u;for(;;){let n=a.default.dirname(t);if(n===t)break;try{let t=await (0,e.realpath)(n),s=a.default.relative(l,t);if(r(s))return null;return{relPath:o,absolutePath:u}}catch{t=n}}return null}}t.s(["resolveWorkspacePath",0,n])},848475,t=>{"use strict";var e=t.i(750227);let a={".md":"text/markdown; charset=utf-8",".markdown":"text/markdown; charset=utf-8",".txt":"text/plain; charset=utf-8",".json":"application/json; charset=utf-8",".jsonc":"application/json; charset=utf-8",".ts":"text/typescript; charset=utf-8",".tsx":"text/typescript; charset=utf-8",".mts":"text/typescript; charset=utf-8",".js":"text/javascript; charset=utf-8",".jsx":"text/javascript; charset=utf-8",".mjs":"text/javascript; charset=utf-8",".html":"text/html; charset=utf-8",".htm":"text/html; charset=utf-8",".css":"text/css; charset=utf-8",".yaml":"text/yaml; charset=utf-8",".yml":"text/yaml; charset=utf-8",".toml":"text/toml; charset=utf-8",".xml":"application/xml; charset=utf-8",".svg":"image/svg+xml",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".avif":"image/avif",".ico":"image/x-icon",".bmp":"image/bmp",".pdf":"application/pdf",".zip":"application/zip",".tar":"application/x-tar",".gz":"application/gzip",".py":"text/x-python; charset=utf-8",".rs":"text/x-rustsrc; charset=utf-8",".go":"text/x-go; charset=utf-8",".sh":"text/x-shellscript; charset=utf-8",".csv":"text/csv; charset=utf-8",".tsv":"text/tab-separated-values; charset=utf-8",".env":"text/plain; charset=utf-8",".log":"text/plain; charset=utf-8",".ini":"text/plain; charset=utf-8",".conf":"text/plain; charset=utf-8",".mmd":"text/plain; charset=utf-8",".ipynb":"application/json; charset=utf-8",".docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",".xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".pptx":"application/vnd.openxmlformats-officedocument.presentationml.presentation",".doc":"application/msword",".xls":"application/vnd.ms-excel",".ppt":"application/vnd.ms-powerpoint",".mp4":"video/mp4",".webm":"video/webm",".mov":"video/quicktime",".m4v":"video/mp4",".mp3":"audio/mpeg",".wav":"audio/wav",".ogg":"audio/ogg",".m4a":"audio/mp4",".aac":"audio/aac"};t.s(["contentTypeForPath",0,function(t){return a[e.default.extname(t).toLowerCase()]??"application/octet-stream"}])},719126,t=>{"use strict";var e=t.i(666680),a=t.i(912714),r=t.i(750227),n=t.i(716234),s=t.i(536654),i=t.i(848475);async function l(t,e){if(!t)return null;let a=await (0,s.resolveWorkspacePath)(t,e,{allowMissing:!0,deniedSegments:n.DENIED_SEGMENTS});return a?.absolutePath??null}async function o(t,e){let r=420;try{let e=await (0,a.stat)(t);r=511&e.mode}catch{}let n=t+".~"+process.pid+"."+Date.now()+".tmp",s=await (0,a.open)(n,"w",r);try{await s.write(e),await s.datasync()}finally{await s.close()}await (0,a.rename)(n,t)}async function u(t,e){let n=r.default.dirname(t);if(e)return await (0,a.mkdir)(n,{recursive:!0}),!0;try{return await (0,a.stat)(n),!0}catch{return!1}}t.s(["atomicWrite",0,o,"ensureParentDir",0,u,"extractShaHex",0,function(t){return t.replace(/^"/,"").replace(/"$/,"").replace(/^sha256:/,"")},"isDeniedRelPath",0,function(t){let e=t.replace(/\\/g,"/");return n.DENIED_SEGMENTS.some(t=>e===t||e.startsWith(t+"/"))},"isMarkdown",0,function(t){return t.endsWith(".md")||t.endsWith(".markdown")},"looksLikeBinary",0,function(t){return t.slice(0,Math.min(t.length,8192)).includes(0)},"mimeByExt",0,function(t){return(0,i.contentTypeForPath)(t)},"safeAbsPath",0,l,"sha256ofBuf",0,function(t){return"sha256:"+(0,e.createHash)("sha256").update(t).digest("hex")}])},81111,(t,e,a)=>{e.exports=t.x("node:stream",()=>require("node:stream"))},60845,t=>{"use strict";var e=t.i(902157),a=t.i(256294);let r=()=>{try{return(0,e.readFileSync)("/proc/self/mountinfo","utf8")}catch{return""}},n=null;function s(){n=null}function i(){let t=Date.now();if(n&&t-n.ts<5e3)return n.entries;let e=function(t){let e=[];for(let a of t.split("\n")){if(!a)continue;let t=a.indexOf(" - ");if(-1===t)continue;let r=a.slice(0,t),n=a.slice(t+3),s=r.split(" "),i=n.split(" ");if(s.length<5||i.length<1)continue;let l=s[4].replace(/\\([0-7]{3})/g,(t,e)=>String.fromCharCode(parseInt(e,8))),o=i[0];e.push({mountPoint:l,fsType:o})}return e}(r());return n={entries:e,ts:t},e}function l(t){if(t.startsWith("fuse"))return!0;switch(t){case"nfs":case"nfs4":case"cifs":case"smb3":case"smbfs":case"afs":case"ceph":case"glusterfs":case"9p":case"davfs":return!0;default:return!1}}function o(t){let r=t.endsWith("/")?t:t+"/",n=new Set;for(let t of i())l(t.fsType)&&t.mountPoint.startsWith(r)&&t.mountPoint.length>r.length&&n.add(t.mountPoint);try{let t,s=(0,a.mountsDir)();try{t=(0,e.readdirSync)(s)}catch{t=[]}for(let e of t){let t=s+"/"+e;t.startsWith(r)&&t.length>r.length&&n.add(t)}}catch{}return Array.from(n)}t.s(["_clearMountCache",0,s,"_injectMountReader",0,function(t){r=t},"_resetMountReader",0,function(){r=()=>{try{return(0,e.readFileSync)("/proc/self/mountinfo","utf8")}catch{return""}}},"isHazardFsType",0,l,"makeMountPruner",0,function(t){let e=[];function a(){e=o(t).sort()}return a(),{isPruned(t){for(let a of e)if(t===a||t.startsWith(a+"/"))return!0;return!1},refresh(){s(),a()},list:()=>[...e]}},"nestedHazardMounts",0,o,"readMountTable",0,i,"rootIsHazardMount",0,function(t){let e=t.endsWith("/")?t.slice(0,-1):t,a=null;for(let t of i()){if(!l(t.fsType))continue;if(e===t.mountPoint)return!0;let r=t.mountPoint.endsWith("/")?t.mountPoint:t.mountPoint+"/";e.startsWith(r)&&(!a||t.mountPoint.length>a.length)&&(a=t.mountPoint)}return null!==a}])},168315,t=>{t.v(e=>Promise.all(["server/chunks/0sag_@better-auth_memory-adapter_dist_index_mjs_0pvj6im._.js"].map(e=>t.l(e))).then(()=>e(862112)))},769787,t=>{t.v(e=>Promise.all(["server/chunks/01er_better-auth_dist_adapters_kysely-adapter_index_mjs_0s~-4gu._.js"].map(e=>t.l(e))).then(()=>e(717789)))},580632,t=>{t.v(t=>Promise.resolve().then(()=>t(270406)))},947559,t=>{t.v(e=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_bun-sqlite-dialect-DzNwOpKv_mjs_0z1z6m4._.js"].map(e=>t.l(e))).then(()=>e(495181)))},715018,t=>{t.v(e=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_node-sqlite-dialect_mjs_0qqlvhl._.js"].map(e=>t.l(e))).then(()=>e(698370)))},146843,t=>{t.v(e=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_d1-sqlite-dialect-C2B7YsIT_mjs_0wynrz3._.js"].map(e=>t.l(e))).then(()=>e(143740)))},697743,t=>{t.v(e=>Promise.all(["server/chunks/07~4_next_dist_server_app-render_after-task-async-storage_external_0lathp_.js","server/chunks/0.u4_next_dist_0yt9zpm._.js","server/chunks/0.u4_next_05jevxw._.js"].map(e=>t.l(e))).then(()=>e(428325)))},99243,t=>{t.v(t=>Promise.resolve().then(()=>t(313414)))},893412,t=>{t.v(t=>Promise.resolve().then(()=>t(499465)))},687903,t=>{t.v(t=>Promise.resolve().then(()=>t(912714)))}];
|
|
2
2
|
|
|
3
|
-
//# sourceMappingURL=%5Broot-of-the-server%
|
|
3
|
+
//# sourceMappingURL=%5Broot-of-the-server%5D__0pru66p._.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
module.exports=[687769,(t,e,i)=>{e.exports=t.x("node:events",()=>require("node:events"))},427597,t=>{"use strict";var e=t.i(687769),i=t.i(902157),s=t.i(912714),r=t.i(750227),a=t.i(81111);let h="files",n="directories",o="files_directories",l={root:".",fileFilter:t=>!0,directoryFilter:t=>!0,type:h,lstat:!1,depth:0x80000000,alwaysStat:!1,highWaterMark:4096};Object.freeze(l);let d="READDIRP_RECURSIVE_ERROR",c=new Set(["ENOENT","EPERM","EACCES","ELOOP",d]),f=[n,"all",o,h],p=new Set([n,"all",o]),m=new Set(["all",o,h]);process.platform;let _=t=>!0,u=t=>{if(void 0===t)return _;if("function"==typeof t)return t;if("string"==typeof t){let e=t.trim();return t=>t.basename===e}if(Array.isArray(t)){let e=t.map(t=>t.trim());return t=>e.some(e=>t.basename===e)}return _};class w extends a.Readable{parents;reading;parent;_stat;_maxDepth;_wantsDir;_wantsFile;_wantsEverything;_root;_isDirent;_statsProp;_rdOptions;_fileFilter;_directoryFilter;constructor(t={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:t.highWaterMark});const e={...l,...t},{root:i,type:a}=e;this._fileFilter=u(e.fileFilter),this._directoryFilter=u(e.directoryFilter);const h=e.lstat?s.lstat:s.stat;this._stat=h,this._maxDepth=null!=e.depth&&Number.isSafeInteger(e.depth)?e.depth:l.depth,this._wantsDir=!!a&&p.has(a),this._wantsFile=!!a&&m.has(a),this._wantsEverything="all"===a,this._root=(0,r.resolve)(i),this._isDirent=!e.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(i,1)],this.reading=!1,this.parent=void 0}async _read(t){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&t>0;){let e=this.parent,i=e&&e.files;if(i&&i.length>0){let{path:s,depth:r}=e,a=i.splice(0,t).map(t=>this._formatEntry(t,s));for(let e of(await Promise.all(a))){if(!e)continue;if(this.destroyed)return;let i=await this._getEntryType(e);"directory"===i&&this._directoryFilter(e)?(r<=this._maxDepth&&this.parents.push(this._exploreDir(e.fullPath,r+1)),this._wantsDir&&(this.push(e),t--)):("file"===i||this._includeAsFile(e))&&this._fileFilter(e)&&this._wantsFile&&(this.push(e),t--)}}else{let t=this.parents.pop();if(!t){this.push(null);break}if(this.parent=await t,this.destroyed)return}}}catch(t){this.destroy(t)}finally{this.reading=!1}}}async _exploreDir(t,e){let i;try{i=await (0,s.readdir)(t,this._rdOptions)}catch(t){this._onError(t)}return{files:i,depth:e,path:t}}async _formatEntry(t,e){let i,s=this._isDirent?t.name:t;try{let a=(0,r.resolve)((0,r.join)(e,s));(i={path:(0,r.relative)(this._root,a),fullPath:a,basename:s})[this._statsProp]=this._isDirent?t:await this._stat(a)}catch(t){this._onError(t);return}return i}_onError(t){c.has(t.code)&&!this.destroyed?this.emit("warn",t):this.destroy(t)}async _getEntryType(t){if(!t&&this._statsProp in t)return"";let e=t[this._statsProp];if(e.isFile())return"file";if(e.isDirectory())return"directory";if(e&&e.isSymbolicLink()){let e=t.fullPath;try{let t=await (0,s.realpath)(e),i=await (0,s.lstat)(t);if(i.isFile())return"file";if(i.isDirectory()){let i=t.length;if(e.startsWith(t)&&e.substr(i,1)===r.sep){let i=Error(`Circular symlink detected: "${e}" points to "${t}"`);return i.code=d,this._onError(i)}return"directory"}}catch(t){return this._onError(t),""}}}_includeAsFile(t){let e=t&&t[this._statsProp];return e&&this._wantsEverything&&!e.isDirectory()}}var g=t.i(660526);let y=()=>{},v=process.platform,P="win32"===v,b="darwin"===v,E="linux"===v,x="freebsd"===v,k="OS400"===(0,g.type)(),W="all",D="ready",F="add",I="change",R="addDir",S="unlink",z="unlinkDir",j="raw",C="error",M={lstat:s.lstat,stat:s.stat},T="listeners",A="errHandlers",O="rawEmitters",N=[T,A,O],H=new Set(["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),U=(t,e)=>{t instanceof Set?t.forEach(e):e(t)},L=(t,e,i)=>{let s=t[e];s instanceof Set||(t[e]=s=new Set([s])),s.add(i)},$=(t,e,i)=>{let s=t[e];s instanceof Set?s.delete(i):s===i&&delete t[e]},q=t=>t instanceof Set?0===t.size:!t,K=new Map;function V(t,e,s,a,h){try{return(0,i.watch)(t,{persistent:e.persistent},(e,i)=>{s(t),h(e,i,{watchedPath:t}),i&&t!==i&&G(r.resolve(t,i),T,r.join(t,i))})}catch(t){a(t);return}}let G=(t,e,i,s,r)=>{let a=K.get(t);a&&U(a[e],t=>{t(i,s,r)})},B=new Map;class J{fsw;_boundHandleError;constructor(t){this.fsw=t,this._boundHandleError=e=>t._handleError(e)}_watchWithNodeFs(t,e){let s,a=this.fsw.options,h=r.dirname(t),n=r.basename(t);this.fsw._getWatchedDir(h).add(n);let o=r.resolve(t),l={persistent:a.persistent};if(e||(e=y),a.usePolling)l.interval=a.interval!==a.binaryInterval&&H.has(r.extname(n).slice(1).toLowerCase())?a.binaryInterval:a.interval,s=((t,e,s,r)=>{let{listener:a,rawEmitter:h}=r,n=B.get(e),o=n&&n.options;return o&&(o.persistent<s.persistent||o.interval>s.interval)&&((0,i.unwatchFile)(e),n=void 0),n?(L(n,T,a),L(n,O,h)):(n={listeners:a,rawEmitters:h,options:s,watcher:(0,i.watchFile)(e,s,(i,s)=>{U(n.rawEmitters,t=>{t(I,e,{curr:i,prev:s})});let r=i.mtimeMs;(i.size!==s.size||r>s.mtimeMs||0===r)&&U(n.listeners,e=>e(t,i))})},B.set(e,n)),()=>{$(n,T,a),$(n,O,h),q(n.listeners)&&(B.delete(e),(0,i.unwatchFile)(e),n.options=n.watcher=void 0,Object.freeze(n))}})(t,o,l,{listener:e,rawEmitter:this.fsw._emitRaw});else s=((t,e,i,s)=>{let r,{listener:a,errHandler:h,rawEmitter:n}=s,o=K.get(e);if(!i.persistent){if(!(r=V(t,i,a,h,n)))return;return r.close.bind(r)}if(o)L(o,T,a),L(o,A,h),L(o,O,n);else{if(!(r=V(t,i,G.bind(null,e,T),h,G.bind(null,e,O))))return;r.on(C,async t=>{let i=G.bind(null,e,A);o&&(o.watcherUnusable=!0),i(t)}),o={listeners:a,errHandlers:h,rawEmitters:n,watcher:r},K.set(e,o)}return()=>{if($(o,T,a),$(o,A,h),$(o,O,n),q(o.listeners)){let t;o.watcher.close(),K.delete(e),N.forEach((t=o,e=>{let i=t[e];i instanceof Set?i.clear():delete t[e]})),o.watcher=void 0,Object.freeze(o)}}})(t,o,l,{listener:e,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw});return s}_handleFile(t,e,i){if(this.fsw.closed)return;let a=r.dirname(t),h=r.basename(t),n=this.fsw._getWatchedDir(a),o=e;if(n.has(h))return;let l=async(e,i)=>{if(this.fsw._throttle("watch",t,5))if(i&&0!==i.mtimeMs){if(n.has(h)){let e=i.atimeMs,s=i.mtimeMs;(!e||e<=s||s!==o.mtimeMs)&&this.fsw._emit(I,t,i),o=i}}else try{let i=await (0,s.stat)(t);if(this.fsw.closed)return;let r=i.atimeMs,a=i.mtimeMs;if((!r||r<=a||a!==o.mtimeMs)&&this.fsw._emit(I,t,i),(b||E||x)&&o.ino!==i.ino){this.fsw._closeFile(e),o=i;let s=this._watchWithNodeFs(t,l);s&&this.fsw._addPathCloser(e,s)}else o=i}catch(t){this.fsw._remove(a,h)}},d=this._watchWithNodeFs(t,l);if(!(i&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(t)){if(!this.fsw._throttle(F,t,0))return;this.fsw._emit(F,t,e)}return d}async _handleSymlink(t,e,i,r){if(this.fsw.closed)return;let a=t.fullPath,h=this.fsw._getWatchedDir(e);if(!this.fsw.options.followSymlinks){let e;this.fsw._incrReadyCount();try{e=await (0,s.realpath)(i)}catch(t){return this.fsw._emitReady(),!0}if(this.fsw.closed)return;return h.has(r)?this.fsw._symlinkPaths.get(a)!==e&&(this.fsw._symlinkPaths.set(a,e),this.fsw._emit(I,i,t.stats)):(h.add(r),this.fsw._symlinkPaths.set(a,e),this.fsw._emit(F,i,t.stats)),this.fsw._emitReady(),!0}if(this.fsw._symlinkPaths.has(a))return!0;this.fsw._symlinkPaths.set(a,!0)}_handleRead(t,e,i,s,a,h,n){t=r.join(t,"");let o=s?`${t}:${s}`:t;if(!(n=this.fsw._throttle("readdir",o,1e3)))return;let l=this.fsw._getWatchedDir(i.path),d=new Set,c=this.fsw._readdirp(t,{fileFilter:t=>i.filterPath(t),directoryFilter:t=>i.filterDir(t)});if(c)return c.on("data",async n=>{if(this.fsw.closed){c=void 0;return}let o=n.path,f=r.join(t,o);if(d.add(o),!(n.stats.isSymbolicLink()&&await this._handleSymlink(n,t,f,o))){if(this.fsw.closed){c=void 0;return}o!==s&&(s||l.has(o))||(this.fsw._incrReadyCount(),f=r.join(a,r.relative(a,f)),this._addToNodeFs(f,e,i,h+1))}}).on(C,this._boundHandleError),new Promise((e,r)=>{if(!c)return r();c.once("end",()=>{if(this.fsw.closed){c=void 0;return}let r=!!n&&n.clear();e(void 0),l.getChildren().filter(e=>e!==t&&!d.has(e)).forEach(e=>{this.fsw._remove(t,e)}),c=void 0,r&&this._handleRead(t,!1,i,s,a,h,n)})})}async _handleDir(t,e,i,s,a,h,n){let o,l,d=this.fsw._getWatchedDir(r.dirname(t)),c=d.has(r.basename(t));i&&this.fsw.options.ignoreInitial||a||c||this.fsw._emit(R,t,e),d.add(r.basename(t)),this.fsw._getWatchedDir(t);let f=this.fsw.options.depth;if((null==f||s<=f)&&!this.fsw._symlinkPaths.has(n)){if(!a&&(await this._handleRead(t,i,h,a,t,s,o),this.fsw.closed))return;l=this._watchWithNodeFs(t,(e,i)=>{i&&0===i.mtimeMs||this._handleRead(e,!1,h,a,t,s,o)})}return l}async _addToNodeFs(t,e,i,a,h){let n=this.fsw._emitReady;if(this.fsw._isIgnored(t)||this.fsw.closed)return n(),!1;let o=this.fsw._getWatchHelpers(t);i&&(o.filterPath=t=>i.filterPath(t),o.filterDir=t=>i.filterDir(t));try{let i,l=await M[o.statMethod](o.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(o.watchPath,l))return n(),!1;let d=this.fsw.options.followSymlinks;if(l.isDirectory()){let n=r.resolve(t),c=d?await (0,s.realpath)(t):t;if(this.fsw.closed||(i=await this._handleDir(o.watchPath,l,e,a,h,o,c),this.fsw.closed))return;n!==c&&void 0!==c&&this.fsw._symlinkPaths.set(n,c)}else if(l.isSymbolicLink()){let h=d?await (0,s.realpath)(t):t;if(this.fsw.closed)return;let n=r.dirname(o.watchPath);if(this.fsw._getWatchedDir(n).add(o.watchPath),this.fsw._emit(F,o.watchPath,l),i=await this._handleDir(n,l,e,a,t,o,h),this.fsw.closed)return;void 0!==h&&this.fsw._symlinkPaths.set(r.resolve(t),h)}else i=this._handleFile(o.watchPath,l,e);return n(),i&&this.fsw._addPathCloser(t,i),!1}catch(e){if(this.fsw._handleError(e))return n(),t}}}let Q=/\\/g,X=/\/\//g,Y=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,Z=/^\.[/\\]/;function tt(t){return Array.isArray(t)?t:[t]}let te=t=>"object"==typeof t&&null!==t&&!(t instanceof RegExp);function ti(t,e,i){let s=function(t){if("string"!=typeof t)throw Error("string expected");t=(t=r.normalize(t)).replace(/\\/g,"/");let e=!1;return t.startsWith("//")&&(e=!0),t=t.replace(X,"/"),e&&(t="/"+t),t}(e);for(let e=0;e<t.length;e++)if((0,t[e])(s,i))return!0;return!1}let ts=t=>{let e=tt(t).flat();if(!e.every(t=>"string"==typeof t))throw TypeError(`Non-string provided as watch path: ${e}`);return e.map(ta)},tr=t=>{let e=t.replace(Q,"/"),i=!1;return e.startsWith("//")&&(i=!0),e=e.replace(X,"/"),i&&(e="/"+e),e},ta=t=>tr(r.normalize(tr(t))),th=(t="")=>e=>"string"==typeof e?ta(r.isAbsolute(e)?e:r.join(t,e)):e,tn=Object.freeze(new Set);class to{path;_removeWatcher;items;constructor(t,e){this.path=t,this._removeWatcher=e,this.items=new Set}add(t){let{items:e}=this;e&&"."!==t&&".."!==t&&e.add(t)}async remove(t){let{items:e}=this;if(!e||(e.delete(t),e.size>0))return;let i=this.path;try{await (0,s.readdir)(i)}catch(t){this._removeWatcher&&this._removeWatcher(r.dirname(i),r.basename(i))}}has(t){let{items:e}=this;if(e)return e.has(t)}getChildren(){let{items:t}=this;return t?[...t.values()]:[]}dispose(){this.items.clear(),this.path="",this._removeWatcher=y,this.items=tn,Object.freeze(this)}}class tl{fsw;path;watchPath;fullWatchPath;dirParts;followSymlinks;statMethod;constructor(t,e,i){this.fsw=i;const s=t;this.path=t=t.replace(Z,""),this.watchPath=s,this.fullWatchPath=r.resolve(s),this.dirParts=[],this.dirParts.forEach(t=>{t.length>1&&t.pop()}),this.followSymlinks=e,this.statMethod=e?"stat":"lstat"}entryPath(t){return r.join(this.watchPath,r.relative(this.watchPath,t.fullPath))}filterPath(t){let{stats:e}=t;if(e&&e.isSymbolicLink())return this.filterDir(t);let i=this.entryPath(t);return this.fsw._isntIgnored(i,e)&&this.fsw._hasReadPermissions(e)}filterDir(t){return this.fsw._isntIgnored(this.entryPath(t),t.stats)}}class td extends e.EventEmitter{closed;options;_closers;_ignoredPaths;_throttled;_streams;_symlinkPaths;_watched;_pendingWrites;_pendingUnlinks;_readyCount;_emitReady;_closePromise;_userIgnored;_readyEmitted;_emitRaw;_boundRemove;_nodeFsHandler;constructor(t={}){super(),this.closed=!1,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._streams=new Set,this._symlinkPaths=new Map,this._watched=new Map,this._pendingWrites=new Map,this._pendingUnlinks=new Map,this._readyCount=0,this._readyEmitted=!1;const e=t.awaitWriteFinish,i={stabilityThreshold:2e3,pollInterval:100},s={persistent:!0,ignoreInitial:!1,ignorePermissionErrors:!1,interval:100,binaryInterval:300,followSymlinks:!0,usePolling:!1,atomic:!0,...t,ignored:t.ignored?tt(t.ignored):tt([]),awaitWriteFinish:!0===e?i:"object"==typeof e&&{...i,...e}};k&&(s.usePolling=!0),void 0===s.atomic&&(s.atomic=!s.usePolling);const r=process.env.CHOKIDAR_USEPOLLING;if(void 0!==r){const t=r.toLowerCase();"false"===t||"0"===t?s.usePolling=!1:"true"===t||"1"===t?s.usePolling=!0:s.usePolling=!!t}const a=process.env.CHOKIDAR_INTERVAL;a&&(s.interval=Number.parseInt(a,10));let h=0;this._emitReady=()=>{++h>=this._readyCount&&(this._emitReady=y,this._readyEmitted=!0,process.nextTick(()=>this.emit(D)))},this._emitRaw=(...t)=>this.emit(j,...t),this._boundRemove=this._remove.bind(this),this.options=s,this._nodeFsHandler=new J(this),Object.freeze(s)}_addIgnoredPath(t){if(te(t)){for(let e of this._ignoredPaths)if(te(e)&&e.path===t.path&&e.recursive===t.recursive)return}this._ignoredPaths.add(t)}_removeIgnoredPath(t){if(this._ignoredPaths.delete(t),"string"==typeof t)for(let e of this._ignoredPaths)te(e)&&e.path===t&&this._ignoredPaths.delete(e)}add(t,e,i){let{cwd:s}=this.options;this.closed=!1,this._closePromise=void 0;let a=ts(t);return s&&(a=a.map(t=>r.isAbsolute(t)?t:r.join(s,t))),a.forEach(t=>{this._removeIgnoredPath(t)}),this._userIgnored=void 0,this._readyCount||(this._readyCount=0),this._readyCount+=a.length,Promise.all(a.map(async t=>{let s=await this._nodeFsHandler._addToNodeFs(t,!i,void 0,0,e);return s&&this._emitReady(),s})).then(t=>{this.closed||t.forEach(t=>{t&&this.add(r.dirname(t),r.basename(e||t))})}),this}unwatch(t){if(this.closed)return this;let e=ts(t),{cwd:i}=this.options;return e.forEach(t=>{r.isAbsolute(t)||this._closers.has(t)||(i&&(t=r.join(i,t)),t=r.resolve(t)),this._closePath(t),this._addIgnoredPath(t),this._watched.has(t)&&this._addIgnoredPath({path:t,recursive:!0}),this._userIgnored=void 0}),this}close(){if(this._closePromise)return this._closePromise;this.closed=!0,this.removeAllListeners();let t=[];return this._closers.forEach(e=>e.forEach(e=>{let i=e();i instanceof Promise&&t.push(i)})),this._streams.forEach(t=>t.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(t=>t.dispose()),this._closers.clear(),this._watched.clear(),this._streams.clear(),this._symlinkPaths.clear(),this._throttled.clear(),this._closePromise=t.length?Promise.all(t).then(()=>void 0):Promise.resolve(),this._closePromise}getWatched(){let t={};return this._watched.forEach((e,i)=>{t[(this.options.cwd?r.relative(this.options.cwd,i):i)||"."]=e.getChildren().sort()}),t}emitWithAll(t,e){this.emit(t,...e),t!==C&&this.emit(W,t,...e)}async _emit(t,e,i){let a;if(this.closed)return;let h=this.options;P&&(e=r.normalize(e)),h.cwd&&(e=r.relative(h.cwd,e));let n=[e];null!=i&&n.push(i);let o=h.awaitWriteFinish;if(o&&(a=this._pendingWrites.get(e)))return a.lastChange=new Date,this;if(h.atomic){if(t===S)return this._pendingUnlinks.set(e,[t,...n]),setTimeout(()=>{this._pendingUnlinks.forEach((t,e)=>{this.emit(...t),this.emit(W,...t),this._pendingUnlinks.delete(e)})},"number"==typeof h.atomic?h.atomic:100),this;t===F&&this._pendingUnlinks.has(e)&&(t=I,this._pendingUnlinks.delete(e))}if(o&&(t===F||t===I)&&this._readyEmitted){let i=(e,i)=>{e?(t=C,n[0]=e,this.emitWithAll(t,n)):i&&(n.length>1?n[1]=i:n.push(i),this.emitWithAll(t,n))};return this._awaitWriteFinish(e,o.stabilityThreshold,t,i),this}if(t===I&&!this._throttle(I,e,50))return this;if(h.alwaysStat&&void 0===i&&(t===F||t===R||t===I)){let t,i=h.cwd?r.join(h.cwd,e):e;try{t=await (0,s.stat)(i)}catch(t){}if(!t||this.closed)return;n.push(t)}return this.emitWithAll(t,n),this}_handleError(t){let e=t&&t.code;return t&&"ENOENT"!==e&&"ENOTDIR"!==e&&(!this.options.ignorePermissionErrors||"EPERM"!==e&&"EACCES"!==e)&&this.emit(C,t),t||this.closed}_throttle(t,e,i){let s;this._throttled.has(t)||this._throttled.set(t,new Map);let r=this._throttled.get(t);if(!r)throw Error("invalid throttle");let a=r.get(e);if(a)return a.count++,!1;let h=()=>{let t=r.get(e),i=t?t.count:0;return r.delete(e),clearTimeout(s),t&&clearTimeout(t.timeoutObject),i},n={timeoutObject:s=setTimeout(h,i),clear:h,count:0};return r.set(e,n),n}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(t,e,s,a){let h,n=this.options.awaitWriteFinish;if("object"!=typeof n)return;let o=n.pollInterval,l=t;this.options.cwd&&!r.isAbsolute(t)&&(l=r.join(this.options.cwd,t));let d=new Date,c=this._pendingWrites;c.has(t)||(c.set(t,{lastChange:d,cancelWait:()=>(c.delete(t),clearTimeout(h),s)}),h=setTimeout(function s(r){(0,i.stat)(l,(i,n)=>{if(i||!c.has(t)){i&&"ENOENT"!==i.code&&a(i);return}let l=Number(new Date);r&&n.size!==r.size&&(c.get(t).lastChange=l),l-c.get(t).lastChange>=e?(c.delete(t),a(void 0,n)):h=setTimeout(s,o,n)})},o))}_isIgnored(t,e){if(this.options.atomic&&Y.test(t))return!0;if(!this._userIgnored){let{cwd:t}=this.options,e=(this.options.ignored||[]).map(th(t)),i=[...[...this._ignoredPaths].map(th(t)),...e];this._userIgnored=function(t,e){if(null==t)throw TypeError("anymatch: specify first argument");let i=tt(t).map(t=>"function"==typeof t?t:"string"==typeof t?e=>t===e:t instanceof RegExp?e=>t.test(e):"object"==typeof t&&null!==t?e=>{if(t.path===e)return!0;if(t.recursive){let i=r.relative(t.path,e);return!!i&&!i.startsWith("..")&&!r.isAbsolute(i)}return!1}:()=>!1);return null==e?(t,e)=>ti(i,t,e):ti(i,e)}(i,void 0)}return this._userIgnored(t,e)}_isntIgnored(t,e){return!this._isIgnored(t,e)}_getWatchHelpers(t){return new tl(t,this.options.followSymlinks,this)}_getWatchedDir(t){let e=r.resolve(t);return this._watched.has(e)||this._watched.set(e,new to(e,this._boundRemove)),this._watched.get(e)}_hasReadPermissions(t){return!!this.options.ignorePermissionErrors||!!(256&Number(t.mode))}_remove(t,e,i){let s=r.join(t,e),a=r.resolve(s);if(i=null!=i?i:this._watched.has(s)||this._watched.has(a),!this._throttle("remove",s,100))return;i||1!==this._watched.size||this.add(t,e,!0),this._getWatchedDir(s).getChildren().forEach(t=>this._remove(s,t));let h=this._getWatchedDir(t),n=h.has(e);h.remove(e),this._symlinkPaths.has(a)&&this._symlinkPaths.delete(a);let o=s;if(this.options.cwd&&(o=r.relative(this.options.cwd,s)),this.options.awaitWriteFinish&&this._pendingWrites.has(o)&&this._pendingWrites.get(o).cancelWait()===F)return;this._watched.delete(s),this._watched.delete(a);let l=i?z:S;n&&!this._isIgnored(s)&&this._emit(l,s),this._closePath(s)}_closePath(t){this._closeFile(t);let e=r.dirname(t);this._getWatchedDir(e).remove(r.basename(t))}_closeFile(t){let e=this._closers.get(t);e&&(e.forEach(t=>t()),this._closers.delete(t))}_addPathCloser(t,e){if(!e)return;let i=this._closers.get(t);i||(i=[],this._closers.set(t,i)),i.push(e)}_readdirp(t,e){if(this.closed)return;let i=function(t,e={}){let i=e.entryType||e.type;if("both"===i&&(i=o),i&&(e.type=i),t){if("string"!=typeof t)throw TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");else if(i&&!f.includes(i))throw Error(`readdirp: Invalid type passed. Use one of ${f.join(", ")}`)}else throw Error("readdirp: root argument is required. Usage: readdirp(root, options)");return e.root=t,new w(e)}(t,{type:W,alwaysStat:!0,lstat:!0,...e,depth:0});return this._streams.add(i),i.once("close",()=>{i=void 0}),i.once("end",()=>{i&&(this._streams.delete(i),i=void 0)}),i}}t.s(["watch",0,function(t,e={}){let i=new td(e);return i.add(t),i}],427597)}];
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=%5Broot-of-the-server%5D__0qicj__._.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
module.exports=[814747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},224361,(e,t,r)=>{t.exports=e.x("util",()=>require("util"))},688947,(e,t,r)=>{t.exports=e.x("stream",()=>require("stream"))},427699,(e,t,r)=>{t.exports=e.x("events",()=>require("events"))},857764,(e,t,r)=>{t.exports=e.x("node:url",()=>require("node:url"))},81111,(e,t,r)=>{t.exports=e.x("node:stream",()=>require("node:stream"))},761095,(e,t,r)=>{t.exports=e.x("node:net",()=>require("node:net"))},345212,762512,e=>{"use strict";var t=e.i(874533),r=e.i(902157),s=e.i(427597),a=e.i(761095),n=e.i(750227);function i(e,t,r=5){switch(t.type){case"started":return{state:{...e,status:"running",crashCount:0,lastError:void 0},action:"none"};case"manual-restart":return{state:{...e,status:"restarting",crashCount:0,lastError:void 0},action:"restart"};case"file-change":if("error"===e.status)return{state:{...e,fileWatchRestartCount:e.fileWatchRestartCount+1},action:"none"};return{state:{...e,status:"restarting",fileWatchRestartCount:e.fileWatchRestartCount+1},action:"restart"};case"crash":{if("error"===e.status)return{state:e,action:"none"};let t=e.crashCount+1;if(t>r)return{state:{...e,crashCount:t,status:"error",lastError:`Auto-restart gave up after ${t} crash restarts (cap ${r}). Fix the app and restart manually.`},action:"none"};return{state:{...e,crashCount:t,status:"restarting"},action:"restart"}}case"stop":return{state:{...e,status:"stopped"},action:"none"}}}var o=e.i(912714),l=e.i(660526),u=e.i(832852);let p="__hosted_apps__",c=/^[a-z0-9][a-z0-9-]*$/,d=new Set(["api","app","apps","s","signin","signout","_next","assets","upload","owner","share","static","public","favicon.ico"]);function h(){let e=process.env.HOME??l.default.homedir();return n.default.join(e,".wiki-viewer")}function f(){return n.default.join(h(),"hosted-apps.json")}async function v(){try{let e=await (0,o.readFile)(f(),"utf8"),t=JSON.parse(e);return{version:1,apps:Array.isArray(t.apps)?t.apps:[]}}catch{return null}}async function g(e){await (0,o.mkdir)(h(),{recursive:!0});let t=f()+".tmp";await (0,o.writeFile)(t,JSON.stringify(e,null,2),{encoding:"utf8",mode:384});try{await (0,o.chmod)(t,384)}catch{}await (0,o.rename)(t,f())}async function m(){let e=await v();if(e)return e;let t={version:1,apps:[]};return await g(t),t}async function w(){let e=await v();return e?.apps??[]}async function y(e){let t=await v();return t?t.apps.find(t=>t.slug===e)??null:null}async function _(e){var t;let r="string"!=typeof(t=e.slug)||0===t.length?{ok:!1,code:"SLUG_REQUIRED"}:c.test(t)?d.has(t)?{ok:!1,code:"SLUG_RESERVED"}:{ok:!0}:{ok:!1,code:"SLUG_INVALID"};return r.ok?(0,u.withFileMutex)(p,async()=>{let t=await m(),r=t.apps.find(t=>t.slug===e.slug);if(r)return{ok:!1,code:"SLUG_TAKEN",ownerWorkspaceId:r.workspaceId};let s={slug:e.slug,type:e.type,workspaceId:e.workspaceId,relPath:e.relPath,..."node"===e.type&&e.script?{script:e.script}:{},..."node"===e.type&&e.persist?{persist:!0}:{},createdAt:new Date().toISOString()};return t.apps.push(s),await g(t),{ok:!0,app:s}}):{ok:!1,code:r.code}}async function R(e,t){return(0,u.withFileMutex)(p,async()=>{let r=await v();if(!r)return null;let s=r.apps.find(t=>t.slug===e);return s&&"node"===s.type?(t?s.persist=!0:delete s.persist,await g(r),s):null})}async function x(e){return(0,u.withFileMutex)(p,async()=>{let t=await v();if(!t)return!1;let r=t.apps.length;return t.apps=t.apps.filter(t=>t.slug!==e),t.apps.length!==r&&(await g(t),!0)})}e.s(["createHostedApp",0,_,"deleteHostedApp",0,x,"getBySlug",0,y,"listHostedApps",0,w,"setHostedAppPersist",0,R],762512);var b=e.i(359211);let P=new Map,E=new Set,T=new Map;function k(e){return`${e.workspaceId}\0${e.relPath}`}function S(e){let t=e.watcher;e.watcher=null,t&&t.close()}function A(e){let t=e.process;if(e.process=null,!t)return;try{!t.killed&&t.pid&&t.kill("SIGTERM")}catch{}let r=setTimeout(()=>{try{!t.killed&&t.pid&&t.kill("SIGKILL")}catch{}},2e3);t.once("exit",()=>clearTimeout(r))}function C(e,t){return new Promise(r=>{let s=(0,a.createConnection)(e,t);s.setTimeout(800),s.on("connect",()=>{s.destroy(),r(!0)}),s.on("error",()=>{s.destroy(),r(!1)}),s.on("timeout",()=>{s.destroy(),r(!1)})})}async function I(e){let[t,r]=await Promise.all([C(e,"127.0.0.1"),C(e,"::1")]);return t||r}async function N(e,t=3e4){let r=Date.now()+t;for(;Date.now()<r&&!e.abort.signal.aborted;){if(await I(e.port))return e.port;await new Promise(e=>setTimeout(e,400))}return null}function j(e){let t=n.default.join(e,"package.json");if(!(0,r.existsSync)(t))return null;try{return JSON.parse((0,r.readFileSync)(t,"utf-8"))}catch{return null}}function O(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function q(e,t){return O(t,"start")?"start":O(t,"preview")&&(0,r.existsSync)(n.default.join(e,"dist"))?"preview":O(t,"dev")?"dev":null}function H(){let e=n.default.dirname(process.execPath),t=process.env.PATH??"";return t.split(n.default.delimiter).includes(e)?t:`${e}${n.default.delimiter}${t}`}function U(e,t){e.restartTimer||e.abort.signal.aborted||(T.set(t,e.supervision),e.restartTimer=setTimeout(()=>{e.restartTimer=null,P.get(t)!==e||e.abort.signal.aborted||"error"===e.supervision.status||D(e.workspaceId,e.relPath,e.absPath,e.script,{persist:!0}).catch(()=>{})},250))}function $(e,t){e.persist&&!e.watcher&&(e.watcher=(0,s.watch)(e.absPath,{ignoreInitial:!0,ignored:t=>n.default.relative(e.absPath,t).split(n.default.sep).some(e=>["node_modules",".git",".next"].includes(e)),awaitWriteFinish:{stabilityThreshold:250,pollInterval:100}}),e.watcher.on("all",()=>{if(P.get(t)!==e||e.abort.signal.aborted)return;let r=i(e.supervision,{type:"file-change"});e.supervision=r.state,"restart"===r.action&&(A(e),e.status="restarting",U(e,t))}))}async function D(e,s,o,l,u){var p;let c=k({workspaceId:e,relPath:s}),d=u?.persist===!0,h=P.get(c);if(h&&"stopped"!==h.status&&"error"!==h.status&&"missing"!==h.status&&h.process)return d&&(h.persist=!0),{port:h.port};h&&(h.abort.abort(),h.restartTimer&&clearTimeout(h.restartTimer),S(h),A(h),P.delete(c)),E.delete(c);let f=await new Promise((e,t)=>{let r=(0,a.createServer)();r.listen(0,"127.0.0.1",()=>{let t=r.address(),s="object"==typeof t&&t?t.port:0;r.close(()=>e(s))}),r.on("error",t)}),v=(0,r.existsSync)(n.default.join(o,"pnpm-lock.yaml"))?"pnpm":(0,r.existsSync)(n.default.join(o,"yarn.lock"))?"yarn":(0,r.existsSync)(n.default.join(o,"bun.lockb"))||(0,r.existsSync)(n.default.join(o,"bun.lock"))?"bun":"npm",g=function(e,t,r,s){let a=j(e);if(!a)return null;let n=a.scripts??{},i=Object.keys({...a.dependencies,...a.devDependencies}).some(e=>"vite"===e||e.includes("vite")),o=["--port",String(r)],l=e=>({bin:t,args:"npm"===t?["run",e,"--",...o]:["run",e,...o],isVite:i});if(s)return O(n,s)?l(s):null;let u=q(e,n);return u?l(u):a.main?{bin:"node",args:[a.main,...o],isVite:!1}:null}(o,v,f,l);if(!g)throw Error("No runnable script found in package.json (need start, preview, or dev)");let m=T.get(c);T.delete(c);let w={workspaceId:e,relPath:s,absPath:o,script:l,port:f,process:null,status:"installing",logs:[],generation:1,abort:new AbortController,persist:!1,supervision:m??{crashCount:0,fileWatchRestartCount:0,status:"stopped"},watcher:null,restartTimer:null};P.set(c,w);let y=e=>{w.logs.push(e),w.logs.length>200&&w.logs.shift()};try{(0,r.existsSync)(n.default.join(o,"node_modules"))||(y(`[wiki-viewer] Running ${v} install…`),await (p=w.abort.signal,new Promise((e,r)=>{if(p.aborted)return void r(Error("Install aborted"));let s=[],a=e=>{y(e),s.push(e)},n=(0,t.spawn)(v,["install"],{cwd:o,stdio:"pipe",env:{...process.env,PATH:H()}}),i=()=>{try{n.kill("SIGTERM")}catch{}};p.addEventListener("abort",i,{once:!0});let l=e=>{for(let t of e.toString().split("\n")){let e=t.trim();e&&a(e)}};n.stdout?.on("data",l),n.stderr?.on("data",l),n.on("error",e=>{p.removeEventListener("abort",i),r(e)}),n.on("exit",t=>{if(p.removeEventListener("abort",i),0===t)e();else{let e=s.slice(-20).join("\n");r(Error(`${v} install failed (exit ${t}):
|
|
2
|
+
${e}`))}})}))),w.status="starting",y(`[wiki-viewer] Starting on port ${f}: ${g.bin} ${g.args.join(" ")}`);let e=(0,t.spawn)(g.bin,g.args,{cwd:o,stdio:"pipe",env:{...process.env,PATH:H(),PORT:String(f),VITE_PORT:String(f)}});w.process=e;let s=e=>{for(let t of e.toString().split("\n")){let e=t.trim();e&&y(e)}};return e.stdout?.on("data",s),e.stderr?.on("data",s),e.on("exit",e=>{if(P.get(c)===w&&"stopped"!==w.status&&!w.abort.signal.aborted){if(w.process=null,w.persist&&0!==e&&null!==e){let t=i(w.supervision,{type:"crash",detail:`exit ${e}`});w.supervision=t.state,"restart"===t.action?(w.status="restarting",U(w,c)):(w.status="error",w.error=w.supervision.lastError);return}w.status=0===e||null===e?"stopped":"error",w.error=e?`Process exited with code ${e}`:void 0}}),N(w).then(t=>{if(P.get(c)===w&&!w.abort.signal.aborted)if(t)w.status="running",w.supervision={...w.supervision,status:"running"},$(w,c);else if(w.persist){let t=i(w.supervision,{type:"crash",detail:"readiness timeout"});w.supervision=t.state,"restart"===t.action?(w.status="restarting",U(w,c)):(w.status="error",w.error=w.supervision.lastError);try{e.kill("SIGTERM")}catch{}}else{w.status="error",w.error="Port never became reachable (30 s timeout)";try{e.kill("SIGTERM")}catch{}}}),{port:f}}catch(e){throw P.get(c)===w&&(w.status="error",w.error=e instanceof Error?e.message:String(e)),e}}async function M(e,t,r,s,a=!0){let n=k({workspaceId:e,relPath:t}),o=P.get(n);return o?(o.supervision=i(o.supervision,{type:"manual-restart"}).state,o.persist=a,o.absPath=r,o.script=s,o.restartTimer&&clearTimeout(o.restartTimer),o.restartTimer=null,A(o),o.status="restarting",U(o,n),{port:o.port}):D(e,t,r,s,{persist:a})}async function W(){if("1"===process.env.WIKI_NO_AUTH||"1"===process.env.WIKI_ALLOW_APP_RUNNER)for(let e of(await w()).filter(e=>"node"===e.type&&!0===e.persist)){let t=k({workspaceId:e.workspaceId,relPath:e.relPath}),s=await (0,b.getWorkspace)(e.workspaceId),a=s?(0,b.safeWorkspacePath)(s.rootDir,e.relPath):null;if(!a||!(0,r.existsSync)(a)){E.add(t);continue}try{await D(e.workspaceId,e.relPath,a,e.script,{persist:!0})}catch{}}}("1"===process.env.WIKI_NO_AUTH||"1"===process.env.WIKI_ALLOW_APP_RUNNER)&&W(),e.s(["getScripts",0,function(e){let t=j(e);if(!t)return{scripts:[],defaultScript:null};let r=t.scripts??{};return{scripts:Object.keys(r),defaultScript:q(e,r)}},"getStatus",0,function(e,t){let r=P.get(k({workspaceId:e,relPath:t}));return r?{status:r.status,port:r.port||void 0,error:r.error,lastError:r.supervision.lastError??r.error,restartCount:r.supervision.crashCount,fileWatchRestartCount:r.supervision.fileWatchRestartCount,logs:r.logs}:E.has(k({workspaceId:e,relPath:t}))?{status:"missing",error:"Hosted app source directory is missing",logs:[]}:{status:"stopped",logs:[]}},"resolveByPrefix",0,function(e,t){for(let r=t.length;r>0;r--){let s=t.slice(0,r).join("/"),a=P.get(k({workspaceId:e,relPath:s}));if(a&&"running"===a.status&&a.port){let e="/"+t.slice(r).join("/");return{relPath:s,port:a.port,rest:e}}}return null},"restartApp",0,M,"setAppPersistence",0,function(e,t,r,s){let a=k({workspaceId:e,relPath:t}),n=P.get(a);n&&(n.persist=s,n.absPath=r,s?$(n,a):S(n))},"startApp",0,D,"stopApp",0,function(e,t){let r=k({workspaceId:e,relPath:t}),s=P.get(r);s&&(s.abort.abort(),s.restartTimer&&clearTimeout(s.restartTimer),s.restartTimer=null,S(s),s.status="stopped",P.delete(r),A(s))}],345212)},727028,(e,t,r)=>{t.exports=e.x("node:zlib",()=>require("node:zlib"))},62496,e=>{"use strict";var t=e.i(985426),r=e.i(257574),s=e.i(507835),a=e.i(457789),n=e.i(119791),i=e.i(141062),o=e.i(957291),l=e.i(535899),u=e.i(610241),p=e.i(62749),c=e.i(624891),d=e.i(725836),h=e.i(532736),f=e.i(257858),v=e.i(487476),g=e.i(193695);e.i(484264);var m=e.i(315709),w=e.i(351216),y=e.i(345212),_=e.i(723012),R=e.i(660038);async function x(e,{params:t}){let r=await (0,R.resolveWorkspaceForUser)(e,"read");if(!r.ok)return w.NextResponse.json({error:r.code},{status:r.status});let s=(await t).path??[],a=(0,y.resolveByPrefix)(r.ws.id,s);if(!a)return w.NextResponse.json({error:"APP_NOT_FOUND"},{status:404});let{port:n,relPath:i,rest:o}=a;return(0,_.forwardToChild)(e,{port:n,rest:o,proxyBase:`/api/app-proxy/${i}`})}e.s(["DELETE",0,x,"GET",0,x,"HEAD",0,x,"OPTIONS",0,x,"PATCH",0,x,"POST",0,x,"PUT",0,x,"dynamic",0,"force-dynamic"],485042);var b=e.i(485042);let P=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/app-proxy/[...path]/route",pathname:"/api/app-proxy/[...path]",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/app-proxy/[...path]/route.ts",nextConfigOutput:"standalone",userland:b,...{}}),{workAsyncStorage:E,workUnitAsyncStorage:T,serverHooks:k}=P;async function S(e,t,s){s.requestMeta&&(0,a.setRequestMeta)(e,s.requestMeta),P.isDev&&(0,a.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let w="/api/app-proxy/[...path]/route";w=w.replace(/\/index$/,"")||"/";let y=await P.prepare(e,t,{srcPage:w,multiZoneDraftMode:!1});if(!y)return t.statusCode=400,t.end("Bad Request"),null==s.waitUntil||s.waitUntil.call(s,Promise.resolve()),null;let{buildId:_,params:R,nextConfig:x,parsedUrl:b,isDraftMode:E,prerenderManifest:T,routerServerContext:k,isOnDemandRevalidate:S,revalidateOnlyGenerated:A,resolvedPathname:C,clientReferenceManifest:I,serverActionsManifest:N}=y,j=(0,o.normalizeAppPath)(w),O=!!(T.dynamicRoutes[j]||T.routes[C]),q=async()=>((null==k?void 0:k.render404)?await k.render404(e,t,b,!1):t.end("This page could not be found"),null);if(O&&!E){let e=!!T.routes[C],t=T.dynamicRoutes[j];if(t&&!1===t.fallback&&!e){if(x.adapterPath)return await q();throw new g.NoFallbackError}}let H=null;!O||P.isDev||E||(H="/index"===(H=C)?"/":H);let U=!0===P.isDev||!O,$=O&&!U;N&&I&&(0,i.setManifestsSingleton)({page:w,clientReferenceManifest:I,serverActionsManifest:N});let D=e.method||"GET",M=(0,n.getTracer)(),W=M.getActiveScopeSpan(),L=!!(null==k?void 0:k.isWrappedByNextServer),F=!!(0,a.getRequestMeta)(e,"minimalMode"),K=(0,a.getRequestMeta)(e,"incrementalCache")||await P.getIncrementalCache(e,x,T,F);null==K||K.resetRequestCache(),globalThis.__incrementalCache=K;let G={params:R,previewProps:T.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:U,incrementalCache:K,cacheLifeProfiles:x.cacheLife,waitUntil:s.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,s,a)=>P.onRequestError(e,t,s,a,k)},sharedContext:{buildId:_}},B=new l.NodeNextRequest(e),z=new l.NodeNextResponse(t),V=u.NextRequestAdapter.fromNodeNextRequest(B,(0,u.signalFromNodeResponse)(t));try{let a,i=async e=>P.handle(V,G).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=M.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==p.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let s=r.get("next.route");if(s){let t=`${D} ${s}`;e.setAttributes({"next.route":s,"http.route":s,"next.span_name":t}),e.updateName(t),a&&a!==e&&(a.setAttribute("http.route",s),a.updateName(t))}else e.updateName(`${D} ${w}`)}),o=async a=>{var n,o;let l=async({previousCacheEntry:r})=>{try{if(!F&&S&&A&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let n=await i(a);e.fetchMetrics=G.renderOpts.fetchMetrics;let o=G.renderOpts.pendingWaitUntil;o&&s.waitUntil&&(s.waitUntil(o),o=void 0);let l=G.renderOpts.collectedTags;if(!O)return await (0,d.sendResponse)(B,z,n,G.renderOpts.pendingWaitUntil),null;{let e=await n.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(n.headers);l&&(t[v.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==G.renderOpts.collectedRevalidate&&!(G.renderOpts.collectedRevalidate>=v.INFINITE_CACHE)&&G.renderOpts.collectedRevalidate,s=void 0===G.renderOpts.collectedExpire||G.renderOpts.collectedExpire>=v.INFINITE_CACHE?void 0:G.renderOpts.collectedExpire;return{value:{kind:m.CachedRouteKind.APP_ROUTE,status:n.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:s}}}}catch(t){throw(null==r?void 0:r.isStale)&&await P.onRequestError(e,t,{routerKind:"App Router",routePath:w,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:$,isOnDemandRevalidate:S})},!1,k),t}},u=await P.handleResponse({req:e,nextConfig:x,cacheKey:H,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:T,isRoutePPREnabled:!1,isOnDemandRevalidate:S,revalidateOnlyGenerated:A,responseGenerator:l,waitUntil:s.waitUntil,isMinimalMode:F});if(!O)return null;if((null==u||null==(n=u.value)?void 0:n.kind)!==m.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==u||null==(o=u.value)?void 0:o.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});F||t.setHeader("x-nextjs-cache",S?"REVALIDATED":u.isMiss?"MISS":u.isStale?"STALE":"HIT"),E&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let p=(0,h.fromNodeOutgoingHttpHeaders)(u.value.headers);return F&&O||p.delete(v.NEXT_CACHE_TAGS_HEADER),!u.cacheControl||t.getHeader("Cache-Control")||p.get("Cache-Control")||p.set("Cache-Control",(0,f.getCacheControlHeader)(u.cacheControl)),await (0,d.sendResponse)(B,z,new Response(u.value.body,{headers:p,status:u.value.status||200})),null};L&&W?await o(W):(a=M.getActiveScopeSpan(),await M.withPropagatedContext(e.headers,()=>M.trace(p.BaseServerSpan.handleRequest,{spanName:`${D} ${w}`,kind:n.SpanKind.SERVER,attributes:{"http.method":D,"http.target":e.url}},o),void 0,!L))}catch(t){if(t instanceof g.NoFallbackError||await P.onRequestError(e,t,{routerKind:"App Router",routePath:j,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:$,isOnDemandRevalidate:S})},!1,k),O)throw t;return await (0,d.sendResponse)(B,z,new Response(null,{status:500})),null}}e.s(["handler",0,S,"patchFetch",0,function(){return(0,s.patchFetch)({workAsyncStorage:E,workUnitAsyncStorage:T})},"routeModule",0,P,"serverHooks",0,k,"workAsyncStorage",0,E,"workUnitAsyncStorage",0,T],62496)},687903,e=>{e.v(e=>Promise.resolve().then(()=>e(912714)))},282139,e=>{e.v(e=>Promise.resolve().then(()=>e(351216)))},168315,e=>{e.v(t=>Promise.all(["server/chunks/0sag_@better-auth_memory-adapter_dist_index_mjs_0pvj6im._.js"].map(t=>e.l(t))).then(()=>t(862112)))},769787,e=>{e.v(t=>Promise.all(["server/chunks/01er_better-auth_dist_adapters_kysely-adapter_index_mjs_0s~-4gu._.js"].map(t=>e.l(t))).then(()=>t(717789)))},580632,e=>{e.v(e=>Promise.resolve().then(()=>e(270406)))},947559,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_bun-sqlite-dialect-DzNwOpKv_mjs_0z1z6m4._.js"].map(t=>e.l(t))).then(()=>t(495181)))},715018,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_node-sqlite-dialect_mjs_0qqlvhl._.js"].map(t=>e.l(t))).then(()=>t(698370)))},146843,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_d1-sqlite-dialect-C2B7YsIT_mjs_0wynrz3._.js"].map(t=>e.l(t))).then(()=>t(143740)))},697743,e=>{e.v(t=>Promise.all(["server/chunks/0.u4_next_05jevxw._.js"].map(t=>e.l(t))).then(()=>t(428325)))},99243,e=>{e.v(e=>Promise.resolve().then(()=>e(313414)))},893412,e=>{e.v(e=>Promise.resolve().then(()=>e(499465)))}];
|
|
3
|
+
|
|
4
|
+
//# sourceMappingURL=%5Broot-of-the-server%5D__0qwikxp._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[536654,e=>{"use strict";var t=e.i(912714),r=e.i(750227);function a(e){return!!(r.default.isAbsolute(e)||".."===e||e.startsWith(".."+r.default.sep)||e.startsWith("../"))}async function n(e,s,i={}){let o;if(!e)return null;let l=function(e){if(e.includes("\0")||r.default.isAbsolute(e))return null;let t=e.replace(/\\/g,"/");return(("."===(t=r.default.posix.normalize(t))||"./"===t)&&(t=""),".."===t||t.startsWith("../")||/^[a-zA-Z]:\//.test(t)||t.startsWith("/"))?null:t}(s);if(null===l)return null;if(i.deniedSegments?.length){for(let e of l.split("/").filter(Boolean))if(i.deniedSegments.includes(e))return null}try{o=await (0,t.realpath)(e)}catch{return null}let u=l?r.default.join(o,l):o;try{let e=await (0,t.realpath)(u),n=r.default.relative(o,e);if(a(n))return null;return{relPath:l,absolutePath:e}}catch{if(!i.allowMissing)return null;let e=u;for(;;){let n=r.default.dirname(e);if(n===e)break;try{let e=await (0,t.realpath)(n),s=r.default.relative(o,e);if(a(s))return null;return{relPath:l,absolutePath:u}}catch{e=n}}return null}}e.s(["resolveWorkspacePath",0,n])},402662,e=>{"use strict";var t=e.i(351216);e.s(["checkOrigin",0,function(e){let r=e.method.toUpperCase();if("GET"===r||"HEAD"===r||"OPTIONS"===r)return null;let a=e.headers.get("origin"),n=e.headers.get("referer");if(!a&&!n)return null;let s=function(e){let t=Array.from(new Set(["localhost","127.0.0.1",e.split(":")[0],...(process.env.WIKI_OWNER_HOSTS??"").split(",").map(e=>e.trim()).filter(Boolean)])),r=["",":3000",":3003"];e.includes(":")&&r.push(":"+e.split(":")[1]);let a=new Set;for(let e of t)for(let t of["http","https"])for(let n of r)a.add(`${t}://${e}${n}`);return a}(e.headers.get("host")??"");if(a)return s.has(a)?null:t.NextResponse.json({error:"FORBIDDEN",message:"Bad origin"},{status:403});if(n){try{let{protocol:e,host:t}=new URL(n);if(s.has(`${e}//${t}`))return null}catch{}return t.NextResponse.json({error:"FORBIDDEN",message:"Bad referer"},{status:403})}return null}])},848475,e=>{"use strict";var t=e.i(750227);let r={".md":"text/markdown; charset=utf-8",".markdown":"text/markdown; charset=utf-8",".txt":"text/plain; charset=utf-8",".json":"application/json; charset=utf-8",".jsonc":"application/json; charset=utf-8",".ts":"text/typescript; charset=utf-8",".tsx":"text/typescript; charset=utf-8",".mts":"text/typescript; charset=utf-8",".js":"text/javascript; charset=utf-8",".jsx":"text/javascript; charset=utf-8",".mjs":"text/javascript; charset=utf-8",".html":"text/html; charset=utf-8",".htm":"text/html; charset=utf-8",".css":"text/css; charset=utf-8",".yaml":"text/yaml; charset=utf-8",".yml":"text/yaml; charset=utf-8",".toml":"text/toml; charset=utf-8",".xml":"application/xml; charset=utf-8",".svg":"image/svg+xml",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".avif":"image/avif",".ico":"image/x-icon",".bmp":"image/bmp",".pdf":"application/pdf",".zip":"application/zip",".tar":"application/x-tar",".gz":"application/gzip",".py":"text/x-python; charset=utf-8",".rs":"text/x-rustsrc; charset=utf-8",".go":"text/x-go; charset=utf-8",".sh":"text/x-shellscript; charset=utf-8",".csv":"text/csv; charset=utf-8",".tsv":"text/tab-separated-values; charset=utf-8",".env":"text/plain; charset=utf-8",".log":"text/plain; charset=utf-8",".ini":"text/plain; charset=utf-8",".conf":"text/plain; charset=utf-8",".mmd":"text/plain; charset=utf-8",".ipynb":"application/json; charset=utf-8",".docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",".xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".pptx":"application/vnd.openxmlformats-officedocument.presentationml.presentation",".doc":"application/msword",".xls":"application/vnd.ms-excel",".ppt":"application/vnd.ms-powerpoint",".mp4":"video/mp4",".webm":"video/webm",".mov":"video/quicktime",".m4v":"video/mp4",".mp3":"audio/mpeg",".wav":"audio/wav",".ogg":"audio/ogg",".m4a":"audio/mp4",".aac":"audio/aac"};e.s(["contentTypeForPath",0,function(e){return r[t.default.extname(e).toLowerCase()]??"application/octet-stream"}])},719126,e=>{"use strict";var t=e.i(666680),r=e.i(912714),a=e.i(750227),n=e.i(716234),s=e.i(536654),i=e.i(848475);async function o(e,t){if(!e)return null;let r=await (0,s.resolveWorkspacePath)(e,t,{allowMissing:!0,deniedSegments:n.DENIED_SEGMENTS});return r?.absolutePath??null}async function l(e,t){let a=420;try{let t=await (0,r.stat)(e);a=511&t.mode}catch{}let n=e+".~"+process.pid+"."+Date.now()+".tmp",s=await (0,r.open)(n,"w",a);try{await s.write(t),await s.datasync()}finally{await s.close()}await (0,r.rename)(n,e)}async function u(e,t){let n=a.default.dirname(e);if(t)return await (0,r.mkdir)(n,{recursive:!0}),!0;try{return await (0,r.stat)(n),!0}catch{return!1}}e.s(["atomicWrite",0,l,"ensureParentDir",0,u,"extractShaHex",0,function(e){return e.replace(/^"/,"").replace(/"$/,"").replace(/^sha256:/,"")},"isDeniedRelPath",0,function(e){let t=e.replace(/\\/g,"/");return n.DENIED_SEGMENTS.some(e=>t===e||t.startsWith(e+"/"))},"isMarkdown",0,function(e){return e.endsWith(".md")||e.endsWith(".markdown")},"looksLikeBinary",0,function(e){return e.slice(0,Math.min(e.length,8192)).includes(0)},"mimeByExt",0,function(e){return(0,i.contentTypeForPath)(e)},"safeAbsPath",0,o,"sha256ofBuf",0,function(e){return"sha256:"+(0,t.createHash)("sha256").update(e).digest("hex")}])},857764,(e,t,r)=>{t.exports=e.x("node:url",()=>require("node:url"))},844376,(e,t,r)=>{t.exports=e.x("node:module",()=>require("node:module"))},511745,883129,e=>{"use strict";let t;var r=e.i(874533),a=e.i(750227),n=e.i(844376),s=e.i(812057),i=e.i(902157),o=e.i(857764);let l={get url(){return`file://${e.P("src/lib/search/rg-path.ts")}`}},u=(0,s.promisify)(r.execFile);function c(e){try{let t=(0,i.statSync)(e);return t.isFile()&&(73&t.mode)!=0}catch{return!1}}function p(e,t,r){let n=a.default.resolve(e);for(let e=0;e<=t;e++){let e=a.default.join(n,r);if(c(e))return e;let t=a.default.dirname(n);if(t===n)break;n=t}return null}async function d(){try{return await u("rg",["--version"]),"rg"}catch{return null}}async function h(){if(void 0!==t)return t;let e=process.env.WIKI_VIEWER_RG;if(e&&c(e))return t=e;let r=process.env.npm_config_arch||process.arch,s=`@vscode/ripgrep-${process.platform}-${r}`;try{let e=(0,o.fileURLToPath)(l.resolve("@vscode/ripgrep")),r=(0,n.createRequire)(e).resolve(`${s}/bin/rg`);if(c(r))return t=r}catch{}let i=a.default.join("node_modules",s,"bin","rg"),u=p(process.cwd(),5,i);if(u)return t=u;let h=a.default.dirname(process.execPath);if(h!==process.cwd()){let e=p(h,5,i);if(e)return t=e}return t=await d()}function f(e){return e.replace(/<\/?mark>/g,"")}function m(e,t,r={}){let a=r.window??60;if(!t.length)return f(e);let n=Buffer.from(e,"utf8"),s=n.length,i=[...t].sort((e,t)=>e.start-t.start),o=i[0],l=Math.floor((o.start+o.end)/2),u=Math.max(0,l-a),c=Math.min(s,l+a);for(;u>0&&(192&n[u])==128;)u++;for(;c<s&&(192&n[c])==128;)c--;let p=i.filter(e=>e.start<c&&e.end>u),d=[],h=u;for(let e of p){let t=Math.max(u,e.start),r=Math.min(c,e.end);t>h&&d.push({text:n.toString("utf8",h,t),mark:!1}),r>t&&d.push({text:n.toString("utf8",t,r),mark:!0}),h=r}h<c&&d.push({text:n.toString("utf8",h,c),mark:!1});let g="";for(let e of(u>0&&(g+="…"),d)){let t=f(e.text);g+=e.mark?`<mark>${t}</mark>`:t}return c<s&&(g+="…"),g}e.s(["buildSnippet",0,m],883129);var g=e.i(719126);let v=null;async function w(){if(v)return v;try{let t=await e.A(267328);return v=t,t}catch{return v={nestedHazardMounts:()=>[],rootIsHazardMount:()=>!1}}}let x=[".git",".pi",".proof","node_modules",".next"];async function y(e){let t=[];for(let e of x)t.push("--glob",`!${e}/**`);for(let r of(await w()).nestedHazardMounts(e)){let n=a.default.relative(e,r);!n||n.startsWith("..")||a.default.isAbsolute(n)||(n=n.replace(/\\/g,"/"),t.push("--glob",`!${n}/**`))}return t}async function k(e){let t=["--json","--no-config","--no-messages","--no-follow","--hidden","--no-ignore","--max-filesize","2M","--crlf"];return(await w()).rootIsHazardMount(e)&&t.push("--no-mmap"),t.push(...await y(e)),t.push("--glob","!*.excalidraw"),t}function R(e){let t=e.replace(/\\/g,"/");return a.default.isAbsolute(t)||(t=a.default.normalize(t).replace(/\\/g,"/")).startsWith("..")||"."===t||(0,g.isDeniedRelPath)(t)?null:t}function _(e){try{e.kill("SIGTERM")}catch{}setTimeout(()=>{try{e.kill("SIGKILL")}catch{}},2e3)}function b(e,t,a,n,s,i,o){return new Promise(l=>{if(s.signal?.aborted)return void l({outcome:"aborted",code:null,stderr:"",truncated:!0});let u=(0,r.spawn)(e,t,{cwd:a,stdio:["ignore","pipe","pipe"],env:{...process.env,RIPGREP_CONFIG_PATH:""}}),c="",p="",d=!1,h=!1,f=null,m=e=>{d||(d=!0,clearTimeout(g),v?.removeEventListener("abort",w),l({outcome:e,code:f,stderr:p,truncated:h}))},g=setTimeout(()=>{h=!0,_(u),m("timeout")},s.timeoutMs),v=s.signal,w=()=>{h=!0,_(u),m("aborted")};v?.addEventListener("abort",w,{once:!0}),u.stdout?.on("data",e=>{if(c+=e.toString("utf8"),n){let e=c.split("\n");for(let t of(c=e.pop()??"",e)){let e;if(t.trim()){try{e=JSON.parse(t)}catch{continue}if("cap"===i(e)){h=!0,_(u),m("success");return}}}}else if(o){let e=c.split("\n");for(let t of(c=e.pop()??"",e))if(t&&"cap"===o(t)){h=!0,_(u),m("success");return}}}),u.stderr?.on("data",e=>{p+=e.toString("utf8")}),u.on("error",e=>{f=-1,p=e.message,m("error")}),u.on("close",e=>{if(f=e,!d){if(n&&c.trim())try{let e=JSON.parse(c.trim());i(e)}catch{}else!n&&o&&c&&o(c);0===e||1===e?m("success"):m("error")}})})}async function S(e,t,r={}){let a=t.trim();if(!a)return{ok:!0,results:[],truncated:!1};let n=a.split(/\s+/).slice(0,8).map(e=>e.endsWith("*")?e.slice(0,-1):e);if(0===n.length)return{ok:!0,results:[],truncated:!1};let s=await h();if(!s)return{ok:!1,reason:"unavailable",message:"ripgrep binary not found"};let i=new Map,o=r.limit??200,l=0,u=await k(e);for(let e of(u.push("--fixed-strings","--ignore-case"),n))u.push("-e",e);u.push("--",r.startPath??".");let c={timeoutMs:r.timeoutMs??1e4,signal:r.signal},p=await b(s,u,e,!0,c,e=>{if("match"!==e.type)return"continue";let t=e.data;if(!t)return"continue";let r=R(t.path.text);if(!r)return"continue";let a=(t.submatches??[]).map(e=>({start:e.start,end:e.end})),s=t.lines.text.replace(/\r?\n$/,""),u=m(s,a),c={path:r,line:t.line_number,col:a[0]?.start!=null?a[0].start+1:1,text:s,snippet:u},p=c.text.toLowerCase(),d=new Set;for(let e=0;e<n.length;e++)p.includes(n[e].toLowerCase())&&d.add(e);let h=i.get(r);for(let e of(h||(h={path:r,matches:[],tokenSet:new Set},i.set(r,h)),d))h.tokenSet.add(e);return(h.matches.push(c),++l>=o)?"cap":"continue"}),d=n.length,f=[];for(let e of i.values()){if(e.tokenSet.size<d)continue;let t=e.matches.sort((e,t)=>e.line-t.line)[0],r=e.tokenSet.size/d*1e3+Math.min(e.matches.length,100);f.push({path:e.path,matchCount:e.matches.length,tokensMatched:e.tokenSet.size,score:r,firstMatch:t})}return(f.sort((e,t)=>t.tokensMatched!==e.tokensMatched?t.tokensMatched-e.tokensMatched:t.matchCount!==e.matchCount?t.matchCount-e.matchCount:e.path.localeCompare(t.path)),"success"===p.outcome)?2===p.code?{ok:!1,reason:"error",message:p.stderr.trim().split("\n")[0]??"rg error",partialResults:f}:{ok:!0,results:f,truncated:p.truncated}:"timeout"===p.outcome?{ok:!1,reason:"timeout",message:"Search timed out",partialResults:f}:{ok:!1,reason:"error",message:p.stderr||"Search failed",partialResults:f}}async function E(e,t,r,a,n){var s,i;let o=[],l=a.limit??200,u=0,c=await k(t);n&&c.push("--pcre2"),c.push("-e",r),c.push("--",a.startPath??".");let p=await b(e,c,t,!0,{timeoutMs:a.timeoutMs??1e4,signal:a.signal},e=>{if("match"!==e.type)return"continue";let t=e.data;if(!t)return"continue";let r=R(t.path.text);if(!r)return"continue";let a=t.submatches??[];return(o.push({path:r,line:t.line_number,col:a[0]?.start!=null?a[0].start+1:1,text:t.lines.text.replace(/\r?\n$/,"")}),++u>=l)?"cap":"continue"});return{outcome:(s=p,i=o,"timeout"===s.outcome?{ok:!1,reason:"timeout",message:"Search timed out",partialResults:i}:"aborted"===s.outcome?{ok:!1,reason:"error",message:"Search aborted",partialResults:i}:"error"===s.outcome||2===s.code?{ok:!1,reason:"error",message:s.stderr.trim().split("\n")[0]??"rg error",partialResults:i}:{ok:!0,results:i,truncated:s.truncated}),stderr:p.stderr,code:p.code}}function P(e){let t=e.toLowerCase();return t.includes("look-around")||t.includes("lookaround")||t.includes("backreference")||t.includes("back-reference")||t.includes("lookahead")||t.includes("lookbehind")}function M(e){let t=e.toLowerCase();return t.includes("regex")||t.includes("pattern")||t.includes("parse")||t.includes("syntax")||t.includes("unclosed")||P(t)}async function C(e,t,r={}){let a=t.trim();if(!a)return{ok:!0,results:[],truncated:!1};let n=await h();if(!n)return{ok:!1,reason:"unavailable",message:"ripgrep binary not found"};let s=await E(n,e,a,r,!1);if(!s.outcome.ok&&"error"===s.outcome.reason&&P(s.stderr)){let t=await E(n,e,a,r,!0);return!t.outcome.ok&&"error"===t.outcome.reason&&M(t.stderr)?{ok:!1,reason:"invalid-pattern",message:t.stderr.trim().split("\n")[0]??"Invalid regex pattern",partialResults:t.outcome.partialResults}:t.outcome}return!s.outcome.ok&&"error"===s.outcome.reason&&M(s.stderr)?{ok:!1,reason:"invalid-pattern",message:s.stderr.trim().split("\n")[0]??"Invalid regex pattern",partialResults:s.outcome.partialResults}:s.outcome}async function j(e,t={}){let r=await h();if(!r)return{ok:!1,reason:"unavailable",message:"ripgrep binary not found"};let a=[],n=t.limit??2e3,s=["--no-config","--no-messages","--no-follow","--hidden","--no-ignore","--crlf"];(await w()).rootIsHazardMount(e)&&s.push("--no-mmap"),s.push(...await y(e)),s.push("--files","--",t.startPath??".");let i=await b(r,s,e,!1,{timeoutMs:t.timeoutMs??1e4,signal:t.signal},()=>"continue",e=>{let t=e.trim();if(!t)return"continue";let r=R(t);return r&&(a.push(r),a.length>=n)?"cap":"continue"});return"success"===i.outcome?{ok:!0,results:a,truncated:i.truncated}:{ok:!1,reason:"timeout"===i.outcome?"timeout":"error",message:i.stderr||"rg --files failed",partialResults:a}}e.s(["rgListFiles",0,j,"rgLiteralSearch",0,S,"rgRegexSearch",0,C],511745)},743532,e=>{"use strict";var t=e.i(985426),r=e.i(257574),a=e.i(507835),n=e.i(457789),s=e.i(119791),i=e.i(141062),o=e.i(957291),l=e.i(535899),u=e.i(610241),c=e.i(62749),p=e.i(624891),d=e.i(725836),h=e.i(532736),f=e.i(257858),m=e.i(487476),g=e.i(193695);e.i(484264);var v=e.i(315709),w=e.i(351216),x=e.i(402662),y=e.i(660038),k=e.i(511745);async function R(e,t,r,a={}){let n=t.trim();if(!n)return{paths:[],truncated:!1};let s=n.split(/\s+/).slice(0,8).map(e=>e.toLowerCase());if(0===s.length)return{paths:[],truncated:!1};let i=await (0,k.rgListFiles)(e,{limit:2e4,timeoutMs:5e3,signal:a.signal});if(!i.ok)return"unavailable"===i.reason?{paths:[],truncated:!1,degraded:"rg-unavailable"}:{paths:_(i.partialResults??[],s,r).results,truncated:!0,degraded:i.reason};let o=_(i.results,s,r);return{paths:o.results,truncated:i.truncated||o.truncated}}function _(e,t,r){let a=[];for(let n of e){let e=n.toLowerCase();if(t.every(t=>e.includes(t))&&(a.push(n),a.length>=r))return{results:a,truncated:!0}}return{results:a,truncated:!1}}async function b(e){let t,r=(0,x.checkOrigin)(e);if(r)return r;let a=await (0,y.resolveWorkspaceForUser)(e);if(!a.ok)return w.NextResponse.json({error:a.code},{status:a.status});try{t=await e.json()}catch{return w.NextResponse.json({error:"INVALID_PAYLOAD"},{status:400})}let n="string"==typeof t.query?t.query:"",s=Math.min("number"==typeof t.limit?t.limit:30,200);if(!n.trim())return w.NextResponse.json({kind:"rg",query:n,matches:[],truncated:!1});let[i,o]=await Promise.all([(0,k.rgLiteralSearch)(a.rootDir,n,{limit:s,timeoutMs:1e4,signal:e.signal}),R(a.rootDir,n,s,{signal:e.signal})]),l=new Set(o.paths),u=[];for(let e of o.paths)u.push({path:e,score:2e3,snippet:""});if(i.ok)for(let e of i.results)l.has(e.path)||u.push({path:e.path,score:e.score,snippet:e.firstMatch.snippet,line:e.firstMatch.line});else if("unavailable"===i.reason);else if(i.partialResults)for(let e of i.partialResults)l.has(e.path)||u.push({path:e.path,score:e.score,snippet:e.firstMatch.snippet,line:e.firstMatch.line});let c=!i.ok||i.truncated||o.truncated,p={kind:"rg",query:n,matches:u.slice(0,s),truncated:c};return i.ok||"unavailable"!==i.reason||(p.degraded="rg-unavailable"),w.NextResponse.json(p)}e.s(["POST",0,b,"runtime",0,"nodejs"],725535);var S=e.i(725535);let E=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/wiki/search/route",pathname:"/api/wiki/search",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/wiki/search/route.ts",nextConfigOutput:"standalone",userland:S,...{}}),{workAsyncStorage:P,workUnitAsyncStorage:M,serverHooks:C}=E;async function j(e,t,a){a.requestMeta&&(0,n.setRequestMeta)(e,a.requestMeta),E.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let w="/api/wiki/search/route";w=w.replace(/\/index$/,"")||"/";let x=await E.prepare(e,t,{srcPage:w,multiZoneDraftMode:!1});if(!x)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:y,params:k,nextConfig:R,parsedUrl:_,isDraftMode:b,prerenderManifest:S,routerServerContext:P,isOnDemandRevalidate:M,revalidateOnlyGenerated:C,resolvedPathname:j,clientReferenceManifest:A,serverActionsManifest:N}=x,T=(0,o.normalizeAppPath)(w),I=!!(S.dynamicRoutes[T]||S.routes[j]),O=async()=>((null==P?void 0:P.render404)?await P.render404(e,t,_,!1):t.end("This page could not be found"),null);if(I&&!b){let e=!!S.routes[j],t=S.dynamicRoutes[T];if(t&&!1===t.fallback&&!e){if(R.adapterPath)return await O();throw new g.NoFallbackError}}let q=null;!I||E.isDev||b||(q="/index"===(q=j)?"/":q);let D=!0===E.isDev||!I,H=I&&!D;N&&A&&(0,i.setManifestsSingleton)({page:w,clientReferenceManifest:A,serverActionsManifest:N});let L=e.method||"GET",$=(0,s.getTracer)(),z=$.getActiveScopeSpan(),W=!!(null==P?void 0:P.isWrappedByNextServer),U=!!(0,n.getRequestMeta)(e,"minimalMode"),F=(0,n.getRequestMeta)(e,"incrementalCache")||await E.getIncrementalCache(e,R,S,U);null==F||F.resetRequestCache(),globalThis.__incrementalCache=F;let B={params:k,previewProps:S.preview,renderOpts:{experimental:{authInterrupts:!!R.experimental.authInterrupts},cacheComponents:!!R.cacheComponents,supportsDynamicResponse:D,incrementalCache:F,cacheLifeProfiles:R.cacheLife,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>E.onRequestError(e,t,a,n,P)},sharedContext:{buildId:y}},K=new l.NodeNextRequest(e),G=new l.NodeNextResponse(t),V=u.NextRequestAdapter.fromNodeNextRequest(K,(0,u.signalFromNodeResponse)(t));try{let n,i=async e=>E.handle(V,B).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=$.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==c.BaseServerSpan.handleRequest)return void 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");if(a){let t=`${L} ${a}`;e.setAttributes({"next.route":a,"http.route":a,"next.span_name":t}),e.updateName(t),n&&n!==e&&(n.setAttribute("http.route",a),n.updateName(t))}else e.updateName(`${L} ${w}`)}),o=async n=>{var s,o;let l=async({previousCacheEntry:r})=>{try{if(!U&&M&&C&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let s=await i(n);e.fetchMetrics=B.renderOpts.fetchMetrics;let o=B.renderOpts.pendingWaitUntil;o&&a.waitUntil&&(a.waitUntil(o),o=void 0);let l=B.renderOpts.collectedTags;if(!I)return await (0,d.sendResponse)(K,G,s,B.renderOpts.pendingWaitUntil),null;{let e=await s.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(s.headers);l&&(t[m.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==B.renderOpts.collectedRevalidate&&!(B.renderOpts.collectedRevalidate>=m.INFINITE_CACHE)&&B.renderOpts.collectedRevalidate,a=void 0===B.renderOpts.collectedExpire||B.renderOpts.collectedExpire>=m.INFINITE_CACHE?void 0:B.renderOpts.collectedExpire;return{value:{kind:v.CachedRouteKind.APP_ROUTE,status:s.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await E.onRequestError(e,t,{routerKind:"App Router",routePath:w,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:H,isOnDemandRevalidate:M})},!1,P),t}},u=await E.handleResponse({req:e,nextConfig:R,cacheKey:q,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:S,isRoutePPREnabled:!1,isOnDemandRevalidate:M,revalidateOnlyGenerated:C,responseGenerator:l,waitUntil:a.waitUntil,isMinimalMode:U});if(!I)return null;if((null==u||null==(s=u.value)?void 0:s.kind)!==v.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==u||null==(o=u.value)?void 0:o.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});U||t.setHeader("x-nextjs-cache",M?"REVALIDATED":u.isMiss?"MISS":u.isStale?"STALE":"HIT"),b&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let c=(0,h.fromNodeOutgoingHttpHeaders)(u.value.headers);return U&&I||c.delete(m.NEXT_CACHE_TAGS_HEADER),!u.cacheControl||t.getHeader("Cache-Control")||c.get("Cache-Control")||c.set("Cache-Control",(0,f.getCacheControlHeader)(u.cacheControl)),await (0,d.sendResponse)(K,G,new Response(u.value.body,{headers:c,status:u.value.status||200})),null};W&&z?await o(z):(n=$.getActiveScopeSpan(),await $.withPropagatedContext(e.headers,()=>$.trace(c.BaseServerSpan.handleRequest,{spanName:`${L} ${w}`,kind:s.SpanKind.SERVER,attributes:{"http.method":L,"http.target":e.url}},o),void 0,!W))}catch(t){if(t instanceof g.NoFallbackError||await E.onRequestError(e,t,{routerKind:"App Router",routePath:T,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:H,isOnDemandRevalidate:M})},!1,P),I)throw t;return await (0,d.sendResponse)(K,G,new Response(null,{status:500})),null}}e.s(["handler",0,j,"patchFetch",0,function(){return(0,a.patchFetch)({workAsyncStorage:P,workUnitAsyncStorage:M})},"routeModule",0,E,"serverHooks",0,C,"workAsyncStorage",0,P,"workUnitAsyncStorage",0,M],743532)},168315,e=>{e.v(t=>Promise.all(["server/chunks/0sag_@better-auth_memory-adapter_dist_index_mjs_0pvj6im._.js"].map(t=>e.l(t))).then(()=>t(862112)))},769787,e=>{e.v(t=>Promise.all(["server/chunks/01er_better-auth_dist_adapters_kysely-adapter_index_mjs_0s~-4gu._.js"].map(t=>e.l(t))).then(()=>t(717789)))},580632,e=>{e.v(e=>Promise.resolve().then(()=>e(270406)))},947559,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_bun-sqlite-dialect-DzNwOpKv_mjs_0z1z6m4._.js"].map(t=>e.l(t))).then(()=>t(495181)))},715018,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_node-sqlite-dialect_mjs_0qqlvhl._.js"].map(t=>e.l(t))).then(()=>t(698370)))},146843,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_d1-sqlite-dialect-C2B7YsIT_mjs_0wynrz3._.js"].map(t=>e.l(t))).then(()=>t(143740)))},697743,e=>{e.v(t=>Promise.all(["server/chunks/0.u4_next_05jevxw._.js"].map(t=>e.l(t))).then(()=>t(428325)))},99243,e=>{e.v(e=>Promise.resolve().then(()=>e(313414)))},893412,e=>{e.v(e=>Promise.resolve().then(()=>e(499465)))},687903,e=>{e.v(e=>Promise.resolve().then(()=>e(912714)))},267328,e=>{e.v(t=>Promise.all(["server/chunks/src_lib_fs_mounts_ts_0ksy80l._.js"].map(t=>e.l(t))).then(()=>t(60845)))}];
|
|
1
|
+
module.exports=[402662,e=>{"use strict";var t=e.i(351216);e.s(["checkOrigin",0,function(e){let r=e.method.toUpperCase();if("GET"===r||"HEAD"===r||"OPTIONS"===r)return null;let a=e.headers.get("origin"),n=e.headers.get("referer");if(!a&&!n)return null;let s=function(e){let t=Array.from(new Set(["localhost","127.0.0.1",e.split(":")[0],...(process.env.WIKI_OWNER_HOSTS??"").split(",").map(e=>e.trim()).filter(Boolean)])),r=["",":3000",":3003"];e.includes(":")&&r.push(":"+e.split(":")[1]);let a=new Set;for(let e of t)for(let t of["http","https"])for(let n of r)a.add(`${t}://${e}${n}`);return a}(e.headers.get("host")??"");if(a)return s.has(a)?null:t.NextResponse.json({error:"FORBIDDEN",message:"Bad origin"},{status:403});if(n){try{let{protocol:e,host:t}=new URL(n);if(s.has(`${e}//${t}`))return null}catch{}return t.NextResponse.json({error:"FORBIDDEN",message:"Bad referer"},{status:403})}return null}])},857764,(e,t,r)=>{t.exports=e.x("node:url",()=>require("node:url"))},536654,e=>{"use strict";var t=e.i(912714),r=e.i(750227);function a(e){return!!(r.default.isAbsolute(e)||".."===e||e.startsWith(".."+r.default.sep)||e.startsWith("../"))}async function n(e,s,i={}){let o;if(!e)return null;let l=function(e){if(e.includes("\0")||r.default.isAbsolute(e))return null;let t=e.replace(/\\/g,"/");return(("."===(t=r.default.posix.normalize(t))||"./"===t)&&(t=""),".."===t||t.startsWith("../")||/^[a-zA-Z]:\//.test(t)||t.startsWith("/"))?null:t}(s);if(null===l)return null;if(i.deniedSegments?.length){for(let e of l.split("/").filter(Boolean))if(i.deniedSegments.includes(e))return null}try{o=await (0,t.realpath)(e)}catch{return null}let u=l?r.default.join(o,l):o;try{let e=await (0,t.realpath)(u),n=r.default.relative(o,e);if(a(n))return null;return{relPath:l,absolutePath:e}}catch{if(!i.allowMissing)return null;let e=u;for(;;){let n=r.default.dirname(e);if(n===e)break;try{let e=await (0,t.realpath)(n),s=r.default.relative(o,e);if(a(s))return null;return{relPath:l,absolutePath:u}}catch{e=n}}return null}}e.s(["resolveWorkspacePath",0,n])},848475,e=>{"use strict";var t=e.i(750227);let r={".md":"text/markdown; charset=utf-8",".markdown":"text/markdown; charset=utf-8",".txt":"text/plain; charset=utf-8",".json":"application/json; charset=utf-8",".jsonc":"application/json; charset=utf-8",".ts":"text/typescript; charset=utf-8",".tsx":"text/typescript; charset=utf-8",".mts":"text/typescript; charset=utf-8",".js":"text/javascript; charset=utf-8",".jsx":"text/javascript; charset=utf-8",".mjs":"text/javascript; charset=utf-8",".html":"text/html; charset=utf-8",".htm":"text/html; charset=utf-8",".css":"text/css; charset=utf-8",".yaml":"text/yaml; charset=utf-8",".yml":"text/yaml; charset=utf-8",".toml":"text/toml; charset=utf-8",".xml":"application/xml; charset=utf-8",".svg":"image/svg+xml",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".avif":"image/avif",".ico":"image/x-icon",".bmp":"image/bmp",".pdf":"application/pdf",".zip":"application/zip",".tar":"application/x-tar",".gz":"application/gzip",".py":"text/x-python; charset=utf-8",".rs":"text/x-rustsrc; charset=utf-8",".go":"text/x-go; charset=utf-8",".sh":"text/x-shellscript; charset=utf-8",".csv":"text/csv; charset=utf-8",".tsv":"text/tab-separated-values; charset=utf-8",".env":"text/plain; charset=utf-8",".log":"text/plain; charset=utf-8",".ini":"text/plain; charset=utf-8",".conf":"text/plain; charset=utf-8",".mmd":"text/plain; charset=utf-8",".ipynb":"application/json; charset=utf-8",".docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",".xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".pptx":"application/vnd.openxmlformats-officedocument.presentationml.presentation",".doc":"application/msword",".xls":"application/vnd.ms-excel",".ppt":"application/vnd.ms-powerpoint",".mp4":"video/mp4",".webm":"video/webm",".mov":"video/quicktime",".m4v":"video/mp4",".mp3":"audio/mpeg",".wav":"audio/wav",".ogg":"audio/ogg",".m4a":"audio/mp4",".aac":"audio/aac"};e.s(["contentTypeForPath",0,function(e){return r[t.default.extname(e).toLowerCase()]??"application/octet-stream"}])},719126,e=>{"use strict";var t=e.i(666680),r=e.i(912714),a=e.i(750227),n=e.i(716234),s=e.i(536654),i=e.i(848475);async function o(e,t){if(!e)return null;let r=await (0,s.resolveWorkspacePath)(e,t,{allowMissing:!0,deniedSegments:n.DENIED_SEGMENTS});return r?.absolutePath??null}async function l(e,t){let a=420;try{let t=await (0,r.stat)(e);a=511&t.mode}catch{}let n=e+".~"+process.pid+"."+Date.now()+".tmp",s=await (0,r.open)(n,"w",a);try{await s.write(t),await s.datasync()}finally{await s.close()}await (0,r.rename)(n,e)}async function u(e,t){let n=a.default.dirname(e);if(t)return await (0,r.mkdir)(n,{recursive:!0}),!0;try{return await (0,r.stat)(n),!0}catch{return!1}}e.s(["atomicWrite",0,l,"ensureParentDir",0,u,"extractShaHex",0,function(e){return e.replace(/^"/,"").replace(/"$/,"").replace(/^sha256:/,"")},"isDeniedRelPath",0,function(e){let t=e.replace(/\\/g,"/");return n.DENIED_SEGMENTS.some(e=>t===e||t.startsWith(e+"/"))},"isMarkdown",0,function(e){return e.endsWith(".md")||e.endsWith(".markdown")},"looksLikeBinary",0,function(e){return e.slice(0,Math.min(e.length,8192)).includes(0)},"mimeByExt",0,function(e){return(0,i.contentTypeForPath)(e)},"safeAbsPath",0,o,"sha256ofBuf",0,function(e){return"sha256:"+(0,t.createHash)("sha256").update(e).digest("hex")}])},844376,(e,t,r)=>{t.exports=e.x("node:module",()=>require("node:module"))},511745,883129,e=>{"use strict";let t;var r=e.i(874533),a=e.i(750227),n=e.i(844376),s=e.i(812057),i=e.i(902157),o=e.i(857764);let l={get url(){return`file://${e.P("src/lib/search/rg-path.ts")}`}},u=(0,s.promisify)(r.execFile);function c(e){try{let t=(0,i.statSync)(e);return t.isFile()&&(73&t.mode)!=0}catch{return!1}}function p(e,t,r){let n=a.default.resolve(e);for(let e=0;e<=t;e++){let e=a.default.join(n,r);if(c(e))return e;let t=a.default.dirname(n);if(t===n)break;n=t}return null}async function d(){try{return await u("rg",["--version"]),"rg"}catch{return null}}async function h(){if(void 0!==t)return t;let e=process.env.WIKI_VIEWER_RG;if(e&&c(e))return t=e;let r=process.env.npm_config_arch||process.arch,s=`@vscode/ripgrep-${process.platform}-${r}`;try{let e=(0,o.fileURLToPath)(l.resolve("@vscode/ripgrep")),r=(0,n.createRequire)(e).resolve(`${s}/bin/rg`);if(c(r))return t=r}catch{}let i=a.default.join("node_modules",s,"bin","rg"),u=p(process.cwd(),5,i);if(u)return t=u;let h=a.default.dirname(process.execPath);if(h!==process.cwd()){let e=p(h,5,i);if(e)return t=e}return t=await d()}function f(e){return e.replace(/<\/?mark>/g,"")}function m(e,t,r={}){let a=r.window??60;if(!t.length)return f(e);let n=Buffer.from(e,"utf8"),s=n.length,i=[...t].sort((e,t)=>e.start-t.start),o=i[0],l=Math.floor((o.start+o.end)/2),u=Math.max(0,l-a),c=Math.min(s,l+a);for(;u>0&&(192&n[u])==128;)u++;for(;c<s&&(192&n[c])==128;)c--;let p=i.filter(e=>e.start<c&&e.end>u),d=[],h=u;for(let e of p){let t=Math.max(u,e.start),r=Math.min(c,e.end);t>h&&d.push({text:n.toString("utf8",h,t),mark:!1}),r>t&&d.push({text:n.toString("utf8",t,r),mark:!0}),h=r}h<c&&d.push({text:n.toString("utf8",h,c),mark:!1});let g="";for(let e of(u>0&&(g+="…"),d)){let t=f(e.text);g+=e.mark?`<mark>${t}</mark>`:t}return c<s&&(g+="…"),g}e.s(["buildSnippet",0,m],883129);var g=e.i(719126);let v=null;async function w(){if(v)return v;try{let t=await e.A(267328);return v=t,t}catch{return v={nestedHazardMounts:()=>[],rootIsHazardMount:()=>!1}}}let x=[".git",".pi",".proof","node_modules",".next"];async function y(e){let t=[];for(let e of x)t.push("--glob",`!${e}/**`);for(let r of(await w()).nestedHazardMounts(e)){let n=a.default.relative(e,r);!n||n.startsWith("..")||a.default.isAbsolute(n)||(n=n.replace(/\\/g,"/"),t.push("--glob",`!${n}/**`))}return t}async function k(e){let t=["--json","--no-config","--no-messages","--no-follow","--hidden","--no-ignore","--max-filesize","2M","--crlf"];return(await w()).rootIsHazardMount(e)&&t.push("--no-mmap"),t.push(...await y(e)),t.push("--glob","!*.excalidraw"),t}function R(e){let t=e.replace(/\\/g,"/");return a.default.isAbsolute(t)||(t=a.default.normalize(t).replace(/\\/g,"/")).startsWith("..")||"."===t||(0,g.isDeniedRelPath)(t)?null:t}function _(e){try{e.kill("SIGTERM")}catch{}setTimeout(()=>{try{e.kill("SIGKILL")}catch{}},2e3)}function b(e,t,a,n,s,i,o){return new Promise(l=>{if(s.signal?.aborted)return void l({outcome:"aborted",code:null,stderr:"",truncated:!0});let u=(0,r.spawn)(e,t,{cwd:a,stdio:["ignore","pipe","pipe"],env:{...process.env,RIPGREP_CONFIG_PATH:""}}),c="",p="",d=!1,h=!1,f=null,m=e=>{d||(d=!0,clearTimeout(g),v?.removeEventListener("abort",w),l({outcome:e,code:f,stderr:p,truncated:h}))},g=setTimeout(()=>{h=!0,_(u),m("timeout")},s.timeoutMs),v=s.signal,w=()=>{h=!0,_(u),m("aborted")};v?.addEventListener("abort",w,{once:!0}),u.stdout?.on("data",e=>{if(c+=e.toString("utf8"),n){let e=c.split("\n");for(let t of(c=e.pop()??"",e)){let e;if(t.trim()){try{e=JSON.parse(t)}catch{continue}if("cap"===i(e)){h=!0,_(u),m("success");return}}}}else if(o){let e=c.split("\n");for(let t of(c=e.pop()??"",e))if(t&&"cap"===o(t)){h=!0,_(u),m("success");return}}}),u.stderr?.on("data",e=>{p+=e.toString("utf8")}),u.on("error",e=>{f=-1,p=e.message,m("error")}),u.on("close",e=>{if(f=e,!d){if(n&&c.trim())try{let e=JSON.parse(c.trim());i(e)}catch{}else!n&&o&&c&&o(c);0===e||1===e?m("success"):m("error")}})})}async function S(e,t,r={}){let a=t.trim();if(!a)return{ok:!0,results:[],truncated:!1};let n=a.split(/\s+/).slice(0,8).map(e=>e.endsWith("*")?e.slice(0,-1):e);if(0===n.length)return{ok:!0,results:[],truncated:!1};let s=await h();if(!s)return{ok:!1,reason:"unavailable",message:"ripgrep binary not found"};let i=new Map,o=r.limit??200,l=0,u=await k(e);for(let e of(u.push("--fixed-strings","--ignore-case"),n))u.push("-e",e);u.push("--",r.startPath??".");let c={timeoutMs:r.timeoutMs??1e4,signal:r.signal},p=await b(s,u,e,!0,c,e=>{if("match"!==e.type)return"continue";let t=e.data;if(!t)return"continue";let r=R(t.path.text);if(!r)return"continue";let a=(t.submatches??[]).map(e=>({start:e.start,end:e.end})),s=t.lines.text.replace(/\r?\n$/,""),u=m(s,a),c={path:r,line:t.line_number,col:a[0]?.start!=null?a[0].start+1:1,text:s,snippet:u},p=c.text.toLowerCase(),d=new Set;for(let e=0;e<n.length;e++)p.includes(n[e].toLowerCase())&&d.add(e);let h=i.get(r);for(let e of(h||(h={path:r,matches:[],tokenSet:new Set},i.set(r,h)),d))h.tokenSet.add(e);return(h.matches.push(c),++l>=o)?"cap":"continue"}),d=n.length,f=[];for(let e of i.values()){if(e.tokenSet.size<d)continue;let t=e.matches.sort((e,t)=>e.line-t.line)[0],r=e.tokenSet.size/d*1e3+Math.min(e.matches.length,100);f.push({path:e.path,matchCount:e.matches.length,tokensMatched:e.tokenSet.size,score:r,firstMatch:t})}return(f.sort((e,t)=>t.tokensMatched!==e.tokensMatched?t.tokensMatched-e.tokensMatched:t.matchCount!==e.matchCount?t.matchCount-e.matchCount:e.path.localeCompare(t.path)),"success"===p.outcome)?2===p.code?{ok:!1,reason:"error",message:p.stderr.trim().split("\n")[0]??"rg error",partialResults:f}:{ok:!0,results:f,truncated:p.truncated}:"timeout"===p.outcome?{ok:!1,reason:"timeout",message:"Search timed out",partialResults:f}:{ok:!1,reason:"error",message:p.stderr||"Search failed",partialResults:f}}async function E(e,t,r,a,n){var s,i;let o=[],l=a.limit??200,u=0,c=await k(t);n&&c.push("--pcre2"),c.push("-e",r),c.push("--",a.startPath??".");let p=await b(e,c,t,!0,{timeoutMs:a.timeoutMs??1e4,signal:a.signal},e=>{if("match"!==e.type)return"continue";let t=e.data;if(!t)return"continue";let r=R(t.path.text);if(!r)return"continue";let a=t.submatches??[];return(o.push({path:r,line:t.line_number,col:a[0]?.start!=null?a[0].start+1:1,text:t.lines.text.replace(/\r?\n$/,"")}),++u>=l)?"cap":"continue"});return{outcome:(s=p,i=o,"timeout"===s.outcome?{ok:!1,reason:"timeout",message:"Search timed out",partialResults:i}:"aborted"===s.outcome?{ok:!1,reason:"error",message:"Search aborted",partialResults:i}:"error"===s.outcome||2===s.code?{ok:!1,reason:"error",message:s.stderr.trim().split("\n")[0]??"rg error",partialResults:i}:{ok:!0,results:i,truncated:s.truncated}),stderr:p.stderr,code:p.code}}function P(e){let t=e.toLowerCase();return t.includes("look-around")||t.includes("lookaround")||t.includes("backreference")||t.includes("back-reference")||t.includes("lookahead")||t.includes("lookbehind")}function M(e){let t=e.toLowerCase();return t.includes("regex")||t.includes("pattern")||t.includes("parse")||t.includes("syntax")||t.includes("unclosed")||P(t)}async function C(e,t,r={}){let a=t.trim();if(!a)return{ok:!0,results:[],truncated:!1};let n=await h();if(!n)return{ok:!1,reason:"unavailable",message:"ripgrep binary not found"};let s=await E(n,e,a,r,!1);if(!s.outcome.ok&&"error"===s.outcome.reason&&P(s.stderr)){let t=await E(n,e,a,r,!0);return!t.outcome.ok&&"error"===t.outcome.reason&&M(t.stderr)?{ok:!1,reason:"invalid-pattern",message:t.stderr.trim().split("\n")[0]??"Invalid regex pattern",partialResults:t.outcome.partialResults}:t.outcome}return!s.outcome.ok&&"error"===s.outcome.reason&&M(s.stderr)?{ok:!1,reason:"invalid-pattern",message:s.stderr.trim().split("\n")[0]??"Invalid regex pattern",partialResults:s.outcome.partialResults}:s.outcome}async function j(e,t={}){let r=await h();if(!r)return{ok:!1,reason:"unavailable",message:"ripgrep binary not found"};let a=[],n=t.limit??2e3,s=["--no-config","--no-messages","--no-follow","--hidden","--no-ignore","--crlf"];(await w()).rootIsHazardMount(e)&&s.push("--no-mmap"),s.push(...await y(e)),s.push("--files","--",t.startPath??".");let i=await b(r,s,e,!1,{timeoutMs:t.timeoutMs??1e4,signal:t.signal},()=>"continue",e=>{let t=e.trim();if(!t)return"continue";let r=R(t);return r&&(a.push(r),a.length>=n)?"cap":"continue"});return"success"===i.outcome?{ok:!0,results:a,truncated:i.truncated}:{ok:!1,reason:"timeout"===i.outcome?"timeout":"error",message:i.stderr||"rg --files failed",partialResults:a}}e.s(["rgListFiles",0,j,"rgLiteralSearch",0,S,"rgRegexSearch",0,C],511745)},743532,e=>{"use strict";var t=e.i(985426),r=e.i(257574),a=e.i(507835),n=e.i(457789),s=e.i(119791),i=e.i(141062),o=e.i(957291),l=e.i(535899),u=e.i(610241),c=e.i(62749),p=e.i(624891),d=e.i(725836),h=e.i(532736),f=e.i(257858),m=e.i(487476),g=e.i(193695);e.i(484264);var v=e.i(315709),w=e.i(351216),x=e.i(402662),y=e.i(660038),k=e.i(511745);async function R(e,t,r,a={}){let n=t.trim();if(!n)return{paths:[],truncated:!1};let s=n.split(/\s+/).slice(0,8).map(e=>e.toLowerCase());if(0===s.length)return{paths:[],truncated:!1};let i=await (0,k.rgListFiles)(e,{limit:2e4,timeoutMs:5e3,signal:a.signal});if(!i.ok)return"unavailable"===i.reason?{paths:[],truncated:!1,degraded:"rg-unavailable"}:{paths:_(i.partialResults??[],s,r).results,truncated:!0,degraded:i.reason};let o=_(i.results,s,r);return{paths:o.results,truncated:i.truncated||o.truncated}}function _(e,t,r){let a=[];for(let n of e){let e=n.toLowerCase();if(t.every(t=>e.includes(t))&&(a.push(n),a.length>=r))return{results:a,truncated:!0}}return{results:a,truncated:!1}}async function b(e){let t,r=(0,x.checkOrigin)(e);if(r)return r;let a=await (0,y.resolveWorkspaceForUser)(e);if(!a.ok)return w.NextResponse.json({error:a.code},{status:a.status});try{t=await e.json()}catch{return w.NextResponse.json({error:"INVALID_PAYLOAD"},{status:400})}let n="string"==typeof t.query?t.query:"",s=Math.min("number"==typeof t.limit?t.limit:30,200);if(!n.trim())return w.NextResponse.json({kind:"rg",query:n,matches:[],truncated:!1});let[i,o]=await Promise.all([(0,k.rgLiteralSearch)(a.rootDir,n,{limit:s,timeoutMs:1e4,signal:e.signal}),R(a.rootDir,n,s,{signal:e.signal})]),l=new Set(o.paths),u=[];for(let e of o.paths)u.push({path:e,score:2e3,snippet:""});if(i.ok)for(let e of i.results)l.has(e.path)||u.push({path:e.path,score:e.score,snippet:e.firstMatch.snippet,line:e.firstMatch.line});else if("unavailable"===i.reason);else if(i.partialResults)for(let e of i.partialResults)l.has(e.path)||u.push({path:e.path,score:e.score,snippet:e.firstMatch.snippet,line:e.firstMatch.line});let c=!i.ok||i.truncated||o.truncated,p={kind:"rg",query:n,matches:u.slice(0,s),truncated:c};return i.ok||"unavailable"!==i.reason||(p.degraded="rg-unavailable"),w.NextResponse.json(p)}e.s(["POST",0,b,"runtime",0,"nodejs"],725535);var S=e.i(725535);let E=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/wiki/search/route",pathname:"/api/wiki/search",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/wiki/search/route.ts",nextConfigOutput:"standalone",userland:S,...{}}),{workAsyncStorage:P,workUnitAsyncStorage:M,serverHooks:C}=E;async function j(e,t,a){a.requestMeta&&(0,n.setRequestMeta)(e,a.requestMeta),E.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let w="/api/wiki/search/route";w=w.replace(/\/index$/,"")||"/";let x=await E.prepare(e,t,{srcPage:w,multiZoneDraftMode:!1});if(!x)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:y,params:k,nextConfig:R,parsedUrl:_,isDraftMode:b,prerenderManifest:S,routerServerContext:P,isOnDemandRevalidate:M,revalidateOnlyGenerated:C,resolvedPathname:j,clientReferenceManifest:A,serverActionsManifest:N}=x,T=(0,o.normalizeAppPath)(w),I=!!(S.dynamicRoutes[T]||S.routes[j]),O=async()=>((null==P?void 0:P.render404)?await P.render404(e,t,_,!1):t.end("This page could not be found"),null);if(I&&!b){let e=!!S.routes[j],t=S.dynamicRoutes[T];if(t&&!1===t.fallback&&!e){if(R.adapterPath)return await O();throw new g.NoFallbackError}}let q=null;!I||E.isDev||b||(q="/index"===(q=j)?"/":q);let D=!0===E.isDev||!I,H=I&&!D;N&&A&&(0,i.setManifestsSingleton)({page:w,clientReferenceManifest:A,serverActionsManifest:N});let L=e.method||"GET",$=(0,s.getTracer)(),z=$.getActiveScopeSpan(),W=!!(null==P?void 0:P.isWrappedByNextServer),U=!!(0,n.getRequestMeta)(e,"minimalMode"),F=(0,n.getRequestMeta)(e,"incrementalCache")||await E.getIncrementalCache(e,R,S,U);null==F||F.resetRequestCache(),globalThis.__incrementalCache=F;let B={params:k,previewProps:S.preview,renderOpts:{experimental:{authInterrupts:!!R.experimental.authInterrupts},cacheComponents:!!R.cacheComponents,supportsDynamicResponse:D,incrementalCache:F,cacheLifeProfiles:R.cacheLife,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>E.onRequestError(e,t,a,n,P)},sharedContext:{buildId:y}},K=new l.NodeNextRequest(e),G=new l.NodeNextResponse(t),V=u.NextRequestAdapter.fromNodeNextRequest(K,(0,u.signalFromNodeResponse)(t));try{let n,i=async e=>E.handle(V,B).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=$.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==c.BaseServerSpan.handleRequest)return void 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");if(a){let t=`${L} ${a}`;e.setAttributes({"next.route":a,"http.route":a,"next.span_name":t}),e.updateName(t),n&&n!==e&&(n.setAttribute("http.route",a),n.updateName(t))}else e.updateName(`${L} ${w}`)}),o=async n=>{var s,o;let l=async({previousCacheEntry:r})=>{try{if(!U&&M&&C&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let s=await i(n);e.fetchMetrics=B.renderOpts.fetchMetrics;let o=B.renderOpts.pendingWaitUntil;o&&a.waitUntil&&(a.waitUntil(o),o=void 0);let l=B.renderOpts.collectedTags;if(!I)return await (0,d.sendResponse)(K,G,s,B.renderOpts.pendingWaitUntil),null;{let e=await s.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(s.headers);l&&(t[m.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==B.renderOpts.collectedRevalidate&&!(B.renderOpts.collectedRevalidate>=m.INFINITE_CACHE)&&B.renderOpts.collectedRevalidate,a=void 0===B.renderOpts.collectedExpire||B.renderOpts.collectedExpire>=m.INFINITE_CACHE?void 0:B.renderOpts.collectedExpire;return{value:{kind:v.CachedRouteKind.APP_ROUTE,status:s.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await E.onRequestError(e,t,{routerKind:"App Router",routePath:w,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:H,isOnDemandRevalidate:M})},!1,P),t}},u=await E.handleResponse({req:e,nextConfig:R,cacheKey:q,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:S,isRoutePPREnabled:!1,isOnDemandRevalidate:M,revalidateOnlyGenerated:C,responseGenerator:l,waitUntil:a.waitUntil,isMinimalMode:U});if(!I)return null;if((null==u||null==(s=u.value)?void 0:s.kind)!==v.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==u||null==(o=u.value)?void 0:o.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});U||t.setHeader("x-nextjs-cache",M?"REVALIDATED":u.isMiss?"MISS":u.isStale?"STALE":"HIT"),b&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let c=(0,h.fromNodeOutgoingHttpHeaders)(u.value.headers);return U&&I||c.delete(m.NEXT_CACHE_TAGS_HEADER),!u.cacheControl||t.getHeader("Cache-Control")||c.get("Cache-Control")||c.set("Cache-Control",(0,f.getCacheControlHeader)(u.cacheControl)),await (0,d.sendResponse)(K,G,new Response(u.value.body,{headers:c,status:u.value.status||200})),null};W&&z?await o(z):(n=$.getActiveScopeSpan(),await $.withPropagatedContext(e.headers,()=>$.trace(c.BaseServerSpan.handleRequest,{spanName:`${L} ${w}`,kind:s.SpanKind.SERVER,attributes:{"http.method":L,"http.target":e.url}},o),void 0,!W))}catch(t){if(t instanceof g.NoFallbackError||await E.onRequestError(e,t,{routerKind:"App Router",routePath:T,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:H,isOnDemandRevalidate:M})},!1,P),I)throw t;return await (0,d.sendResponse)(K,G,new Response(null,{status:500})),null}}e.s(["handler",0,j,"patchFetch",0,function(){return(0,a.patchFetch)({workAsyncStorage:P,workUnitAsyncStorage:M})},"routeModule",0,E,"serverHooks",0,C,"workAsyncStorage",0,P,"workUnitAsyncStorage",0,M],743532)},168315,e=>{e.v(t=>Promise.all(["server/chunks/0sag_@better-auth_memory-adapter_dist_index_mjs_0pvj6im._.js"].map(t=>e.l(t))).then(()=>t(862112)))},769787,e=>{e.v(t=>Promise.all(["server/chunks/01er_better-auth_dist_adapters_kysely-adapter_index_mjs_0s~-4gu._.js"].map(t=>e.l(t))).then(()=>t(717789)))},580632,e=>{e.v(e=>Promise.resolve().then(()=>e(270406)))},947559,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_bun-sqlite-dialect-DzNwOpKv_mjs_0z1z6m4._.js"].map(t=>e.l(t))).then(()=>t(495181)))},715018,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_node-sqlite-dialect_mjs_0qqlvhl._.js"].map(t=>e.l(t))).then(()=>t(698370)))},146843,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_d1-sqlite-dialect-C2B7YsIT_mjs_0wynrz3._.js"].map(t=>e.l(t))).then(()=>t(143740)))},697743,e=>{e.v(t=>Promise.all(["server/chunks/0.u4_next_05jevxw._.js"].map(t=>e.l(t))).then(()=>t(428325)))},99243,e=>{e.v(e=>Promise.resolve().then(()=>e(313414)))},893412,e=>{e.v(e=>Promise.resolve().then(()=>e(499465)))},687903,e=>{e.v(e=>Promise.resolve().then(()=>e(912714)))},267328,e=>{e.v(t=>Promise.all(["server/chunks/src_lib_fs_mounts_ts_0ksy80l._.js"].map(t=>e.l(t))).then(()=>t(60845)))}];
|
|
2
2
|
|
|
3
|
-
//# sourceMappingURL=%5Broot-of-the-server%
|
|
3
|
+
//# sourceMappingURL=%5Broot-of-the-server%5D__0tl7-s6._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[536654,e=>{"use strict";var t=e.i(912714),r=e.i(750227);function l(e){return!!(r.default.isAbsolute(e)||".."===e||e.startsWith(".."+r.default.sep)||e.startsWith("../"))}async function s(e,a,i={}){let n;if(!e)return null;let u=function(e){if(e.includes("\0")||r.default.isAbsolute(e))return null;let t=e.replace(/\\/g,"/");return(("."===(t=r.default.posix.normalize(t))||"./"===t)&&(t=""),".."===t||t.startsWith("../")||/^[a-zA-Z]:\//.test(t)||t.startsWith("/"))?null:t}(a);if(null===u)return null;if(i.deniedSegments?.length){for(let e of u.split("/").filter(Boolean))if(i.deniedSegments.includes(e))return null}try{n=await (0,t.realpath)(e)}catch{return null}let o=u?r.default.join(n,u):n;try{let e=await (0,t.realpath)(o),s=r.default.relative(n,e);if(l(s))return null;return{relPath:u,absolutePath:e}}catch{if(!i.allowMissing)return null;let e=o;for(;;){let s=r.default.dirname(e);if(s===e)break;try{let e=await (0,t.realpath)(s),a=r.default.relative(n,e);if(l(a))return null;return{relPath:u,absolutePath:o}}catch{e=s}}return null}}e.s(["resolveWorkspacePath",0,s])},224361,(e,t,r)=>{t.exports=e.x("util",()=>require("util"))},688947,(e,t,r)=>{t.exports=e.x("stream",()=>require("stream"))},427699,(e,t,r)=>{t.exports=e.x("events",()=>require("events"))},
|
|
1
|
+
module.exports=[536654,e=>{"use strict";var t=e.i(912714),r=e.i(750227);function l(e){return!!(r.default.isAbsolute(e)||".."===e||e.startsWith(".."+r.default.sep)||e.startsWith("../"))}async function s(e,a,i={}){let n;if(!e)return null;let u=function(e){if(e.includes("\0")||r.default.isAbsolute(e))return null;let t=e.replace(/\\/g,"/");return(("."===(t=r.default.posix.normalize(t))||"./"===t)&&(t=""),".."===t||t.startsWith("../")||/^[a-zA-Z]:\//.test(t)||t.startsWith("/"))?null:t}(a);if(null===u)return null;if(i.deniedSegments?.length){for(let e of u.split("/").filter(Boolean))if(i.deniedSegments.includes(e))return null}try{n=await (0,t.realpath)(e)}catch{return null}let o=u?r.default.join(n,u):n;try{let e=await (0,t.realpath)(o),s=r.default.relative(n,e);if(l(s))return null;return{relPath:u,absolutePath:e}}catch{if(!i.allowMissing)return null;let e=o;for(;;){let s=r.default.dirname(e);if(s===e)break;try{let e=await (0,t.realpath)(s),a=r.default.relative(n,e);if(l(a))return null;return{relPath:u,absolutePath:o}}catch{e=s}}return null}}e.s(["resolveWorkspacePath",0,s])},224361,(e,t,r)=>{t.exports=e.x("util",()=>require("util"))},688947,(e,t,r)=>{t.exports=e.x("stream",()=>require("stream"))},427699,(e,t,r)=>{t.exports=e.x("events",()=>require("events"))},81111,(e,t,r)=>{t.exports=e.x("node:stream",()=>require("node:stream"))},500874,(e,t,r)=>{t.exports=e.x("buffer",()=>require("buffer"))},168315,e=>{e.v(t=>Promise.all(["server/chunks/0sag_@better-auth_memory-adapter_dist_index_mjs_0pvj6im._.js"].map(t=>e.l(t))).then(()=>t(862112)))},769787,e=>{e.v(t=>Promise.all(["server/chunks/01er_better-auth_dist_adapters_kysely-adapter_index_mjs_0s~-4gu._.js"].map(t=>e.l(t))).then(()=>t(717789)))},580632,e=>{e.v(e=>Promise.resolve().then(()=>e(270406)))},947559,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_bun-sqlite-dialect-DzNwOpKv_mjs_0z1z6m4._.js"].map(t=>e.l(t))).then(()=>t(495181)))},715018,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_node-sqlite-dialect_mjs_0qqlvhl._.js"].map(t=>e.l(t))).then(()=>t(698370)))},146843,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_d1-sqlite-dialect-C2B7YsIT_mjs_0wynrz3._.js"].map(t=>e.l(t))).then(()=>t(143740)))},697743,e=>{e.v(t=>Promise.all(["server/chunks/0.u4_next_05jevxw._.js"].map(t=>e.l(t))).then(()=>t(428325)))},99243,e=>{e.v(e=>Promise.resolve().then(()=>e(313414)))},893412,e=>{e.v(e=>Promise.resolve().then(()=>e(499465)))},687903,e=>{e.v(e=>Promise.resolve().then(()=>e(912714)))}];
|
|
2
2
|
|
|
3
|
-
//# sourceMappingURL=%5Broot-of-the-server%
|
|
3
|
+
//# sourceMappingURL=%5Broot-of-the-server%5D__0veby1x._.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
module.exports=[402662,e=>{"use strict";var t=e.i(351216);e.s(["checkOrigin",0,function(e){let r=e.method.toUpperCase();if("GET"===r||"HEAD"===r||"OPTIONS"===r)return null;let s=e.headers.get("origin"),n=e.headers.get("referer");if(!s&&!n)return null;let a=function(e){let t=Array.from(new Set(["localhost","127.0.0.1",e.split(":")[0],...(process.env.WIKI_OWNER_HOSTS??"").split(",").map(e=>e.trim()).filter(Boolean)])),r=["",":3000",":3003"];e.includes(":")&&r.push(":"+e.split(":")[1]);let s=new Set;for(let e of t)for(let t of["http","https"])for(let n of r)s.add(`${t}://${e}${n}`);return s}(e.headers.get("host")??"");if(s)return a.has(s)?null:t.NextResponse.json({error:"FORBIDDEN",message:"Bad origin"},{status:403});if(n){try{let{protocol:e,host:t}=new URL(n);if(a.has(`${e}//${t}`))return null}catch{}return t.NextResponse.json({error:"FORBIDDEN",message:"Bad referer"},{status:403})}return null}])},814747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},224361,(e,t,r)=>{t.exports=e.x("util",()=>require("util"))},688947,(e,t,r)=>{t.exports=e.x("stream",()=>require("stream"))},427699,(e,t,r)=>{t.exports=e.x("events",()=>require("events"))},81111,(e,t,r)=>{t.exports=e.x("node:stream",()=>require("node:stream"))},761095,(e,t,r)=>{t.exports=e.x("node:net",()=>require("node:net"))},345212,762512,e=>{"use strict";var t=e.i(874533),r=e.i(902157),s=e.i(427597),n=e.i(761095),a=e.i(750227);function i(e,t,r=5){switch(t.type){case"started":return{state:{...e,status:"running",crashCount:0,lastError:void 0},action:"none"};case"manual-restart":return{state:{...e,status:"restarting",crashCount:0,lastError:void 0},action:"restart"};case"file-change":if("error"===e.status)return{state:{...e,fileWatchRestartCount:e.fileWatchRestartCount+1},action:"none"};return{state:{...e,status:"restarting",fileWatchRestartCount:e.fileWatchRestartCount+1},action:"restart"};case"crash":{if("error"===e.status)return{state:e,action:"none"};let t=e.crashCount+1;if(t>r)return{state:{...e,crashCount:t,status:"error",lastError:`Auto-restart gave up after ${t} crash restarts (cap ${r}). Fix the app and restart manually.`},action:"none"};return{state:{...e,crashCount:t,status:"restarting"},action:"restart"}}case"stop":return{state:{...e,status:"stopped"},action:"none"}}}var o=e.i(912714),l=e.i(660526),u=e.i(832852);let p="__hosted_apps__",c=/^[a-z0-9][a-z0-9-]*$/,d=new Set(["api","app","apps","s","signin","signout","_next","assets","upload","owner","share","static","public","favicon.ico"]);function h(){let e=process.env.HOME??l.default.homedir();return a.default.join(e,".wiki-viewer")}function f(){return a.default.join(h(),"hosted-apps.json")}async function g(){try{let e=await (0,o.readFile)(f(),"utf8"),t=JSON.parse(e);return{version:1,apps:Array.isArray(t.apps)?t.apps:[]}}catch{return null}}async function v(e){await (0,o.mkdir)(h(),{recursive:!0});let t=f()+".tmp";await (0,o.writeFile)(t,JSON.stringify(e,null,2),{encoding:"utf8",mode:384});try{await (0,o.chmod)(t,384)}catch{}await (0,o.rename)(t,f())}async function w(){let e=await g();if(e)return e;let t={version:1,apps:[]};return await v(t),t}async function m(){let e=await g();return e?.apps??[]}async function y(e){let t=await g();return t?t.apps.find(t=>t.slug===e)??null:null}async function R(e){var t;let r="string"!=typeof(t=e.slug)||0===t.length?{ok:!1,code:"SLUG_REQUIRED"}:c.test(t)?d.has(t)?{ok:!1,code:"SLUG_RESERVED"}:{ok:!0}:{ok:!1,code:"SLUG_INVALID"};return r.ok?(0,u.withFileMutex)(p,async()=>{let t=await w(),r=t.apps.find(t=>t.slug===e.slug);if(r)return{ok:!1,code:"SLUG_TAKEN",ownerWorkspaceId:r.workspaceId};let s={slug:e.slug,type:e.type,workspaceId:e.workspaceId,relPath:e.relPath,..."node"===e.type&&e.script?{script:e.script}:{},..."node"===e.type&&e.persist?{persist:!0}:{},createdAt:new Date().toISOString()};return t.apps.push(s),await v(t),{ok:!0,app:s}}):{ok:!1,code:r.code}}async function _(e,t){return(0,u.withFileMutex)(p,async()=>{let r=await g();if(!r)return null;let s=r.apps.find(t=>t.slug===e);return s&&"node"===s.type?(t?s.persist=!0:delete s.persist,await v(r),s):null})}async function x(e){return(0,u.withFileMutex)(p,async()=>{let t=await g();if(!t)return!1;let r=t.apps.length;return t.apps=t.apps.filter(t=>t.slug!==e),t.apps.length!==r&&(await v(t),!0)})}e.s(["createHostedApp",0,R,"deleteHostedApp",0,x,"getBySlug",0,y,"listHostedApps",0,m,"setHostedAppPersist",0,_],762512);var E=e.i(359211);let k=new Map,b=new Set,P=new Map;function S(e){return`${e.workspaceId}\0${e.relPath}`}function T(e){let t=e.watcher;e.watcher=null,t&&t.close()}function A(e){let t=e.process;if(e.process=null,!t)return;try{!t.killed&&t.pid&&t.kill("SIGTERM")}catch{}let r=setTimeout(()=>{try{!t.killed&&t.pid&&t.kill("SIGKILL")}catch{}},2e3);t.once("exit",()=>clearTimeout(r))}function I(e,t){return new Promise(r=>{let s=(0,n.createConnection)(e,t);s.setTimeout(800),s.on("connect",()=>{s.destroy(),r(!0)}),s.on("error",()=>{s.destroy(),r(!1)}),s.on("timeout",()=>{s.destroy(),r(!1)})})}async function N(e){let[t,r]=await Promise.all([I(e,"127.0.0.1"),I(e,"::1")]);return t||r}async function j(e,t=3e4){let r=Date.now()+t;for(;Date.now()<r&&!e.abort.signal.aborted;){if(await N(e.port))return e.port;await new Promise(e=>setTimeout(e,400))}return null}function C(e){let t=a.default.join(e,"package.json");if(!(0,r.existsSync)(t))return null;try{return JSON.parse((0,r.readFileSync)(t,"utf-8"))}catch{return null}}function O(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function U(e,t){return O(t,"start")?"start":O(t,"preview")&&(0,r.existsSync)(a.default.join(e,"dist"))?"preview":O(t,"dev")?"dev":null}function D(){let e=a.default.dirname(process.execPath),t=process.env.PATH??"";return t.split(a.default.delimiter).includes(e)?t:`${e}${a.default.delimiter}${t}`}function q(e,t){e.restartTimer||e.abort.signal.aborted||(P.set(t,e.supervision),e.restartTimer=setTimeout(()=>{e.restartTimer=null,k.get(t)!==e||e.abort.signal.aborted||"error"===e.supervision.status||$(e.workspaceId,e.relPath,e.absPath,e.script,{persist:!0}).catch(()=>{})},250))}function H(e,t){e.persist&&!e.watcher&&(e.watcher=(0,s.watch)(e.absPath,{ignoreInitial:!0,ignored:t=>a.default.relative(e.absPath,t).split(a.default.sep).some(e=>["node_modules",".git",".next"].includes(e)),awaitWriteFinish:{stabilityThreshold:250,pollInterval:100}}),e.watcher.on("all",()=>{if(k.get(t)!==e||e.abort.signal.aborted)return;let r=i(e.supervision,{type:"file-change"});e.supervision=r.state,"restart"===r.action&&(A(e),e.status="restarting",q(e,t))}))}async function $(e,s,o,l,u){var p;let c=S({workspaceId:e,relPath:s}),d=u?.persist===!0,h=k.get(c);if(h&&"stopped"!==h.status&&"error"!==h.status&&"missing"!==h.status&&h.process)return d&&(h.persist=!0),{port:h.port};h&&(h.abort.abort(),h.restartTimer&&clearTimeout(h.restartTimer),T(h),A(h),k.delete(c)),b.delete(c);let f=await new Promise((e,t)=>{let r=(0,n.createServer)();r.listen(0,"127.0.0.1",()=>{let t=r.address(),s="object"==typeof t&&t?t.port:0;r.close(()=>e(s))}),r.on("error",t)}),g=(0,r.existsSync)(a.default.join(o,"pnpm-lock.yaml"))?"pnpm":(0,r.existsSync)(a.default.join(o,"yarn.lock"))?"yarn":(0,r.existsSync)(a.default.join(o,"bun.lockb"))||(0,r.existsSync)(a.default.join(o,"bun.lock"))?"bun":"npm",v=function(e,t,r,s){let n=C(e);if(!n)return null;let a=n.scripts??{},i=Object.keys({...n.dependencies,...n.devDependencies}).some(e=>"vite"===e||e.includes("vite")),o=["--port",String(r)],l=e=>({bin:t,args:"npm"===t?["run",e,"--",...o]:["run",e,...o],isVite:i});if(s)return O(a,s)?l(s):null;let u=U(e,a);return u?l(u):n.main?{bin:"node",args:[n.main,...o],isVite:!1}:null}(o,g,f,l);if(!v)throw Error("No runnable script found in package.json (need start, preview, or dev)");let w=P.get(c);P.delete(c);let m={workspaceId:e,relPath:s,absPath:o,script:l,port:f,process:null,status:"installing",logs:[],generation:1,abort:new AbortController,persist:!1,supervision:w??{crashCount:0,fileWatchRestartCount:0,status:"stopped"},watcher:null,restartTimer:null};k.set(c,m);let y=e=>{m.logs.push(e),m.logs.length>200&&m.logs.shift()};try{(0,r.existsSync)(a.default.join(o,"node_modules"))||(y(`[wiki-viewer] Running ${g} install…`),await (p=m.abort.signal,new Promise((e,r)=>{if(p.aborted)return void r(Error("Install aborted"));let s=[],n=e=>{y(e),s.push(e)},a=(0,t.spawn)(g,["install"],{cwd:o,stdio:"pipe",env:{...process.env,PATH:D()}}),i=()=>{try{a.kill("SIGTERM")}catch{}};p.addEventListener("abort",i,{once:!0});let l=e=>{for(let t of e.toString().split("\n")){let e=t.trim();e&&n(e)}};a.stdout?.on("data",l),a.stderr?.on("data",l),a.on("error",e=>{p.removeEventListener("abort",i),r(e)}),a.on("exit",t=>{if(p.removeEventListener("abort",i),0===t)e();else{let e=s.slice(-20).join("\n");r(Error(`${g} install failed (exit ${t}):
|
|
2
|
+
${e}`))}})}))),m.status="starting",y(`[wiki-viewer] Starting on port ${f}: ${v.bin} ${v.args.join(" ")}`);let e=(0,t.spawn)(v.bin,v.args,{cwd:o,stdio:"pipe",env:{...process.env,PATH:D(),PORT:String(f),VITE_PORT:String(f)}});m.process=e;let s=e=>{for(let t of e.toString().split("\n")){let e=t.trim();e&&y(e)}};return e.stdout?.on("data",s),e.stderr?.on("data",s),e.on("exit",e=>{if(k.get(c)===m&&"stopped"!==m.status&&!m.abort.signal.aborted){if(m.process=null,m.persist&&0!==e&&null!==e){let t=i(m.supervision,{type:"crash",detail:`exit ${e}`});m.supervision=t.state,"restart"===t.action?(m.status="restarting",q(m,c)):(m.status="error",m.error=m.supervision.lastError);return}m.status=0===e||null===e?"stopped":"error",m.error=e?`Process exited with code ${e}`:void 0}}),j(m).then(t=>{if(k.get(c)===m&&!m.abort.signal.aborted)if(t)m.status="running",m.supervision={...m.supervision,status:"running"},H(m,c);else if(m.persist){let t=i(m.supervision,{type:"crash",detail:"readiness timeout"});m.supervision=t.state,"restart"===t.action?(m.status="restarting",q(m,c)):(m.status="error",m.error=m.supervision.lastError);try{e.kill("SIGTERM")}catch{}}else{m.status="error",m.error="Port never became reachable (30 s timeout)";try{e.kill("SIGTERM")}catch{}}}),{port:f}}catch(e){throw k.get(c)===m&&(m.status="error",m.error=e instanceof Error?e.message:String(e)),e}}async function W(e,t,r,s,n=!0){let a=S({workspaceId:e,relPath:t}),o=k.get(a);return o?(o.supervision=i(o.supervision,{type:"manual-restart"}).state,o.persist=n,o.absPath=r,o.script=s,o.restartTimer&&clearTimeout(o.restartTimer),o.restartTimer=null,A(o),o.status="restarting",q(o,a),{port:o.port}):$(e,t,r,s,{persist:n})}async function M(){if("1"===process.env.WIKI_NO_AUTH||"1"===process.env.WIKI_ALLOW_APP_RUNNER)for(let e of(await m()).filter(e=>"node"===e.type&&!0===e.persist)){let t=S({workspaceId:e.workspaceId,relPath:e.relPath}),s=await (0,E.getWorkspace)(e.workspaceId),n=s?(0,E.safeWorkspacePath)(s.rootDir,e.relPath):null;if(!n||!(0,r.existsSync)(n)){b.add(t);continue}try{await $(e.workspaceId,e.relPath,n,e.script,{persist:!0})}catch{}}}("1"===process.env.WIKI_NO_AUTH||"1"===process.env.WIKI_ALLOW_APP_RUNNER)&&M(),e.s(["getScripts",0,function(e){let t=C(e);if(!t)return{scripts:[],defaultScript:null};let r=t.scripts??{};return{scripts:Object.keys(r),defaultScript:U(e,r)}},"getStatus",0,function(e,t){let r=k.get(S({workspaceId:e,relPath:t}));return r?{status:r.status,port:r.port||void 0,error:r.error,lastError:r.supervision.lastError??r.error,restartCount:r.supervision.crashCount,fileWatchRestartCount:r.supervision.fileWatchRestartCount,logs:r.logs}:b.has(S({workspaceId:e,relPath:t}))?{status:"missing",error:"Hosted app source directory is missing",logs:[]}:{status:"stopped",logs:[]}},"resolveByPrefix",0,function(e,t){for(let r=t.length;r>0;r--){let s=t.slice(0,r).join("/"),n=k.get(S({workspaceId:e,relPath:s}));if(n&&"running"===n.status&&n.port){let e="/"+t.slice(r).join("/");return{relPath:s,port:n.port,rest:e}}}return null},"restartApp",0,W,"setAppPersistence",0,function(e,t,r,s){let n=S({workspaceId:e,relPath:t}),a=k.get(n);a&&(a.persist=s,a.absPath=r,s?H(a,n):T(a))},"startApp",0,$,"stopApp",0,function(e,t){let r=S({workspaceId:e,relPath:t}),s=k.get(r);s&&(s.abort.abort(),s.restartTimer&&clearTimeout(s.restartTimer),s.restartTimer=null,T(s),s.status="stopped",k.delete(r),A(s))}],345212)},711376,e=>{"use strict";var t=e.i(985426),r=e.i(257574),s=e.i(507835),n=e.i(457789),a=e.i(119791),i=e.i(141062),o=e.i(957291),l=e.i(535899),u=e.i(610241),p=e.i(62749),c=e.i(624891),d=e.i(725836),h=e.i(532736),f=e.i(257858),g=e.i(487476),v=e.i(193695);e.i(484264);var w=e.i(315709),m=e.i(351216),y=e.i(402662),R=e.i(660038),_=e.i(359211),x=e.i(345212);function E(e){return"1"===process.env.WIKI_NO_AUTH||"1"===process.env.WIKI_ALLOW_APP_RUNNER||e.isAdmin}async function k(e){let t=await (0,R.resolveWorkspaceForUser)(e);if(!t.ok)return m.NextResponse.json({error:t.code},{status:t.status});let{searchParams:r}=new URL(e.url),s=r.get("path")??"",n=(0,x.getStatus)(t.ws.id,s),a=(0,_.safeWorkspacePath)(t.rootDir,s),i=a?(0,x.getScripts)(a):{scripts:[],defaultScript:null};return m.NextResponse.json({...n,...i})}async function b(e){let t=(0,y.checkOrigin)(e);if(t)return t;let r=await (0,R.resolveWorkspaceForUser)(e,"write");if(!r.ok)return m.NextResponse.json({error:r.code},{status:r.status});let{rootDir:s}=r;if(!E(r))return m.NextResponse.json({error:"ADMIN_REQUIRED"},{status:403});let n=await e.json(),a=n.path;if(!a||"string"!=typeof a)return m.NextResponse.json({error:"Missing path"},{status:400});let i=(0,_.safeWorkspacePath)(s,a);if(!i)return m.NextResponse.json({error:"Invalid path"},{status:400});let o="string"==typeof n.script?n.script:void 0;try{let e=await (0,x.startApp)(r.ws.id,a,i,o);return m.NextResponse.json(e)}catch(e){return m.NextResponse.json({error:String(e)},{status:500})}}async function P(e){let t=(0,y.checkOrigin)(e);if(t)return t;let r=await (0,R.resolveWorkspaceForUser)(e,"write");if(!r.ok)return m.NextResponse.json({error:r.code},{status:r.status});if(!E(r))return m.NextResponse.json({error:"ADMIN_REQUIRED"},{status:403});let s=(await e.json()).path;return s&&"string"==typeof s?((0,x.stopApp)(r.ws.id,s),m.NextResponse.json({ok:!0})):m.NextResponse.json({error:"Missing path"},{status:400})}e.s(["DELETE",0,P,"GET",0,k,"POST",0,b],41743);var S=e.i(41743);let T=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/wiki/app/route",pathname:"/api/wiki/app",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/wiki/app/route.ts",nextConfigOutput:"standalone",userland:S,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:I,serverHooks:N}=T;async function j(e,t,s){s.requestMeta&&(0,n.setRequestMeta)(e,s.requestMeta),T.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let m="/api/wiki/app/route";m=m.replace(/\/index$/,"")||"/";let y=await T.prepare(e,t,{srcPage:m,multiZoneDraftMode:!1});if(!y)return t.statusCode=400,t.end("Bad Request"),null==s.waitUntil||s.waitUntil.call(s,Promise.resolve()),null;let{buildId:R,params:_,nextConfig:x,parsedUrl:E,isDraftMode:k,prerenderManifest:b,routerServerContext:P,isOnDemandRevalidate:S,revalidateOnlyGenerated:A,resolvedPathname:I,clientReferenceManifest:N,serverActionsManifest:j}=y,C=(0,o.normalizeAppPath)(m),O=!!(b.dynamicRoutes[C]||b.routes[I]),U=async()=>((null==P?void 0:P.render404)?await P.render404(e,t,E,!1):t.end("This page could not be found"),null);if(O&&!k){let e=!!b.routes[I],t=b.dynamicRoutes[C];if(t&&!1===t.fallback&&!e){if(x.adapterPath)return await U();throw new v.NoFallbackError}}let D=null;!O||T.isDev||k||(D="/index"===(D=I)?"/":D);let q=!0===T.isDev||!O,H=O&&!q;j&&N&&(0,i.setManifestsSingleton)({page:m,clientReferenceManifest:N,serverActionsManifest:j});let $=e.method||"GET",W=(0,a.getTracer)(),M=W.getActiveScopeSpan(),L=!!(null==P?void 0:P.isWrappedByNextServer),F=!!(0,n.getRequestMeta)(e,"minimalMode"),K=(0,n.getRequestMeta)(e,"incrementalCache")||await T.getIncrementalCache(e,x,b,F);null==K||K.resetRequestCache(),globalThis.__incrementalCache=K;let B={params:_,previewProps:b.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:q,incrementalCache:K,cacheLifeProfiles:x.cacheLife,waitUntil:s.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,s,n)=>T.onRequestError(e,t,s,n,P)},sharedContext:{buildId:R}},G=new l.NodeNextRequest(e),V=new l.NodeNextResponse(t),z=u.NextRequestAdapter.fromNodeNextRequest(G,(0,u.signalFromNodeResponse)(t));try{let n,i=async e=>T.handle(z,B).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=W.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==p.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let s=r.get("next.route");if(s){let t=`${$} ${s}`;e.setAttributes({"next.route":s,"http.route":s,"next.span_name":t}),e.updateName(t),n&&n!==e&&(n.setAttribute("http.route",s),n.updateName(t))}else e.updateName(`${$} ${m}`)}),o=async n=>{var a,o;let l=async({previousCacheEntry:r})=>{try{if(!F&&S&&A&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let a=await i(n);e.fetchMetrics=B.renderOpts.fetchMetrics;let o=B.renderOpts.pendingWaitUntil;o&&s.waitUntil&&(s.waitUntil(o),o=void 0);let l=B.renderOpts.collectedTags;if(!O)return await (0,d.sendResponse)(G,V,a,B.renderOpts.pendingWaitUntil),null;{let e=await a.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(a.headers);l&&(t[g.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==B.renderOpts.collectedRevalidate&&!(B.renderOpts.collectedRevalidate>=g.INFINITE_CACHE)&&B.renderOpts.collectedRevalidate,s=void 0===B.renderOpts.collectedExpire||B.renderOpts.collectedExpire>=g.INFINITE_CACHE?void 0:B.renderOpts.collectedExpire;return{value:{kind:w.CachedRouteKind.APP_ROUTE,status:a.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:s}}}}catch(t){throw(null==r?void 0:r.isStale)&&await T.onRequestError(e,t,{routerKind:"App Router",routePath:m,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:H,isOnDemandRevalidate:S})},!1,P),t}},u=await T.handleResponse({req:e,nextConfig:x,cacheKey:D,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:b,isRoutePPREnabled:!1,isOnDemandRevalidate:S,revalidateOnlyGenerated:A,responseGenerator:l,waitUntil:s.waitUntil,isMinimalMode:F});if(!O)return null;if((null==u||null==(a=u.value)?void 0:a.kind)!==w.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==u||null==(o=u.value)?void 0:o.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});F||t.setHeader("x-nextjs-cache",S?"REVALIDATED":u.isMiss?"MISS":u.isStale?"STALE":"HIT"),k&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let p=(0,h.fromNodeOutgoingHttpHeaders)(u.value.headers);return F&&O||p.delete(g.NEXT_CACHE_TAGS_HEADER),!u.cacheControl||t.getHeader("Cache-Control")||p.get("Cache-Control")||p.set("Cache-Control",(0,f.getCacheControlHeader)(u.cacheControl)),await (0,d.sendResponse)(G,V,new Response(u.value.body,{headers:p,status:u.value.status||200})),null};L&&M?await o(M):(n=W.getActiveScopeSpan(),await W.withPropagatedContext(e.headers,()=>W.trace(p.BaseServerSpan.handleRequest,{spanName:`${$} ${m}`,kind:a.SpanKind.SERVER,attributes:{"http.method":$,"http.target":e.url}},o),void 0,!L))}catch(t){if(t instanceof v.NoFallbackError||await T.onRequestError(e,t,{routerKind:"App Router",routePath:C,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:H,isOnDemandRevalidate:S})},!1,P),O)throw t;return await (0,d.sendResponse)(G,V,new Response(null,{status:500})),null}}e.s(["handler",0,j,"patchFetch",0,function(){return(0,s.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:I})},"routeModule",0,T,"serverHooks",0,N,"workAsyncStorage",0,A,"workUnitAsyncStorage",0,I],711376)},168315,e=>{e.v(t=>Promise.all(["server/chunks/0sag_@better-auth_memory-adapter_dist_index_mjs_0pvj6im._.js"].map(t=>e.l(t))).then(()=>t(862112)))},769787,e=>{e.v(t=>Promise.all(["server/chunks/01er_better-auth_dist_adapters_kysely-adapter_index_mjs_0s~-4gu._.js"].map(t=>e.l(t))).then(()=>t(717789)))},580632,e=>{e.v(e=>Promise.resolve().then(()=>e(270406)))},947559,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_bun-sqlite-dialect-DzNwOpKv_mjs_0z1z6m4._.js"].map(t=>e.l(t))).then(()=>t(495181)))},715018,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_node-sqlite-dialect_mjs_0qqlvhl._.js"].map(t=>e.l(t))).then(()=>t(698370)))},146843,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_d1-sqlite-dialect-C2B7YsIT_mjs_0wynrz3._.js"].map(t=>e.l(t))).then(()=>t(143740)))},697743,e=>{e.v(t=>Promise.all(["server/chunks/0.u4_next_05jevxw._.js"].map(t=>e.l(t))).then(()=>t(428325)))},99243,e=>{e.v(e=>Promise.resolve().then(()=>e(313414)))},893412,e=>{e.v(e=>Promise.resolve().then(()=>e(499465)))},687903,e=>{e.v(e=>Promise.resolve().then(()=>e(912714)))}];
|
|
3
|
+
|
|
4
|
+
//# sourceMappingURL=%5Broot-of-the-server%5D__0yqf3ec._.js.map
|