@synthever/jrouter 1.0.0 → 1.0.2
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/app/.next-cli-build/BUILD_ID +1 -1
- package/app/.next-cli-build/app-path-routes-manifest.json +14 -14
- package/app/.next-cli-build/build-manifest.json +2 -2
- package/app/.next-cli-build/prerender-manifest.json +2 -2
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/health/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error.html +1 -1
- package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_not-found.html +1 -1
- package/app/.next-cli-build/server/app/_not-found.rsc +5 -5
- package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/api/auth/login/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/logout/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/reset-password/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/start/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/status/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +9 -9
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codewhale-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codex-profiles/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/crush-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +3 -3
- package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/forge-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js +5 -5
- package/app/.next-cli-build/server/app/api/cli-tools/hermes-profiles/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/omp-settings/route.js +3 -3
- package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/smelt-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/combos/presets/route.js +1 -1
- package/app/.next-cli-build/server/app/api/combos/route.js +1 -1
- package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/headroom/restart/route.js +1 -1
- package/app/.next-cli-build/server/app/api/headroom/start/route.js +1 -1
- package/app/.next-cli-build/server/app/api/keys/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/keys/[id]/secret/route.js +1 -1
- package/app/.next-cli-build/server/app/api/keys/route.js +1 -1
- package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js +2 -2
- package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js +2 -2
- package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js +1 -1
- package/app/.next-cli-build/server/app/api/model-health/check/route.js +1 -1
- package/app/.next-cli-build/server/app/api/model-health/check-all/route.js +1 -1
- package/app/.next-cli-build/server/app/api/model-health/config/route.js +1 -1
- package/app/.next-cli-build/server/app/api/model-health/history/route.js +1 -1
- package/app/.next-cli-build/server/app/api/model-health/model/route.js +1 -1
- package/app/.next-cli-build/server/app/api/model-health/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/model-health/route.js +1 -1
- package/app/.next-cli-build/server/app/api/model-health/run-scheduled/route.js +1 -1
- package/app/.next-cli-build/server/app/api/model-health/summary/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/alias/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/availability/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/catalog-sync/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/custom/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/disabled/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/limits/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/zed/import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/pricing/route.js +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/connections/keys/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/overrides/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js +2 -2
- package/app/.next-cli-build/server/app/api/proxy-pools/netlify-deploy/route.js +4 -4
- package/app/.next-cli-build/server/app/api/proxy-pools/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/health/route.js +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/install/route.js +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/start/route.js +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/status/route.js +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js +1 -1
- package/app/.next-cli-build/server/app/api/settings/database/route.js +1 -1
- package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/settings/require-login/route.js +1 -1
- package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/claude-reset/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/chart/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/history/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/logs/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-details/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-logs/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/stats/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/stream/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/route.js +1 -1
- package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/callback.html +1 -1
- package/app/.next-cli-build/server/app/callback.rsc +5 -5
- package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/health.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/health.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/health.segments/!KGRhc2hib2FyZCk/dashboard/health/__PAGE__.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/health.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/health.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/playground.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/playground.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard/playground/__PAGE__.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/playground.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/playground.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard.html +1 -1
- package/app/.next-cli-build/server/app/dashboard.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/index.html +1 -1
- package/app/.next-cli-build/server/app/index.rsc +5 -5
- package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing/page.js +1 -1
- package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/landing.html +1 -1
- package/app/.next-cli-build/server/app/landing.rsc +6 -6
- package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/login/page.js +1 -1
- package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/login.html +1 -1
- package/app/.next-cli-build/server/app/login.rsc +6 -6
- package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/manifest.webmanifest/route.js +1 -1
- package/app/.next-cli-build/server/app/manifest.webmanifest.body +1 -1
- package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app-paths-manifest.json +14 -14
- package/app/.next-cli-build/server/chunks/1133.js +1 -1
- package/app/.next-cli-build/server/chunks/1757.js +2 -2
- package/app/.next-cli-build/server/chunks/2132.js +1 -1
- package/app/.next-cli-build/server/chunks/2524.js +1 -1
- package/app/.next-cli-build/server/chunks/2732.js +1 -1
- package/app/.next-cli-build/server/chunks/2760.js +1 -1
- package/app/.next-cli-build/server/chunks/3192.js +1 -1
- package/app/.next-cli-build/server/chunks/3360.js +1 -1
- package/app/.next-cli-build/server/chunks/3535.js +1 -1
- package/app/.next-cli-build/server/chunks/3966.js +6 -6
- package/app/.next-cli-build/server/chunks/412.js +1 -1
- package/app/.next-cli-build/server/chunks/4123.js +3 -3
- package/app/.next-cli-build/server/chunks/4152.js +1 -1
- package/app/.next-cli-build/server/chunks/436.js +1 -1
- package/app/.next-cli-build/server/chunks/455.js +1 -1
- package/app/.next-cli-build/server/chunks/4642.js +1 -1
- package/app/.next-cli-build/server/chunks/4746.js +1 -1
- package/app/.next-cli-build/server/chunks/4764.js +1 -1
- package/app/.next-cli-build/server/chunks/4827.js +1 -1
- package/app/.next-cli-build/server/chunks/4864.js +6 -6
- package/app/.next-cli-build/server/chunks/5299.js +25 -25
- package/app/.next-cli-build/server/chunks/5330.js +1 -1
- package/app/.next-cli-build/server/chunks/5615.js +2 -2
- package/app/.next-cli-build/server/chunks/6296.js +5 -5
- package/app/.next-cli-build/server/chunks/735.js +1 -1
- package/app/.next-cli-build/server/chunks/7373.js +1 -1
- package/app/.next-cli-build/server/chunks/7716.js +1 -1
- package/app/.next-cli-build/server/chunks/8126.js +1 -1
- package/app/.next-cli-build/server/chunks/8306.js +1 -1
- package/app/.next-cli-build/server/chunks/8432.js +1 -1
- package/app/.next-cli-build/server/chunks/8749.js +1 -1
- package/app/.next-cli-build/server/chunks/9032.js +1 -1
- package/app/.next-cli-build/server/chunks/9046.js +1 -1
- package/app/.next-cli-build/server/chunks/9128.js +1 -1
- package/app/.next-cli-build/server/chunks/9489.js +1 -1
- package/app/.next-cli-build/server/chunks/9609.js +1 -1
- package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
- package/app/.next-cli-build/server/middleware.js +2 -2
- package/app/.next-cli-build/server/pages/404.html +1 -1
- package/app/.next-cli-build/server/pages/500.html +1 -1
- package/app/.next-cli-build/static/chunks/{1321-b2785838003873e1.js → 1321-9eb7d54c5b900efb.js} +1 -1
- package/app/.next-cli-build/static/chunks/{5497-66e7c2a2b715a638.js → 5497-973a06c94a94aff7.js} +1 -1
- package/app/.next-cli-build/static/chunks/761-1bcb7334763d5645.js +132 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/{page-9f4426c30039c7d5.js → page-3960bffd1fddbbad.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/endpoint/{page-0c7b45a45ba51753.js → page-61b17862582ff807.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/profile/{page-de6dfc43c2687bd8.js → page-1a560f2b5cdf2e31.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/skills/page-4c6b176d5c59d8a4.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/token-saver/{page-e631d28dd402dc1e.js → page-d0031965cf7eff51.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/landing/{page-431f7e8093b8ca51.js → page-5bc39b166588b878.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/login/{page-80c4e229a5f38a6b.js → page-f2b166590b653d36.js} +1 -1
- package/app/custom-server.js +2 -2
- package/app/package.json +1 -1
- package/app/src/lib/oauth/providers/xiaomi-mimo.js +2 -2
- package/app/src/lib/updater/updater.js +3 -3
- package/app/src/mitm/server.js +10 -10
- package/cli.js +6 -6
- package/hooks/postinstall.js +2 -2
- package/hooks/sqliteRuntime.js +2 -2
- package/hooks/trayRuntime.js +3 -3
- package/package.json +7 -3
- package/src/cli/api/client.js +3 -3
- package/src/cli/commands/connect.js +3 -3
- package/src/cli/commands/connectTools.js +12 -12
- package/src/cli/commands/xaiVideo.js +1 -1
- package/src/cli/menus/cliTools.js +18 -18
- package/src/cli/menus/settings.js +1 -1
- package/src/cli/tray/autostart.js +1 -1
- package/app/.next-cli-build/static/chunks/761-57ed45cdddcf32eb.js +0 -132
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/skills/page-316b3186a841d862.js +0 -1
- /package/app/.next-cli-build/static/{fjLlI_-eBYMOp6J-a-q-6 → MDZXE-9g1sq006f6JNky9}/_buildManifest.js +0 -0
- /package/app/.next-cli-build/static/{fjLlI_-eBYMOp6J-a-q-6 → MDZXE-9g1sq006f6JNky9}/_ssgManifest.js +0 -0
|
@@ -6,15 +6,15 @@
|
|
|
6
6
|
9:I[86869,[],"IconMark"]
|
|
7
7
|
b:I[57121,[],""]
|
|
8
8
|
c:I[74581,[],""]
|
|
9
|
-
f:I[21110,["2904","static/chunks/2904-325a27680944b549.js","6506","static/chunks/6506-db81555d02f69026.js","8500","static/chunks/8500-01a63dafd809e317.js","3847","static/chunks/3847-6d17069c42bf9f98.js","1321","static/chunks/1321-
|
|
10
|
-
10:I[94635,["2546","static/chunks/2546-2cafc79bfc5dd8b2.js","1321","static/chunks/1321-
|
|
11
|
-
11:I[30565,["2546","static/chunks/2546-2cafc79bfc5dd8b2.js","1321","static/chunks/1321-
|
|
9
|
+
f:I[21110,["2904","static/chunks/2904-325a27680944b549.js","6506","static/chunks/6506-db81555d02f69026.js","8500","static/chunks/8500-01a63dafd809e317.js","3847","static/chunks/3847-6d17069c42bf9f98.js","1321","static/chunks/1321-9eb7d54c5b900efb.js","705","static/chunks/705-6384bb1f563b1bdb.js","5497","static/chunks/5497-973a06c94a94aff7.js","9305","static/chunks/app/(dashboard)/layout-b6c7b32a4ffc5db9.js"],"ThemeProvider"]
|
|
10
|
+
10:I[94635,["2546","static/chunks/2546-2cafc79bfc5dd8b2.js","1321","static/chunks/1321-9eb7d54c5b900efb.js","7177","static/chunks/app/layout-9141ab742963d556.js"],"RuntimeI18nProvider"]
|
|
11
|
+
11:I[30565,["2546","static/chunks/2546-2cafc79bfc5dd8b2.js","1321","static/chunks/1321-9eb7d54c5b900efb.js","7177","static/chunks/app/layout-9141ab742963d556.js"],"GoogleAnalytics"]
|
|
12
12
|
:HL["/_next/static/css/15730e9f7c5c55ef.css","style"]
|
|
13
13
|
:HL["/_next/static/css/f0e9ffc68c4f886a.css","style"]
|
|
14
14
|
6:X
|
|
15
15
|
e:X
|
|
16
16
|
e:C
|
|
17
|
-
0:{"buildId":"
|
|
17
|
+
0:{"buildId":"MDZXE-9g1sq006f6JNky9","data":[{"rsc":["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],null,["$","$L2",null,{"children":["$","$3",null,{"name":"Next.MetadataOutlet","children":"$@4"}]}]]}],"isPartial":"$@5","staleTime":"$6","varyParams":null},{"rsc":["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L7",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","2",{"name":"theme-color","content":"#0a0a0a"}]]}],["$","div",null,{"hidden":true,"children":["$","$L8",null,{"children":["$","$3",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"JRouter - AI Infrastructure Management"}],["$","meta","1",{"name":"description","content":"One endpoint for all your AI providers. Manage keys, monitor usage, and scale effortlessly."}],["$","link","2",{"rel":"manifest","href":"/manifest.webmanifest"}],["$","link","3",{"rel":"icon","href":"/brand/jrouter.svg"}],["$","$L9","4",{}]]}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],"isPartial":"$@a","staleTime":"$6","varyParams":null},{"rsc":["$","$1","c",{"children":[null,["$","$Lb",null,{"parallelRouterKey":"children","template":["$","$Lc",null,{}]}]]}],"isPartial":"$@d","staleTime":"$6","varyParams":"$e"},{"rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/15730e9f7c5c55ef.css","precedence":"next"}],["$","link","1",{"rel":"stylesheet","href":"/_next/static/css/f0e9ffc68c4f886a.css","precedence":"next"}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"children":[["$","head",null,{"children":[["$","script",null,{"dangerouslySetInnerHTML":{"__html":"(function(){try{var s=localStorage.getItem('theme');var t=s?(JSON.parse(s).state||{}).theme:'system';t=t||'system';var m=window.matchMedia('(prefers-color-scheme: dark)').matches;if(t==='dark'||(t==='system'&&m)){document.documentElement.classList.add('dark')}}catch(e){}})();"}}],["$","script",null,{"dangerouslySetInnerHTML":{"__html":"var d=document,r=d.documentElement,f=function(){r.classList.add('fonts-loaded')};if(d.fonts&&d.fonts.load){d.fonts.load('24px \"Material Symbols Outlined\"').then(f).catch(f);setTimeout(f,3000)}else{f()}"}}]]}],["$","body",null,{"className":"__variable_8eaea4 __variable_8c25df font-sans antialiased","children":[["$","$Lf",null,{"children":["$","$L10",null,{"children":["$","$Lb",null,{"parallelRouterKey":"children","template":["$","$Lc",null,{}]}]}]}],["$","$L11",null,{"gaId":"G-LC959F603F"}]]}]]}]]}],"isPartial":"$@12","staleTime":"$6","varyParams":null}],"isUpgradeableISRFallback":false,"a":"$@13","rootVaryParams":null,"needsRuntimeRequest":"$@14"}
|
|
18
18
|
4:null
|
|
19
19
|
6:300
|
|
20
20
|
14:true
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
:HL["/_next/static/media/7d4881bb7e1bf84d-s.p.woff2","font",{"crossOrigin":"","type":"font/woff2"}]
|
|
3
3
|
:HL["/_next/static/css/15730e9f7c5c55ef.css","style"]
|
|
4
4
|
:HL["/_next/static/css/f0e9ffc68c4f886a.css","style"]
|
|
5
|
-
0:{"tree":{"name":"","param":null,"prefetchHints":4176,"slots":{"children":{"name":"_not-found","param":null,"prefetchHints":4192,"slots":{"children":{"name":"__PAGE__","param":null,"prefetchHints":4256,"slots":null}}}}},"staleTime":300,"buildId":"
|
|
5
|
+
0:{"tree":{"name":"","param":null,"prefetchHints":4176,"slots":{"children":{"name":"_not-found","param":null,"prefetchHints":4192,"slots":{"children":{"name":"__PAGE__","param":null,"prefetchHints":4256,"slots":null}}}}},"staleTime":300,"buildId":"MDZXE-9g1sq006f6JNky9"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
(()=>{var a={};a.id=7758,a.ids=[7758],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1932:a=>{"use strict";a.exports=require("url")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},7985:(a,b,c)=>{"use strict";c.d(b,{Jm:()=>e,N:()=>k,eI:()=>f,eW:()=>h,mH:()=>j,uZ:()=>n,wu:()=>l,x7:()=>m});var d=c(15081);function e(a){if(!a||"string"!=typeof a)return"";let b=a.replace(/-----BEGIN CERTIFICATE-----/gi,"").replace(/-----END CERTIFICATE-----/gi,"").replace(/[^A-Za-z0-9+/=]/g,"");if(!b)return"";let c=b.match(/.{1,64}/g)||[];return`-----BEGIN CERTIFICATE-----
|
|
2
2
|
${c.join("\n")}
|
|
3
|
-
-----END CERTIFICATE-----`}function f(a){return!!(a?.samlEntryPoint&&a?.samlCert)}function g(a){return(a||"").replace(/\/+$/,"")}function h(a,b){let c=(b?.baseUrl||"").trim()||process.env.BASE_URL||"http://localhost:20128";if(c)return g(c);if(a){let b=a?.headers?.get?.("x-forwarded-proto")||"",c=a?.headers?.get?.("x-forwarded-host")||a?.headers?.get?.("host")||"";if(c){let d=(b||new URL(a.url).protocol||"http:").replace(/:$/,"");return`${d}://${c}`.replace(/\/+$/,"")}if(a.url)return g(new URL(a.url).origin)}return"http://localhost:20128"}function i(a,b){let c=e(a?.samlCert||"")||"-----BEGIN CERTIFICATE-----\nMIIC...DUMMY...\n-----END CERTIFICATE-----",f=`${b}/api/auth/saml/acs`;return new d.Qb({entryPoint:a?.samlEntryPoint||"https://example.com/sso",issuer:a?.samlIssuer||"urn:9router:sp",idpCert:c,cert:c,callbackUrl:f,acceptedClockSkewMs:6e4,wantAssertionsSigned:!0,validateInResponseTo:"never",requestIdExpirationMs:288e5})}async function j(a,b){let c=h(a,b),d=i(b,c),e=await d.generateAuthorizeRequestAsync(!1,!1),f=e.match(/ID="([^"]+)"/),g=f?f[1]:"";return{authorizeUrl:await d._requestToUrlAsync(e,null,"authorize",{}),requestId:g}}async function k(a,b,c,d){if(!d?.samlCert)throw Error("IdP X.509 Certificate (samlCert) is missing or not configured");let e=h(a,d),f=i(d,e),g=("object"==typeof b&&null!==b?b:{SAMLResponse:b}).SAMLResponse;if(!g)throw Error("Missing SAMLResponse parameter in assertion POST body");if(c){let a=Buffer.from(g,"base64").toString("utf8").match(/InResponseTo=["']([^"']+)["']/i),b=a?a[1]:null;if(!b||b!==c)throw Error(`InResponseTo mismatch: expected ${c}, received ${b||"none"}`)}let j=await f.validatePostResponseAsync({SAMLResponse:g});return j?.profile||j}function l(a,b){return i(b,a).generateServiceProviderMetadata()}function m(a={},b={}){if(!a)return"";let c=b.samlAttributeEmail;if(c&&a[c]){let b=a[c];return Array.isArray(b)?b[0]:String(b)}let d=["email","emailAddress","mail","nameID","nameId","upn","http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress","http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier","http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn"];for(let b of d)if(a[b]){let c=a[b];return Array.isArray(c)?c[0]:String(c)}if(a.attributes){for(let b of d)if(a.attributes[b]){let c=a.attributes[b];return Array.isArray(c)?c[0]:String(c)}}return""}function n(a={},b={}){if(!a)return"";let c=b.samlAttributeName;if(c&&a[c]){let b=a[c];return Array.isArray(b)?b[0]:String(b)}for(let b of["displayName","name","cn","commonName","http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name","http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname"])if(a[b]){let c=a[b];return Array.isArray(c)?c[0]:String(c)}if(a.givenName||a.sn||a.surname){let b=a.givenName||"",c=a.sn||a.surname||"",d=`${b} ${c}`.trim();if(d)return d}return m(a,b)}c(42655)},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},8303:(a,b,c)=>{"use strict";c.d(b,{B3:()=>k,T1:()=>l,im:()=>j,sv:()=>i});var d=c(48645);let e=[3e4,12e4,6e5,18e5],f=new Map;function g(){return Date.now()}function h(a){let b=f.get(a);return b?b.lastFailAt&&g()-b.lastFailAt>36e5&&(!b.lockUntil||g()>=b.lockUntil)?(f.delete(a),null):b:null}function i(a){let b=h(a);if(!b||!b.lockUntil)return{locked:!1};let c=b.lockUntil-g();return c<=0?{locked:!1}:{locked:!0,retryAfter:Math.ceil(c/1e3)}}function j(a){let b=h(a)||{fails:0,lockUntil:0,lockLevel:0,lastFailAt:0};if(b.fails+=1,b.lastFailAt=g(),b.fails>=5){let a=e[Math.min(b.lockLevel,e.length-1)];b.lockUntil=g()+a,b.lockLevel+=1,b.fails=0}return f.set(a,b),{remainingBeforeLock:Math.max(0,5-b.fails)}}function k(a){f.delete(a)}function l(a){if((0,d.M)(a)){let b=a.headers.get("x-9r-real-ip");if(b)return b}if("true"===process.env.TRUST_PROXY){let b=a.headers.get("x-forwarded-for");if(b)return b.split(",")[0].trim()}return"unknown"}},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},11723:a=>{"use strict";a.exports=require("querystring")},16698:a=>{"use strict";a.exports=require("node:async_hooks")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{"use strict";a.exports=require("os")},27910:a=>{"use strict";a.exports=require("stream")},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},30906:(a,b,c)=>{"use strict";let d;c.d(b,{gR:()=>E,hT:()=>D,Pf:()=>C,GY:()=>B,sP:()=>F,Ir:()=>A,Mj:()=>z,iw:()=>x,EJ:()=>y,Ui:()=>I,Rj:()=>J,HO:()=>G,x8:()=>H});var e=c(77598),f=c.n(e),g=c(99129),h=c(64416),i=c(80700),j=c(38805);async function k(a,b,c){let d=a.get(b)||a.set(b,{}).get(b),{alg:e}=c;if(void 0===d[e]){let a=(0,h.xY)(c,b,!0).then(a=>{if("public"!==a.type)throw new g.Dm("JSON Web Key Set members must be public keys");return d[e]=a,a}).catch(b=>{throw d[e]===a&&delete d[e],b});d[e]=a}return d[e]}function l(a){let b;try{b=structuredClone(a)}catch{}if(!(0,j.fV)(b))throw new g.Dm("JSON Web Key Set malformed");let c=b.keys.map(a=>{let b=(0,h.ZZ)(a);return Array.isArray(b.key_ops)&&(b.key_ops=[...b.key_ops]),b}),d=new WeakMap;return Object.defineProperty(async(a,e)=>{let{alg:f,kid:h}={...a,...e?.header},j="string"==typeof f?i.p[f]:void 0;if(!j||j.secret)throw new g.T0('Unsupported "alg" value for a JSON Web Key Set');let l=b.keys.filter((a,b)=>(function(a,b,c,d){let{kty:e,key_ops:f,ext:g,kid:h,alg:i,use:j,crv:k}=a;return(void 0===g||"boolean"==typeof g)&&(void 0===f||Array.isArray(f)&&f.every((a,b)=>"string"==typeof a&&f.indexOf(a)===b)&&f.includes("verify"))&&b.kty.includes(e)&&(void 0===d||"string"==typeof d&&d===h)&&(void 0===i?"AKP"!==e:c===i)&&(void 0===j||"sig"===j)&&(!b.crv||k===b.crv)})(c[b],j,f,h)),{0:m,length:n}=l;if(!n)throw new g.BT;if(1!==n){let a=new g.$4;throw a[Symbol.asyncIterator]=async function*(){for(let a of l)try{yield await k(d,a,j)}catch{}},a}return k(d,m,j)},"jwks",{value:()=>structuredClone(b)})}(typeof navigator>"u"||!navigator.userAgent?.startsWith?.("Mozilla/5.0 "))&&(d="jose/v6.2.12");let m=Symbol();async function n(a,b,c,d=fetch){let e=await d(a,{method:"GET",signal:c,redirect:"manual",headers:b}).catch(a=>{throw"TimeoutError"===a.name?new g.xb:a});if(200!==e.status)throw new g.i4("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await e.json()}catch{throw new g.i4("Failed to parse the JSON Web Key Set HTTP response as JSON")}}let o=Symbol();function p(a,b){return Number.isFinite(a)&&Date.now()<a+b}function q(a,b,c){if(Number.isNaN(a))throw TypeError(`"${c}" option must not be NaN`);return"number"==typeof a?a:b}var r=c(17509),s=c(89718);let t="openid profile email",u="Sign in with OIDC";function v(a){return(a||"").trim().replace(/\/+$/,"")}function w(a){return(a||t).trim()||t}function x(a){let b=process.env.BASE_URL||"http://localhost:20128";if(b)return v(b);let c=a?.headers?.get?.("x-forwarded-proto")||"",d=a?.headers?.get?.("x-forwarded-host")||a?.headers?.get?.("host")||"";if(d){let b=(c||new URL(a.url).protocol||"http:").replace(/:$/,"");return`${b}://${d}`.replace(/\/+$/,"")}return v(new URL(a.url).origin)}function y(a){return!!(v(a?.oidcIssuerUrl)&&(a?.oidcClientId||"").trim()&&(a?.oidcClientSecret||"").trim())}async function z(){let a=await (0,s.mt)();return["oidc","both"].includes(a.authMode)&&y(a)?{issuerUrl:v(a.oidcIssuerUrl),clientId:a.oidcClientId.trim(),clientSecret:a.oidcClientSecret.trim(),scopes:w(a.oidcScopes),loginLabel:(a.oidcLoginLabel||u).trim()||u}:null}async function A(a){let b=`${v(a)}/.well-known/openid-configuration`,c=await fetch(b,{cache:"no-store"});if(!c.ok)throw Error(`Failed to load OIDC discovery document from ${b}`);return await c.json()}function B(){let a=f().randomBytes(32).toString("base64url"),b=f().createHash("sha256").update(a).digest("base64url");return{verifier:a,challenge:b}}function C(){return f().randomBytes(16).toString("base64url")}function D(){return f().randomBytes(16).toString("base64url")}function E({authorizationEndpoint:a,clientId:b,redirectUri:c,scopes:d=t,state:e,nonce:f,codeChallenge:g}){let h=new URL(a);return h.searchParams.set("response_type","code"),h.searchParams.set("client_id",b),h.searchParams.set("redirect_uri",c),h.searchParams.set("scope",w(d)),h.searchParams.set("state",e),h.searchParams.set("nonce",f),h.searchParams.set("code_challenge",g),h.searchParams.set("code_challenge_method","S256"),h.toString()}async function F({tokenEndpoint:a,clientId:b,clientSecret:c,code:d,redirectUri:e,codeVerifier:f}){let g=new URLSearchParams({grant_type:"authorization_code",client_id:b,code:d,redirect_uri:e,code_verifier:f});c&&g.set("client_secret",c);let h=await fetch(a,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:g}),i=await h.json().catch(()=>({}));if(!h.ok)throw Error(i?.error_description||i?.error||`OIDC token exchange failed (${h.status})`);return i}async function G({tokenEndpoint:a,clientId:b,clientSecret:c,redirectUri:d}){if(!c)return{tested:!1,valid:null,message:"No client secret was provided, so secret validation was skipped."};let e=new URLSearchParams({grant_type:"authorization_code",client_id:b,client_secret:c,code:"__oidc_test_invalid_code__",redirect_uri:d,code_verifier:"__oidc_test_invalid_verifier__"}),f=await fetch(a,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:e}),g=await f.json().catch(()=>({})),h=(g?.error||"").toLowerCase(),i=g?.error_description||g?.error||"";return f.ok?{tested:!0,valid:!0,message:"Client secret was accepted by the token endpoint.",raw:g}:"invalid_client"===h||"unauthorized_client"===h||/client.*(invalid|failed|mismatch)/i.test(i)?{tested:!0,valid:!1,message:i||"Client secret is not valid.",raw:g}:"invalid_grant"===h||"invalid_code"===h||/grant|code/i.test(i)?{tested:!0,valid:!0,message:"Client secret was accepted; the token exchange failed only because the test authorization code is invalid.",raw:g}:{tested:!0,valid:null,message:i||`Token endpoint responded with ${f.status}`,raw:g}}async function H({idToken:a,issuer:b,audience:c,jwksUri:e,nonce:f}){let h=function(a){if(!(a instanceof URL))throw TypeError("url must be an instance of URL");let b=new URL(a.href).href,c=(void 0)??{},e=c.timeoutDuration;if("number"==typeof e&&(!Number.isInteger(e)||e<0))throw TypeError('"timeoutDuration" option must be a non-negative integer');let f="number"==typeof e?e:5e3,h=q(c.cooldownDuration,3e4,"cooldownDuration"),i=q(c.cacheMaxAge,6e5,"cacheMaxAge"),k=new Headers(c.headers);d&&!k.has("User-Agent")&&k.set("User-Agent",d),k.has("accept")||k.set("accept","application/json, application/jwk-set+json");let r=c[m],s=c[o],t,u,v=0,w=0,x;if(s&&"object"==typeof s){let{uat:a,jwks:b}=s;p(a,i)&&(0,j.fV)(b)&&(t=a,x=l(b))}let y=async()=>{if(u&&("u">typeof WebSocketPair||"u">typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||"u">typeof EdgeRuntime&&"vercel"===EdgeRuntime)&&(u=void 0),!u){let a=++v,c=u=n(b,k,AbortSignal.timeout(f),r).then(b=>{let c=l(b);if(a<=w)return;x=c;let d=Date.now();s&&(s.uat=d,s.jwks=b),t=d,w=a}).finally(()=>{u===c&&(u=void 0)})}await u};return Object.defineProperties(async(a,b)=>{x&&p(t,i)||await y();try{return await x(a,b)}catch(c){if(c instanceof g.BT&&!p(t,h))return await y(),x(a,b);throw c}},{coolingDown:{get:()=>p(t,h),enumerable:!0},fresh:{get:()=>p(t,i),enumerable:!0},reload:{value:y,enumerable:!0},reloading:{get:()=>!!u,enumerable:!0},jwks:{value:()=>x?.jwks(),enumerable:!0}})}(new URL(e)),{payload:i}=await (0,r.V)(a,h,{issuer:b,audience:c,nonce:f});return i}function I(a={}){return a.preferred_username||a.email||a.name||a.given_name||a.sub||"OIDC user"}function J(a={}){return a.email||""}},33792:(a,b,c)=>{"use strict";c.d(b,{Dc:()=>r,OZ:()=>u,YK:()=>p,dY:()=>s,nz:()=>v,tm:()=>t});var d=c(8292),e=c(17509),f=c(34013),g=c(73024),h=c.n(g),i=c(76760),j=c.n(i),k=c(77598),l=c.n(k),m=c(49120),n=c(89718);let o=new TextEncoder().encode(function(){if(process.env.JWT_SECRET)return process.env.JWT_SECRET;let a=j().join(m.n,"jwt-secret");try{return h().readFileSync(a,"utf8").trim()}catch{}h().mkdirSync(m.n,{recursive:!0});let b=l().randomBytes(32).toString("hex");return h().writeFileSync(a,b,{mode:384}),b}());function p(a){let b="true"===process.env.AUTH_COOKIE_SECURE,c=a?.headers?.get?.("x-forwarded-proto");return b||"https"===c}async function q(a={}){return new d.P({authenticated:!0,...a}).setProtectedHeader({alg:"HS256"}).setIssuedAt().setExpirationTime("24h").sign(o)}async function r(a){if(!a)return!1;try{return await (0,e.V)(a,o),!0}catch{return!1}}async function s(a){if(!a)return null;try{let{payload:b}=await (0,e.V)(a,o);return b}catch{return null}}async function t(a,b,c={}){let d=await q(c);a.set("auth_token",d,{httpOnly:!0,secure:p(b),sameSite:"lax",path:"/",maxAge:86400})}function u(a){a.delete("auth_token")}async function v(a){if("string"!=typeof a||!a)return!1;let b=await (0,n.mt)(),c=b?.password;return c?f.Ay.compare(a,c):a===(process.env.INITIAL_PASSWORD||"123456")}},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},46293:a=>{"use strict";a.exports=require("sql.js")},48645:(a,b,c)=>{"use strict";function d(a){let b=process.env.NINEROUTER_PEER_TOKEN;return!!b&&a.headers.get("x-9r-peer-token")===b}c.d(b,{M:()=>d})},49120:(a,b,c)=>{"use strict";c.d(b,{n:()=>l});var d=c(73024),e=c.n(d),f=c(33873),g=c.n(f),h=c(21820),i=c.n(h);let j="9router";function k(){return"win32"===process.platform?g().join(process.env.APPDATA||g().join(i().homedir(),"AppData","Roaming"),j):g().join(i().homedir(),`.${j}`)}let l=function(){let a=process.env.DATA_DIR;if(!a)return k();if("win32"===process.platform&&/^\//.test(a))return console.warn(`[DATA_DIR] '${a}' is a Unix path on Windows → fallback to default`),k();try{return e().mkdirSync(a,{recursive:!0}),a}catch(b){if(b?.code==="EACCES"||b?.code==="EPERM")return console.warn(`[DATA_DIR] '${a}' not writable → fallback ~/.${j}`),k();throw b}}()},54603:(a,b,c)=>{"use strict";c.d(b,{Xj:()=>q});var d=c(19713),e=c(73024),f=c.n(e),g=c(76760),h=c.n(g),i=c(77598),j=c.n(i),k=c(49120);let l=h().join(k.n,"machine-id"),m=h().join(k.n,"auth"),n=h().join(m,"cli-secret"),o=null,p=null;async function q(a=null){let b=a||process.env.MACHINE_ID_SALT||"endpoint-proxy-salt",c=function(){if(o)return o;try{if(o=f().readFileSync(l,"utf8").trim())return o}catch{}try{o=(0,d.machineIdSync)()}catch{o=j().randomUUID()}try{f().mkdirSync(k.n,{recursive:!0}),f().writeFileSync(l,o,{mode:384})}catch{}return o}(),e="9r-cli-auth"===b?function(){if(p)return p;try{if(p=f().readFileSync(n,"utf8").trim())return p}catch{}p=j().randomBytes(32).toString("hex");try{f().mkdirSync(m,{recursive:!0}),f().writeFileSync(n,p,{mode:384})}catch{}return p}():"";return j().createHash("sha256").update(c+b+e).digest("hex").substring(0,16)}},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},66136:a=>{"use strict";a.exports=require("timers")},68658:(a,b,c)=>{"use strict";c.d(b,{v5:()=>j}),c(23211);var d=c(89718),e=c(54603),f=c(33792),g=c(48645);let h=new Set(["localhost","127.0.0.1","::1"]);function i(a){if(!a)return!1;let b=String(a).trim().toLowerCase();if(b.startsWith("[")){let a=b.indexOf("]");if(-1===a)return!1;b=b.slice(1,a)}else -1!==b.indexOf(":")&&b.indexOf(":")===b.lastIndexOf(":")&&(b=b.slice(0,b.indexOf(":")));return b.startsWith("::ffff:")&&(b=b.slice(7)),h.has(b)}function j(a){if(a.headers.get("x-9r-via-proxy")||!((0,g.M)(a)&&i(a.headers.get("x-9r-real-ip"))))return!1;let b=a.headers.get("origin");if(b)try{if(!i(new URL(b).hostname))return!1}catch{return!1}return!0}},73024:a=>{"use strict";a.exports=require("node:fs")},74075:a=>{"use strict";a.exports=require("zlib")},76760:a=>{"use strict";a.exports=require("node:path")},77598:a=>{"use strict";a.exports=require("node:crypto")},78335:()=>{},79646:a=>{"use strict";a.exports=require("child_process")},79868:a=>{"use strict";a.exports=require("node:sqlite")},81787:a=>{"use strict";a.exports=require("bun:sqlite")},82323:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>A,patchFetch:()=>z,routeModule:()=>v,serverHooks:()=>y,workAsyncStorage:()=>w,workUnitAsyncStorage:()=>x});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(10246),u=c(37527);let v=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/auth/login/route",pathname:"/api/auth/login",filename:"route",bundlePath:"app/api/auth/login/route"},distDir:".next-cli-build",relativeProjectDir:"",resolvedPagePath:"/root/workspace/JRouter/src/app/api/auth/login/route.js",nextConfigOutput:"standalone",userland:()=>c(87644),...{}}),{workAsyncStorage:w,workUnitAsyncStorage:x,serverHooks:y}=v;function z(){return(0,f.patchFetch)({workAsyncStorage:w,workUnitAsyncStorage:x})}async function A(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),v.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/auth/login/route";"/index"===d&&(d="/");let f=await v.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:w,deploymentId:x,params:y,nextConfig:z,parsedUrl:A,isDraftMode:B,prerenderManifest:C,routerServerContext:D,isOnDemandRevalidate:E,revalidateOnlyGenerated:F,resolvedPathname:G,clientReferenceManifest:H,serverActionsManifest:I}=f,J=(0,j.normalizeAppPath)(d),K=!!C.routes[G]&&(v.isDev||(0,t.isRouteCacheOwner)(G,v.cacheOwner,C.routes[G])),L=!!(C.dynamicRoutes[J]||K),M=async()=>((null==D?void 0:D.render404)?await D.render404(a,b,A,!1):b.end("This page could not be found"),null);if(L&&!B){let a=C.dynamicRoutes[J];if(a&&!1===a.fallback&&!K){if(z.adapterPath)return await M();throw new s.NoFallbackError}}let N=null;!L||v.isDev||B||(N="/index"===(N=G)?"/":N);let O=!0===v.isDev||!L,P=L&&!O;I&&H&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:H,serverActionsManifest:I});let Q=a.method||"GET",R=(0,h.getTracer)(),S=R.getActiveScopeSpan(),T=!!(null==D?void 0:D.isWrappedByNextServer),U=!!(0,g.getRequestMeta)(a,"minimalMode"),V=(0,g.getRequestMeta)(a,"incrementalCache")||await v.getIncrementalCache(a,z,C,U);null==V||V.resetRequestCache(),globalThis.__incrementalCache=V;let W={params:y,previewProps:C.preview,renderOpts:{experimental:{authInterrupts:!!z.experimental.authInterrupts,useCacheTimeout:z.experimental.useCacheTimeout},cacheComponents:!!z.cacheComponents,validationLevel:z.experimental.instantInsights.validationLevel,isDraftMode:B,supportsDynamicResponse:O,incrementalCache:V,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:z.cacheLife,staticPageGenerationTimeout:z.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>v.onRequestError(a,b,d,e,D)},sharedContext:{buildId:w,deploymentId:x}},X=new k.NodeNextRequest(a),Y=new k.NodeNextResponse(b),Z=l.NextRequestAdapter.fromNodeNextRequest(X,(0,l.signalFromNodeResponse)(b)),$=async({previousCacheEntry:e})=>{try{if(!U&&E&&F&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await v.handle(Z,W);a.fetchMetrics=W.renderOpts.fetchMetrics;let f=W.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=W.renderOpts.collectedTags;if(!L)return await (0,o.I)(X,Y,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==W.renderOpts.collectedRevalidate&&!(W.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&W.renderOpts.collectedRevalidate,e=void 0===W.renderOpts.collectedExpire||W.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?z.expireTime:void 0:W.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await v.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:P,isOnDemandRevalidate:E})},!1,D),b}},_=async(d,f)=>{try{var g,i;let d=await v.handleResponse({req:a,nextConfig:z,cacheKey:N,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:C,isRoutePPREnabled:!1,isOnDemandRevalidate:E,revalidateOnlyGenerated:F,responseGenerator:$,waitUntil:c.waitUntil,isMinimalMode:U});if(!L)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});U||b.setHeader("x-nextjs-cache",E?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),B&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);U&&L||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(X,Y,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await v.onRequestError(a,b,{routerKind:"App Router",routePath:J,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:P,isOnDemandRevalidate:E})},!1,D),L)throw b;await (0,o.I)(X,Y,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=R.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||J,g=`${Q} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(T&&S)await _(S,void 0);else{let b=R.getActiveScopeSpan();await R.withPropagatedContext(a.headers,()=>R.trace(m.BaseServerSpan.handleRequest,{spanName:`${Q} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":Q,"http.target":a.url}},a=>_(a,b)),void 0,!T)}}},83997:a=>{"use strict";a.exports=require("tty")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87550:a=>{"use strict";a.exports=require("better-sqlite3")},87644:(a,b,c)=>{"use strict";c.r(b),c.d(b,{POST:()=>o});var d=c(23211),e=c(89718),f=c(34013),g=c(65573),h=c(33792),i=c(30906),j=c(7985),k=c(8303),l=c(68658);let m="Forgot password? Reset to default via 9Router CLI → Settings → Reset Password to Default.",n={"Cache-Control":"no-store"};async function o(a){try{let b,c,o,p=(0,k.T1)(a),q=(0,k.sv)(p);if(q.locked)return d.NextResponse.json({error:`Too many failed attempts. Try again in ${q.retryAfter}s. ${m}`,retryAfter:q.retryAfter,resetHint:m},{status:429,headers:{"Retry-After":String(q.retryAfter)}});let{password:r}=await a.json(),s=await (0,e.mt)();if(b=(a.headers.get("host")||"").split(":")[0].toLowerCase(),c=s.tunnelUrl?new URL(s.tunnelUrl).hostname.toLowerCase():"",o=s.tailscaleUrl?new URL(s.tailscaleUrl).hostname.toLowerCase():"",(c&&b===c||o&&b===o)&&!0!==s.tunnelDashboardAccess)return d.NextResponse.json({error:"Dashboard access via tunnel is disabled"},{status:403});let t=s.password;if("sso"===s.authMode||"saml"===s.authMode||"oidc"===s.authMode){let a=s.ssoType||("saml"===s.authMode?"saml":"oidc");if("saml"===a&&(0,j.eI)(s))return d.NextResponse.json({error:"Password login is disabled. Use SAML SSO sign in."},{status:403});if("oidc"===a&&(0,i.EJ)(s))return d.NextResponse.json({error:"Password login is disabled. Use OIDC sign in."},{status:403})}let u=!1;if(t)u=await f.Ay.compare(r,t);else{let a=process.env.INITIAL_PASSWORD||"123456";u=r===a}if(u){(0,k.B3)(p);let b=!t&&!process.env.INITIAL_PASSWORD&&!(0,l.v5)(a);if(b)return d.NextResponse.json({success:!1,error:"Default password must be changed before remote access. Change it from the local machine (or set INITIAL_PASSWORD).",mustChangePassword:b},{status:403,headers:n});let c=await (0,g.UL)();return await (0,h.tm)(c,a),d.NextResponse.json({success:!0,mustChangePassword:!1},{headers:n})}let{remainingBeforeLock:v}=(0,k.im)(p),w=(0,k.sv)(p);if(w.locked)return d.NextResponse.json({error:`Too many failed attempts. Try again in ${w.retryAfter}s. ${m}`,retryAfter:w.retryAfter,resetHint:m},{status:429,headers:{"Retry-After":String(w.retryAfter)}});return d.NextResponse.json({error:`Invalid password. ${v} attempt(s) left before lockout.`,remainingBeforeLock:v},{status:401})}catch(a){return d.NextResponse.json({error:a.message},{status:500})}}},89718:(a,b,c)=>{"use strict";c.d(b,{CG:()=>d.CG,Dj:()=>d.Dj,Fh:()=>d.getProviderNodes,Iq:()=>d.Iq,K1:()=>d.K1,KJ:()=>d.KJ,L:()=>d.L,L9:()=>d.L9,Lh:()=>d.Lh,Mc:()=>d.Mc,OM:()=>d.OM,PX:()=>d.PX,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Uv:()=>d.Uv,VT:()=>d.VT,XW:()=>d.XW,Xx:()=>d.Xx,Yd:()=>d.Yd,ZO:()=>d.ZO,bI:()=>d.bI,c:()=>d.c,ek:()=>d.ek,fK:()=>d.fK,fv:()=>d.fv,getProviderConnections:()=>d.P,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,iE:()=>d.iE,jd:()=>d.jd,mt:()=>d.mt,o5:()=>d.o5,oG:()=>d.oG,op:()=>d.op,r4:()=>d.r4,uL:()=>d.uL,ui:()=>d.ui,updateProviderConnection:()=>d.rj,uv:()=>d.getCustomModels,yF:()=>d.yF,yg:()=>d.yg,zP:()=>d.zP});var d=c(83192)},94735:a=>{"use strict";a.exports=require("events")},96487:()=>{}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[2970,1813,2391,8292,5573,6140,5081,6674,4642,3192],()=>b(b.s=82323));module.exports=c})();
|
|
3
|
+
-----END CERTIFICATE-----`}function f(a){return!!(a?.samlEntryPoint&&a?.samlCert)}function g(a){return(a||"").replace(/\/+$/,"")}function h(a,b){let c=(b?.baseUrl||"").trim()||process.env.BASE_URL||"http://localhost:20128";if(c)return g(c);if(a){let b=a?.headers?.get?.("x-forwarded-proto")||"",c=a?.headers?.get?.("x-forwarded-host")||a?.headers?.get?.("host")||"";if(c){let d=(b||new URL(a.url).protocol||"http:").replace(/:$/,"");return`${d}://${c}`.replace(/\/+$/,"")}if(a.url)return g(new URL(a.url).origin)}return"http://localhost:20128"}function i(a,b){let c=e(a?.samlCert||"")||"-----BEGIN CERTIFICATE-----\nMIIC...DUMMY...\n-----END CERTIFICATE-----",f=`${b}/api/auth/saml/acs`;return new d.Qb({entryPoint:a?.samlEntryPoint||"https://example.com/sso",issuer:a?.samlIssuer||"urn:jrouter:sp",idpCert:c,cert:c,callbackUrl:f,acceptedClockSkewMs:6e4,wantAssertionsSigned:!0,validateInResponseTo:"never",requestIdExpirationMs:288e5})}async function j(a,b){let c=h(a,b),d=i(b,c),e=await d.generateAuthorizeRequestAsync(!1,!1),f=e.match(/ID="([^"]+)"/),g=f?f[1]:"";return{authorizeUrl:await d._requestToUrlAsync(e,null,"authorize",{}),requestId:g}}async function k(a,b,c,d){if(!d?.samlCert)throw Error("IdP X.509 Certificate (samlCert) is missing or not configured");let e=h(a,d),f=i(d,e),g=("object"==typeof b&&null!==b?b:{SAMLResponse:b}).SAMLResponse;if(!g)throw Error("Missing SAMLResponse parameter in assertion POST body");if(c){let a=Buffer.from(g,"base64").toString("utf8").match(/InResponseTo=["']([^"']+)["']/i),b=a?a[1]:null;if(!b||b!==c)throw Error(`InResponseTo mismatch: expected ${c}, received ${b||"none"}`)}let j=await f.validatePostResponseAsync({SAMLResponse:g});return j?.profile||j}function l(a,b){return i(b,a).generateServiceProviderMetadata()}function m(a={},b={}){if(!a)return"";let c=b.samlAttributeEmail;if(c&&a[c]){let b=a[c];return Array.isArray(b)?b[0]:String(b)}let d=["email","emailAddress","mail","nameID","nameId","upn","http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress","http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier","http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn"];for(let b of d)if(a[b]){let c=a[b];return Array.isArray(c)?c[0]:String(c)}if(a.attributes){for(let b of d)if(a.attributes[b]){let c=a.attributes[b];return Array.isArray(c)?c[0]:String(c)}}return""}function n(a={},b={}){if(!a)return"";let c=b.samlAttributeName;if(c&&a[c]){let b=a[c];return Array.isArray(b)?b[0]:String(b)}for(let b of["displayName","name","cn","commonName","http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name","http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname"])if(a[b]){let c=a[b];return Array.isArray(c)?c[0]:String(c)}if(a.givenName||a.sn||a.surname){let b=a.givenName||"",c=a.sn||a.surname||"",d=`${b} ${c}`.trim();if(d)return d}return m(a,b)}c(42655)},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},8303:(a,b,c)=>{"use strict";c.d(b,{B3:()=>k,T1:()=>l,im:()=>j,sv:()=>i});var d=c(48645);let e=[3e4,12e4,6e5,18e5],f=new Map;function g(){return Date.now()}function h(a){let b=f.get(a);return b?b.lastFailAt&&g()-b.lastFailAt>36e5&&(!b.lockUntil||g()>=b.lockUntil)?(f.delete(a),null):b:null}function i(a){let b=h(a);if(!b||!b.lockUntil)return{locked:!1};let c=b.lockUntil-g();return c<=0?{locked:!1}:{locked:!0,retryAfter:Math.ceil(c/1e3)}}function j(a){let b=h(a)||{fails:0,lockUntil:0,lockLevel:0,lastFailAt:0};if(b.fails+=1,b.lastFailAt=g(),b.fails>=5){let a=e[Math.min(b.lockLevel,e.length-1)];b.lockUntil=g()+a,b.lockLevel+=1,b.fails=0}return f.set(a,b),{remainingBeforeLock:Math.max(0,5-b.fails)}}function k(a){f.delete(a)}function l(a){if((0,d.M)(a)){let b=a.headers.get("x-9r-real-ip");if(b)return b}if("true"===process.env.TRUST_PROXY){let b=a.headers.get("x-forwarded-for");if(b)return b.split(",")[0].trim()}return"unknown"}},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},11723:a=>{"use strict";a.exports=require("querystring")},16698:a=>{"use strict";a.exports=require("node:async_hooks")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{"use strict";a.exports=require("os")},27910:a=>{"use strict";a.exports=require("stream")},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},30906:(a,b,c)=>{"use strict";let d;c.d(b,{gR:()=>E,hT:()=>D,Pf:()=>C,GY:()=>B,sP:()=>F,Ir:()=>A,Mj:()=>z,iw:()=>x,EJ:()=>y,Ui:()=>I,Rj:()=>J,HO:()=>G,x8:()=>H});var e=c(77598),f=c.n(e),g=c(99129),h=c(64416),i=c(80700),j=c(38805);async function k(a,b,c){let d=a.get(b)||a.set(b,{}).get(b),{alg:e}=c;if(void 0===d[e]){let a=(0,h.xY)(c,b,!0).then(a=>{if("public"!==a.type)throw new g.Dm("JSON Web Key Set members must be public keys");return d[e]=a,a}).catch(b=>{throw d[e]===a&&delete d[e],b});d[e]=a}return d[e]}function l(a){let b;try{b=structuredClone(a)}catch{}if(!(0,j.fV)(b))throw new g.Dm("JSON Web Key Set malformed");let c=b.keys.map(a=>{let b=(0,h.ZZ)(a);return Array.isArray(b.key_ops)&&(b.key_ops=[...b.key_ops]),b}),d=new WeakMap;return Object.defineProperty(async(a,e)=>{let{alg:f,kid:h}={...a,...e?.header},j="string"==typeof f?i.p[f]:void 0;if(!j||j.secret)throw new g.T0('Unsupported "alg" value for a JSON Web Key Set');let l=b.keys.filter((a,b)=>(function(a,b,c,d){let{kty:e,key_ops:f,ext:g,kid:h,alg:i,use:j,crv:k}=a;return(void 0===g||"boolean"==typeof g)&&(void 0===f||Array.isArray(f)&&f.every((a,b)=>"string"==typeof a&&f.indexOf(a)===b)&&f.includes("verify"))&&b.kty.includes(e)&&(void 0===d||"string"==typeof d&&d===h)&&(void 0===i?"AKP"!==e:c===i)&&(void 0===j||"sig"===j)&&(!b.crv||k===b.crv)})(c[b],j,f,h)),{0:m,length:n}=l;if(!n)throw new g.BT;if(1!==n){let a=new g.$4;throw a[Symbol.asyncIterator]=async function*(){for(let a of l)try{yield await k(d,a,j)}catch{}},a}return k(d,m,j)},"jwks",{value:()=>structuredClone(b)})}(typeof navigator>"u"||!navigator.userAgent?.startsWith?.("Mozilla/5.0 "))&&(d="jose/v6.2.12");let m=Symbol();async function n(a,b,c,d=fetch){let e=await d(a,{method:"GET",signal:c,redirect:"manual",headers:b}).catch(a=>{throw"TimeoutError"===a.name?new g.xb:a});if(200!==e.status)throw new g.i4("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await e.json()}catch{throw new g.i4("Failed to parse the JSON Web Key Set HTTP response as JSON")}}let o=Symbol();function p(a,b){return Number.isFinite(a)&&Date.now()<a+b}function q(a,b,c){if(Number.isNaN(a))throw TypeError(`"${c}" option must not be NaN`);return"number"==typeof a?a:b}var r=c(17509),s=c(89718);let t="openid profile email",u="Sign in with OIDC";function v(a){return(a||"").trim().replace(/\/+$/,"")}function w(a){return(a||t).trim()||t}function x(a){let b=process.env.BASE_URL||"http://localhost:20128";if(b)return v(b);let c=a?.headers?.get?.("x-forwarded-proto")||"",d=a?.headers?.get?.("x-forwarded-host")||a?.headers?.get?.("host")||"";if(d){let b=(c||new URL(a.url).protocol||"http:").replace(/:$/,"");return`${b}://${d}`.replace(/\/+$/,"")}return v(new URL(a.url).origin)}function y(a){return!!(v(a?.oidcIssuerUrl)&&(a?.oidcClientId||"").trim()&&(a?.oidcClientSecret||"").trim())}async function z(){let a=await (0,s.mt)();return["oidc","both"].includes(a.authMode)&&y(a)?{issuerUrl:v(a.oidcIssuerUrl),clientId:a.oidcClientId.trim(),clientSecret:a.oidcClientSecret.trim(),scopes:w(a.oidcScopes),loginLabel:(a.oidcLoginLabel||u).trim()||u}:null}async function A(a){let b=`${v(a)}/.well-known/openid-configuration`,c=await fetch(b,{cache:"no-store"});if(!c.ok)throw Error(`Failed to load OIDC discovery document from ${b}`);return await c.json()}function B(){let a=f().randomBytes(32).toString("base64url"),b=f().createHash("sha256").update(a).digest("base64url");return{verifier:a,challenge:b}}function C(){return f().randomBytes(16).toString("base64url")}function D(){return f().randomBytes(16).toString("base64url")}function E({authorizationEndpoint:a,clientId:b,redirectUri:c,scopes:d=t,state:e,nonce:f,codeChallenge:g}){let h=new URL(a);return h.searchParams.set("response_type","code"),h.searchParams.set("client_id",b),h.searchParams.set("redirect_uri",c),h.searchParams.set("scope",w(d)),h.searchParams.set("state",e),h.searchParams.set("nonce",f),h.searchParams.set("code_challenge",g),h.searchParams.set("code_challenge_method","S256"),h.toString()}async function F({tokenEndpoint:a,clientId:b,clientSecret:c,code:d,redirectUri:e,codeVerifier:f}){let g=new URLSearchParams({grant_type:"authorization_code",client_id:b,code:d,redirect_uri:e,code_verifier:f});c&&g.set("client_secret",c);let h=await fetch(a,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:g}),i=await h.json().catch(()=>({}));if(!h.ok)throw Error(i?.error_description||i?.error||`OIDC token exchange failed (${h.status})`);return i}async function G({tokenEndpoint:a,clientId:b,clientSecret:c,redirectUri:d}){if(!c)return{tested:!1,valid:null,message:"No client secret was provided, so secret validation was skipped."};let e=new URLSearchParams({grant_type:"authorization_code",client_id:b,client_secret:c,code:"__oidc_test_invalid_code__",redirect_uri:d,code_verifier:"__oidc_test_invalid_verifier__"}),f=await fetch(a,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:e}),g=await f.json().catch(()=>({})),h=(g?.error||"").toLowerCase(),i=g?.error_description||g?.error||"";return f.ok?{tested:!0,valid:!0,message:"Client secret was accepted by the token endpoint.",raw:g}:"invalid_client"===h||"unauthorized_client"===h||/client.*(invalid|failed|mismatch)/i.test(i)?{tested:!0,valid:!1,message:i||"Client secret is not valid.",raw:g}:"invalid_grant"===h||"invalid_code"===h||/grant|code/i.test(i)?{tested:!0,valid:!0,message:"Client secret was accepted; the token exchange failed only because the test authorization code is invalid.",raw:g}:{tested:!0,valid:null,message:i||`Token endpoint responded with ${f.status}`,raw:g}}async function H({idToken:a,issuer:b,audience:c,jwksUri:e,nonce:f}){let h=function(a){if(!(a instanceof URL))throw TypeError("url must be an instance of URL");let b=new URL(a.href).href,c=(void 0)??{},e=c.timeoutDuration;if("number"==typeof e&&(!Number.isInteger(e)||e<0))throw TypeError('"timeoutDuration" option must be a non-negative integer');let f="number"==typeof e?e:5e3,h=q(c.cooldownDuration,3e4,"cooldownDuration"),i=q(c.cacheMaxAge,6e5,"cacheMaxAge"),k=new Headers(c.headers);d&&!k.has("User-Agent")&&k.set("User-Agent",d),k.has("accept")||k.set("accept","application/json, application/jwk-set+json");let r=c[m],s=c[o],t,u,v=0,w=0,x;if(s&&"object"==typeof s){let{uat:a,jwks:b}=s;p(a,i)&&(0,j.fV)(b)&&(t=a,x=l(b))}let y=async()=>{if(u&&("u">typeof WebSocketPair||"u">typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||"u">typeof EdgeRuntime&&"vercel"===EdgeRuntime)&&(u=void 0),!u){let a=++v,c=u=n(b,k,AbortSignal.timeout(f),r).then(b=>{let c=l(b);if(a<=w)return;x=c;let d=Date.now();s&&(s.uat=d,s.jwks=b),t=d,w=a}).finally(()=>{u===c&&(u=void 0)})}await u};return Object.defineProperties(async(a,b)=>{x&&p(t,i)||await y();try{return await x(a,b)}catch(c){if(c instanceof g.BT&&!p(t,h))return await y(),x(a,b);throw c}},{coolingDown:{get:()=>p(t,h),enumerable:!0},fresh:{get:()=>p(t,i),enumerable:!0},reload:{value:y,enumerable:!0},reloading:{get:()=>!!u,enumerable:!0},jwks:{value:()=>x?.jwks(),enumerable:!0}})}(new URL(e)),{payload:i}=await (0,r.V)(a,h,{issuer:b,audience:c,nonce:f});return i}function I(a={}){return a.preferred_username||a.email||a.name||a.given_name||a.sub||"OIDC user"}function J(a={}){return a.email||""}},33792:(a,b,c)=>{"use strict";c.d(b,{Dc:()=>r,OZ:()=>u,YK:()=>p,dY:()=>s,nz:()=>v,tm:()=>t});var d=c(8292),e=c(17509),f=c(34013),g=c(73024),h=c.n(g),i=c(76760),j=c.n(i),k=c(77598),l=c.n(k),m=c(49120),n=c(89718);let o=new TextEncoder().encode(function(){if(process.env.JWT_SECRET)return process.env.JWT_SECRET;let a=j().join(m.n,"jwt-secret");try{return h().readFileSync(a,"utf8").trim()}catch{}h().mkdirSync(m.n,{recursive:!0});let b=l().randomBytes(32).toString("hex");return h().writeFileSync(a,b,{mode:384}),b}());function p(a){let b="true"===process.env.AUTH_COOKIE_SECURE,c=a?.headers?.get?.("x-forwarded-proto");return b||"https"===c}async function q(a={}){return new d.P({authenticated:!0,...a}).setProtectedHeader({alg:"HS256"}).setIssuedAt().setExpirationTime("24h").sign(o)}async function r(a){if(!a)return!1;try{return await (0,e.V)(a,o),!0}catch{return!1}}async function s(a){if(!a)return null;try{let{payload:b}=await (0,e.V)(a,o);return b}catch{return null}}async function t(a,b,c={}){let d=await q(c);a.set("auth_token",d,{httpOnly:!0,secure:p(b),sameSite:"lax",path:"/",maxAge:86400})}function u(a){a.delete("auth_token")}async function v(a){if("string"!=typeof a||!a)return!1;let b=await (0,n.mt)(),c=b?.password;return c?f.Ay.compare(a,c):a===(process.env.INITIAL_PASSWORD||"123456")}},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},46293:a=>{"use strict";a.exports=require("sql.js")},48645:(a,b,c)=>{"use strict";function d(a){let b=process.env.JROUTER_PEER_TOKEN;return!!b&&a.headers.get("x-9r-peer-token")===b}c.d(b,{M:()=>d})},49120:(a,b,c)=>{"use strict";c.d(b,{n:()=>l});var d=c(73024),e=c.n(d),f=c(33873),g=c.n(f),h=c(21820),i=c.n(h);let j="jrouter";function k(){return"win32"===process.platform?g().join(process.env.APPDATA||g().join(i().homedir(),"AppData","Roaming"),j):g().join(i().homedir(),`.${j}`)}let l=function(){let a=process.env.DATA_DIR;if(!a)return k();if("win32"===process.platform&&/^\//.test(a))return console.warn(`[DATA_DIR] '${a}' is a Unix path on Windows → fallback to default`),k();try{return e().mkdirSync(a,{recursive:!0}),a}catch(b){if(b?.code==="EACCES"||b?.code==="EPERM")return console.warn(`[DATA_DIR] '${a}' not writable → fallback ~/.${j}`),k();throw b}}()},54603:(a,b,c)=>{"use strict";c.d(b,{Xj:()=>q});var d=c(19713),e=c(73024),f=c.n(e),g=c(76760),h=c.n(g),i=c(77598),j=c.n(i),k=c(49120);let l=h().join(k.n,"machine-id"),m=h().join(k.n,"auth"),n=h().join(m,"cli-secret"),o=null,p=null;async function q(a=null){let b=a||process.env.MACHINE_ID_SALT||"endpoint-proxy-salt",c=function(){if(o)return o;try{if(o=f().readFileSync(l,"utf8").trim())return o}catch{}try{o=(0,d.machineIdSync)()}catch{o=j().randomUUID()}try{f().mkdirSync(k.n,{recursive:!0}),f().writeFileSync(l,o,{mode:384})}catch{}return o}(),e="jr-cli-auth"===b?function(){if(p)return p;try{if(p=f().readFileSync(n,"utf8").trim())return p}catch{}p=j().randomBytes(32).toString("hex");try{f().mkdirSync(m,{recursive:!0}),f().writeFileSync(n,p,{mode:384})}catch{}return p}():"";return j().createHash("sha256").update(c+b+e).digest("hex").substring(0,16)}},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},66136:a=>{"use strict";a.exports=require("timers")},68658:(a,b,c)=>{"use strict";c.d(b,{v5:()=>j}),c(23211);var d=c(89718),e=c(54603),f=c(33792),g=c(48645);let h=new Set(["localhost","127.0.0.1","::1"]);function i(a){if(!a)return!1;let b=String(a).trim().toLowerCase();if(b.startsWith("[")){let a=b.indexOf("]");if(-1===a)return!1;b=b.slice(1,a)}else -1!==b.indexOf(":")&&b.indexOf(":")===b.lastIndexOf(":")&&(b=b.slice(0,b.indexOf(":")));return b.startsWith("::ffff:")&&(b=b.slice(7)),h.has(b)}function j(a){if(a.headers.get("x-9r-via-proxy")||!((0,g.M)(a)&&i(a.headers.get("x-9r-real-ip"))))return!1;let b=a.headers.get("origin");if(b)try{if(!i(new URL(b).hostname))return!1}catch{return!1}return!0}},73024:a=>{"use strict";a.exports=require("node:fs")},74075:a=>{"use strict";a.exports=require("zlib")},76760:a=>{"use strict";a.exports=require("node:path")},77598:a=>{"use strict";a.exports=require("node:crypto")},78335:()=>{},79646:a=>{"use strict";a.exports=require("child_process")},79868:a=>{"use strict";a.exports=require("node:sqlite")},81787:a=>{"use strict";a.exports=require("bun:sqlite")},82323:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>A,patchFetch:()=>z,routeModule:()=>v,serverHooks:()=>y,workAsyncStorage:()=>w,workUnitAsyncStorage:()=>x});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(10246),u=c(37527);let v=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/auth/login/route",pathname:"/api/auth/login",filename:"route",bundlePath:"app/api/auth/login/route"},distDir:".next-cli-build",relativeProjectDir:"",resolvedPagePath:"/root/workspace/JRouter/src/app/api/auth/login/route.js",nextConfigOutput:"standalone",userland:()=>c(87644),...{}}),{workAsyncStorage:w,workUnitAsyncStorage:x,serverHooks:y}=v;function z(){return(0,f.patchFetch)({workAsyncStorage:w,workUnitAsyncStorage:x})}async function A(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),v.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/auth/login/route";"/index"===d&&(d="/");let f=await v.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:w,deploymentId:x,params:y,nextConfig:z,parsedUrl:A,isDraftMode:B,prerenderManifest:C,routerServerContext:D,isOnDemandRevalidate:E,revalidateOnlyGenerated:F,resolvedPathname:G,clientReferenceManifest:H,serverActionsManifest:I}=f,J=(0,j.normalizeAppPath)(d),K=!!C.routes[G]&&(v.isDev||(0,t.isRouteCacheOwner)(G,v.cacheOwner,C.routes[G])),L=!!(C.dynamicRoutes[J]||K),M=async()=>((null==D?void 0:D.render404)?await D.render404(a,b,A,!1):b.end("This page could not be found"),null);if(L&&!B){let a=C.dynamicRoutes[J];if(a&&!1===a.fallback&&!K){if(z.adapterPath)return await M();throw new s.NoFallbackError}}let N=null;!L||v.isDev||B||(N="/index"===(N=G)?"/":N);let O=!0===v.isDev||!L,P=L&&!O;I&&H&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:H,serverActionsManifest:I});let Q=a.method||"GET",R=(0,h.getTracer)(),S=R.getActiveScopeSpan(),T=!!(null==D?void 0:D.isWrappedByNextServer),U=!!(0,g.getRequestMeta)(a,"minimalMode"),V=(0,g.getRequestMeta)(a,"incrementalCache")||await v.getIncrementalCache(a,z,C,U);null==V||V.resetRequestCache(),globalThis.__incrementalCache=V;let W={params:y,previewProps:C.preview,renderOpts:{experimental:{authInterrupts:!!z.experimental.authInterrupts,useCacheTimeout:z.experimental.useCacheTimeout},cacheComponents:!!z.cacheComponents,validationLevel:z.experimental.instantInsights.validationLevel,isDraftMode:B,supportsDynamicResponse:O,incrementalCache:V,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:z.cacheLife,staticPageGenerationTimeout:z.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>v.onRequestError(a,b,d,e,D)},sharedContext:{buildId:w,deploymentId:x}},X=new k.NodeNextRequest(a),Y=new k.NodeNextResponse(b),Z=l.NextRequestAdapter.fromNodeNextRequest(X,(0,l.signalFromNodeResponse)(b)),$=async({previousCacheEntry:e})=>{try{if(!U&&E&&F&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await v.handle(Z,W);a.fetchMetrics=W.renderOpts.fetchMetrics;let f=W.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=W.renderOpts.collectedTags;if(!L)return await (0,o.I)(X,Y,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==W.renderOpts.collectedRevalidate&&!(W.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&W.renderOpts.collectedRevalidate,e=void 0===W.renderOpts.collectedExpire||W.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?z.expireTime:void 0:W.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await v.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:P,isOnDemandRevalidate:E})},!1,D),b}},_=async(d,f)=>{try{var g,i;let d=await v.handleResponse({req:a,nextConfig:z,cacheKey:N,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:C,isRoutePPREnabled:!1,isOnDemandRevalidate:E,revalidateOnlyGenerated:F,responseGenerator:$,waitUntil:c.waitUntil,isMinimalMode:U});if(!L)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});U||b.setHeader("x-nextjs-cache",E?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),B&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);U&&L||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(X,Y,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await v.onRequestError(a,b,{routerKind:"App Router",routePath:J,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:P,isOnDemandRevalidate:E})},!1,D),L)throw b;await (0,o.I)(X,Y,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=R.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||J,g=`${Q} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(T&&S)await _(S,void 0);else{let b=R.getActiveScopeSpan();await R.withPropagatedContext(a.headers,()=>R.trace(m.BaseServerSpan.handleRequest,{spanName:`${Q} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":Q,"http.target":a.url}},a=>_(a,b)),void 0,!T)}}},83997:a=>{"use strict";a.exports=require("tty")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87550:a=>{"use strict";a.exports=require("better-sqlite3")},87644:(a,b,c)=>{"use strict";c.r(b),c.d(b,{POST:()=>o});var d=c(23211),e=c(89718),f=c(34013),g=c(65573),h=c(33792),i=c(30906),j=c(7985),k=c(8303),l=c(68658);let m="Forgot password? Reset to default via JRouter CLI → Settings → Reset Password to Default.",n={"Cache-Control":"no-store"};async function o(a){try{let b,c,o,p=(0,k.T1)(a),q=(0,k.sv)(p);if(q.locked)return d.NextResponse.json({error:`Too many failed attempts. Try again in ${q.retryAfter}s. ${m}`,retryAfter:q.retryAfter,resetHint:m},{status:429,headers:{"Retry-After":String(q.retryAfter)}});let{password:r}=await a.json(),s=await (0,e.mt)();if(b=(a.headers.get("host")||"").split(":")[0].toLowerCase(),c=s.tunnelUrl?new URL(s.tunnelUrl).hostname.toLowerCase():"",o=s.tailscaleUrl?new URL(s.tailscaleUrl).hostname.toLowerCase():"",(c&&b===c||o&&b===o)&&!0!==s.tunnelDashboardAccess)return d.NextResponse.json({error:"Dashboard access via tunnel is disabled"},{status:403});let t=s.password;if("sso"===s.authMode||"saml"===s.authMode||"oidc"===s.authMode){let a=s.ssoType||("saml"===s.authMode?"saml":"oidc");if("saml"===a&&(0,j.eI)(s))return d.NextResponse.json({error:"Password login is disabled. Use SAML SSO sign in."},{status:403});if("oidc"===a&&(0,i.EJ)(s))return d.NextResponse.json({error:"Password login is disabled. Use OIDC sign in."},{status:403})}let u=!1;if(t)u=await f.Ay.compare(r,t);else{let a=process.env.INITIAL_PASSWORD||"123456";u=r===a}if(u){(0,k.B3)(p);let b=!t&&!process.env.INITIAL_PASSWORD&&!(0,l.v5)(a);if(b)return d.NextResponse.json({success:!1,error:"Default password must be changed before remote access. Change it from the local machine (or set INITIAL_PASSWORD).",mustChangePassword:b},{status:403,headers:n});let c=await (0,g.UL)();return await (0,h.tm)(c,a),d.NextResponse.json({success:!0,mustChangePassword:!1},{headers:n})}let{remainingBeforeLock:v}=(0,k.im)(p),w=(0,k.sv)(p);if(w.locked)return d.NextResponse.json({error:`Too many failed attempts. Try again in ${w.retryAfter}s. ${m}`,retryAfter:w.retryAfter,resetHint:m},{status:429,headers:{"Retry-After":String(w.retryAfter)}});return d.NextResponse.json({error:`Invalid password. ${v} attempt(s) left before lockout.`,remainingBeforeLock:v},{status:401})}catch(a){return d.NextResponse.json({error:a.message},{status:500})}}},89718:(a,b,c)=>{"use strict";c.d(b,{CG:()=>d.CG,Dj:()=>d.Dj,Fh:()=>d.getProviderNodes,Iq:()=>d.Iq,K1:()=>d.K1,KJ:()=>d.KJ,L:()=>d.L,L9:()=>d.L9,Lh:()=>d.Lh,Mc:()=>d.Mc,OM:()=>d.OM,PX:()=>d.PX,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Uv:()=>d.Uv,VT:()=>d.VT,XW:()=>d.XW,Xx:()=>d.Xx,Yd:()=>d.Yd,ZO:()=>d.ZO,bI:()=>d.bI,c:()=>d.c,ek:()=>d.ek,fK:()=>d.fK,fv:()=>d.fv,getProviderConnections:()=>d.P,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,iE:()=>d.iE,jd:()=>d.jd,mt:()=>d.mt,o5:()=>d.o5,oG:()=>d.oG,op:()=>d.op,r4:()=>d.r4,uL:()=>d.uL,ui:()=>d.ui,updateProviderConnection:()=>d.rj,uv:()=>d.getCustomModels,yF:()=>d.yF,yg:()=>d.yg,zP:()=>d.zP});var d=c(83192)},94735:a=>{"use strict";a.exports=require("events")},96487:()=>{}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[2970,1813,2391,8292,5573,6140,5081,6674,4642,3192],()=>b(b.s=82323));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var a={};a.id=8489,a.ids=[8489],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},16698:a=>{"use strict";a.exports=require("node:async_hooks")},17509:(a,b,c)=>{"use strict";c.d(b,{V:()=>m});var d=c(80700),e=c(99129),f=c(73575),g=c(38805),h=c(64416);function i(a){try{return(0,f.lF)(a)}catch{throw new e.Ye("JWS Compact Serialization payload must use only ASCII characters")}}async function j(a,b,c,i,j){let{protected:k,header:l,payload:m}=a,n=j??(void 0===k?{}:(0,g.OX)(k,e.Ye,"JWS Protected Header is invalid"));if(!(0,g.fz)(n,l))throw new e.Ye("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let o={...n,...l},p=(0,g.J0)(n,(0,g.nI)(e.Ye,g.qc,b[1],n,o)),{alg:q}=o;if("string"!=typeof q||!q)throw new e.Ye('JWS "alg" (Algorithm) Header Parameter missing or invalid');if(b[0]&&!b[0].has(q))throw new e.Rb('"alg" (Algorithm) Header Parameter value not allowed');if(p){if("string"!=typeof m)throw new e.Ye("JWS Payload must be a string")}else if("string"!=typeof m&&!(m instanceof Uint8Array))throw new e.Ye("JWS Payload must be a string or an Uint8Array instance");let r=p||"string"!=typeof m?m:i(m),s=!1;"function"==typeof c&&(c=await c(n,a),s=!0);let t=(0,d.q)(q),u=(0,f.xW)(void 0!==k?(0,f.lF)(k):new Uint8Array,(0,f.lF)("."),"string"==typeof r?b[2]??=(0,g.Fo)(r,"payload",e.Ye):r),v=(0,g.h2)(a.signature,"signature",e.Ye),w=await (0,h.dT)(t,c,"verify"),x=await (0,h.GK)(w,t.subtle,"verify");t.minRsaBits&&(0,h.or)(t.alg,x);let y=!1;try{y=await crypto.subtle.verify(t.signing,x,v,u)}catch{}if(!y)throw new e.h2;let z={payload:"string"==typeof r?(0,g.h2)(r,"payload",e.Ye):r};return void 0!==k&&(z.protectedHeader=n),void 0!==l&&(z.unprotectedHeader=l),s?[{...z,key:w},p]:[z,p]}async function k(a,b,c){if(a instanceof Uint8Array&&(a=f.D0.decode(a)),"string"!=typeof a)throw new e.Ye("Compact JWS must be a string or Uint8Array");let{0:d,1:g,2:h,length:k}=a.split(".");if(3!==k)throw new e.Ye("Invalid Compact JWS");return j({payload:g,protected:d,signature:h},b,c,i)}var l=c(17347);async function m(a,b,c){let[d,f]=await k(a,[c&&(0,g.Fw)("algorithms",c.algorithms),c?.crit],b);if(!f)throw new e.Dp("JWTs MUST NOT use unencoded payload");let h=(0,l.k6)(d.protectedHeader,d.payload,c);return{...d,payload:h}}},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{"use strict";a.exports=require("os")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33792:(a,b,c)=>{"use strict";c.d(b,{Dc:()=>r,OZ:()=>u,YK:()=>p,dY:()=>s,nz:()=>v,tm:()=>t});var d=c(8292),e=c(17509),f=c(34013),g=c(73024),h=c.n(g),i=c(76760),j=c.n(i),k=c(77598),l=c.n(k),m=c(49120),n=c(89718);let o=new TextEncoder().encode(function(){if(process.env.JWT_SECRET)return process.env.JWT_SECRET;let a=j().join(m.n,"jwt-secret");try{return h().readFileSync(a,"utf8").trim()}catch{}h().mkdirSync(m.n,{recursive:!0});let b=l().randomBytes(32).toString("hex");return h().writeFileSync(a,b,{mode:384}),b}());function p(a){let b="true"===process.env.AUTH_COOKIE_SECURE,c=a?.headers?.get?.("x-forwarded-proto");return b||"https"===c}async function q(a={}){return new d.P({authenticated:!0,...a}).setProtectedHeader({alg:"HS256"}).setIssuedAt().setExpirationTime("24h").sign(o)}async function r(a){if(!a)return!1;try{return await (0,e.V)(a,o),!0}catch{return!1}}async function s(a){if(!a)return null;try{let{payload:b}=await (0,e.V)(a,o);return b}catch{return null}}async function t(a,b,c={}){let d=await q(c);a.set("auth_token",d,{httpOnly:!0,secure:p(b),sameSite:"lax",path:"/",maxAge:86400})}function u(a){a.delete("auth_token")}async function v(a){if("string"!=typeof a||!a)return!1;let b=await (0,n.mt)(),c=b?.password;return c?f.Ay.compare(a,c):a===(process.env.INITIAL_PASSWORD||"123456")}},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},46293:a=>{"use strict";a.exports=require("sql.js")},49120:(a,b,c)=>{"use strict";c.d(b,{n:()=>l});var d=c(73024),e=c.n(d),f=c(33873),g=c.n(f),h=c(21820),i=c.n(h);let j="9router";function k(){return"win32"===process.platform?g().join(process.env.APPDATA||g().join(i().homedir(),"AppData","Roaming"),j):g().join(i().homedir(),`.${j}`)}let l=function(){let a=process.env.DATA_DIR;if(!a)return k();if("win32"===process.platform&&/^\//.test(a))return console.warn(`[DATA_DIR] '${a}' is a Unix path on Windows → fallback to default`),k();try{return e().mkdirSync(a,{recursive:!0}),a}catch(b){if(b?.code==="EACCES"||b?.code==="EPERM")return console.warn(`[DATA_DIR] '${a}' not writable → fallback ~/.${j}`),k();throw b}}()},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},65595:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>A,patchFetch:()=>z,routeModule:()=>v,serverHooks:()=>y,workAsyncStorage:()=>w,workUnitAsyncStorage:()=>x});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(10246),u=c(37527);let v=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/auth/logout/route",pathname:"/api/auth/logout",filename:"route",bundlePath:"app/api/auth/logout/route"},distDir:".next-cli-build",relativeProjectDir:"",resolvedPagePath:"/root/workspace/JRouter/src/app/api/auth/logout/route.js",nextConfigOutput:"standalone",userland:()=>c(83723),...{}}),{workAsyncStorage:w,workUnitAsyncStorage:x,serverHooks:y}=v;function z(){return(0,f.patchFetch)({workAsyncStorage:w,workUnitAsyncStorage:x})}async function A(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),v.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/auth/logout/route";"/index"===d&&(d="/");let f=await v.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:w,deploymentId:x,params:y,nextConfig:z,parsedUrl:A,isDraftMode:B,prerenderManifest:C,routerServerContext:D,isOnDemandRevalidate:E,revalidateOnlyGenerated:F,resolvedPathname:G,clientReferenceManifest:H,serverActionsManifest:I}=f,J=(0,j.normalizeAppPath)(d),K=!!C.routes[G]&&(v.isDev||(0,t.isRouteCacheOwner)(G,v.cacheOwner,C.routes[G])),L=!!(C.dynamicRoutes[J]||K),M=async()=>((null==D?void 0:D.render404)?await D.render404(a,b,A,!1):b.end("This page could not be found"),null);if(L&&!B){let a=C.dynamicRoutes[J];if(a&&!1===a.fallback&&!K){if(z.adapterPath)return await M();throw new s.NoFallbackError}}let N=null;!L||v.isDev||B||(N="/index"===(N=G)?"/":N);let O=!0===v.isDev||!L,P=L&&!O;I&&H&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:H,serverActionsManifest:I});let Q=a.method||"GET",R=(0,h.getTracer)(),S=R.getActiveScopeSpan(),T=!!(null==D?void 0:D.isWrappedByNextServer),U=!!(0,g.getRequestMeta)(a,"minimalMode"),V=(0,g.getRequestMeta)(a,"incrementalCache")||await v.getIncrementalCache(a,z,C,U);null==V||V.resetRequestCache(),globalThis.__incrementalCache=V;let W={params:y,previewProps:C.preview,renderOpts:{experimental:{authInterrupts:!!z.experimental.authInterrupts,useCacheTimeout:z.experimental.useCacheTimeout},cacheComponents:!!z.cacheComponents,validationLevel:z.experimental.instantInsights.validationLevel,isDraftMode:B,supportsDynamicResponse:O,incrementalCache:V,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:z.cacheLife,staticPageGenerationTimeout:z.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>v.onRequestError(a,b,d,e,D)},sharedContext:{buildId:w,deploymentId:x}},X=new k.NodeNextRequest(a),Y=new k.NodeNextResponse(b),Z=l.NextRequestAdapter.fromNodeNextRequest(X,(0,l.signalFromNodeResponse)(b)),$=async({previousCacheEntry:e})=>{try{if(!U&&E&&F&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await v.handle(Z,W);a.fetchMetrics=W.renderOpts.fetchMetrics;let f=W.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=W.renderOpts.collectedTags;if(!L)return await (0,o.I)(X,Y,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==W.renderOpts.collectedRevalidate&&!(W.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&W.renderOpts.collectedRevalidate,e=void 0===W.renderOpts.collectedExpire||W.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?z.expireTime:void 0:W.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await v.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:P,isOnDemandRevalidate:E})},!1,D),b}},_=async(d,f)=>{try{var g,i;let d=await v.handleResponse({req:a,nextConfig:z,cacheKey:N,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:C,isRoutePPREnabled:!1,isOnDemandRevalidate:E,revalidateOnlyGenerated:F,responseGenerator:$,waitUntil:c.waitUntil,isMinimalMode:U});if(!L)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});U||b.setHeader("x-nextjs-cache",E?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),B&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);U&&L||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(X,Y,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await v.onRequestError(a,b,{routerKind:"App Router",routePath:J,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:P,isOnDemandRevalidate:E})},!1,D),L)throw b;await (0,o.I)(X,Y,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=R.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||J,g=`${Q} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(T&&S)await _(S,void 0);else{let b=R.getActiveScopeSpan();await R.withPropagatedContext(a.headers,()=>R.trace(m.BaseServerSpan.handleRequest,{spanName:`${Q} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":Q,"http.target":a.url}},a=>_(a,b)),void 0,!T)}}},73024:a=>{"use strict";a.exports=require("node:fs")},76760:a=>{"use strict";a.exports=require("node:path")},77598:a=>{"use strict";a.exports=require("node:crypto")},78335:()=>{},79868:a=>{"use strict";a.exports=require("node:sqlite")},81787:a=>{"use strict";a.exports=require("bun:sqlite")},83723:(a,b,c)=>{"use strict";c.r(b),c.d(b,{POST:()=>g});var d=c(23211),e=c(65573),f=c(33792);async function g(){let a=await (0,e.UL)();return(0,f.OZ)(a),a.delete("oidc_state"),a.delete("oidc_nonce"),a.delete("oidc_code_verifier"),d.NextResponse.json({success:!0},{headers:{"Cache-Control":"no-store"}})}},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87550:a=>{"use strict";a.exports=require("better-sqlite3")},89718:(a,b,c)=>{"use strict";c.d(b,{CG:()=>d.CG,Dj:()=>d.Dj,Fh:()=>d.getProviderNodes,Iq:()=>d.Iq,K1:()=>d.K1,KJ:()=>d.KJ,L:()=>d.L,L9:()=>d.L9,Lh:()=>d.Lh,Mc:()=>d.Mc,OM:()=>d.OM,PX:()=>d.PX,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Uv:()=>d.Uv,VT:()=>d.VT,XW:()=>d.XW,Xx:()=>d.Xx,Yd:()=>d.Yd,ZO:()=>d.ZO,bI:()=>d.bI,c:()=>d.c,ek:()=>d.ek,fK:()=>d.fK,fv:()=>d.fv,getProviderConnections:()=>d.P,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,iE:()=>d.iE,jd:()=>d.jd,mt:()=>d.mt,o5:()=>d.o5,oG:()=>d.oG,op:()=>d.op,r4:()=>d.r4,uL:()=>d.uL,ui:()=>d.ui,updateProviderConnection:()=>d.rj,uv:()=>d.getCustomModels,yF:()=>d.yF,yg:()=>d.yg,zP:()=>d.zP});var d=c(83192)},94735:a=>{"use strict";a.exports=require("events")},96487:()=>{}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[2970,1813,2391,8292,5573,4642,3192],()=>b(b.s=65595));module.exports=c})();
|
|
1
|
+
(()=>{var a={};a.id=8489,a.ids=[8489],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},16698:a=>{"use strict";a.exports=require("node:async_hooks")},17509:(a,b,c)=>{"use strict";c.d(b,{V:()=>m});var d=c(80700),e=c(99129),f=c(73575),g=c(38805),h=c(64416);function i(a){try{return(0,f.lF)(a)}catch{throw new e.Ye("JWS Compact Serialization payload must use only ASCII characters")}}async function j(a,b,c,i,j){let{protected:k,header:l,payload:m}=a,n=j??(void 0===k?{}:(0,g.OX)(k,e.Ye,"JWS Protected Header is invalid"));if(!(0,g.fz)(n,l))throw new e.Ye("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let o={...n,...l},p=(0,g.J0)(n,(0,g.nI)(e.Ye,g.qc,b[1],n,o)),{alg:q}=o;if("string"!=typeof q||!q)throw new e.Ye('JWS "alg" (Algorithm) Header Parameter missing or invalid');if(b[0]&&!b[0].has(q))throw new e.Rb('"alg" (Algorithm) Header Parameter value not allowed');if(p){if("string"!=typeof m)throw new e.Ye("JWS Payload must be a string")}else if("string"!=typeof m&&!(m instanceof Uint8Array))throw new e.Ye("JWS Payload must be a string or an Uint8Array instance");let r=p||"string"!=typeof m?m:i(m),s=!1;"function"==typeof c&&(c=await c(n,a),s=!0);let t=(0,d.q)(q),u=(0,f.xW)(void 0!==k?(0,f.lF)(k):new Uint8Array,(0,f.lF)("."),"string"==typeof r?b[2]??=(0,g.Fo)(r,"payload",e.Ye):r),v=(0,g.h2)(a.signature,"signature",e.Ye),w=await (0,h.dT)(t,c,"verify"),x=await (0,h.GK)(w,t.subtle,"verify");t.minRsaBits&&(0,h.or)(t.alg,x);let y=!1;try{y=await crypto.subtle.verify(t.signing,x,v,u)}catch{}if(!y)throw new e.h2;let z={payload:"string"==typeof r?(0,g.h2)(r,"payload",e.Ye):r};return void 0!==k&&(z.protectedHeader=n),void 0!==l&&(z.unprotectedHeader=l),s?[{...z,key:w},p]:[z,p]}async function k(a,b,c){if(a instanceof Uint8Array&&(a=f.D0.decode(a)),"string"!=typeof a)throw new e.Ye("Compact JWS must be a string or Uint8Array");let{0:d,1:g,2:h,length:k}=a.split(".");if(3!==k)throw new e.Ye("Invalid Compact JWS");return j({payload:g,protected:d,signature:h},b,c,i)}var l=c(17347);async function m(a,b,c){let[d,f]=await k(a,[c&&(0,g.Fw)("algorithms",c.algorithms),c?.crit],b);if(!f)throw new e.Dp("JWTs MUST NOT use unencoded payload");let h=(0,l.k6)(d.protectedHeader,d.payload,c);return{...d,payload:h}}},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{"use strict";a.exports=require("os")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33792:(a,b,c)=>{"use strict";c.d(b,{Dc:()=>r,OZ:()=>u,YK:()=>p,dY:()=>s,nz:()=>v,tm:()=>t});var d=c(8292),e=c(17509),f=c(34013),g=c(73024),h=c.n(g),i=c(76760),j=c.n(i),k=c(77598),l=c.n(k),m=c(49120),n=c(89718);let o=new TextEncoder().encode(function(){if(process.env.JWT_SECRET)return process.env.JWT_SECRET;let a=j().join(m.n,"jwt-secret");try{return h().readFileSync(a,"utf8").trim()}catch{}h().mkdirSync(m.n,{recursive:!0});let b=l().randomBytes(32).toString("hex");return h().writeFileSync(a,b,{mode:384}),b}());function p(a){let b="true"===process.env.AUTH_COOKIE_SECURE,c=a?.headers?.get?.("x-forwarded-proto");return b||"https"===c}async function q(a={}){return new d.P({authenticated:!0,...a}).setProtectedHeader({alg:"HS256"}).setIssuedAt().setExpirationTime("24h").sign(o)}async function r(a){if(!a)return!1;try{return await (0,e.V)(a,o),!0}catch{return!1}}async function s(a){if(!a)return null;try{let{payload:b}=await (0,e.V)(a,o);return b}catch{return null}}async function t(a,b,c={}){let d=await q(c);a.set("auth_token",d,{httpOnly:!0,secure:p(b),sameSite:"lax",path:"/",maxAge:86400})}function u(a){a.delete("auth_token")}async function v(a){if("string"!=typeof a||!a)return!1;let b=await (0,n.mt)(),c=b?.password;return c?f.Ay.compare(a,c):a===(process.env.INITIAL_PASSWORD||"123456")}},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},46293:a=>{"use strict";a.exports=require("sql.js")},49120:(a,b,c)=>{"use strict";c.d(b,{n:()=>l});var d=c(73024),e=c.n(d),f=c(33873),g=c.n(f),h=c(21820),i=c.n(h);let j="jrouter";function k(){return"win32"===process.platform?g().join(process.env.APPDATA||g().join(i().homedir(),"AppData","Roaming"),j):g().join(i().homedir(),`.${j}`)}let l=function(){let a=process.env.DATA_DIR;if(!a)return k();if("win32"===process.platform&&/^\//.test(a))return console.warn(`[DATA_DIR] '${a}' is a Unix path on Windows → fallback to default`),k();try{return e().mkdirSync(a,{recursive:!0}),a}catch(b){if(b?.code==="EACCES"||b?.code==="EPERM")return console.warn(`[DATA_DIR] '${a}' not writable → fallback ~/.${j}`),k();throw b}}()},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},65595:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>A,patchFetch:()=>z,routeModule:()=>v,serverHooks:()=>y,workAsyncStorage:()=>w,workUnitAsyncStorage:()=>x});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(10246),u=c(37527);let v=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/auth/logout/route",pathname:"/api/auth/logout",filename:"route",bundlePath:"app/api/auth/logout/route"},distDir:".next-cli-build",relativeProjectDir:"",resolvedPagePath:"/root/workspace/JRouter/src/app/api/auth/logout/route.js",nextConfigOutput:"standalone",userland:()=>c(83723),...{}}),{workAsyncStorage:w,workUnitAsyncStorage:x,serverHooks:y}=v;function z(){return(0,f.patchFetch)({workAsyncStorage:w,workUnitAsyncStorage:x})}async function A(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),v.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/auth/logout/route";"/index"===d&&(d="/");let f=await v.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:w,deploymentId:x,params:y,nextConfig:z,parsedUrl:A,isDraftMode:B,prerenderManifest:C,routerServerContext:D,isOnDemandRevalidate:E,revalidateOnlyGenerated:F,resolvedPathname:G,clientReferenceManifest:H,serverActionsManifest:I}=f,J=(0,j.normalizeAppPath)(d),K=!!C.routes[G]&&(v.isDev||(0,t.isRouteCacheOwner)(G,v.cacheOwner,C.routes[G])),L=!!(C.dynamicRoutes[J]||K),M=async()=>((null==D?void 0:D.render404)?await D.render404(a,b,A,!1):b.end("This page could not be found"),null);if(L&&!B){let a=C.dynamicRoutes[J];if(a&&!1===a.fallback&&!K){if(z.adapterPath)return await M();throw new s.NoFallbackError}}let N=null;!L||v.isDev||B||(N="/index"===(N=G)?"/":N);let O=!0===v.isDev||!L,P=L&&!O;I&&H&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:H,serverActionsManifest:I});let Q=a.method||"GET",R=(0,h.getTracer)(),S=R.getActiveScopeSpan(),T=!!(null==D?void 0:D.isWrappedByNextServer),U=!!(0,g.getRequestMeta)(a,"minimalMode"),V=(0,g.getRequestMeta)(a,"incrementalCache")||await v.getIncrementalCache(a,z,C,U);null==V||V.resetRequestCache(),globalThis.__incrementalCache=V;let W={params:y,previewProps:C.preview,renderOpts:{experimental:{authInterrupts:!!z.experimental.authInterrupts,useCacheTimeout:z.experimental.useCacheTimeout},cacheComponents:!!z.cacheComponents,validationLevel:z.experimental.instantInsights.validationLevel,isDraftMode:B,supportsDynamicResponse:O,incrementalCache:V,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:z.cacheLife,staticPageGenerationTimeout:z.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>v.onRequestError(a,b,d,e,D)},sharedContext:{buildId:w,deploymentId:x}},X=new k.NodeNextRequest(a),Y=new k.NodeNextResponse(b),Z=l.NextRequestAdapter.fromNodeNextRequest(X,(0,l.signalFromNodeResponse)(b)),$=async({previousCacheEntry:e})=>{try{if(!U&&E&&F&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await v.handle(Z,W);a.fetchMetrics=W.renderOpts.fetchMetrics;let f=W.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=W.renderOpts.collectedTags;if(!L)return await (0,o.I)(X,Y,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==W.renderOpts.collectedRevalidate&&!(W.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&W.renderOpts.collectedRevalidate,e=void 0===W.renderOpts.collectedExpire||W.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?z.expireTime:void 0:W.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await v.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:P,isOnDemandRevalidate:E})},!1,D),b}},_=async(d,f)=>{try{var g,i;let d=await v.handleResponse({req:a,nextConfig:z,cacheKey:N,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:C,isRoutePPREnabled:!1,isOnDemandRevalidate:E,revalidateOnlyGenerated:F,responseGenerator:$,waitUntil:c.waitUntil,isMinimalMode:U});if(!L)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});U||b.setHeader("x-nextjs-cache",E?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),B&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);U&&L||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(X,Y,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await v.onRequestError(a,b,{routerKind:"App Router",routePath:J,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:P,isOnDemandRevalidate:E})},!1,D),L)throw b;await (0,o.I)(X,Y,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=R.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||J,g=`${Q} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(T&&S)await _(S,void 0);else{let b=R.getActiveScopeSpan();await R.withPropagatedContext(a.headers,()=>R.trace(m.BaseServerSpan.handleRequest,{spanName:`${Q} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":Q,"http.target":a.url}},a=>_(a,b)),void 0,!T)}}},73024:a=>{"use strict";a.exports=require("node:fs")},76760:a=>{"use strict";a.exports=require("node:path")},77598:a=>{"use strict";a.exports=require("node:crypto")},78335:()=>{},79868:a=>{"use strict";a.exports=require("node:sqlite")},81787:a=>{"use strict";a.exports=require("bun:sqlite")},83723:(a,b,c)=>{"use strict";c.r(b),c.d(b,{POST:()=>g});var d=c(23211),e=c(65573),f=c(33792);async function g(){let a=await (0,e.UL)();return(0,f.OZ)(a),a.delete("oidc_state"),a.delete("oidc_nonce"),a.delete("oidc_code_verifier"),d.NextResponse.json({success:!0},{headers:{"Cache-Control":"no-store"}})}},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87550:a=>{"use strict";a.exports=require("better-sqlite3")},89718:(a,b,c)=>{"use strict";c.d(b,{CG:()=>d.CG,Dj:()=>d.Dj,Fh:()=>d.getProviderNodes,Iq:()=>d.Iq,K1:()=>d.K1,KJ:()=>d.KJ,L:()=>d.L,L9:()=>d.L9,Lh:()=>d.Lh,Mc:()=>d.Mc,OM:()=>d.OM,PX:()=>d.PX,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Uv:()=>d.Uv,VT:()=>d.VT,XW:()=>d.XW,Xx:()=>d.Xx,Yd:()=>d.Yd,ZO:()=>d.ZO,bI:()=>d.bI,c:()=>d.c,ek:()=>d.ek,fK:()=>d.fK,fv:()=>d.fv,getProviderConnections:()=>d.P,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,iE:()=>d.iE,jd:()=>d.jd,mt:()=>d.mt,o5:()=>d.o5,oG:()=>d.oG,op:()=>d.op,r4:()=>d.r4,uL:()=>d.uL,ui:()=>d.ui,updateProviderConnection:()=>d.rj,uv:()=>d.getCustomModels,yF:()=>d.yF,yg:()=>d.yg,zP:()=>d.zP});var d=c(83192)},94735:a=>{"use strict";a.exports=require("events")},96487:()=>{}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[2970,1813,2391,8292,5573,4642,3192],()=>b(b.s=65595));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var a={};a.id=4674,a.ids=[4674],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},16698:a=>{"use strict";a.exports=require("node:async_hooks")},17509:(a,b,c)=>{"use strict";c.d(b,{V:()=>m});var d=c(80700),e=c(99129),f=c(73575),g=c(38805),h=c(64416);function i(a){try{return(0,f.lF)(a)}catch{throw new e.Ye("JWS Compact Serialization payload must use only ASCII characters")}}async function j(a,b,c,i,j){let{protected:k,header:l,payload:m}=a,n=j??(void 0===k?{}:(0,g.OX)(k,e.Ye,"JWS Protected Header is invalid"));if(!(0,g.fz)(n,l))throw new e.Ye("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let o={...n,...l},p=(0,g.J0)(n,(0,g.nI)(e.Ye,g.qc,b[1],n,o)),{alg:q}=o;if("string"!=typeof q||!q)throw new e.Ye('JWS "alg" (Algorithm) Header Parameter missing or invalid');if(b[0]&&!b[0].has(q))throw new e.Rb('"alg" (Algorithm) Header Parameter value not allowed');if(p){if("string"!=typeof m)throw new e.Ye("JWS Payload must be a string")}else if("string"!=typeof m&&!(m instanceof Uint8Array))throw new e.Ye("JWS Payload must be a string or an Uint8Array instance");let r=p||"string"!=typeof m?m:i(m),s=!1;"function"==typeof c&&(c=await c(n,a),s=!0);let t=(0,d.q)(q),u=(0,f.xW)(void 0!==k?(0,f.lF)(k):new Uint8Array,(0,f.lF)("."),"string"==typeof r?b[2]??=(0,g.Fo)(r,"payload",e.Ye):r),v=(0,g.h2)(a.signature,"signature",e.Ye),w=await (0,h.dT)(t,c,"verify"),x=await (0,h.GK)(w,t.subtle,"verify");t.minRsaBits&&(0,h.or)(t.alg,x);let y=!1;try{y=await crypto.subtle.verify(t.signing,x,v,u)}catch{}if(!y)throw new e.h2;let z={payload:"string"==typeof r?(0,g.h2)(r,"payload",e.Ye):r};return void 0!==k&&(z.protectedHeader=n),void 0!==l&&(z.unprotectedHeader=l),s?[{...z,key:w},p]:[z,p]}async function k(a,b,c){if(a instanceof Uint8Array&&(a=f.D0.decode(a)),"string"!=typeof a)throw new e.Ye("Compact JWS must be a string or Uint8Array");let{0:d,1:g,2:h,length:k}=a.split(".");if(3!==k)throw new e.Ye("Invalid Compact JWS");return j({payload:g,protected:d,signature:h},b,c,i)}var l=c(17347);async function m(a,b,c){let[d,f]=await k(a,[c&&(0,g.Fw)("algorithms",c.algorithms),c?.crit],b);if(!f)throw new e.Dp("JWTs MUST NOT use unencoded payload");let h=(0,l.k6)(d.protectedHeader,d.payload,c);return{...d,payload:h}}},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{"use strict";a.exports=require("os")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},30906:(a,b,c)=>{"use strict";let d;c.d(b,{gR:()=>E,hT:()=>D,Pf:()=>C,GY:()=>B,sP:()=>F,Ir:()=>A,Mj:()=>z,iw:()=>x,EJ:()=>y,Ui:()=>I,Rj:()=>J,HO:()=>G,x8:()=>H});var e=c(77598),f=c.n(e),g=c(99129),h=c(64416),i=c(80700),j=c(38805);async function k(a,b,c){let d=a.get(b)||a.set(b,{}).get(b),{alg:e}=c;if(void 0===d[e]){let a=(0,h.xY)(c,b,!0).then(a=>{if("public"!==a.type)throw new g.Dm("JSON Web Key Set members must be public keys");return d[e]=a,a}).catch(b=>{throw d[e]===a&&delete d[e],b});d[e]=a}return d[e]}function l(a){let b;try{b=structuredClone(a)}catch{}if(!(0,j.fV)(b))throw new g.Dm("JSON Web Key Set malformed");let c=b.keys.map(a=>{let b=(0,h.ZZ)(a);return Array.isArray(b.key_ops)&&(b.key_ops=[...b.key_ops]),b}),d=new WeakMap;return Object.defineProperty(async(a,e)=>{let{alg:f,kid:h}={...a,...e?.header},j="string"==typeof f?i.p[f]:void 0;if(!j||j.secret)throw new g.T0('Unsupported "alg" value for a JSON Web Key Set');let l=b.keys.filter((a,b)=>(function(a,b,c,d){let{kty:e,key_ops:f,ext:g,kid:h,alg:i,use:j,crv:k}=a;return(void 0===g||"boolean"==typeof g)&&(void 0===f||Array.isArray(f)&&f.every((a,b)=>"string"==typeof a&&f.indexOf(a)===b)&&f.includes("verify"))&&b.kty.includes(e)&&(void 0===d||"string"==typeof d&&d===h)&&(void 0===i?"AKP"!==e:c===i)&&(void 0===j||"sig"===j)&&(!b.crv||k===b.crv)})(c[b],j,f,h)),{0:m,length:n}=l;if(!n)throw new g.BT;if(1!==n){let a=new g.$4;throw a[Symbol.asyncIterator]=async function*(){for(let a of l)try{yield await k(d,a,j)}catch{}},a}return k(d,m,j)},"jwks",{value:()=>structuredClone(b)})}(typeof navigator>"u"||!navigator.userAgent?.startsWith?.("Mozilla/5.0 "))&&(d="jose/v6.2.12");let m=Symbol();async function n(a,b,c,d=fetch){let e=await d(a,{method:"GET",signal:c,redirect:"manual",headers:b}).catch(a=>{throw"TimeoutError"===a.name?new g.xb:a});if(200!==e.status)throw new g.i4("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await e.json()}catch{throw new g.i4("Failed to parse the JSON Web Key Set HTTP response as JSON")}}let o=Symbol();function p(a,b){return Number.isFinite(a)&&Date.now()<a+b}function q(a,b,c){if(Number.isNaN(a))throw TypeError(`"${c}" option must not be NaN`);return"number"==typeof a?a:b}var r=c(17509),s=c(89718);let t="openid profile email",u="Sign in with OIDC";function v(a){return(a||"").trim().replace(/\/+$/,"")}function w(a){return(a||t).trim()||t}function x(a){let b=process.env.BASE_URL||"http://localhost:20128";if(b)return v(b);let c=a?.headers?.get?.("x-forwarded-proto")||"",d=a?.headers?.get?.("x-forwarded-host")||a?.headers?.get?.("host")||"";if(d){let b=(c||new URL(a.url).protocol||"http:").replace(/:$/,"");return`${b}://${d}`.replace(/\/+$/,"")}return v(new URL(a.url).origin)}function y(a){return!!(v(a?.oidcIssuerUrl)&&(a?.oidcClientId||"").trim()&&(a?.oidcClientSecret||"").trim())}async function z(){let a=await (0,s.mt)();return["oidc","both"].includes(a.authMode)&&y(a)?{issuerUrl:v(a.oidcIssuerUrl),clientId:a.oidcClientId.trim(),clientSecret:a.oidcClientSecret.trim(),scopes:w(a.oidcScopes),loginLabel:(a.oidcLoginLabel||u).trim()||u}:null}async function A(a){let b=`${v(a)}/.well-known/openid-configuration`,c=await fetch(b,{cache:"no-store"});if(!c.ok)throw Error(`Failed to load OIDC discovery document from ${b}`);return await c.json()}function B(){let a=f().randomBytes(32).toString("base64url"),b=f().createHash("sha256").update(a).digest("base64url");return{verifier:a,challenge:b}}function C(){return f().randomBytes(16).toString("base64url")}function D(){return f().randomBytes(16).toString("base64url")}function E({authorizationEndpoint:a,clientId:b,redirectUri:c,scopes:d=t,state:e,nonce:f,codeChallenge:g}){let h=new URL(a);return h.searchParams.set("response_type","code"),h.searchParams.set("client_id",b),h.searchParams.set("redirect_uri",c),h.searchParams.set("scope",w(d)),h.searchParams.set("state",e),h.searchParams.set("nonce",f),h.searchParams.set("code_challenge",g),h.searchParams.set("code_challenge_method","S256"),h.toString()}async function F({tokenEndpoint:a,clientId:b,clientSecret:c,code:d,redirectUri:e,codeVerifier:f}){let g=new URLSearchParams({grant_type:"authorization_code",client_id:b,code:d,redirect_uri:e,code_verifier:f});c&&g.set("client_secret",c);let h=await fetch(a,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:g}),i=await h.json().catch(()=>({}));if(!h.ok)throw Error(i?.error_description||i?.error||`OIDC token exchange failed (${h.status})`);return i}async function G({tokenEndpoint:a,clientId:b,clientSecret:c,redirectUri:d}){if(!c)return{tested:!1,valid:null,message:"No client secret was provided, so secret validation was skipped."};let e=new URLSearchParams({grant_type:"authorization_code",client_id:b,client_secret:c,code:"__oidc_test_invalid_code__",redirect_uri:d,code_verifier:"__oidc_test_invalid_verifier__"}),f=await fetch(a,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:e}),g=await f.json().catch(()=>({})),h=(g?.error||"").toLowerCase(),i=g?.error_description||g?.error||"";return f.ok?{tested:!0,valid:!0,message:"Client secret was accepted by the token endpoint.",raw:g}:"invalid_client"===h||"unauthorized_client"===h||/client.*(invalid|failed|mismatch)/i.test(i)?{tested:!0,valid:!1,message:i||"Client secret is not valid.",raw:g}:"invalid_grant"===h||"invalid_code"===h||/grant|code/i.test(i)?{tested:!0,valid:!0,message:"Client secret was accepted; the token exchange failed only because the test authorization code is invalid.",raw:g}:{tested:!0,valid:null,message:i||`Token endpoint responded with ${f.status}`,raw:g}}async function H({idToken:a,issuer:b,audience:c,jwksUri:e,nonce:f}){let h=function(a){if(!(a instanceof URL))throw TypeError("url must be an instance of URL");let b=new URL(a.href).href,c=(void 0)??{},e=c.timeoutDuration;if("number"==typeof e&&(!Number.isInteger(e)||e<0))throw TypeError('"timeoutDuration" option must be a non-negative integer');let f="number"==typeof e?e:5e3,h=q(c.cooldownDuration,3e4,"cooldownDuration"),i=q(c.cacheMaxAge,6e5,"cacheMaxAge"),k=new Headers(c.headers);d&&!k.has("User-Agent")&&k.set("User-Agent",d),k.has("accept")||k.set("accept","application/json, application/jwk-set+json");let r=c[m],s=c[o],t,u,v=0,w=0,x;if(s&&"object"==typeof s){let{uat:a,jwks:b}=s;p(a,i)&&(0,j.fV)(b)&&(t=a,x=l(b))}let y=async()=>{if(u&&("u">typeof WebSocketPair||"u">typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||"u">typeof EdgeRuntime&&"vercel"===EdgeRuntime)&&(u=void 0),!u){let a=++v,c=u=n(b,k,AbortSignal.timeout(f),r).then(b=>{let c=l(b);if(a<=w)return;x=c;let d=Date.now();s&&(s.uat=d,s.jwks=b),t=d,w=a}).finally(()=>{u===c&&(u=void 0)})}await u};return Object.defineProperties(async(a,b)=>{x&&p(t,i)||await y();try{return await x(a,b)}catch(c){if(c instanceof g.BT&&!p(t,h))return await y(),x(a,b);throw c}},{coolingDown:{get:()=>p(t,h),enumerable:!0},fresh:{get:()=>p(t,i),enumerable:!0},reload:{value:y,enumerable:!0},reloading:{get:()=>!!u,enumerable:!0},jwks:{value:()=>x?.jwks(),enumerable:!0}})}(new URL(e)),{payload:i}=await (0,r.V)(a,h,{issuer:b,audience:c,nonce:f});return i}function I(a={}){return a.preferred_username||a.email||a.name||a.given_name||a.sub||"OIDC user"}function J(a={}){return a.email||""}},33792:(a,b,c)=>{"use strict";c.d(b,{Dc:()=>r,OZ:()=>u,YK:()=>p,dY:()=>s,nz:()=>v,tm:()=>t});var d=c(8292),e=c(17509),f=c(34013),g=c(73024),h=c.n(g),i=c(76760),j=c.n(i),k=c(77598),l=c.n(k),m=c(49120),n=c(89718);let o=new TextEncoder().encode(function(){if(process.env.JWT_SECRET)return process.env.JWT_SECRET;let a=j().join(m.n,"jwt-secret");try{return h().readFileSync(a,"utf8").trim()}catch{}h().mkdirSync(m.n,{recursive:!0});let b=l().randomBytes(32).toString("hex");return h().writeFileSync(a,b,{mode:384}),b}());function p(a){let b="true"===process.env.AUTH_COOKIE_SECURE,c=a?.headers?.get?.("x-forwarded-proto");return b||"https"===c}async function q(a={}){return new d.P({authenticated:!0,...a}).setProtectedHeader({alg:"HS256"}).setIssuedAt().setExpirationTime("24h").sign(o)}async function r(a){if(!a)return!1;try{return await (0,e.V)(a,o),!0}catch{return!1}}async function s(a){if(!a)return null;try{let{payload:b}=await (0,e.V)(a,o);return b}catch{return null}}async function t(a,b,c={}){let d=await q(c);a.set("auth_token",d,{httpOnly:!0,secure:p(b),sameSite:"lax",path:"/",maxAge:86400})}function u(a){a.delete("auth_token")}async function v(a){if("string"!=typeof a||!a)return!1;let b=await (0,n.mt)(),c=b?.password;return c?f.Ay.compare(a,c):a===(process.env.INITIAL_PASSWORD||"123456")}},33873:a=>{"use strict";a.exports=require("path")},34932:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GET:()=>i});var d=c(23211),e=c(65573),f=c(30906),g=c(33792);function h(a){a.delete("oidc_state"),a.delete("oidc_nonce"),a.delete("oidc_code_verifier")}async function i(a){let b=new URL(a.url),c=b.searchParams.get("error");if(c)return d.NextResponse.redirect(new URL(`/login?error=${encodeURIComponent(c)}`,(0,f.iw)(a)));let i=b.searchParams.get("code"),j=b.searchParams.get("state");if(!i||!j)return d.NextResponse.redirect(new URL("/login?error=oidc_missing_code",(0,f.iw)(a)));let k=await (0,e.UL)(),l=k.get("oidc_state")?.value,m=k.get("oidc_nonce")?.value,n=k.get("oidc_code_verifier")?.value;if(!l||!m||!n||l!==j)return h(k),d.NextResponse.redirect(new URL("/login?error=oidc_invalid_state",(0,f.iw)(a)));try{let b=await (0,f.Mj)();if(!b)return h(k),d.NextResponse.redirect(new URL("/login?error=oidc_not_configured",(0,f.iw)(a)));let c=await (0,f.Ir)(b.issuerUrl),e=c.issuer||b.issuerUrl,j=`${(0,f.iw)(a)}/api/auth/oidc/callback`,l=await (0,f.sP)({tokenEndpoint:c.token_endpoint,clientId:b.clientId,clientSecret:b.clientSecret,code:i,redirectUri:j,codeVerifier:n});if(!l.id_token)throw Error("OIDC provider did not return an id_token");let o=await (0,f.x8)({idToken:l.id_token,issuer:e,audience:b.clientId,jwksUri:c.jwks_uri,nonce:m});return h(k),await (0,g.tm)(k,a,{oidc:!0,oidcSub:o.sub||null,oidcEmail:(0,f.Rj)(o)||null,oidcName:(0,f.Ui)(o)}),d.NextResponse.redirect(new URL("/dashboard",(0,f.iw)(a)))}catch(b){return h(k),d.NextResponse.redirect(new URL(`/login?error=${encodeURIComponent(b.message||"oidc_callback_failed")}`,(0,f.iw)(a)))}}},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},46293:a=>{"use strict";a.exports=require("sql.js")},49120:(a,b,c)=>{"use strict";c.d(b,{n:()=>l});var d=c(73024),e=c.n(d),f=c(33873),g=c.n(f),h=c(21820),i=c.n(h);let j="9router";function k(){return"win32"===process.platform?g().join(process.env.APPDATA||g().join(i().homedir(),"AppData","Roaming"),j):g().join(i().homedir(),`.${j}`)}let l=function(){let a=process.env.DATA_DIR;if(!a)return k();if("win32"===process.platform&&/^\//.test(a))return console.warn(`[DATA_DIR] '${a}' is a Unix path on Windows → fallback to default`),k();try{return e().mkdirSync(a,{recursive:!0}),a}catch(b){if(b?.code==="EACCES"||b?.code==="EPERM")return console.warn(`[DATA_DIR] '${a}' not writable → fallback ~/.${j}`),k();throw b}}()},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73024:a=>{"use strict";a.exports=require("node:fs")},76760:a=>{"use strict";a.exports=require("node:path")},77598:a=>{"use strict";a.exports=require("node:crypto")},78335:()=>{},79868:a=>{"use strict";a.exports=require("node:sqlite")},81787:a=>{"use strict";a.exports=require("bun:sqlite")},85615:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>A,patchFetch:()=>z,routeModule:()=>v,serverHooks:()=>y,workAsyncStorage:()=>w,workUnitAsyncStorage:()=>x});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(10246),u=c(37527);let v=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/auth/oidc/callback/route",pathname:"/api/auth/oidc/callback",filename:"route",bundlePath:"app/api/auth/oidc/callback/route"},distDir:".next-cli-build",relativeProjectDir:"",resolvedPagePath:"/root/workspace/JRouter/src/app/api/auth/oidc/callback/route.js",nextConfigOutput:"standalone",userland:()=>c(34932),...{}}),{workAsyncStorage:w,workUnitAsyncStorage:x,serverHooks:y}=v;function z(){return(0,f.patchFetch)({workAsyncStorage:w,workUnitAsyncStorage:x})}async function A(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),v.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/auth/oidc/callback/route";"/index"===d&&(d="/");let f=await v.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:w,deploymentId:x,params:y,nextConfig:z,parsedUrl:A,isDraftMode:B,prerenderManifest:C,routerServerContext:D,isOnDemandRevalidate:E,revalidateOnlyGenerated:F,resolvedPathname:G,clientReferenceManifest:H,serverActionsManifest:I}=f,J=(0,j.normalizeAppPath)(d),K=!!C.routes[G]&&(v.isDev||(0,t.isRouteCacheOwner)(G,v.cacheOwner,C.routes[G])),L=!!(C.dynamicRoutes[J]||K),M=async()=>((null==D?void 0:D.render404)?await D.render404(a,b,A,!1):b.end("This page could not be found"),null);if(L&&!B){let a=C.dynamicRoutes[J];if(a&&!1===a.fallback&&!K){if(z.adapterPath)return await M();throw new s.NoFallbackError}}let N=null;!L||v.isDev||B||(N="/index"===(N=G)?"/":N);let O=!0===v.isDev||!L,P=L&&!O;I&&H&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:H,serverActionsManifest:I});let Q=a.method||"GET",R=(0,h.getTracer)(),S=R.getActiveScopeSpan(),T=!!(null==D?void 0:D.isWrappedByNextServer),U=!!(0,g.getRequestMeta)(a,"minimalMode"),V=(0,g.getRequestMeta)(a,"incrementalCache")||await v.getIncrementalCache(a,z,C,U);null==V||V.resetRequestCache(),globalThis.__incrementalCache=V;let W={params:y,previewProps:C.preview,renderOpts:{experimental:{authInterrupts:!!z.experimental.authInterrupts,useCacheTimeout:z.experimental.useCacheTimeout},cacheComponents:!!z.cacheComponents,validationLevel:z.experimental.instantInsights.validationLevel,isDraftMode:B,supportsDynamicResponse:O,incrementalCache:V,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:z.cacheLife,staticPageGenerationTimeout:z.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>v.onRequestError(a,b,d,e,D)},sharedContext:{buildId:w,deploymentId:x}},X=new k.NodeNextRequest(a),Y=new k.NodeNextResponse(b),Z=l.NextRequestAdapter.fromNodeNextRequest(X,(0,l.signalFromNodeResponse)(b)),$=async({previousCacheEntry:e})=>{try{if(!U&&E&&F&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await v.handle(Z,W);a.fetchMetrics=W.renderOpts.fetchMetrics;let f=W.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=W.renderOpts.collectedTags;if(!L)return await (0,o.I)(X,Y,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==W.renderOpts.collectedRevalidate&&!(W.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&W.renderOpts.collectedRevalidate,e=void 0===W.renderOpts.collectedExpire||W.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?z.expireTime:void 0:W.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await v.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:P,isOnDemandRevalidate:E})},!1,D),b}},_=async(d,f)=>{try{var g,i;let d=await v.handleResponse({req:a,nextConfig:z,cacheKey:N,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:C,isRoutePPREnabled:!1,isOnDemandRevalidate:E,revalidateOnlyGenerated:F,responseGenerator:$,waitUntil:c.waitUntil,isMinimalMode:U});if(!L)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});U||b.setHeader("x-nextjs-cache",E?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),B&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);U&&L||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(X,Y,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await v.onRequestError(a,b,{routerKind:"App Router",routePath:J,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:P,isOnDemandRevalidate:E})},!1,D),L)throw b;await (0,o.I)(X,Y,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=R.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||J,g=`${Q} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(T&&S)await _(S,void 0);else{let b=R.getActiveScopeSpan();await R.withPropagatedContext(a.headers,()=>R.trace(m.BaseServerSpan.handleRequest,{spanName:`${Q} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":Q,"http.target":a.url}},a=>_(a,b)),void 0,!T)}}},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87550:a=>{"use strict";a.exports=require("better-sqlite3")},89718:(a,b,c)=>{"use strict";c.d(b,{CG:()=>d.CG,Dj:()=>d.Dj,Fh:()=>d.getProviderNodes,Iq:()=>d.Iq,K1:()=>d.K1,KJ:()=>d.KJ,L:()=>d.L,L9:()=>d.L9,Lh:()=>d.Lh,Mc:()=>d.Mc,OM:()=>d.OM,PX:()=>d.PX,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Uv:()=>d.Uv,VT:()=>d.VT,XW:()=>d.XW,Xx:()=>d.Xx,Yd:()=>d.Yd,ZO:()=>d.ZO,bI:()=>d.bI,c:()=>d.c,ek:()=>d.ek,fK:()=>d.fK,fv:()=>d.fv,getProviderConnections:()=>d.P,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,iE:()=>d.iE,jd:()=>d.jd,mt:()=>d.mt,o5:()=>d.o5,oG:()=>d.oG,op:()=>d.op,r4:()=>d.r4,uL:()=>d.uL,ui:()=>d.ui,updateProviderConnection:()=>d.rj,uv:()=>d.getCustomModels,yF:()=>d.yF,yg:()=>d.yg,zP:()=>d.zP});var d=c(83192)},94735:a=>{"use strict";a.exports=require("events")},96487:()=>{}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[2970,1813,2391,8292,5573,4642,3192],()=>b(b.s=85615));module.exports=c})();
|
|
1
|
+
(()=>{var a={};a.id=4674,a.ids=[4674],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},16698:a=>{"use strict";a.exports=require("node:async_hooks")},17509:(a,b,c)=>{"use strict";c.d(b,{V:()=>m});var d=c(80700),e=c(99129),f=c(73575),g=c(38805),h=c(64416);function i(a){try{return(0,f.lF)(a)}catch{throw new e.Ye("JWS Compact Serialization payload must use only ASCII characters")}}async function j(a,b,c,i,j){let{protected:k,header:l,payload:m}=a,n=j??(void 0===k?{}:(0,g.OX)(k,e.Ye,"JWS Protected Header is invalid"));if(!(0,g.fz)(n,l))throw new e.Ye("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let o={...n,...l},p=(0,g.J0)(n,(0,g.nI)(e.Ye,g.qc,b[1],n,o)),{alg:q}=o;if("string"!=typeof q||!q)throw new e.Ye('JWS "alg" (Algorithm) Header Parameter missing or invalid');if(b[0]&&!b[0].has(q))throw new e.Rb('"alg" (Algorithm) Header Parameter value not allowed');if(p){if("string"!=typeof m)throw new e.Ye("JWS Payload must be a string")}else if("string"!=typeof m&&!(m instanceof Uint8Array))throw new e.Ye("JWS Payload must be a string or an Uint8Array instance");let r=p||"string"!=typeof m?m:i(m),s=!1;"function"==typeof c&&(c=await c(n,a),s=!0);let t=(0,d.q)(q),u=(0,f.xW)(void 0!==k?(0,f.lF)(k):new Uint8Array,(0,f.lF)("."),"string"==typeof r?b[2]??=(0,g.Fo)(r,"payload",e.Ye):r),v=(0,g.h2)(a.signature,"signature",e.Ye),w=await (0,h.dT)(t,c,"verify"),x=await (0,h.GK)(w,t.subtle,"verify");t.minRsaBits&&(0,h.or)(t.alg,x);let y=!1;try{y=await crypto.subtle.verify(t.signing,x,v,u)}catch{}if(!y)throw new e.h2;let z={payload:"string"==typeof r?(0,g.h2)(r,"payload",e.Ye):r};return void 0!==k&&(z.protectedHeader=n),void 0!==l&&(z.unprotectedHeader=l),s?[{...z,key:w},p]:[z,p]}async function k(a,b,c){if(a instanceof Uint8Array&&(a=f.D0.decode(a)),"string"!=typeof a)throw new e.Ye("Compact JWS must be a string or Uint8Array");let{0:d,1:g,2:h,length:k}=a.split(".");if(3!==k)throw new e.Ye("Invalid Compact JWS");return j({payload:g,protected:d,signature:h},b,c,i)}var l=c(17347);async function m(a,b,c){let[d,f]=await k(a,[c&&(0,g.Fw)("algorithms",c.algorithms),c?.crit],b);if(!f)throw new e.Dp("JWTs MUST NOT use unencoded payload");let h=(0,l.k6)(d.protectedHeader,d.payload,c);return{...d,payload:h}}},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{"use strict";a.exports=require("os")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},30906:(a,b,c)=>{"use strict";let d;c.d(b,{gR:()=>E,hT:()=>D,Pf:()=>C,GY:()=>B,sP:()=>F,Ir:()=>A,Mj:()=>z,iw:()=>x,EJ:()=>y,Ui:()=>I,Rj:()=>J,HO:()=>G,x8:()=>H});var e=c(77598),f=c.n(e),g=c(99129),h=c(64416),i=c(80700),j=c(38805);async function k(a,b,c){let d=a.get(b)||a.set(b,{}).get(b),{alg:e}=c;if(void 0===d[e]){let a=(0,h.xY)(c,b,!0).then(a=>{if("public"!==a.type)throw new g.Dm("JSON Web Key Set members must be public keys");return d[e]=a,a}).catch(b=>{throw d[e]===a&&delete d[e],b});d[e]=a}return d[e]}function l(a){let b;try{b=structuredClone(a)}catch{}if(!(0,j.fV)(b))throw new g.Dm("JSON Web Key Set malformed");let c=b.keys.map(a=>{let b=(0,h.ZZ)(a);return Array.isArray(b.key_ops)&&(b.key_ops=[...b.key_ops]),b}),d=new WeakMap;return Object.defineProperty(async(a,e)=>{let{alg:f,kid:h}={...a,...e?.header},j="string"==typeof f?i.p[f]:void 0;if(!j||j.secret)throw new g.T0('Unsupported "alg" value for a JSON Web Key Set');let l=b.keys.filter((a,b)=>(function(a,b,c,d){let{kty:e,key_ops:f,ext:g,kid:h,alg:i,use:j,crv:k}=a;return(void 0===g||"boolean"==typeof g)&&(void 0===f||Array.isArray(f)&&f.every((a,b)=>"string"==typeof a&&f.indexOf(a)===b)&&f.includes("verify"))&&b.kty.includes(e)&&(void 0===d||"string"==typeof d&&d===h)&&(void 0===i?"AKP"!==e:c===i)&&(void 0===j||"sig"===j)&&(!b.crv||k===b.crv)})(c[b],j,f,h)),{0:m,length:n}=l;if(!n)throw new g.BT;if(1!==n){let a=new g.$4;throw a[Symbol.asyncIterator]=async function*(){for(let a of l)try{yield await k(d,a,j)}catch{}},a}return k(d,m,j)},"jwks",{value:()=>structuredClone(b)})}(typeof navigator>"u"||!navigator.userAgent?.startsWith?.("Mozilla/5.0 "))&&(d="jose/v6.2.12");let m=Symbol();async function n(a,b,c,d=fetch){let e=await d(a,{method:"GET",signal:c,redirect:"manual",headers:b}).catch(a=>{throw"TimeoutError"===a.name?new g.xb:a});if(200!==e.status)throw new g.i4("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await e.json()}catch{throw new g.i4("Failed to parse the JSON Web Key Set HTTP response as JSON")}}let o=Symbol();function p(a,b){return Number.isFinite(a)&&Date.now()<a+b}function q(a,b,c){if(Number.isNaN(a))throw TypeError(`"${c}" option must not be NaN`);return"number"==typeof a?a:b}var r=c(17509),s=c(89718);let t="openid profile email",u="Sign in with OIDC";function v(a){return(a||"").trim().replace(/\/+$/,"")}function w(a){return(a||t).trim()||t}function x(a){let b=process.env.BASE_URL||"http://localhost:20128";if(b)return v(b);let c=a?.headers?.get?.("x-forwarded-proto")||"",d=a?.headers?.get?.("x-forwarded-host")||a?.headers?.get?.("host")||"";if(d){let b=(c||new URL(a.url).protocol||"http:").replace(/:$/,"");return`${b}://${d}`.replace(/\/+$/,"")}return v(new URL(a.url).origin)}function y(a){return!!(v(a?.oidcIssuerUrl)&&(a?.oidcClientId||"").trim()&&(a?.oidcClientSecret||"").trim())}async function z(){let a=await (0,s.mt)();return["oidc","both"].includes(a.authMode)&&y(a)?{issuerUrl:v(a.oidcIssuerUrl),clientId:a.oidcClientId.trim(),clientSecret:a.oidcClientSecret.trim(),scopes:w(a.oidcScopes),loginLabel:(a.oidcLoginLabel||u).trim()||u}:null}async function A(a){let b=`${v(a)}/.well-known/openid-configuration`,c=await fetch(b,{cache:"no-store"});if(!c.ok)throw Error(`Failed to load OIDC discovery document from ${b}`);return await c.json()}function B(){let a=f().randomBytes(32).toString("base64url"),b=f().createHash("sha256").update(a).digest("base64url");return{verifier:a,challenge:b}}function C(){return f().randomBytes(16).toString("base64url")}function D(){return f().randomBytes(16).toString("base64url")}function E({authorizationEndpoint:a,clientId:b,redirectUri:c,scopes:d=t,state:e,nonce:f,codeChallenge:g}){let h=new URL(a);return h.searchParams.set("response_type","code"),h.searchParams.set("client_id",b),h.searchParams.set("redirect_uri",c),h.searchParams.set("scope",w(d)),h.searchParams.set("state",e),h.searchParams.set("nonce",f),h.searchParams.set("code_challenge",g),h.searchParams.set("code_challenge_method","S256"),h.toString()}async function F({tokenEndpoint:a,clientId:b,clientSecret:c,code:d,redirectUri:e,codeVerifier:f}){let g=new URLSearchParams({grant_type:"authorization_code",client_id:b,code:d,redirect_uri:e,code_verifier:f});c&&g.set("client_secret",c);let h=await fetch(a,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:g}),i=await h.json().catch(()=>({}));if(!h.ok)throw Error(i?.error_description||i?.error||`OIDC token exchange failed (${h.status})`);return i}async function G({tokenEndpoint:a,clientId:b,clientSecret:c,redirectUri:d}){if(!c)return{tested:!1,valid:null,message:"No client secret was provided, so secret validation was skipped."};let e=new URLSearchParams({grant_type:"authorization_code",client_id:b,client_secret:c,code:"__oidc_test_invalid_code__",redirect_uri:d,code_verifier:"__oidc_test_invalid_verifier__"}),f=await fetch(a,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:e}),g=await f.json().catch(()=>({})),h=(g?.error||"").toLowerCase(),i=g?.error_description||g?.error||"";return f.ok?{tested:!0,valid:!0,message:"Client secret was accepted by the token endpoint.",raw:g}:"invalid_client"===h||"unauthorized_client"===h||/client.*(invalid|failed|mismatch)/i.test(i)?{tested:!0,valid:!1,message:i||"Client secret is not valid.",raw:g}:"invalid_grant"===h||"invalid_code"===h||/grant|code/i.test(i)?{tested:!0,valid:!0,message:"Client secret was accepted; the token exchange failed only because the test authorization code is invalid.",raw:g}:{tested:!0,valid:null,message:i||`Token endpoint responded with ${f.status}`,raw:g}}async function H({idToken:a,issuer:b,audience:c,jwksUri:e,nonce:f}){let h=function(a){if(!(a instanceof URL))throw TypeError("url must be an instance of URL");let b=new URL(a.href).href,c=(void 0)??{},e=c.timeoutDuration;if("number"==typeof e&&(!Number.isInteger(e)||e<0))throw TypeError('"timeoutDuration" option must be a non-negative integer');let f="number"==typeof e?e:5e3,h=q(c.cooldownDuration,3e4,"cooldownDuration"),i=q(c.cacheMaxAge,6e5,"cacheMaxAge"),k=new Headers(c.headers);d&&!k.has("User-Agent")&&k.set("User-Agent",d),k.has("accept")||k.set("accept","application/json, application/jwk-set+json");let r=c[m],s=c[o],t,u,v=0,w=0,x;if(s&&"object"==typeof s){let{uat:a,jwks:b}=s;p(a,i)&&(0,j.fV)(b)&&(t=a,x=l(b))}let y=async()=>{if(u&&("u">typeof WebSocketPair||"u">typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||"u">typeof EdgeRuntime&&"vercel"===EdgeRuntime)&&(u=void 0),!u){let a=++v,c=u=n(b,k,AbortSignal.timeout(f),r).then(b=>{let c=l(b);if(a<=w)return;x=c;let d=Date.now();s&&(s.uat=d,s.jwks=b),t=d,w=a}).finally(()=>{u===c&&(u=void 0)})}await u};return Object.defineProperties(async(a,b)=>{x&&p(t,i)||await y();try{return await x(a,b)}catch(c){if(c instanceof g.BT&&!p(t,h))return await y(),x(a,b);throw c}},{coolingDown:{get:()=>p(t,h),enumerable:!0},fresh:{get:()=>p(t,i),enumerable:!0},reload:{value:y,enumerable:!0},reloading:{get:()=>!!u,enumerable:!0},jwks:{value:()=>x?.jwks(),enumerable:!0}})}(new URL(e)),{payload:i}=await (0,r.V)(a,h,{issuer:b,audience:c,nonce:f});return i}function I(a={}){return a.preferred_username||a.email||a.name||a.given_name||a.sub||"OIDC user"}function J(a={}){return a.email||""}},33792:(a,b,c)=>{"use strict";c.d(b,{Dc:()=>r,OZ:()=>u,YK:()=>p,dY:()=>s,nz:()=>v,tm:()=>t});var d=c(8292),e=c(17509),f=c(34013),g=c(73024),h=c.n(g),i=c(76760),j=c.n(i),k=c(77598),l=c.n(k),m=c(49120),n=c(89718);let o=new TextEncoder().encode(function(){if(process.env.JWT_SECRET)return process.env.JWT_SECRET;let a=j().join(m.n,"jwt-secret");try{return h().readFileSync(a,"utf8").trim()}catch{}h().mkdirSync(m.n,{recursive:!0});let b=l().randomBytes(32).toString("hex");return h().writeFileSync(a,b,{mode:384}),b}());function p(a){let b="true"===process.env.AUTH_COOKIE_SECURE,c=a?.headers?.get?.("x-forwarded-proto");return b||"https"===c}async function q(a={}){return new d.P({authenticated:!0,...a}).setProtectedHeader({alg:"HS256"}).setIssuedAt().setExpirationTime("24h").sign(o)}async function r(a){if(!a)return!1;try{return await (0,e.V)(a,o),!0}catch{return!1}}async function s(a){if(!a)return null;try{let{payload:b}=await (0,e.V)(a,o);return b}catch{return null}}async function t(a,b,c={}){let d=await q(c);a.set("auth_token",d,{httpOnly:!0,secure:p(b),sameSite:"lax",path:"/",maxAge:86400})}function u(a){a.delete("auth_token")}async function v(a){if("string"!=typeof a||!a)return!1;let b=await (0,n.mt)(),c=b?.password;return c?f.Ay.compare(a,c):a===(process.env.INITIAL_PASSWORD||"123456")}},33873:a=>{"use strict";a.exports=require("path")},34932:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GET:()=>i});var d=c(23211),e=c(65573),f=c(30906),g=c(33792);function h(a){a.delete("oidc_state"),a.delete("oidc_nonce"),a.delete("oidc_code_verifier")}async function i(a){let b=new URL(a.url),c=b.searchParams.get("error");if(c)return d.NextResponse.redirect(new URL(`/login?error=${encodeURIComponent(c)}`,(0,f.iw)(a)));let i=b.searchParams.get("code"),j=b.searchParams.get("state");if(!i||!j)return d.NextResponse.redirect(new URL("/login?error=oidc_missing_code",(0,f.iw)(a)));let k=await (0,e.UL)(),l=k.get("oidc_state")?.value,m=k.get("oidc_nonce")?.value,n=k.get("oidc_code_verifier")?.value;if(!l||!m||!n||l!==j)return h(k),d.NextResponse.redirect(new URL("/login?error=oidc_invalid_state",(0,f.iw)(a)));try{let b=await (0,f.Mj)();if(!b)return h(k),d.NextResponse.redirect(new URL("/login?error=oidc_not_configured",(0,f.iw)(a)));let c=await (0,f.Ir)(b.issuerUrl),e=c.issuer||b.issuerUrl,j=`${(0,f.iw)(a)}/api/auth/oidc/callback`,l=await (0,f.sP)({tokenEndpoint:c.token_endpoint,clientId:b.clientId,clientSecret:b.clientSecret,code:i,redirectUri:j,codeVerifier:n});if(!l.id_token)throw Error("OIDC provider did not return an id_token");let o=await (0,f.x8)({idToken:l.id_token,issuer:e,audience:b.clientId,jwksUri:c.jwks_uri,nonce:m});return h(k),await (0,g.tm)(k,a,{oidc:!0,oidcSub:o.sub||null,oidcEmail:(0,f.Rj)(o)||null,oidcName:(0,f.Ui)(o)}),d.NextResponse.redirect(new URL("/dashboard",(0,f.iw)(a)))}catch(b){return h(k),d.NextResponse.redirect(new URL(`/login?error=${encodeURIComponent(b.message||"oidc_callback_failed")}`,(0,f.iw)(a)))}}},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},46293:a=>{"use strict";a.exports=require("sql.js")},49120:(a,b,c)=>{"use strict";c.d(b,{n:()=>l});var d=c(73024),e=c.n(d),f=c(33873),g=c.n(f),h=c(21820),i=c.n(h);let j="jrouter";function k(){return"win32"===process.platform?g().join(process.env.APPDATA||g().join(i().homedir(),"AppData","Roaming"),j):g().join(i().homedir(),`.${j}`)}let l=function(){let a=process.env.DATA_DIR;if(!a)return k();if("win32"===process.platform&&/^\//.test(a))return console.warn(`[DATA_DIR] '${a}' is a Unix path on Windows → fallback to default`),k();try{return e().mkdirSync(a,{recursive:!0}),a}catch(b){if(b?.code==="EACCES"||b?.code==="EPERM")return console.warn(`[DATA_DIR] '${a}' not writable → fallback ~/.${j}`),k();throw b}}()},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73024:a=>{"use strict";a.exports=require("node:fs")},76760:a=>{"use strict";a.exports=require("node:path")},77598:a=>{"use strict";a.exports=require("node:crypto")},78335:()=>{},79868:a=>{"use strict";a.exports=require("node:sqlite")},81787:a=>{"use strict";a.exports=require("bun:sqlite")},85615:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>A,patchFetch:()=>z,routeModule:()=>v,serverHooks:()=>y,workAsyncStorage:()=>w,workUnitAsyncStorage:()=>x});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(10246),u=c(37527);let v=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/auth/oidc/callback/route",pathname:"/api/auth/oidc/callback",filename:"route",bundlePath:"app/api/auth/oidc/callback/route"},distDir:".next-cli-build",relativeProjectDir:"",resolvedPagePath:"/root/workspace/JRouter/src/app/api/auth/oidc/callback/route.js",nextConfigOutput:"standalone",userland:()=>c(34932),...{}}),{workAsyncStorage:w,workUnitAsyncStorage:x,serverHooks:y}=v;function z(){return(0,f.patchFetch)({workAsyncStorage:w,workUnitAsyncStorage:x})}async function A(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),v.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/auth/oidc/callback/route";"/index"===d&&(d="/");let f=await v.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:w,deploymentId:x,params:y,nextConfig:z,parsedUrl:A,isDraftMode:B,prerenderManifest:C,routerServerContext:D,isOnDemandRevalidate:E,revalidateOnlyGenerated:F,resolvedPathname:G,clientReferenceManifest:H,serverActionsManifest:I}=f,J=(0,j.normalizeAppPath)(d),K=!!C.routes[G]&&(v.isDev||(0,t.isRouteCacheOwner)(G,v.cacheOwner,C.routes[G])),L=!!(C.dynamicRoutes[J]||K),M=async()=>((null==D?void 0:D.render404)?await D.render404(a,b,A,!1):b.end("This page could not be found"),null);if(L&&!B){let a=C.dynamicRoutes[J];if(a&&!1===a.fallback&&!K){if(z.adapterPath)return await M();throw new s.NoFallbackError}}let N=null;!L||v.isDev||B||(N="/index"===(N=G)?"/":N);let O=!0===v.isDev||!L,P=L&&!O;I&&H&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:H,serverActionsManifest:I});let Q=a.method||"GET",R=(0,h.getTracer)(),S=R.getActiveScopeSpan(),T=!!(null==D?void 0:D.isWrappedByNextServer),U=!!(0,g.getRequestMeta)(a,"minimalMode"),V=(0,g.getRequestMeta)(a,"incrementalCache")||await v.getIncrementalCache(a,z,C,U);null==V||V.resetRequestCache(),globalThis.__incrementalCache=V;let W={params:y,previewProps:C.preview,renderOpts:{experimental:{authInterrupts:!!z.experimental.authInterrupts,useCacheTimeout:z.experimental.useCacheTimeout},cacheComponents:!!z.cacheComponents,validationLevel:z.experimental.instantInsights.validationLevel,isDraftMode:B,supportsDynamicResponse:O,incrementalCache:V,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:z.cacheLife,staticPageGenerationTimeout:z.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>v.onRequestError(a,b,d,e,D)},sharedContext:{buildId:w,deploymentId:x}},X=new k.NodeNextRequest(a),Y=new k.NodeNextResponse(b),Z=l.NextRequestAdapter.fromNodeNextRequest(X,(0,l.signalFromNodeResponse)(b)),$=async({previousCacheEntry:e})=>{try{if(!U&&E&&F&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await v.handle(Z,W);a.fetchMetrics=W.renderOpts.fetchMetrics;let f=W.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=W.renderOpts.collectedTags;if(!L)return await (0,o.I)(X,Y,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==W.renderOpts.collectedRevalidate&&!(W.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&W.renderOpts.collectedRevalidate,e=void 0===W.renderOpts.collectedExpire||W.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?z.expireTime:void 0:W.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await v.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:P,isOnDemandRevalidate:E})},!1,D),b}},_=async(d,f)=>{try{var g,i;let d=await v.handleResponse({req:a,nextConfig:z,cacheKey:N,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:C,isRoutePPREnabled:!1,isOnDemandRevalidate:E,revalidateOnlyGenerated:F,responseGenerator:$,waitUntil:c.waitUntil,isMinimalMode:U});if(!L)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});U||b.setHeader("x-nextjs-cache",E?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),B&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);U&&L||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(X,Y,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await v.onRequestError(a,b,{routerKind:"App Router",routePath:J,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:P,isOnDemandRevalidate:E})},!1,D),L)throw b;await (0,o.I)(X,Y,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=R.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||J,g=`${Q} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(T&&S)await _(S,void 0);else{let b=R.getActiveScopeSpan();await R.withPropagatedContext(a.headers,()=>R.trace(m.BaseServerSpan.handleRequest,{spanName:`${Q} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":Q,"http.target":a.url}},a=>_(a,b)),void 0,!T)}}},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87550:a=>{"use strict";a.exports=require("better-sqlite3")},89718:(a,b,c)=>{"use strict";c.d(b,{CG:()=>d.CG,Dj:()=>d.Dj,Fh:()=>d.getProviderNodes,Iq:()=>d.Iq,K1:()=>d.K1,KJ:()=>d.KJ,L:()=>d.L,L9:()=>d.L9,Lh:()=>d.Lh,Mc:()=>d.Mc,OM:()=>d.OM,PX:()=>d.PX,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Uv:()=>d.Uv,VT:()=>d.VT,XW:()=>d.XW,Xx:()=>d.Xx,Yd:()=>d.Yd,ZO:()=>d.ZO,bI:()=>d.bI,c:()=>d.c,ek:()=>d.ek,fK:()=>d.fK,fv:()=>d.fv,getProviderConnections:()=>d.P,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,iE:()=>d.iE,jd:()=>d.jd,mt:()=>d.mt,o5:()=>d.o5,oG:()=>d.oG,op:()=>d.op,r4:()=>d.r4,uL:()=>d.uL,ui:()=>d.ui,updateProviderConnection:()=>d.rj,uv:()=>d.getCustomModels,yF:()=>d.yF,yg:()=>d.yg,zP:()=>d.zP});var d=c(83192)},94735:a=>{"use strict";a.exports=require("events")},96487:()=>{}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[2970,1813,2391,8292,5573,4642,3192],()=>b(b.s=85615));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var a={};a.id=9709,a.ids=[9709],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},7811:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>A,patchFetch:()=>z,routeModule:()=>v,serverHooks:()=>y,workAsyncStorage:()=>w,workUnitAsyncStorage:()=>x});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(10246),u=c(37527);let v=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/auth/oidc/start/route",pathname:"/api/auth/oidc/start",filename:"route",bundlePath:"app/api/auth/oidc/start/route"},distDir:".next-cli-build",relativeProjectDir:"",resolvedPagePath:"/root/workspace/JRouter/src/app/api/auth/oidc/start/route.js",nextConfigOutput:"standalone",userland:()=>c(24503),...{}}),{workAsyncStorage:w,workUnitAsyncStorage:x,serverHooks:y}=v;function z(){return(0,f.patchFetch)({workAsyncStorage:w,workUnitAsyncStorage:x})}async function A(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),v.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/auth/oidc/start/route";"/index"===d&&(d="/");let f=await v.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:w,deploymentId:x,params:y,nextConfig:z,parsedUrl:A,isDraftMode:B,prerenderManifest:C,routerServerContext:D,isOnDemandRevalidate:E,revalidateOnlyGenerated:F,resolvedPathname:G,clientReferenceManifest:H,serverActionsManifest:I}=f,J=(0,j.normalizeAppPath)(d),K=!!C.routes[G]&&(v.isDev||(0,t.isRouteCacheOwner)(G,v.cacheOwner,C.routes[G])),L=!!(C.dynamicRoutes[J]||K),M=async()=>((null==D?void 0:D.render404)?await D.render404(a,b,A,!1):b.end("This page could not be found"),null);if(L&&!B){let a=C.dynamicRoutes[J];if(a&&!1===a.fallback&&!K){if(z.adapterPath)return await M();throw new s.NoFallbackError}}let N=null;!L||v.isDev||B||(N="/index"===(N=G)?"/":N);let O=!0===v.isDev||!L,P=L&&!O;I&&H&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:H,serverActionsManifest:I});let Q=a.method||"GET",R=(0,h.getTracer)(),S=R.getActiveScopeSpan(),T=!!(null==D?void 0:D.isWrappedByNextServer),U=!!(0,g.getRequestMeta)(a,"minimalMode"),V=(0,g.getRequestMeta)(a,"incrementalCache")||await v.getIncrementalCache(a,z,C,U);null==V||V.resetRequestCache(),globalThis.__incrementalCache=V;let W={params:y,previewProps:C.preview,renderOpts:{experimental:{authInterrupts:!!z.experimental.authInterrupts,useCacheTimeout:z.experimental.useCacheTimeout},cacheComponents:!!z.cacheComponents,validationLevel:z.experimental.instantInsights.validationLevel,isDraftMode:B,supportsDynamicResponse:O,incrementalCache:V,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:z.cacheLife,staticPageGenerationTimeout:z.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>v.onRequestError(a,b,d,e,D)},sharedContext:{buildId:w,deploymentId:x}},X=new k.NodeNextRequest(a),Y=new k.NodeNextResponse(b),Z=l.NextRequestAdapter.fromNodeNextRequest(X,(0,l.signalFromNodeResponse)(b)),$=async({previousCacheEntry:e})=>{try{if(!U&&E&&F&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await v.handle(Z,W);a.fetchMetrics=W.renderOpts.fetchMetrics;let f=W.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=W.renderOpts.collectedTags;if(!L)return await (0,o.I)(X,Y,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==W.renderOpts.collectedRevalidate&&!(W.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&W.renderOpts.collectedRevalidate,e=void 0===W.renderOpts.collectedExpire||W.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?z.expireTime:void 0:W.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await v.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:P,isOnDemandRevalidate:E})},!1,D),b}},_=async(d,f)=>{try{var g,i;let d=await v.handleResponse({req:a,nextConfig:z,cacheKey:N,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:C,isRoutePPREnabled:!1,isOnDemandRevalidate:E,revalidateOnlyGenerated:F,responseGenerator:$,waitUntil:c.waitUntil,isMinimalMode:U});if(!L)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});U||b.setHeader("x-nextjs-cache",E?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),B&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);U&&L||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(X,Y,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await v.onRequestError(a,b,{routerKind:"App Router",routePath:J,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:P,isOnDemandRevalidate:E})},!1,D),L)throw b;await (0,o.I)(X,Y,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=R.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||J,g=`${Q} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(T&&S)await _(S,void 0);else{let b=R.getActiveScopeSpan();await R.withPropagatedContext(a.headers,()=>R.trace(m.BaseServerSpan.handleRequest,{spanName:`${Q} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":Q,"http.target":a.url}},a=>_(a,b)),void 0,!T)}}},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},16698:a=>{"use strict";a.exports=require("node:async_hooks")},17509:(a,b,c)=>{"use strict";c.d(b,{V:()=>m});var d=c(80700),e=c(99129),f=c(73575),g=c(38805),h=c(64416);function i(a){try{return(0,f.lF)(a)}catch{throw new e.Ye("JWS Compact Serialization payload must use only ASCII characters")}}async function j(a,b,c,i,j){let{protected:k,header:l,payload:m}=a,n=j??(void 0===k?{}:(0,g.OX)(k,e.Ye,"JWS Protected Header is invalid"));if(!(0,g.fz)(n,l))throw new e.Ye("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let o={...n,...l},p=(0,g.J0)(n,(0,g.nI)(e.Ye,g.qc,b[1],n,o)),{alg:q}=o;if("string"!=typeof q||!q)throw new e.Ye('JWS "alg" (Algorithm) Header Parameter missing or invalid');if(b[0]&&!b[0].has(q))throw new e.Rb('"alg" (Algorithm) Header Parameter value not allowed');if(p){if("string"!=typeof m)throw new e.Ye("JWS Payload must be a string")}else if("string"!=typeof m&&!(m instanceof Uint8Array))throw new e.Ye("JWS Payload must be a string or an Uint8Array instance");let r=p||"string"!=typeof m?m:i(m),s=!1;"function"==typeof c&&(c=await c(n,a),s=!0);let t=(0,d.q)(q),u=(0,f.xW)(void 0!==k?(0,f.lF)(k):new Uint8Array,(0,f.lF)("."),"string"==typeof r?b[2]??=(0,g.Fo)(r,"payload",e.Ye):r),v=(0,g.h2)(a.signature,"signature",e.Ye),w=await (0,h.dT)(t,c,"verify"),x=await (0,h.GK)(w,t.subtle,"verify");t.minRsaBits&&(0,h.or)(t.alg,x);let y=!1;try{y=await crypto.subtle.verify(t.signing,x,v,u)}catch{}if(!y)throw new e.h2;let z={payload:"string"==typeof r?(0,g.h2)(r,"payload",e.Ye):r};return void 0!==k&&(z.protectedHeader=n),void 0!==l&&(z.unprotectedHeader=l),s?[{...z,key:w},p]:[z,p]}async function k(a,b,c){if(a instanceof Uint8Array&&(a=f.D0.decode(a)),"string"!=typeof a)throw new e.Ye("Compact JWS must be a string or Uint8Array");let{0:d,1:g,2:h,length:k}=a.split(".");if(3!==k)throw new e.Ye("Invalid Compact JWS");return j({payload:g,protected:d,signature:h},b,c,i)}var l=c(17347);async function m(a,b,c){let[d,f]=await k(a,[c&&(0,g.Fw)("algorithms",c.algorithms),c?.crit],b);if(!f)throw new e.Dp("JWTs MUST NOT use unencoded payload");let h=(0,l.k6)(d.protectedHeader,d.payload,c);return{...d,payload:h}}},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{"use strict";a.exports=require("os")},24503:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GET:()=>h});var d=c(23211),e=c(65573),f=c(30906),g=c(33792);async function h(a){try{let b=await (0,f.Mj)();if(!b)return d.NextResponse.redirect(new URL("/login?error=oidc_not_configured",(0,f.iw)(a)));let c=await (0,f.Ir)(b.issuerUrl),h=(0,f.Pf)(),i=(0,f.hT)(),{verifier:j,challenge:k}=(0,f.GY)(),l=`${(0,f.iw)(a)}/api/auth/oidc/callback`,m=(0,f.gR)({authorizationEndpoint:c.authorization_endpoint,clientId:b.clientId,redirectUri:l,scopes:b.scopes,state:h,nonce:i,codeChallenge:k}),n=await (0,e.UL)(),o={httpOnly:!0,secure:(0,g.YK)(a),sameSite:"lax",path:"/",maxAge:600};return n.set("oidc_state",h,o),n.set("oidc_nonce",i,o),n.set("oidc_code_verifier",j,o),d.NextResponse.redirect(m)}catch(b){return d.NextResponse.redirect(new URL(`/login?error=${encodeURIComponent(b.message||"oidc_start_failed")}`,(0,f.iw)(a)))}}},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},30906:(a,b,c)=>{"use strict";let d;c.d(b,{gR:()=>E,hT:()=>D,Pf:()=>C,GY:()=>B,sP:()=>F,Ir:()=>A,Mj:()=>z,iw:()=>x,EJ:()=>y,Ui:()=>I,Rj:()=>J,HO:()=>G,x8:()=>H});var e=c(77598),f=c.n(e),g=c(99129),h=c(64416),i=c(80700),j=c(38805);async function k(a,b,c){let d=a.get(b)||a.set(b,{}).get(b),{alg:e}=c;if(void 0===d[e]){let a=(0,h.xY)(c,b,!0).then(a=>{if("public"!==a.type)throw new g.Dm("JSON Web Key Set members must be public keys");return d[e]=a,a}).catch(b=>{throw d[e]===a&&delete d[e],b});d[e]=a}return d[e]}function l(a){let b;try{b=structuredClone(a)}catch{}if(!(0,j.fV)(b))throw new g.Dm("JSON Web Key Set malformed");let c=b.keys.map(a=>{let b=(0,h.ZZ)(a);return Array.isArray(b.key_ops)&&(b.key_ops=[...b.key_ops]),b}),d=new WeakMap;return Object.defineProperty(async(a,e)=>{let{alg:f,kid:h}={...a,...e?.header},j="string"==typeof f?i.p[f]:void 0;if(!j||j.secret)throw new g.T0('Unsupported "alg" value for a JSON Web Key Set');let l=b.keys.filter((a,b)=>(function(a,b,c,d){let{kty:e,key_ops:f,ext:g,kid:h,alg:i,use:j,crv:k}=a;return(void 0===g||"boolean"==typeof g)&&(void 0===f||Array.isArray(f)&&f.every((a,b)=>"string"==typeof a&&f.indexOf(a)===b)&&f.includes("verify"))&&b.kty.includes(e)&&(void 0===d||"string"==typeof d&&d===h)&&(void 0===i?"AKP"!==e:c===i)&&(void 0===j||"sig"===j)&&(!b.crv||k===b.crv)})(c[b],j,f,h)),{0:m,length:n}=l;if(!n)throw new g.BT;if(1!==n){let a=new g.$4;throw a[Symbol.asyncIterator]=async function*(){for(let a of l)try{yield await k(d,a,j)}catch{}},a}return k(d,m,j)},"jwks",{value:()=>structuredClone(b)})}(typeof navigator>"u"||!navigator.userAgent?.startsWith?.("Mozilla/5.0 "))&&(d="jose/v6.2.12");let m=Symbol();async function n(a,b,c,d=fetch){let e=await d(a,{method:"GET",signal:c,redirect:"manual",headers:b}).catch(a=>{throw"TimeoutError"===a.name?new g.xb:a});if(200!==e.status)throw new g.i4("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await e.json()}catch{throw new g.i4("Failed to parse the JSON Web Key Set HTTP response as JSON")}}let o=Symbol();function p(a,b){return Number.isFinite(a)&&Date.now()<a+b}function q(a,b,c){if(Number.isNaN(a))throw TypeError(`"${c}" option must not be NaN`);return"number"==typeof a?a:b}var r=c(17509),s=c(89718);let t="openid profile email",u="Sign in with OIDC";function v(a){return(a||"").trim().replace(/\/+$/,"")}function w(a){return(a||t).trim()||t}function x(a){let b=process.env.BASE_URL||"http://localhost:20128";if(b)return v(b);let c=a?.headers?.get?.("x-forwarded-proto")||"",d=a?.headers?.get?.("x-forwarded-host")||a?.headers?.get?.("host")||"";if(d){let b=(c||new URL(a.url).protocol||"http:").replace(/:$/,"");return`${b}://${d}`.replace(/\/+$/,"")}return v(new URL(a.url).origin)}function y(a){return!!(v(a?.oidcIssuerUrl)&&(a?.oidcClientId||"").trim()&&(a?.oidcClientSecret||"").trim())}async function z(){let a=await (0,s.mt)();return["oidc","both"].includes(a.authMode)&&y(a)?{issuerUrl:v(a.oidcIssuerUrl),clientId:a.oidcClientId.trim(),clientSecret:a.oidcClientSecret.trim(),scopes:w(a.oidcScopes),loginLabel:(a.oidcLoginLabel||u).trim()||u}:null}async function A(a){let b=`${v(a)}/.well-known/openid-configuration`,c=await fetch(b,{cache:"no-store"});if(!c.ok)throw Error(`Failed to load OIDC discovery document from ${b}`);return await c.json()}function B(){let a=f().randomBytes(32).toString("base64url"),b=f().createHash("sha256").update(a).digest("base64url");return{verifier:a,challenge:b}}function C(){return f().randomBytes(16).toString("base64url")}function D(){return f().randomBytes(16).toString("base64url")}function E({authorizationEndpoint:a,clientId:b,redirectUri:c,scopes:d=t,state:e,nonce:f,codeChallenge:g}){let h=new URL(a);return h.searchParams.set("response_type","code"),h.searchParams.set("client_id",b),h.searchParams.set("redirect_uri",c),h.searchParams.set("scope",w(d)),h.searchParams.set("state",e),h.searchParams.set("nonce",f),h.searchParams.set("code_challenge",g),h.searchParams.set("code_challenge_method","S256"),h.toString()}async function F({tokenEndpoint:a,clientId:b,clientSecret:c,code:d,redirectUri:e,codeVerifier:f}){let g=new URLSearchParams({grant_type:"authorization_code",client_id:b,code:d,redirect_uri:e,code_verifier:f});c&&g.set("client_secret",c);let h=await fetch(a,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:g}),i=await h.json().catch(()=>({}));if(!h.ok)throw Error(i?.error_description||i?.error||`OIDC token exchange failed (${h.status})`);return i}async function G({tokenEndpoint:a,clientId:b,clientSecret:c,redirectUri:d}){if(!c)return{tested:!1,valid:null,message:"No client secret was provided, so secret validation was skipped."};let e=new URLSearchParams({grant_type:"authorization_code",client_id:b,client_secret:c,code:"__oidc_test_invalid_code__",redirect_uri:d,code_verifier:"__oidc_test_invalid_verifier__"}),f=await fetch(a,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:e}),g=await f.json().catch(()=>({})),h=(g?.error||"").toLowerCase(),i=g?.error_description||g?.error||"";return f.ok?{tested:!0,valid:!0,message:"Client secret was accepted by the token endpoint.",raw:g}:"invalid_client"===h||"unauthorized_client"===h||/client.*(invalid|failed|mismatch)/i.test(i)?{tested:!0,valid:!1,message:i||"Client secret is not valid.",raw:g}:"invalid_grant"===h||"invalid_code"===h||/grant|code/i.test(i)?{tested:!0,valid:!0,message:"Client secret was accepted; the token exchange failed only because the test authorization code is invalid.",raw:g}:{tested:!0,valid:null,message:i||`Token endpoint responded with ${f.status}`,raw:g}}async function H({idToken:a,issuer:b,audience:c,jwksUri:e,nonce:f}){let h=function(a){if(!(a instanceof URL))throw TypeError("url must be an instance of URL");let b=new URL(a.href).href,c=(void 0)??{},e=c.timeoutDuration;if("number"==typeof e&&(!Number.isInteger(e)||e<0))throw TypeError('"timeoutDuration" option must be a non-negative integer');let f="number"==typeof e?e:5e3,h=q(c.cooldownDuration,3e4,"cooldownDuration"),i=q(c.cacheMaxAge,6e5,"cacheMaxAge"),k=new Headers(c.headers);d&&!k.has("User-Agent")&&k.set("User-Agent",d),k.has("accept")||k.set("accept","application/json, application/jwk-set+json");let r=c[m],s=c[o],t,u,v=0,w=0,x;if(s&&"object"==typeof s){let{uat:a,jwks:b}=s;p(a,i)&&(0,j.fV)(b)&&(t=a,x=l(b))}let y=async()=>{if(u&&("u">typeof WebSocketPair||"u">typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||"u">typeof EdgeRuntime&&"vercel"===EdgeRuntime)&&(u=void 0),!u){let a=++v,c=u=n(b,k,AbortSignal.timeout(f),r).then(b=>{let c=l(b);if(a<=w)return;x=c;let d=Date.now();s&&(s.uat=d,s.jwks=b),t=d,w=a}).finally(()=>{u===c&&(u=void 0)})}await u};return Object.defineProperties(async(a,b)=>{x&&p(t,i)||await y();try{return await x(a,b)}catch(c){if(c instanceof g.BT&&!p(t,h))return await y(),x(a,b);throw c}},{coolingDown:{get:()=>p(t,h),enumerable:!0},fresh:{get:()=>p(t,i),enumerable:!0},reload:{value:y,enumerable:!0},reloading:{get:()=>!!u,enumerable:!0},jwks:{value:()=>x?.jwks(),enumerable:!0}})}(new URL(e)),{payload:i}=await (0,r.V)(a,h,{issuer:b,audience:c,nonce:f});return i}function I(a={}){return a.preferred_username||a.email||a.name||a.given_name||a.sub||"OIDC user"}function J(a={}){return a.email||""}},33792:(a,b,c)=>{"use strict";c.d(b,{Dc:()=>r,OZ:()=>u,YK:()=>p,dY:()=>s,nz:()=>v,tm:()=>t});var d=c(8292),e=c(17509),f=c(34013),g=c(73024),h=c.n(g),i=c(76760),j=c.n(i),k=c(77598),l=c.n(k),m=c(49120),n=c(89718);let o=new TextEncoder().encode(function(){if(process.env.JWT_SECRET)return process.env.JWT_SECRET;let a=j().join(m.n,"jwt-secret");try{return h().readFileSync(a,"utf8").trim()}catch{}h().mkdirSync(m.n,{recursive:!0});let b=l().randomBytes(32).toString("hex");return h().writeFileSync(a,b,{mode:384}),b}());function p(a){let b="true"===process.env.AUTH_COOKIE_SECURE,c=a?.headers?.get?.("x-forwarded-proto");return b||"https"===c}async function q(a={}){return new d.P({authenticated:!0,...a}).setProtectedHeader({alg:"HS256"}).setIssuedAt().setExpirationTime("24h").sign(o)}async function r(a){if(!a)return!1;try{return await (0,e.V)(a,o),!0}catch{return!1}}async function s(a){if(!a)return null;try{let{payload:b}=await (0,e.V)(a,o);return b}catch{return null}}async function t(a,b,c={}){let d=await q(c);a.set("auth_token",d,{httpOnly:!0,secure:p(b),sameSite:"lax",path:"/",maxAge:86400})}function u(a){a.delete("auth_token")}async function v(a){if("string"!=typeof a||!a)return!1;let b=await (0,n.mt)(),c=b?.password;return c?f.Ay.compare(a,c):a===(process.env.INITIAL_PASSWORD||"123456")}},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},46293:a=>{"use strict";a.exports=require("sql.js")},49120:(a,b,c)=>{"use strict";c.d(b,{n:()=>l});var d=c(73024),e=c.n(d),f=c(33873),g=c.n(f),h=c(21820),i=c.n(h);let j="9router";function k(){return"win32"===process.platform?g().join(process.env.APPDATA||g().join(i().homedir(),"AppData","Roaming"),j):g().join(i().homedir(),`.${j}`)}let l=function(){let a=process.env.DATA_DIR;if(!a)return k();if("win32"===process.platform&&/^\//.test(a))return console.warn(`[DATA_DIR] '${a}' is a Unix path on Windows → fallback to default`),k();try{return e().mkdirSync(a,{recursive:!0}),a}catch(b){if(b?.code==="EACCES"||b?.code==="EPERM")return console.warn(`[DATA_DIR] '${a}' not writable → fallback ~/.${j}`),k();throw b}}()},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73024:a=>{"use strict";a.exports=require("node:fs")},76760:a=>{"use strict";a.exports=require("node:path")},77598:a=>{"use strict";a.exports=require("node:crypto")},78335:()=>{},79868:a=>{"use strict";a.exports=require("node:sqlite")},81787:a=>{"use strict";a.exports=require("bun:sqlite")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87550:a=>{"use strict";a.exports=require("better-sqlite3")},89718:(a,b,c)=>{"use strict";c.d(b,{CG:()=>d.CG,Dj:()=>d.Dj,Fh:()=>d.getProviderNodes,Iq:()=>d.Iq,K1:()=>d.K1,KJ:()=>d.KJ,L:()=>d.L,L9:()=>d.L9,Lh:()=>d.Lh,Mc:()=>d.Mc,OM:()=>d.OM,PX:()=>d.PX,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Uv:()=>d.Uv,VT:()=>d.VT,XW:()=>d.XW,Xx:()=>d.Xx,Yd:()=>d.Yd,ZO:()=>d.ZO,bI:()=>d.bI,c:()=>d.c,ek:()=>d.ek,fK:()=>d.fK,fv:()=>d.fv,getProviderConnections:()=>d.P,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,iE:()=>d.iE,jd:()=>d.jd,mt:()=>d.mt,o5:()=>d.o5,oG:()=>d.oG,op:()=>d.op,r4:()=>d.r4,uL:()=>d.uL,ui:()=>d.ui,updateProviderConnection:()=>d.rj,uv:()=>d.getCustomModels,yF:()=>d.yF,yg:()=>d.yg,zP:()=>d.zP});var d=c(83192)},94735:a=>{"use strict";a.exports=require("events")},96487:()=>{}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[2970,1813,2391,8292,5573,4642,3192],()=>b(b.s=7811));module.exports=c})();
|
|
1
|
+
(()=>{var a={};a.id=9709,a.ids=[9709],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},7811:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>A,patchFetch:()=>z,routeModule:()=>v,serverHooks:()=>y,workAsyncStorage:()=>w,workUnitAsyncStorage:()=>x});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(10246),u=c(37527);let v=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/auth/oidc/start/route",pathname:"/api/auth/oidc/start",filename:"route",bundlePath:"app/api/auth/oidc/start/route"},distDir:".next-cli-build",relativeProjectDir:"",resolvedPagePath:"/root/workspace/JRouter/src/app/api/auth/oidc/start/route.js",nextConfigOutput:"standalone",userland:()=>c(24503),...{}}),{workAsyncStorage:w,workUnitAsyncStorage:x,serverHooks:y}=v;function z(){return(0,f.patchFetch)({workAsyncStorage:w,workUnitAsyncStorage:x})}async function A(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),v.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/auth/oidc/start/route";"/index"===d&&(d="/");let f=await v.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:w,deploymentId:x,params:y,nextConfig:z,parsedUrl:A,isDraftMode:B,prerenderManifest:C,routerServerContext:D,isOnDemandRevalidate:E,revalidateOnlyGenerated:F,resolvedPathname:G,clientReferenceManifest:H,serverActionsManifest:I}=f,J=(0,j.normalizeAppPath)(d),K=!!C.routes[G]&&(v.isDev||(0,t.isRouteCacheOwner)(G,v.cacheOwner,C.routes[G])),L=!!(C.dynamicRoutes[J]||K),M=async()=>((null==D?void 0:D.render404)?await D.render404(a,b,A,!1):b.end("This page could not be found"),null);if(L&&!B){let a=C.dynamicRoutes[J];if(a&&!1===a.fallback&&!K){if(z.adapterPath)return await M();throw new s.NoFallbackError}}let N=null;!L||v.isDev||B||(N="/index"===(N=G)?"/":N);let O=!0===v.isDev||!L,P=L&&!O;I&&H&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:H,serverActionsManifest:I});let Q=a.method||"GET",R=(0,h.getTracer)(),S=R.getActiveScopeSpan(),T=!!(null==D?void 0:D.isWrappedByNextServer),U=!!(0,g.getRequestMeta)(a,"minimalMode"),V=(0,g.getRequestMeta)(a,"incrementalCache")||await v.getIncrementalCache(a,z,C,U);null==V||V.resetRequestCache(),globalThis.__incrementalCache=V;let W={params:y,previewProps:C.preview,renderOpts:{experimental:{authInterrupts:!!z.experimental.authInterrupts,useCacheTimeout:z.experimental.useCacheTimeout},cacheComponents:!!z.cacheComponents,validationLevel:z.experimental.instantInsights.validationLevel,isDraftMode:B,supportsDynamicResponse:O,incrementalCache:V,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:z.cacheLife,staticPageGenerationTimeout:z.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>v.onRequestError(a,b,d,e,D)},sharedContext:{buildId:w,deploymentId:x}},X=new k.NodeNextRequest(a),Y=new k.NodeNextResponse(b),Z=l.NextRequestAdapter.fromNodeNextRequest(X,(0,l.signalFromNodeResponse)(b)),$=async({previousCacheEntry:e})=>{try{if(!U&&E&&F&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await v.handle(Z,W);a.fetchMetrics=W.renderOpts.fetchMetrics;let f=W.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=W.renderOpts.collectedTags;if(!L)return await (0,o.I)(X,Y,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==W.renderOpts.collectedRevalidate&&!(W.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&W.renderOpts.collectedRevalidate,e=void 0===W.renderOpts.collectedExpire||W.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?z.expireTime:void 0:W.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await v.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:P,isOnDemandRevalidate:E})},!1,D),b}},_=async(d,f)=>{try{var g,i;let d=await v.handleResponse({req:a,nextConfig:z,cacheKey:N,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:C,isRoutePPREnabled:!1,isOnDemandRevalidate:E,revalidateOnlyGenerated:F,responseGenerator:$,waitUntil:c.waitUntil,isMinimalMode:U});if(!L)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});U||b.setHeader("x-nextjs-cache",E?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),B&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);U&&L||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(X,Y,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await v.onRequestError(a,b,{routerKind:"App Router",routePath:J,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:P,isOnDemandRevalidate:E})},!1,D),L)throw b;await (0,o.I)(X,Y,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=R.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||J,g=`${Q} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(T&&S)await _(S,void 0);else{let b=R.getActiveScopeSpan();await R.withPropagatedContext(a.headers,()=>R.trace(m.BaseServerSpan.handleRequest,{spanName:`${Q} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":Q,"http.target":a.url}},a=>_(a,b)),void 0,!T)}}},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},16698:a=>{"use strict";a.exports=require("node:async_hooks")},17509:(a,b,c)=>{"use strict";c.d(b,{V:()=>m});var d=c(80700),e=c(99129),f=c(73575),g=c(38805),h=c(64416);function i(a){try{return(0,f.lF)(a)}catch{throw new e.Ye("JWS Compact Serialization payload must use only ASCII characters")}}async function j(a,b,c,i,j){let{protected:k,header:l,payload:m}=a,n=j??(void 0===k?{}:(0,g.OX)(k,e.Ye,"JWS Protected Header is invalid"));if(!(0,g.fz)(n,l))throw new e.Ye("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let o={...n,...l},p=(0,g.J0)(n,(0,g.nI)(e.Ye,g.qc,b[1],n,o)),{alg:q}=o;if("string"!=typeof q||!q)throw new e.Ye('JWS "alg" (Algorithm) Header Parameter missing or invalid');if(b[0]&&!b[0].has(q))throw new e.Rb('"alg" (Algorithm) Header Parameter value not allowed');if(p){if("string"!=typeof m)throw new e.Ye("JWS Payload must be a string")}else if("string"!=typeof m&&!(m instanceof Uint8Array))throw new e.Ye("JWS Payload must be a string or an Uint8Array instance");let r=p||"string"!=typeof m?m:i(m),s=!1;"function"==typeof c&&(c=await c(n,a),s=!0);let t=(0,d.q)(q),u=(0,f.xW)(void 0!==k?(0,f.lF)(k):new Uint8Array,(0,f.lF)("."),"string"==typeof r?b[2]??=(0,g.Fo)(r,"payload",e.Ye):r),v=(0,g.h2)(a.signature,"signature",e.Ye),w=await (0,h.dT)(t,c,"verify"),x=await (0,h.GK)(w,t.subtle,"verify");t.minRsaBits&&(0,h.or)(t.alg,x);let y=!1;try{y=await crypto.subtle.verify(t.signing,x,v,u)}catch{}if(!y)throw new e.h2;let z={payload:"string"==typeof r?(0,g.h2)(r,"payload",e.Ye):r};return void 0!==k&&(z.protectedHeader=n),void 0!==l&&(z.unprotectedHeader=l),s?[{...z,key:w},p]:[z,p]}async function k(a,b,c){if(a instanceof Uint8Array&&(a=f.D0.decode(a)),"string"!=typeof a)throw new e.Ye("Compact JWS must be a string or Uint8Array");let{0:d,1:g,2:h,length:k}=a.split(".");if(3!==k)throw new e.Ye("Invalid Compact JWS");return j({payload:g,protected:d,signature:h},b,c,i)}var l=c(17347);async function m(a,b,c){let[d,f]=await k(a,[c&&(0,g.Fw)("algorithms",c.algorithms),c?.crit],b);if(!f)throw new e.Dp("JWTs MUST NOT use unencoded payload");let h=(0,l.k6)(d.protectedHeader,d.payload,c);return{...d,payload:h}}},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{"use strict";a.exports=require("os")},24503:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GET:()=>h});var d=c(23211),e=c(65573),f=c(30906),g=c(33792);async function h(a){try{let b=await (0,f.Mj)();if(!b)return d.NextResponse.redirect(new URL("/login?error=oidc_not_configured",(0,f.iw)(a)));let c=await (0,f.Ir)(b.issuerUrl),h=(0,f.Pf)(),i=(0,f.hT)(),{verifier:j,challenge:k}=(0,f.GY)(),l=`${(0,f.iw)(a)}/api/auth/oidc/callback`,m=(0,f.gR)({authorizationEndpoint:c.authorization_endpoint,clientId:b.clientId,redirectUri:l,scopes:b.scopes,state:h,nonce:i,codeChallenge:k}),n=await (0,e.UL)(),o={httpOnly:!0,secure:(0,g.YK)(a),sameSite:"lax",path:"/",maxAge:600};return n.set("oidc_state",h,o),n.set("oidc_nonce",i,o),n.set("oidc_code_verifier",j,o),d.NextResponse.redirect(m)}catch(b){return d.NextResponse.redirect(new URL(`/login?error=${encodeURIComponent(b.message||"oidc_start_failed")}`,(0,f.iw)(a)))}}},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},30906:(a,b,c)=>{"use strict";let d;c.d(b,{gR:()=>E,hT:()=>D,Pf:()=>C,GY:()=>B,sP:()=>F,Ir:()=>A,Mj:()=>z,iw:()=>x,EJ:()=>y,Ui:()=>I,Rj:()=>J,HO:()=>G,x8:()=>H});var e=c(77598),f=c.n(e),g=c(99129),h=c(64416),i=c(80700),j=c(38805);async function k(a,b,c){let d=a.get(b)||a.set(b,{}).get(b),{alg:e}=c;if(void 0===d[e]){let a=(0,h.xY)(c,b,!0).then(a=>{if("public"!==a.type)throw new g.Dm("JSON Web Key Set members must be public keys");return d[e]=a,a}).catch(b=>{throw d[e]===a&&delete d[e],b});d[e]=a}return d[e]}function l(a){let b;try{b=structuredClone(a)}catch{}if(!(0,j.fV)(b))throw new g.Dm("JSON Web Key Set malformed");let c=b.keys.map(a=>{let b=(0,h.ZZ)(a);return Array.isArray(b.key_ops)&&(b.key_ops=[...b.key_ops]),b}),d=new WeakMap;return Object.defineProperty(async(a,e)=>{let{alg:f,kid:h}={...a,...e?.header},j="string"==typeof f?i.p[f]:void 0;if(!j||j.secret)throw new g.T0('Unsupported "alg" value for a JSON Web Key Set');let l=b.keys.filter((a,b)=>(function(a,b,c,d){let{kty:e,key_ops:f,ext:g,kid:h,alg:i,use:j,crv:k}=a;return(void 0===g||"boolean"==typeof g)&&(void 0===f||Array.isArray(f)&&f.every((a,b)=>"string"==typeof a&&f.indexOf(a)===b)&&f.includes("verify"))&&b.kty.includes(e)&&(void 0===d||"string"==typeof d&&d===h)&&(void 0===i?"AKP"!==e:c===i)&&(void 0===j||"sig"===j)&&(!b.crv||k===b.crv)})(c[b],j,f,h)),{0:m,length:n}=l;if(!n)throw new g.BT;if(1!==n){let a=new g.$4;throw a[Symbol.asyncIterator]=async function*(){for(let a of l)try{yield await k(d,a,j)}catch{}},a}return k(d,m,j)},"jwks",{value:()=>structuredClone(b)})}(typeof navigator>"u"||!navigator.userAgent?.startsWith?.("Mozilla/5.0 "))&&(d="jose/v6.2.12");let m=Symbol();async function n(a,b,c,d=fetch){let e=await d(a,{method:"GET",signal:c,redirect:"manual",headers:b}).catch(a=>{throw"TimeoutError"===a.name?new g.xb:a});if(200!==e.status)throw new g.i4("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await e.json()}catch{throw new g.i4("Failed to parse the JSON Web Key Set HTTP response as JSON")}}let o=Symbol();function p(a,b){return Number.isFinite(a)&&Date.now()<a+b}function q(a,b,c){if(Number.isNaN(a))throw TypeError(`"${c}" option must not be NaN`);return"number"==typeof a?a:b}var r=c(17509),s=c(89718);let t="openid profile email",u="Sign in with OIDC";function v(a){return(a||"").trim().replace(/\/+$/,"")}function w(a){return(a||t).trim()||t}function x(a){let b=process.env.BASE_URL||"http://localhost:20128";if(b)return v(b);let c=a?.headers?.get?.("x-forwarded-proto")||"",d=a?.headers?.get?.("x-forwarded-host")||a?.headers?.get?.("host")||"";if(d){let b=(c||new URL(a.url).protocol||"http:").replace(/:$/,"");return`${b}://${d}`.replace(/\/+$/,"")}return v(new URL(a.url).origin)}function y(a){return!!(v(a?.oidcIssuerUrl)&&(a?.oidcClientId||"").trim()&&(a?.oidcClientSecret||"").trim())}async function z(){let a=await (0,s.mt)();return["oidc","both"].includes(a.authMode)&&y(a)?{issuerUrl:v(a.oidcIssuerUrl),clientId:a.oidcClientId.trim(),clientSecret:a.oidcClientSecret.trim(),scopes:w(a.oidcScopes),loginLabel:(a.oidcLoginLabel||u).trim()||u}:null}async function A(a){let b=`${v(a)}/.well-known/openid-configuration`,c=await fetch(b,{cache:"no-store"});if(!c.ok)throw Error(`Failed to load OIDC discovery document from ${b}`);return await c.json()}function B(){let a=f().randomBytes(32).toString("base64url"),b=f().createHash("sha256").update(a).digest("base64url");return{verifier:a,challenge:b}}function C(){return f().randomBytes(16).toString("base64url")}function D(){return f().randomBytes(16).toString("base64url")}function E({authorizationEndpoint:a,clientId:b,redirectUri:c,scopes:d=t,state:e,nonce:f,codeChallenge:g}){let h=new URL(a);return h.searchParams.set("response_type","code"),h.searchParams.set("client_id",b),h.searchParams.set("redirect_uri",c),h.searchParams.set("scope",w(d)),h.searchParams.set("state",e),h.searchParams.set("nonce",f),h.searchParams.set("code_challenge",g),h.searchParams.set("code_challenge_method","S256"),h.toString()}async function F({tokenEndpoint:a,clientId:b,clientSecret:c,code:d,redirectUri:e,codeVerifier:f}){let g=new URLSearchParams({grant_type:"authorization_code",client_id:b,code:d,redirect_uri:e,code_verifier:f});c&&g.set("client_secret",c);let h=await fetch(a,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:g}),i=await h.json().catch(()=>({}));if(!h.ok)throw Error(i?.error_description||i?.error||`OIDC token exchange failed (${h.status})`);return i}async function G({tokenEndpoint:a,clientId:b,clientSecret:c,redirectUri:d}){if(!c)return{tested:!1,valid:null,message:"No client secret was provided, so secret validation was skipped."};let e=new URLSearchParams({grant_type:"authorization_code",client_id:b,client_secret:c,code:"__oidc_test_invalid_code__",redirect_uri:d,code_verifier:"__oidc_test_invalid_verifier__"}),f=await fetch(a,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:e}),g=await f.json().catch(()=>({})),h=(g?.error||"").toLowerCase(),i=g?.error_description||g?.error||"";return f.ok?{tested:!0,valid:!0,message:"Client secret was accepted by the token endpoint.",raw:g}:"invalid_client"===h||"unauthorized_client"===h||/client.*(invalid|failed|mismatch)/i.test(i)?{tested:!0,valid:!1,message:i||"Client secret is not valid.",raw:g}:"invalid_grant"===h||"invalid_code"===h||/grant|code/i.test(i)?{tested:!0,valid:!0,message:"Client secret was accepted; the token exchange failed only because the test authorization code is invalid.",raw:g}:{tested:!0,valid:null,message:i||`Token endpoint responded with ${f.status}`,raw:g}}async function H({idToken:a,issuer:b,audience:c,jwksUri:e,nonce:f}){let h=function(a){if(!(a instanceof URL))throw TypeError("url must be an instance of URL");let b=new URL(a.href).href,c=(void 0)??{},e=c.timeoutDuration;if("number"==typeof e&&(!Number.isInteger(e)||e<0))throw TypeError('"timeoutDuration" option must be a non-negative integer');let f="number"==typeof e?e:5e3,h=q(c.cooldownDuration,3e4,"cooldownDuration"),i=q(c.cacheMaxAge,6e5,"cacheMaxAge"),k=new Headers(c.headers);d&&!k.has("User-Agent")&&k.set("User-Agent",d),k.has("accept")||k.set("accept","application/json, application/jwk-set+json");let r=c[m],s=c[o],t,u,v=0,w=0,x;if(s&&"object"==typeof s){let{uat:a,jwks:b}=s;p(a,i)&&(0,j.fV)(b)&&(t=a,x=l(b))}let y=async()=>{if(u&&("u">typeof WebSocketPair||"u">typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||"u">typeof EdgeRuntime&&"vercel"===EdgeRuntime)&&(u=void 0),!u){let a=++v,c=u=n(b,k,AbortSignal.timeout(f),r).then(b=>{let c=l(b);if(a<=w)return;x=c;let d=Date.now();s&&(s.uat=d,s.jwks=b),t=d,w=a}).finally(()=>{u===c&&(u=void 0)})}await u};return Object.defineProperties(async(a,b)=>{x&&p(t,i)||await y();try{return await x(a,b)}catch(c){if(c instanceof g.BT&&!p(t,h))return await y(),x(a,b);throw c}},{coolingDown:{get:()=>p(t,h),enumerable:!0},fresh:{get:()=>p(t,i),enumerable:!0},reload:{value:y,enumerable:!0},reloading:{get:()=>!!u,enumerable:!0},jwks:{value:()=>x?.jwks(),enumerable:!0}})}(new URL(e)),{payload:i}=await (0,r.V)(a,h,{issuer:b,audience:c,nonce:f});return i}function I(a={}){return a.preferred_username||a.email||a.name||a.given_name||a.sub||"OIDC user"}function J(a={}){return a.email||""}},33792:(a,b,c)=>{"use strict";c.d(b,{Dc:()=>r,OZ:()=>u,YK:()=>p,dY:()=>s,nz:()=>v,tm:()=>t});var d=c(8292),e=c(17509),f=c(34013),g=c(73024),h=c.n(g),i=c(76760),j=c.n(i),k=c(77598),l=c.n(k),m=c(49120),n=c(89718);let o=new TextEncoder().encode(function(){if(process.env.JWT_SECRET)return process.env.JWT_SECRET;let a=j().join(m.n,"jwt-secret");try{return h().readFileSync(a,"utf8").trim()}catch{}h().mkdirSync(m.n,{recursive:!0});let b=l().randomBytes(32).toString("hex");return h().writeFileSync(a,b,{mode:384}),b}());function p(a){let b="true"===process.env.AUTH_COOKIE_SECURE,c=a?.headers?.get?.("x-forwarded-proto");return b||"https"===c}async function q(a={}){return new d.P({authenticated:!0,...a}).setProtectedHeader({alg:"HS256"}).setIssuedAt().setExpirationTime("24h").sign(o)}async function r(a){if(!a)return!1;try{return await (0,e.V)(a,o),!0}catch{return!1}}async function s(a){if(!a)return null;try{let{payload:b}=await (0,e.V)(a,o);return b}catch{return null}}async function t(a,b,c={}){let d=await q(c);a.set("auth_token",d,{httpOnly:!0,secure:p(b),sameSite:"lax",path:"/",maxAge:86400})}function u(a){a.delete("auth_token")}async function v(a){if("string"!=typeof a||!a)return!1;let b=await (0,n.mt)(),c=b?.password;return c?f.Ay.compare(a,c):a===(process.env.INITIAL_PASSWORD||"123456")}},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},46293:a=>{"use strict";a.exports=require("sql.js")},49120:(a,b,c)=>{"use strict";c.d(b,{n:()=>l});var d=c(73024),e=c.n(d),f=c(33873),g=c.n(f),h=c(21820),i=c.n(h);let j="jrouter";function k(){return"win32"===process.platform?g().join(process.env.APPDATA||g().join(i().homedir(),"AppData","Roaming"),j):g().join(i().homedir(),`.${j}`)}let l=function(){let a=process.env.DATA_DIR;if(!a)return k();if("win32"===process.platform&&/^\//.test(a))return console.warn(`[DATA_DIR] '${a}' is a Unix path on Windows → fallback to default`),k();try{return e().mkdirSync(a,{recursive:!0}),a}catch(b){if(b?.code==="EACCES"||b?.code==="EPERM")return console.warn(`[DATA_DIR] '${a}' not writable → fallback ~/.${j}`),k();throw b}}()},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73024:a=>{"use strict";a.exports=require("node:fs")},76760:a=>{"use strict";a.exports=require("node:path")},77598:a=>{"use strict";a.exports=require("node:crypto")},78335:()=>{},79868:a=>{"use strict";a.exports=require("node:sqlite")},81787:a=>{"use strict";a.exports=require("bun:sqlite")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87550:a=>{"use strict";a.exports=require("better-sqlite3")},89718:(a,b,c)=>{"use strict";c.d(b,{CG:()=>d.CG,Dj:()=>d.Dj,Fh:()=>d.getProviderNodes,Iq:()=>d.Iq,K1:()=>d.K1,KJ:()=>d.KJ,L:()=>d.L,L9:()=>d.L9,Lh:()=>d.Lh,Mc:()=>d.Mc,OM:()=>d.OM,PX:()=>d.PX,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Uv:()=>d.Uv,VT:()=>d.VT,XW:()=>d.XW,Xx:()=>d.Xx,Yd:()=>d.Yd,ZO:()=>d.ZO,bI:()=>d.bI,c:()=>d.c,ek:()=>d.ek,fK:()=>d.fK,fv:()=>d.fv,getProviderConnections:()=>d.P,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,iE:()=>d.iE,jd:()=>d.jd,mt:()=>d.mt,o5:()=>d.o5,oG:()=>d.oG,op:()=>d.op,r4:()=>d.r4,uL:()=>d.uL,ui:()=>d.ui,updateProviderConnection:()=>d.rj,uv:()=>d.getCustomModels,yF:()=>d.yF,yg:()=>d.yg,zP:()=>d.zP});var d=c(83192)},94735:a=>{"use strict";a.exports=require("events")},96487:()=>{}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[2970,1813,2391,8292,5573,4642,3192],()=>b(b.s=7811));module.exports=c})();
|