zevairouter 1.0.145 → 1.0.147
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/CHANGELOG.md +17 -0
- package/cli/app/.next-cli-build/BUILD_ID +1 -1
- package/cli/app/.next-cli-build/app-path-routes-manifest.json +9 -9
- package/cli/app/.next-cli-build/build-manifest.json +2 -2
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/automation/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/context/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/terminal/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error.html +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/_not-found.html +1 -1
- package/cli/app/.next-cli-build/server/app/_not-found.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/api/models/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/version/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/callback.html +1 -1
- package/cli/app/.next-cli-build/server/app/callback.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/automation.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/automation.rsc +6 -6
- package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard/automation/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard/automation.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_full.segment.rsc +6 -6
- package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_index.segment.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_tree.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +6 -6
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +6 -6
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +6 -6
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +6 -6
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/combos.rsc +6 -6
- package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +6 -6
- package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/context.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/context.rsc +6 -6
- package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard/context/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard/context.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_full.segment.rsc +6 -6
- package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_index.segment.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_tree.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.rsc +6 -6
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +6 -6
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +6 -6
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +6 -6
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.rsc +6 -6
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +6 -6
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/playground.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/playground.rsc +6 -6
- package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard/playground/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard/playground.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_full.segment.rsc +6 -6
- package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_index.segment.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_tree.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/profile.rsc +6 -6
- package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +6 -6
- package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.rsc +6 -6
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +6 -6
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers.rsc +6 -6
- package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +6 -6
- package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +6 -6
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +6 -6
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +6 -6
- package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +6 -6
- package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_index.segment.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/quota.rsc +7 -7
- package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +7 -7
- package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/token-saver.rsc +6 -6
- package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +6 -6
- package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/translator.rsc +6 -6
- package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +6 -6
- package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/usage.rsc +6 -6
- package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +6 -6
- package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard.rsc +6 -6
- package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +6 -6
- package/cli/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/index.html +1 -1
- package/cli/app/.next-cli-build/server/app/index.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/landing.html +1 -1
- package/cli/app/.next-cli-build/server/app/landing.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/login.html +1 -1
- package/cli/app/.next-cli-build/server/app/login.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app-paths-manifest.json +9 -9
- package/cli/app/.next-cli-build/server/chunks/3155.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/412.js +2 -2
- package/cli/app/.next-cli-build/server/chunks/4746.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/5307.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/5469.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/8242.js +2 -2
- package/cli/app/.next-cli-build/server/chunks/8306.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/9621.js +1 -1
- package/cli/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/pages/404.html +1 -1
- package/cli/app/.next-cli-build/server/pages/500.html +1 -1
- package/cli/app/.next-cli-build/static/chunks/523-176a0660a9383518.js +3 -0
- package/cli/app/.next-cli-build/static/chunks/5497-8d0ec2995dc0a392.js +7 -0
- package/cli/app/.next-cli-build/static/chunks/{620-b21eb963d0189283.js → 620-375754e53341e85b.js} +1 -1
- package/cli/app/.next-cli-build/static/chunks/9126-7d5476f17beddfb0.js +1 -0
- package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-2468e6ba8d1efeec.js +1 -0
- package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-579bf915396efc69.js +1 -0
- package/cli/app/.next-cli-build/static/css/87ffa46afc2273f4.css +1 -0
- package/cli/app/CHANGELOG.md +17 -0
- package/cli/app/package.json +1 -1
- package/cli/package.json +1 -1
- package/package.json +1 -1
- package/src/app/(dashboard)/dashboard/basic-chat/BasicChatPageClient.js +91 -38
- package/src/app/(dashboard)/dashboard/endpoint/EndpointPageClient.js +45 -38
- package/src/app/(dashboard)/dashboard/providers/page.js +199 -173
- package/src/app/(dashboard)/dashboard/usage/components/OverviewCards.js +11 -17
- package/src/app/(dashboard)/dashboard/usage/components/ProviderLimits/QuotaTable.js +15 -9
- package/src/app/(dashboard)/dashboard/usage/components/ProviderLimits/index.js +188 -120
- package/src/app/(dashboard)/dashboard/usage/components/ProviderTopology.js +149 -24
- package/src/shared/components/Header.js +4 -4
- package/src/shared/components/HeaderLanguage.js +2 -1
- package/src/shared/components/HeaderMenu.js +2 -1
- package/src/shared/components/Toggle.js +28 -12
- package/src/shared/components/UsageStats.js +3 -3
- package/cli/app/.next-cli-build/static/chunks/523-078802482e95c757.js +0 -3
- package/cli/app/.next-cli-build/static/chunks/5497-276ef7bcaaa911b7.js +0 -7
- package/cli/app/.next-cli-build/static/chunks/9126-9e1755f122b943cd.js +0 -1
- package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-2cedde97aaf3c729.js +0 -1
- package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-6050ac2547c62b54.js +0 -1
- package/cli/app/.next-cli-build/static/css/b912482d9fc0b2ed.css +0 -1
- /package/cli/app/.next-cli-build/static/{x2eyEbk18Mgl67fqRmEFx → y-U4C09T7DItXT7CZZV41}/_buildManifest.js +0 -0
- /package/cli/app/.next-cli-build/static/{x2eyEbk18Mgl67fqRmEFx → y-U4C09T7DItXT7CZZV41}/_ssgManifest.js +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
exports.id=8242,exports.ids=[8242],exports.modules={43173:(a,b,c)=>{"use strict";c.d(b,{default:()=>m});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(2116),i=c.n(h),j=c(50412),k=c(50377);let l=[{icon:"public",title:"Access Anywhere",desc:"Use your API from any network"},{icon:"group",title:"Share Endpoint",desc:"Share URL with team members"},{icon:"code",title:"Use in Cursor/Cline",desc:"Connect AI tools remotely"},{icon:"lock",title:"Encrypted",desc:"End-to-end TLS via Cloudflare"}];function m({machineId:a}){let[b,c]=(0,e.useState)([]),[f,g]=(0,e.useState)(!0),[h,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)(""),[u,v]=(0,e.useState)(null),[w,x]=(0,e.useState)(null),[y,z]=(0,e.useState)(null),[A,B]=(0,e.useState)(null),[C,D]=(0,e.useState)(()=>new Set),[E,F]=(0,e.useState)(()=>({})),[G,H]=(0,e.useState)(!1),[I,J]=(0,e.useState)(!0),[K,L]=(0,e.useState)(!0),[M,N]=(0,e.useState)(!1),[O,P]=(0,e.useState)(!0),[Q,R]=(0,e.useState)(!1),[S,T]=(0,e.useState)(!1),[U,V]=(0,e.useState)(""),[W,X]=(0,e.useState)(""),[Y,Z]=(0,e.useState)(!1),[$,_]=(0,e.useState)(""),[aa,ab]=(0,e.useState)(null),[ac,ad]=(0,e.useState)(!1),[ae,af]=(0,e.useState)(!1),[ag,ah]=(0,e.useState)(!1),[ai,aj]=(0,e.useState)(!1),[ak,al]=(0,e.useState)(""),[am,an]=(0,e.useState)(!1),[ao,ap]=(0,e.useState)(""),[aq,ar]=(0,e.useState)(null),[as,at]=(0,e.useState)(""),[au,av]=(0,e.useState)(""),[aw,ax]=(0,e.useState)(null),[ay,az]=(0,e.useState)(!1),[aA,aB]=(0,e.useState)([]),[aC,aD]=(0,e.useState)(""),[aE,aF]=(0,e.useState)(!1),[aG,aH]=(0,e.useState)(!1),[aI,aJ]=(0,e.useState)(!1),aK=(0,e.useRef)(null);(0,e.useRef)(0),(0,e.useRef)(0),(0,e.useRef)(!1),(0,e.useRef)(!1),(0,e.useRef)(!1),(0,e.useRef)(!1);let[aL,aM]=(0,e.useState)(!1),[aN,aO]=(0,e.useState)(!1),[aP,aQ]=(0,e.useState)(!1),{copied:aR,copy:aS}=(0,k.C)(),aT=!I||!K,aU=I?"Change the default dashboard password before activating the tunnel.":'Enable "Require login" and set a custom password before activating the tunnel.';(0,e.useCallback)((a,b,c,d,e,f)=>{b.current?(c.current=0,d(!0),e.current||(e.current=!0,f(!0))):(c.current+=1,c.current>=5&&d(!1))},[]);let aV=async a=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({tunnelDashboardAccess:a})})).ok&&N(a)}catch(a){console.log("Error updating tunnelDashboardAccess:",a)}},aW=async a=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireApiKey:a})})).ok&&H(a)}catch(a){console.log("Error updating requireApiKey:",a)}},aX=async()=>{try{let a=await fetch("/api/keys"),b=await a.json();a.ok&&c(b.keys||[])}catch(a){console.log("Error fetching data:",a)}finally{g(!1)}},aY=async(...a)=>{Z(!0),_("Waiting for tunnel ready...");let b=a.filter(Boolean).map(a=>`${a}/api/health`),c=Date.now();for(;Date.now()-c<3e5;){if(await new Promise(a=>setTimeout(a,2e3)),await Promise.any(b.map(async a=>{if((await fetch(a,{mode:"cors",cache:"no-store"})).ok)return!0;throw Error("not ready")})).catch(()=>!1))return R(!0),Z(!1),_(""),!0;if((Date.now()-c)%1e4<2e3)try{let a=await fetch("/api/tunnel/status");if(a.ok){let b=await a.json();if(!b.tunnel?.enabled)return ab({type:"error",message:"Tunnel process stopped unexpectedly."}),Z(!1),_(""),!1}}catch{}}return ab({type:"error",message:"Tunnel created but not reachable. Please try again."}),Z(!1),_(""),!1},aZ=async()=>{ad(!1),Z(!0),ab(null),_("Creating tunnel...");let a=!0;(async()=>{for(;a;){try{let b=await fetch("/api/tunnel/status");if(b.ok){let c=await b.json();c.download?.downloading?_(`Downloading cloudflared... ${c.download.progress}%`):a&&_("Creating tunnel...")}}catch{}await new Promise(a=>setTimeout(a,1e3))}})();try{let b=await fetch("/api/tunnel/enable",{method:"POST"});a=!1;let c=await b.json();if(!b.ok)return void ab({type:"error",message:c.error||"Failed to enable tunnel"});let d=c.tunnelUrl;if(!d)return void ab({type:"error",message:"No tunnel URL returned"});V(d),X(c.publicUrl||""),await aY(c.publicUrl,d)}catch(a){ab({type:"error",message:a.message})}finally{a=!1,Z(!1),_("")}},a$=async()=>{Z(!0),ab(null);try{let a=await fetch("/api/tunnel/disable",{method:"POST"}),b=await a.json();a.ok?(R(!1),V(""),af(!1),ab({type:"success",message:"Tunnel disabled"})):ab({type:"error",message:b.error||"Failed to disable tunnel"})}catch(a){ab({type:"error",message:a.message})}finally{Z(!1)}},a_=async()=>{ax(null);try{let a=await fetch("/api/tunnel/tailscale-check");if(a.ok){let b=await a.json();return ax(b.installed),b}}catch{}return ax(!1),{installed:!1}},a0=async()=>{az(!0),ar(null),aB([]);try{let a=await fetch("/api/tunnel/tailscale-install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:aC})});aD("");let b=a.body.getReader(),c=new TextDecoder,d="";for(;;){let{done:a,value:e}=await b.read();if(a)break;let f=(d+=c.decode(e,{stream:!0})).split("\n\n");for(let a of(d=f.pop()||"",f)){let b=a.split("\n"),c="progress",d=null;for(let a of b)if(a.startsWith("event: ")&&(c=a.slice(7).trim()),a.startsWith("data: "))try{d=JSON.parse(a.slice(6))}catch{}if(d)if("progress"===c)aB(a=>[...a.slice(-50),d.message]);else if("done"===c){ax(!0),az(!1),aH(!1),a4();return}else"error"===c&&ar({type:"error",message:d.error||"Install failed"})}}}catch(a){ar({type:"error",message:a.message})}finally{az(!1)}},a1=async a=>{ap("Waiting for Tailscale ready...");let b=`${a}/api/health`,c=Date.now();for(;Date.now()-c<3e5;){await new Promise(a=>setTimeout(a,2e3));try{let a=await fetch(b,{mode:"no-cors",cache:"no-store"});if(a.ok||"opaque"===a.type)return!0}catch{}}return!1},a2=(a,b)=>{at(a),av(b)},a3=()=>{at(""),av("")},a4=async()=>{aH(!1),aF(!0),an(!0),ar(null),ap("Connecting..."),a3();try{let a=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),b=await a.json();if(a.ok&&b.success){al(b.tunnelUrl||"");let a=await a1(b.tunnelUrl);ah(!0),ar(a?null:{type:"warning",message:"Connected but not reachable yet."});return}if(b.needsLogin&&b.authUrl){a2(b.authUrl,"Open Login Page"),ap('Login required — click "Open Login Page" to continue');for(let a=0;a<40;a++){await new Promise(a=>setTimeout(a,3e3));try{let a=await fetch("/api/tunnel/tailscale-check");if(a.ok&&(await a.json()).loggedIn){a3(),ap("Starting funnel...");let a=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),b=await a.json();if(a.ok&&b.success){al(b.tunnelUrl||"");let a=await a1(b.tunnelUrl);ah(!0),ar(a?null:{type:"warning",message:"Connected but not reachable yet."})}else b.funnelNotEnabled&&b.enableUrl?await a5(b.enableUrl):ar({type:"error",message:b.error||"Failed to start funnel"});return}}catch{}}a3(),ar({type:"error",message:"Login timed out. Please try again."});return}if(b.funnelNotEnabled&&b.enableUrl)return void await a5(b.enableUrl);ar({type:"error",message:b.error||"Failed to connect"})}catch(a){ar({type:"error",message:a.message})}finally{an(!1),aF(!1),ap(""),a3()}},a5=async a=>{a2(a,"Open Funnel Settings"),ap('Click "Open Funnel Settings" to enable Funnel...');for(let a=0;a<40;a++){await new Promise(a=>setTimeout(a,3e3));try{let a=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),b=await a.json();if(a.ok&&b.success){a3(),al(b.tunnelUrl||"");let a=await a1(b.tunnelUrl);ah(!0),ar(a?null:{type:"warning",message:"Connected but not reachable yet."});return}if(b.funnelNotEnabled)continue;if(b.error){a3(),ar({type:"error",message:b.error});return}}catch{}}a3(),ar({type:"error",message:"Timed out waiting for Funnel to be enabled."})},a6=async()=>{an(!0),ar(null);try{let a=await fetch("/api/tunnel/tailscale-disable",{method:"POST"}),b=await a.json();a.ok?(ah(!1),al(""),aJ(!1),ar({type:"success",message:"Tailscale disabled"})):ar({type:"error",message:b.error||"Failed to disable Tailscale"})}catch(a){ar({type:"error",message:a.message})}finally{an(!1)}},a7=async()=>{ar(null),aB([]);let a=await a_();a?.installed&&a?.hasCachedPassword?a4():aH(!0)},a8=async a=>{if(a.preventDefault(),s.trim()&&!y){z("create"),B(null);try{let a=await fetch("/api/keys",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:s})}),b=await a.json();if(!a.ok)throw Error(b.error||`Failed to create key (${a.status})`);v(b.key),b.id&&b.key&&F(a=>({...a,[b.id]:b.key})),await aX(),t(""),r(!1),B({type:"success",message:"API key created"})}catch(a){B({type:"error",message:a.message})}finally{z(null)}}},a9=async(a,b)=>{if(!y){z(`toggle:${a}`),B(null);try{let d=await fetch(`/api/keys/${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:b})});if(!d.ok)throw Error(`Failed to update key (${d.status})`);c(c=>c.map(c=>c.id===a?{...c,isActive:b}:c)),B({type:"success",message:"API key updated"})}catch(a){B({type:"error",message:a.message})}finally{z(null)}}},ba=async(a,b,d)=>{if(y)return;let e=""===d?0:Math.max(0,Number(d)||0);z(`budget:${a}`),B(null);try{let d=await fetch(`/api/keys/${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({[b]:e})});if(!d.ok)throw Error(`Failed to update budget (${d.status})`);c(c=>c.map(c=>c.id===a?{...c,[b]:e}:c)),B({type:"success",message:"Budget updated"})}catch(a){B({type:"error",message:a.message})}finally{z(null)}},bb=async a=>{if(E[a])return E[a];let b=await fetch(`/api/keys/${a}?reveal=1`,{cache:"no-store"}),c=await b.json().catch(()=>({}));if(!b.ok)throw Error(c.error||`Failed to reveal key (${b.status})`);let d=c.key?.key||c.key;if("string"!=typeof d||!d)throw Error("Key secret is not available");return F(b=>({...b,[a]:d})),d},bc=async a=>{if(C.has(a))return void D(b=>{let c=new Set(b);return c.delete(a),c});try{await bb(a),D(b=>{let c=new Set(b);return c.add(a),c}),B(null)}catch(a){B({type:"error",message:a.message})}},bd=async a=>{try{let b=await bb(a);aS(b,a),B(null)}catch(a){B({type:"error",message:a.message})}},[be,bf]=(0,e.useState)("/v1");return f?(0,d.jsxs)("div",{className:"flex flex-col gap-6 lg:gap-7",children:[(0,d.jsx)(j.Qv,{}),(0,d.jsx)(j.Qv,{})]}):(0,d.jsxs)("div",{className:"flex flex-col gap-6 lg:gap-7",children:[(0,d.jsxs)(j.Zp,{padding:"none",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 rounded-t-[13px] border-b border-border-subtle bg-linear-to-r from-primary/[0.07] via-primary/[0.025] to-transparent px-4 py-4 sm:px-5",children:[(0,d.jsx)("span",{className:"material-symbols-outlined flex size-11 shrink-0 items-center justify-center rounded-xl bg-primary/12 text-[22px] text-primary ring-1 ring-primary/15",children:"terminal"}),(0,d.jsxs)("div",{children:[(0,d.jsx)("h2",{className:"text-lg font-semibold leading-tight",children:"API Endpoint"}),(0,d.jsx)("p",{className:"mt-0.5 text-xs text-text-muted",children:"Choose how local and remote clients connect to Zevai Router."})]})]}),(0,d.jsxs)("div",{className:"p-4 sm:p-5",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsx)(n,{label:"Local",url:be,copyId:"local_url",copied:aR,onCopy:aS}),(0,d.jsxs)("div",{className:"grid min-w-0 grid-cols-[minmax(0,1fr)_auto_auto] items-center gap-2.5 rounded-xl border border-border-subtle bg-bg/55 p-3 transition-colors hover:border-primary/20 sm:flex",children:[(0,d.jsx)("span",{className:`col-span-full inline-flex min-h-8 w-full shrink-0 items-center justify-center rounded-lg px-2.5 text-[11px] font-semibold uppercase tracking-[0.08em] sm:w-[96px] ${Q?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:"Tunnel"}),Q&&!Y&&S?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(j.pd,{"aria-label":"Cloudflare Tunnel endpoint URL",value:`${W||U}/v1`,readOnly:!0,className:"w-full min-w-0 font-mono text-sm sm:flex-1"}),(0,d.jsx)("button",{onClick:()=>aS(`${W||U}/v1`,"tunnel_url"),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"tunnel_url"===aR?"check":"content_copy"})}),(0,d.jsx)("button",{onClick:()=>af(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tunnel",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):!Q||Y||S?Y?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),$||"Creating tunnel..."]}),(0,d.jsx)("button",{onClick:()=>{Z(!1),_("")},className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):aa?.type==="error"?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-red-300 dark:border-red-800 bg-red-500/5 text-sm text-red-600 dark:text-red-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"error"}),aa.message]}),(0,d.jsx)(j.$n,{size:"sm",icon:"cloud_upload",onClick:()=>ad(!0),children:"Enable"})]}):O?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Checking..."]}),(0,d.jsx)("button",{onClick:()=>P(!1),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):(0,d.jsx)(j.$n,{size:"sm",icon:"cloud_upload",onClick:()=>{aT?ab({type:"error",message:`Security required: ${aU}`}):G?ad(!0):ab({type:"error",message:'Security required: Enable "Require API key" before activating the tunnel.'})},children:"Enable"}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-amber-300 dark:border-amber-800 bg-amber-500/5 text-sm text-amber-600 dark:text-amber-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),aL?"Tunnel reconnecting...":"Tunnel checking..."]}),(0,d.jsx)("button",{onClick:()=>af(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tunnel",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]})]}),(0,d.jsxs)("div",{className:"grid min-w-0 grid-cols-[minmax(0,1fr)_auto_auto] items-center gap-2.5 rounded-xl border border-border-subtle bg-bg/55 p-3 transition-colors hover:border-primary/20 sm:flex",children:[(0,d.jsx)("span",{className:`col-span-full inline-flex min-h-8 w-full shrink-0 items-center justify-center rounded-lg px-2.5 text-[11px] font-semibold uppercase tracking-[0.08em] sm:w-[96px] ${ag?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:"Tailscale"}),ag&&!am&&ai?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(j.pd,{"aria-label":"Tailscale endpoint URL",value:`${ak}/v1`,readOnly:!0,className:"w-full min-w-0 font-mono text-sm sm:flex-1"}),(0,d.jsx)("button",{onClick:()=>aS(`${ak}/v1`,"ts_url"),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"ts_url"===aR?"check":"content_copy"})}),(0,d.jsx)("button",{onClick:()=>aJ(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tailscale",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):!ag||am||ai?am||aE?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),ao||"Connecting..."]}),as&&(0,d.jsx)(j.$n,{size:"sm",icon:"open_in_new",onClick:()=>window.open(as,"tailscale_auth","width=600,height=700,noopener,noreferrer"),children:au||"Open"}),(0,d.jsx)("button",{onClick:()=>{an(!1),aF(!1),ap(""),a3()},className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):aq?.type==="error"?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-red-300 dark:border-red-800 bg-red-500/5 text-sm text-red-600 dark:text-red-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"error"}),aq.message]}),(0,d.jsx)(j.$n,{size:"sm",icon:"vpn_lock",onClick:a7,children:"Enable"})]}):(0,d.jsx)(j.$n,{size:"sm",icon:"vpn_lock",onClick:()=>{aT?ar({type:"error",message:`Security required: ${aU}`}):a7()},className:"bg-linear-to-r from-indigo-500 to-purple-500 hover:from-indigo-600 hover:to-purple-600 text-white!",children:"Enable"}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-amber-300 dark:border-amber-800 bg-amber-500/5 text-sm text-amber-600 dark:text-amber-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),aN?"Tailscale reconnecting...":"Tailscale checking..."]}),(0,d.jsx)("button",{onClick:()=>aJ(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tailscale",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]})]})]}),aT&&!Q&&!ag&&(0,d.jsx)("div",{className:"mt-4",children:(0,d.jsx)(q,{message:aU,action:{label:"Open settings",href:"/dashboard/profile"}})}),(Q||ag)&&(0,d.jsxs)("div",{className:"mt-4 flex flex-col gap-2",children:[!G&&(0,d.jsx)(q,{message:"Require API key is disabled — your endpoint is publicly accessible without authentication.",action:{label:"Enable",href:"#require-api-key"}}),(!I||!K)&&(0,d.jsx)(q,{message:I?"Dashboard uses the default password — change it in Profile settings.":"Require login is disabled — anyone can access your dashboard via tunnel.",action:{label:I?"Change password":"Enable",href:"/dashboard/profile"}})]}),(Q||ag)&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex items-center gap-3",children:[(0,d.jsx)(j.lM,{label:"Allow dashboard access via tunnel",checked:M,onChange:()=>aV(!M)}),(0,d.jsx)(p,{text:"When enabled, the dashboard can be accessed through your tunnel or Tailscale URL (login still required). When disabled, dashboard access via tunnel/Tailscale is completely blocked."})]})]})]}),(0,d.jsx)(j.Zp,{id:"rtk",padding:"none",className:"relative overflow-hidden border-primary/20 bg-linear-to-br from-primary/[0.08] via-surface to-surface",children:(0,d.jsxs)("div",{className:"relative flex flex-col gap-4 p-5 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3.5",children:[(0,d.jsx)("span",{className:"material-symbols-outlined flex size-11 shrink-0 items-center justify-center rounded-xl bg-primary text-[22px] text-white shadow-[0_10px_24px_-14px_rgba(229,106,74,0.9)]",children:"bolt"}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold leading-tight",children:"Token Saver"}),(0,d.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Tune RTK, Caveman, Ponytail, Headroom, and PXPIPE in one workspace."})]})]}),(0,d.jsxs)(i(),{href:"/dashboard/token-saver",className:"inline-flex w-full shrink-0 items-center justify-center gap-1.5 rounded-lg border border-primary/25 bg-surface/80 px-3.5 py-2 text-sm font-semibold text-text-main shadow-sm transition-[border-color,color,transform] hover:translate-x-0.5 hover:border-primary/50 hover:text-primary sm:w-auto",children:["Open workspace",(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"arrow_forward"})]})]})}),(0,d.jsxs)(j.Zp,{id:"require-api-key",children:[(0,d.jsxs)("div",{className:"mb-5 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined flex size-11 shrink-0 items-center justify-center rounded-xl bg-primary/10 text-[21px] text-primary ring-1 ring-primary/15",children:"vpn_key"}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold leading-tight",children:"API Keys"}),(0,d.jsxs)("span",{className:"rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-text-muted ring-1 ring-border-subtle",children:[b.length," ",1===b.length?"key":"keys"]})]}),(0,d.jsx)("p",{className:"mt-0.5 text-xs text-text-muted",children:"Control authentication and spending per client."})]})]}),(0,d.jsx)(j.$n,{icon:"add",onClick:()=>r(!0),className:"w-full sm:w-auto",children:"Create Key"})]}),A&&(0,d.jsx)("p",{role:"status",className:`mb-4 text-sm ${"error"===A.type?"text-red-500":"text-green-500"}`,children:A.message}),(0,d.jsxs)("div",{className:"mb-4 flex flex-col gap-3 rounded-xl border border-primary/15 bg-primary/[0.045] p-4 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-lg bg-surface text-[17px] text-primary ring-1 ring-border-subtle",children:"shield_lock"}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"font-medium",children:"Require API key"}),(0,d.jsx)("p",{className:"mt-0.5 text-sm text-text-muted",children:"Reject requests that do not include a valid client key."})]})]}),(0,d.jsx)("div",{className:"shrink-0 self-end sm:self-auto",children:(0,d.jsx)(j.lM,{label:"Require API key",checked:G,onChange:()=>aW(!G)})})]}),aP&&!G&&(0,d.jsx)("div",{className:"mb-4 -mt-2",children:(0,d.jsx)(q,{message:"Endpoint is exposed without an API key."})}),0===b.length?(0,d.jsxs)("div",{className:"rounded-xl border border-dashed border-border bg-surface-2/25 py-12 text-center",children:[(0,d.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"vpn_key"})}),(0,d.jsx)("p",{className:"text-text-main font-medium mb-1",children:"No API keys yet"}),(0,d.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Create your first API key to get started"}),(0,d.jsx)(j.$n,{icon:"add",onClick:()=>r(!0),children:"Create Key"})]}):(0,d.jsx)("div",{className:"grid grid-cols-1 gap-3 lg:grid-cols-2",children:b.map(a=>{var b,e;return(0,d.jsxs)("div",{className:`group flex min-w-0 flex-wrap items-center justify-between gap-3 rounded-xl border border-border-subtle bg-surface-2/25 p-4 transition-[border-color,box-shadow,opacity] hover:border-primary/20 hover:shadow-[0_14px_28px_-26px_rgba(15,23,42,0.65)] ${!1===a.isActive?"opacity-60":""}`,children:[(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"text-sm font-medium",children:a.name}),(0,d.jsxs)("div",{className:"flex items-center gap-2 mt-1 min-w-0",children:[(0,d.jsx)("code",{className:"text-xs text-text-muted font-mono truncate max-w-[min(100%,28rem)]",children:(b=a,C.has(b.id)&&E[b.id]?E[b.id]:b.maskedKey||((e=b.key)?e.length>8?e.slice(0,8)+"...":e:"")||"••••••••")}),(0,d.jsx)("button",{type:"button",onClick:()=>bc(a.id),className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all shrink-0",title:C.has(a.id)?"Hide key":"Show key","aria-label":C.has(a.id)?"Hide API key":"Show API key",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:C.has(a.id)?"visibility_off":"visibility"})}),(0,d.jsx)("button",{type:"button",onClick:()=>bd(a.id),className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all shrink-0",title:"Copy key","aria-label":"Copy API key",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:aR===a.id?"check":"content_copy"})})]}),(0,d.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Created ",new Date(a.createdAt).toLocaleDateString()]}),!1===a.isActive&&(0,d.jsx)("p",{className:"text-xs text-orange-500 mt-1",children:"Paused"}),(0,d.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-3",children:[(0,d.jsxs)("label",{className:"flex items-center gap-1 text-[11px] text-text-muted",children:["Daily $",(0,d.jsx)("input",{type:"number",min:"0",step:"0.01",disabled:y===`budget:${a.id}`,defaultValue:a.budgetDaily||0,onBlur:b=>ba(a.id,"budgetDaily",b.target.value),className:"w-16 rounded border border-border bg-surface px-1 py-0.5 text-[11px]",title:"Daily budget cap in USD (0 = unlimited)"})]}),(0,d.jsxs)("label",{className:"flex items-center gap-1 text-[11px] text-text-muted",children:["Monthly $",(0,d.jsx)("input",{type:"number",min:"0",step:"0.01",disabled:y===`budget:${a.id}`,defaultValue:a.budgetMonthly||0,onBlur:b=>ba(a.id,"budgetMonthly",b.target.value),className:"w-16 rounded border border-border bg-surface px-1 py-0.5 text-[11px]",title:"Monthly budget cap in USD (0 = unlimited)"})]})]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(j.lM,{size:"sm",disabled:y===`toggle:${a.id}`,checked:a.isActive??!0,onChange:b=>{a.isActive&&!b?x({title:"Pause API Key",message:`Pause API key "${a.name}"?
|
|
1
|
+
exports.id=8242,exports.ids=[8242],exports.modules={43173:(a,b,c)=>{"use strict";c.d(b,{default:()=>m});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(2116),i=c.n(h),j=c(50412),k=c(50377);let l=[{icon:"public",title:"Access Anywhere",desc:"Use your API from any network"},{icon:"group",title:"Share Endpoint",desc:"Share URL with team members"},{icon:"code",title:"Use in Cursor/Cline",desc:"Connect AI tools remotely"},{icon:"lock",title:"Encrypted",desc:"End-to-end TLS via Cloudflare"}];function m({machineId:a}){let[b,c]=(0,e.useState)([]),[f,g]=(0,e.useState)(!0),[h,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)(""),[u,v]=(0,e.useState)(null),[w,x]=(0,e.useState)(null),[y,z]=(0,e.useState)(null),[A,B]=(0,e.useState)(null),[C,D]=(0,e.useState)(()=>new Set),[E,F]=(0,e.useState)(()=>({})),[G,H]=(0,e.useState)(!1),[I,J]=(0,e.useState)(!0),[K,L]=(0,e.useState)(!0),[M,N]=(0,e.useState)(!1),[O,P]=(0,e.useState)(!0),[Q,R]=(0,e.useState)(!1),[S,T]=(0,e.useState)(!1),[U,V]=(0,e.useState)(""),[W,X]=(0,e.useState)(""),[Y,Z]=(0,e.useState)(!1),[$,_]=(0,e.useState)(""),[aa,ab]=(0,e.useState)(null),[ac,ad]=(0,e.useState)(!1),[ae,af]=(0,e.useState)(!1),[ag,ah]=(0,e.useState)(!1),[ai,aj]=(0,e.useState)(!1),[ak,al]=(0,e.useState)(""),[am,an]=(0,e.useState)(!1),[ao,ap]=(0,e.useState)(""),[aq,ar]=(0,e.useState)(null),[as,at]=(0,e.useState)(""),[au,av]=(0,e.useState)(""),[aw,ax]=(0,e.useState)(null),[ay,az]=(0,e.useState)(!1),[aA,aB]=(0,e.useState)([]),[aC,aD]=(0,e.useState)(""),[aE,aF]=(0,e.useState)(!1),[aG,aH]=(0,e.useState)(!1),[aI,aJ]=(0,e.useState)(!1),aK=(0,e.useRef)(null);(0,e.useRef)(0),(0,e.useRef)(0),(0,e.useRef)(!1),(0,e.useRef)(!1),(0,e.useRef)(!1),(0,e.useRef)(!1);let[aL,aM]=(0,e.useState)(!1),[aN,aO]=(0,e.useState)(!1),[aP,aQ]=(0,e.useState)(!1),{copied:aR,copy:aS}=(0,k.C)(),aT=!I||!K,aU=I?"Change the default dashboard password before activating the tunnel.":'Enable "Require login" and set a custom password before activating the tunnel.';(0,e.useCallback)((a,b,c,d,e,f)=>{b.current?(c.current=0,d(!0),e.current||(e.current=!0,f(!0))):(c.current+=1,c.current>=5&&d(!1))},[]);let aV=async a=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({tunnelDashboardAccess:a})})).ok&&N(a)}catch(a){console.log("Error updating tunnelDashboardAccess:",a)}},aW=async a=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireApiKey:a})})).ok&&H(a)}catch(a){console.log("Error updating requireApiKey:",a)}},aX=async()=>{try{let a=await fetch("/api/keys"),b=await a.json();a.ok&&c(b.keys||[])}catch(a){console.log("Error fetching data:",a)}finally{g(!1)}},aY=async(...a)=>{Z(!0),_("Waiting for tunnel ready...");let b=a.filter(Boolean).map(a=>`${a}/api/health`),c=Date.now();for(;Date.now()-c<3e5;){if(await new Promise(a=>setTimeout(a,2e3)),await Promise.any(b.map(async a=>{if((await fetch(a,{mode:"cors",cache:"no-store"})).ok)return!0;throw Error("not ready")})).catch(()=>!1))return R(!0),Z(!1),_(""),!0;if((Date.now()-c)%1e4<2e3)try{let a=await fetch("/api/tunnel/status");if(a.ok){let b=await a.json();if(!b.tunnel?.enabled)return ab({type:"error",message:"Tunnel process stopped unexpectedly."}),Z(!1),_(""),!1}}catch{}}return ab({type:"error",message:"Tunnel created but not reachable. Please try again."}),Z(!1),_(""),!1},aZ=async()=>{ad(!1),Z(!0),ab(null),_("Creating tunnel...");let a=!0;(async()=>{for(;a;){try{let b=await fetch("/api/tunnel/status");if(b.ok){let c=await b.json();c.download?.downloading?_(`Downloading cloudflared... ${c.download.progress}%`):a&&_("Creating tunnel...")}}catch{}await new Promise(a=>setTimeout(a,1e3))}})();try{let b=await fetch("/api/tunnel/enable",{method:"POST"});a=!1;let c=await b.json();if(!b.ok)return void ab({type:"error",message:c.error||"Failed to enable tunnel"});let d=c.tunnelUrl;if(!d)return void ab({type:"error",message:"No tunnel URL returned"});V(d),X(c.publicUrl||""),await aY(c.publicUrl,d)}catch(a){ab({type:"error",message:a.message})}finally{a=!1,Z(!1),_("")}},a$=async()=>{Z(!0),ab(null);try{let a=await fetch("/api/tunnel/disable",{method:"POST"}),b=await a.json();a.ok?(R(!1),V(""),af(!1),ab({type:"success",message:"Tunnel disabled"})):ab({type:"error",message:b.error||"Failed to disable tunnel"})}catch(a){ab({type:"error",message:a.message})}finally{Z(!1)}},a_=async()=>{ax(null);try{let a=await fetch("/api/tunnel/tailscale-check");if(a.ok){let b=await a.json();return ax(b.installed),b}}catch{}return ax(!1),{installed:!1}},a0=async()=>{az(!0),ar(null),aB([]);try{let a=await fetch("/api/tunnel/tailscale-install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:aC})});aD("");let b=a.body.getReader(),c=new TextDecoder,d="";for(;;){let{done:a,value:e}=await b.read();if(a)break;let f=(d+=c.decode(e,{stream:!0})).split("\n\n");for(let a of(d=f.pop()||"",f)){let b=a.split("\n"),c="progress",d=null;for(let a of b)if(a.startsWith("event: ")&&(c=a.slice(7).trim()),a.startsWith("data: "))try{d=JSON.parse(a.slice(6))}catch{}if(d)if("progress"===c)aB(a=>[...a.slice(-50),d.message]);else if("done"===c){ax(!0),az(!1),aH(!1),a4();return}else"error"===c&&ar({type:"error",message:d.error||"Install failed"})}}}catch(a){ar({type:"error",message:a.message})}finally{az(!1)}},a1=async a=>{ap("Waiting for Tailscale ready...");let b=`${a}/api/health`,c=Date.now();for(;Date.now()-c<3e5;){await new Promise(a=>setTimeout(a,2e3));try{let a=await fetch(b,{mode:"no-cors",cache:"no-store"});if(a.ok||"opaque"===a.type)return!0}catch{}}return!1},a2=(a,b)=>{at(a),av(b)},a3=()=>{at(""),av("")},a4=async()=>{aH(!1),aF(!0),an(!0),ar(null),ap("Connecting..."),a3();try{let a=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),b=await a.json();if(a.ok&&b.success){al(b.tunnelUrl||"");let a=await a1(b.tunnelUrl);ah(!0),ar(a?null:{type:"warning",message:"Connected but not reachable yet."});return}if(b.needsLogin&&b.authUrl){a2(b.authUrl,"Open Login Page"),ap('Login required — click "Open Login Page" to continue');for(let a=0;a<40;a++){await new Promise(a=>setTimeout(a,3e3));try{let a=await fetch("/api/tunnel/tailscale-check");if(a.ok&&(await a.json()).loggedIn){a3(),ap("Starting funnel...");let a=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),b=await a.json();if(a.ok&&b.success){al(b.tunnelUrl||"");let a=await a1(b.tunnelUrl);ah(!0),ar(a?null:{type:"warning",message:"Connected but not reachable yet."})}else b.funnelNotEnabled&&b.enableUrl?await a5(b.enableUrl):ar({type:"error",message:b.error||"Failed to start funnel"});return}}catch{}}a3(),ar({type:"error",message:"Login timed out. Please try again."});return}if(b.funnelNotEnabled&&b.enableUrl)return void await a5(b.enableUrl);ar({type:"error",message:b.error||"Failed to connect"})}catch(a){ar({type:"error",message:a.message})}finally{an(!1),aF(!1),ap(""),a3()}},a5=async a=>{a2(a,"Open Funnel Settings"),ap('Click "Open Funnel Settings" to enable Funnel...');for(let a=0;a<40;a++){await new Promise(a=>setTimeout(a,3e3));try{let a=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),b=await a.json();if(a.ok&&b.success){a3(),al(b.tunnelUrl||"");let a=await a1(b.tunnelUrl);ah(!0),ar(a?null:{type:"warning",message:"Connected but not reachable yet."});return}if(b.funnelNotEnabled)continue;if(b.error){a3(),ar({type:"error",message:b.error});return}}catch{}}a3(),ar({type:"error",message:"Timed out waiting for Funnel to be enabled."})},a6=async()=>{an(!0),ar(null);try{let a=await fetch("/api/tunnel/tailscale-disable",{method:"POST"}),b=await a.json();a.ok?(ah(!1),al(""),aJ(!1),ar({type:"success",message:"Tailscale disabled"})):ar({type:"error",message:b.error||"Failed to disable Tailscale"})}catch(a){ar({type:"error",message:a.message})}finally{an(!1)}},a7=async()=>{ar(null),aB([]);let a=await a_();a?.installed&&a?.hasCachedPassword?a4():aH(!0)},a8=async a=>{if(a.preventDefault(),s.trim()&&!y){z("create"),B(null);try{let a=await fetch("/api/keys",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:s})}),b=await a.json();if(!a.ok)throw Error(b.error||`Failed to create key (${a.status})`);v(b.key),b.id&&b.key&&F(a=>({...a,[b.id]:b.key})),await aX(),t(""),r(!1),B({type:"success",message:"API key created"})}catch(a){B({type:"error",message:a.message})}finally{z(null)}}},a9=async(a,b)=>{if(!y){z(`toggle:${a}`),B(null);try{let d=await fetch(`/api/keys/${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:b})});if(!d.ok)throw Error(`Failed to update key (${d.status})`);c(c=>c.map(c=>c.id===a?{...c,isActive:b}:c)),B({type:"success",message:"API key updated"})}catch(a){B({type:"error",message:a.message})}finally{z(null)}}},ba=async(a,b,d)=>{if(y)return;let e=""===d?0:Math.max(0,Number(d)||0);z(`budget:${a}`),B(null);try{let d=await fetch(`/api/keys/${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({[b]:e})});if(!d.ok)throw Error(`Failed to update budget (${d.status})`);c(c=>c.map(c=>c.id===a?{...c,[b]:e}:c)),B({type:"success",message:"Budget updated"})}catch(a){B({type:"error",message:a.message})}finally{z(null)}},bb=async a=>{if(E[a])return E[a];let b=await fetch(`/api/keys/${a}?reveal=1`,{cache:"no-store"}),c=await b.json().catch(()=>({}));if(!b.ok)throw Error(c.error||`Failed to reveal key (${b.status})`);let d=c.key?.key||c.key;if("string"!=typeof d||!d)throw Error("Key secret is not available");return F(b=>({...b,[a]:d})),d},bc=async a=>{if(C.has(a))return void D(b=>{let c=new Set(b);return c.delete(a),c});try{await bb(a),D(b=>{let c=new Set(b);return c.add(a),c}),B(null)}catch(a){B({type:"error",message:a.message})}},bd=async a=>{try{let b=await bb(a);aS(b,a),B(null)}catch(a){B({type:"error",message:a.message})}},[be,bf]=(0,e.useState)("/v1");return f?(0,d.jsxs)("div",{className:"flex flex-col gap-6 lg:gap-7",children:[(0,d.jsx)(j.Qv,{}),(0,d.jsx)(j.Qv,{})]}):(0,d.jsxs)("div",{className:"flex flex-col gap-6 lg:gap-7",children:[(0,d.jsxs)(j.Zp,{padding:"none",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 rounded-t-[13px] border-b border-border-subtle bg-linear-to-r from-primary/[0.07] via-primary/[0.025] to-transparent px-4 py-4 sm:px-5",children:[(0,d.jsx)("span",{className:"material-symbols-outlined flex size-11 shrink-0 items-center justify-center rounded-xl bg-primary/12 text-[22px] text-primary ring-1 ring-primary/15",children:"terminal"}),(0,d.jsxs)("div",{children:[(0,d.jsx)("h2",{className:"text-lg font-semibold leading-tight",children:"API Endpoint"}),(0,d.jsx)("p",{className:"mt-0.5 text-xs text-text-muted",children:"Choose how local and remote clients connect to Zevai Router."})]})]}),(0,d.jsxs)("div",{className:"p-4 sm:p-5",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsx)(n,{label:"Local",url:be,copyId:"local_url",copied:aR,onCopy:aS}),(0,d.jsxs)("div",{className:"grid min-w-0 grid-cols-[minmax(0,1fr)_auto_auto] items-center gap-2.5 rounded-xl border border-border-subtle bg-bg/55 p-3 transition-colors hover:border-primary/20 sm:flex",children:[(0,d.jsx)("span",{className:`col-span-full inline-flex min-h-8 w-full shrink-0 items-center justify-center rounded-lg px-2.5 text-[11px] font-semibold uppercase tracking-[0.08em] sm:w-[96px] ${Q?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:"Tunnel"}),Q&&!Y&&S?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(j.pd,{"aria-label":"Cloudflare Tunnel endpoint URL",value:`${W||U}/v1`,readOnly:!0,className:"w-full min-w-0 font-mono text-sm sm:flex-1"}),(0,d.jsx)("button",{onClick:()=>aS(`${W||U}/v1`,"tunnel_url"),className:"flex size-11 shrink-0 items-center justify-center rounded-xl text-text-muted transition-colors hover:bg-black/5 hover:text-primary dark:hover:bg-white/5 sm:size-9 sm:rounded-lg",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"tunnel_url"===aR?"check":"content_copy"})}),(0,d.jsx)("button",{onClick:()=>af(!0),className:"flex size-11 shrink-0 items-center justify-center rounded-xl text-red-500 transition-colors hover:bg-red-500/10 sm:size-9 sm:rounded-lg",title:"Disable Tunnel",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):!Q||Y||S?Y?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),$||"Creating tunnel..."]}),(0,d.jsx)("button",{onClick:()=>{Z(!1),_("")},className:"flex size-11 shrink-0 items-center justify-center rounded-xl text-red-500 transition-colors hover:bg-red-500/10 sm:size-9 sm:rounded-lg",title:"Stop",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):aa?.type==="error"?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-red-300 dark:border-red-800 bg-red-500/5 text-sm text-red-600 dark:text-red-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"error"}),aa.message]}),(0,d.jsx)(j.$n,{size:"sm",icon:"cloud_upload",className:"min-h-11 sm:min-h-8",onClick:()=>ad(!0),children:"Enable"})]}):O?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Checking..."]}),(0,d.jsx)("button",{onClick:()=>P(!1),className:"flex size-11 shrink-0 items-center justify-center rounded-xl text-red-500 transition-colors hover:bg-red-500/10 sm:size-9 sm:rounded-lg",title:"Stop",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):(0,d.jsx)(j.$n,{size:"sm",icon:"cloud_upload",className:"min-h-11 sm:min-h-8",onClick:()=>{aT?ab({type:"error",message:`Security required: ${aU}`}):G?ad(!0):ab({type:"error",message:'Security required: Enable "Require API key" before activating the tunnel.'})},children:"Enable"}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-amber-300 dark:border-amber-800 bg-amber-500/5 text-sm text-amber-600 dark:text-amber-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),aL?"Tunnel reconnecting...":"Tunnel checking..."]}),(0,d.jsx)("button",{onClick:()=>af(!0),className:"flex size-11 shrink-0 items-center justify-center rounded-xl text-red-500 transition-colors hover:bg-red-500/10 sm:size-9 sm:rounded-lg",title:"Disable Tunnel",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]})]}),(0,d.jsxs)("div",{className:"grid min-w-0 grid-cols-[minmax(0,1fr)_auto_auto] items-center gap-2.5 rounded-xl border border-border-subtle bg-bg/55 p-3 transition-colors hover:border-primary/20 sm:flex",children:[(0,d.jsx)("span",{className:`col-span-full inline-flex min-h-8 w-full shrink-0 items-center justify-center rounded-lg px-2.5 text-[11px] font-semibold uppercase tracking-[0.08em] sm:w-[96px] ${ag?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:"Tailscale"}),ag&&!am&&ai?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(j.pd,{"aria-label":"Tailscale endpoint URL",value:`${ak}/v1`,readOnly:!0,className:"w-full min-w-0 font-mono text-sm sm:flex-1"}),(0,d.jsx)("button",{onClick:()=>aS(`${ak}/v1`,"ts_url"),className:"flex size-11 shrink-0 items-center justify-center rounded-xl text-text-muted transition-colors hover:bg-black/5 hover:text-primary dark:hover:bg-white/5 sm:size-9 sm:rounded-lg",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"ts_url"===aR?"check":"content_copy"})}),(0,d.jsx)("button",{onClick:()=>aJ(!0),className:"flex size-11 shrink-0 items-center justify-center rounded-xl text-red-500 transition-colors hover:bg-red-500/10 sm:size-9 sm:rounded-lg",title:"Disable Tailscale",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):!ag||am||ai?am||aE?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),ao||"Connecting..."]}),as&&(0,d.jsx)(j.$n,{size:"sm",icon:"open_in_new",onClick:()=>window.open(as,"tailscale_auth","width=600,height=700,noopener,noreferrer"),children:au||"Open"}),(0,d.jsx)("button",{onClick:()=>{an(!1),aF(!1),ap(""),a3()},className:"flex size-11 shrink-0 items-center justify-center rounded-xl text-red-500 transition-colors hover:bg-red-500/10 sm:size-9 sm:rounded-lg",title:"Stop",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):aq?.type==="error"?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-red-300 dark:border-red-800 bg-red-500/5 text-sm text-red-600 dark:text-red-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"error"}),aq.message]}),(0,d.jsx)(j.$n,{size:"sm",icon:"vpn_lock",className:"min-h-11 sm:min-h-8",onClick:a7,children:"Enable"})]}):(0,d.jsx)(j.$n,{size:"sm",icon:"vpn_lock",onClick:()=>{aT?ar({type:"error",message:`Security required: ${aU}`}):a7()},className:"min-h-11 sm:min-h-8",children:"Enable"}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-amber-300 dark:border-amber-800 bg-amber-500/5 text-sm text-amber-600 dark:text-amber-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),aN?"Tailscale reconnecting...":"Tailscale checking..."]}),(0,d.jsx)("button",{onClick:()=>aJ(!0),className:"flex size-11 shrink-0 items-center justify-center rounded-xl text-red-500 transition-colors hover:bg-red-500/10 sm:size-9 sm:rounded-lg",title:"Disable Tailscale",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]})]})]}),aT&&!Q&&!ag&&(0,d.jsx)("div",{className:"mt-4",children:(0,d.jsx)(q,{message:aU,action:{label:"Open settings",href:"/dashboard/profile"}})}),(Q||ag)&&(0,d.jsxs)("div",{className:"mt-4 flex flex-col gap-2",children:[!G&&(0,d.jsx)(q,{message:"Require API key is disabled — your endpoint is publicly accessible without authentication.",action:{label:"Enable",href:"#require-api-key"}}),(!I||!K)&&(0,d.jsx)(q,{message:I?"Dashboard uses the default password — change it in Profile settings.":"Require login is disabled — anyone can access your dashboard via tunnel.",action:{label:I?"Change password":"Enable",href:"/dashboard/profile"}})]}),(Q||ag)&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex items-center gap-3",children:[(0,d.jsx)(j.lM,{touchTarget:!0,label:"Allow dashboard access via tunnel",checked:M,onChange:()=>aV(!M)}),(0,d.jsx)(p,{text:"When enabled, the dashboard can be accessed through your tunnel or Tailscale URL (login still required). When disabled, dashboard access via tunnel/Tailscale is completely blocked."})]})]})]}),(0,d.jsx)(j.Zp,{id:"rtk",padding:"none",className:"relative overflow-hidden border-primary/20 bg-linear-to-br from-primary/[0.08] via-surface to-surface",children:(0,d.jsxs)("div",{className:"relative flex flex-col gap-4 p-5 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3.5",children:[(0,d.jsx)("span",{className:"material-symbols-outlined flex size-11 shrink-0 items-center justify-center rounded-xl bg-primary text-[22px] text-white shadow-[0_10px_24px_-14px_rgba(229,106,74,0.9)]",children:"bolt"}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold leading-tight",children:"Token Saver"}),(0,d.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Tune RTK, Caveman, Ponytail, Headroom, and PXPIPE in one workspace."})]})]}),(0,d.jsxs)(i(),{href:"/dashboard/token-saver",className:"inline-flex min-h-11 w-full shrink-0 items-center justify-center gap-1.5 rounded-xl border border-primary/25 bg-surface/80 px-3.5 py-2 text-sm font-semibold text-text-main shadow-sm transition-[border-color,color,transform] hover:translate-x-0.5 hover:border-primary/50 hover:text-primary sm:min-h-0 sm:w-auto sm:rounded-lg",children:["Open workspace",(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"arrow_forward"})]})]})}),(0,d.jsxs)(j.Zp,{id:"require-api-key",children:[(0,d.jsxs)("div",{className:"mb-5 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined flex size-11 shrink-0 items-center justify-center rounded-xl bg-primary/10 text-[21px] text-primary ring-1 ring-primary/15",children:"vpn_key"}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold leading-tight",children:"API Keys"}),(0,d.jsxs)("span",{className:"rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-text-muted ring-1 ring-border-subtle",children:[b.length," ",1===b.length?"key":"keys"]})]}),(0,d.jsx)("p",{className:"mt-0.5 text-xs text-text-muted",children:"Control authentication and spending per client."})]})]}),(0,d.jsx)(j.$n,{icon:"add",onClick:()=>r(!0),className:"w-full sm:w-auto",children:"Create Key"})]}),A&&(0,d.jsx)("p",{role:"status",className:`mb-4 text-sm ${"error"===A.type?"text-red-500":"text-green-500"}`,children:A.message}),(0,d.jsxs)("div",{className:"mb-4 flex flex-col gap-3 rounded-xl border border-primary/15 bg-primary/[0.045] p-4 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-lg bg-surface text-[17px] text-primary ring-1 ring-border-subtle",children:"shield_lock"}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"font-medium",children:"Require API key"}),(0,d.jsx)("p",{className:"mt-0.5 text-sm text-text-muted",children:"Reject requests that do not include a valid client key."})]})]}),(0,d.jsx)("div",{className:"shrink-0 self-end sm:self-auto",children:(0,d.jsx)(j.lM,{touchTarget:!0,label:"Require API key",checked:G,onChange:()=>aW(!G)})})]}),aP&&!G&&(0,d.jsx)("div",{className:"mb-4 -mt-2",children:(0,d.jsx)(q,{message:"Endpoint is exposed without an API key."})}),0===b.length?(0,d.jsxs)("div",{className:"rounded-xl border border-dashed border-border bg-surface-2/25 py-12 text-center",children:[(0,d.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"vpn_key"})}),(0,d.jsx)("p",{className:"text-text-main font-medium mb-1",children:"No API keys yet"}),(0,d.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Create your first API key to get started"}),(0,d.jsx)(j.$n,{icon:"add",onClick:()=>r(!0),children:"Create Key"})]}):(0,d.jsx)("div",{className:"grid grid-cols-1 gap-3 lg:grid-cols-2",children:b.map(a=>{var b,e;return(0,d.jsxs)("div",{className:`group flex min-w-0 flex-wrap items-center justify-between gap-3 rounded-xl border border-border-subtle bg-surface-2/25 p-4 transition-[border-color,box-shadow,opacity] hover:border-primary/20 hover:shadow-[0_14px_28px_-26px_rgba(15,23,42,0.65)] ${!1===a.isActive?"opacity-60":""}`,children:[(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"text-sm font-medium",children:a.name}),(0,d.jsxs)("div",{className:"flex items-center gap-2 mt-1 min-w-0",children:[(0,d.jsx)("code",{className:"text-xs text-text-muted font-mono truncate max-w-[min(100%,28rem)]",children:(b=a,C.has(b.id)&&E[b.id]?E[b.id]:b.maskedKey||((e=b.key)?e.length>8?e.slice(0,8)+"...":e:"")||"••••••••")}),(0,d.jsx)("button",{type:"button",onClick:()=>bc(a.id),className:"flex size-11 shrink-0 items-center justify-center rounded-xl text-text-muted opacity-100 transition-all hover:bg-black/5 hover:text-primary dark:hover:bg-white/5 sm:size-7 sm:rounded-lg sm:opacity-0 sm:group-hover:opacity-100",title:C.has(a.id)?"Hide key":"Show key","aria-label":C.has(a.id)?"Hide API key":"Show API key",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:C.has(a.id)?"visibility_off":"visibility"})}),(0,d.jsx)("button",{type:"button",onClick:()=>bd(a.id),className:"flex size-11 shrink-0 items-center justify-center rounded-xl text-text-muted opacity-100 transition-all hover:bg-black/5 hover:text-primary dark:hover:bg-white/5 sm:size-7 sm:rounded-lg sm:opacity-0 sm:group-hover:opacity-100",title:"Copy key","aria-label":"Copy API key",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:aR===a.id?"check":"content_copy"})})]}),(0,d.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Created ",new Date(a.createdAt).toLocaleDateString()]}),!1===a.isActive&&(0,d.jsx)("p",{className:"text-xs text-orange-500 mt-1",children:"Paused"}),(0,d.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-3",children:[(0,d.jsxs)("label",{className:"flex items-center gap-1 text-[11px] text-text-muted",children:["Daily $",(0,d.jsx)("input",{type:"number",min:"0",step:"0.01",disabled:y===`budget:${a.id}`,defaultValue:a.budgetDaily||0,onBlur:b=>ba(a.id,"budgetDaily",b.target.value),className:"w-16 rounded border border-border bg-surface px-1 py-0.5 text-[11px]",title:"Daily budget cap in USD (0 = unlimited)"})]}),(0,d.jsxs)("label",{className:"flex items-center gap-1 text-[11px] text-text-muted",children:["Monthly $",(0,d.jsx)("input",{type:"number",min:"0",step:"0.01",disabled:y===`budget:${a.id}`,defaultValue:a.budgetMonthly||0,onBlur:b=>ba(a.id,"budgetMonthly",b.target.value),className:"w-16 rounded border border-border bg-surface px-1 py-0.5 text-[11px]",title:"Monthly budget cap in USD (0 = unlimited)"})]})]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("div",{className:"flex size-11 items-center justify-center sm:size-auto",children:(0,d.jsx)(j.lM,{size:"sm",touchTarget:!0,disabled:y===`toggle:${a.id}`,checked:a.isActive??!0,onChange:b=>{a.isActive&&!b?x({title:"Pause API Key",message:`Pause API key "${a.name}"?
|
|
2
2
|
|
|
3
|
-
This key will stop working immediately but can be resumed later.`,onConfirm:async()=>{x(null),a9(a.id,b)}}):a9(a.id,b)},title:a.isActive?"Pause key":"Resume key"}),(0,d.jsx)("button",{disabled:y===`delete:${a.id}`,onClick:()=>{var b;return b=a.id,void(!y&&x({title:"Delete API Key",message:"Delete this API key?",onConfirm:async()=>{x(null),z(`delete:${b}`),B(null);try{let a=await fetch(`/api/keys/${b}`,{method:"DELETE"});if(!a.ok)throw Error(`Failed to delete key (${a.status})`);c(a=>a.filter(a=>a.id!==b)),D(a=>{let c=new Set(a);return c.delete(b),c}),F(a=>{if(!(b in a))return a;let c={...a};return delete c[b],c}),B({type:"success",message:"API key deleted"})}catch(a){B({type:"error",message:a.message})}finally{z(null)}}}))},className:"p-2 hover:bg-red-500/10 rounded text-red-500 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]})]},a.id)})})]}),(0,d.jsx)(j.aF,{isOpen:h,title:"Create API Key",onClose:()=>{r(!1),t("")},children:(0,d.jsxs)("form",{className:"flex flex-col gap-4",onSubmit:a8,children:[(0,d.jsx)(j.pd,{label:"Key Name",value:s,onChange:a=>t(a.target.value),placeholder:"Production Key"}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{type:"submit",fullWidth:!0,disabled:!s.trim()||"create"===y,children:"create"===y?"Creating...":"Create"}),(0,d.jsx)(j.$n,{type:"button",onClick:()=>{r(!1),t("")},variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,d.jsx)(j.aF,{isOpen:!!u,title:"API Key Created",onClose:()=>v(null),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4",children:[(0,d.jsx)("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 mb-2 font-medium",children:"Save this key now!"}),(0,d.jsx)("p",{className:"text-sm text-yellow-700 dark:text-yellow-300",children:"This is the only time you will see this key. Store it securely."})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.pd,{value:u||"",readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,d.jsx)(j.$n,{variant:"secondary",icon:"created_key"===aR?"check":"content_copy",onClick:()=>aS(u,"created_key"),children:"created_key"===aR?"Copied!":"Copy"})]}),(0,d.jsx)(j.$n,{onClick:()=>v(null),fullWidth:!0,children:"Done"})]})}),(0,d.jsx)(j.aF,{isOpen:ac,title:"Enable Tunnel",onClose:()=>ad(!1),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("div",{className:"bg-surface-2 border border-border-subtle rounded-lg p-4",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary",children:"cloud_upload"}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm text-text-main font-medium mb-1",children:"Cloudflare Tunnel"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Expose your local ZevaiRouter to the internet. No port forwarding, no static IP needed. Share endpoint URL with your team or use it in Cursor, Cline, and other AI tools from anywhere."})]})]})}),(0,d.jsx)("div",{className:"grid grid-cols-2 gap-3",children:l.map(a=>(0,d.jsxs)("div",{className:"flex flex-col items-center text-center p-3 rounded-lg bg-sidebar/50",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-xl text-primary mb-1",children:a.icon}),(0,d.jsx)("p",{className:"text-xs font-semibold",children:a.title}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:a.desc})]},a.title))}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Requires outbound port 7844 (TCP/UDP). Connection may take 10-30s."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{onClick:aZ,fullWidth:!0,children:"Start Tunnel"}),(0,d.jsx)(j.$n,{onClick:()=>ad(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,d.jsx)(j.aF,{isOpen:ae,title:"Disable Tunnel",onClose:()=>!Y&&af(!1),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"The Cloudflare tunnel will be disconnected. Remote access via tunnel URL will stop working."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{onClick:a$,fullWidth:!0,disabled:Y,variant:"danger",children:Y?"Disabling...":"Disable"}),(0,d.jsx)(j.$n,{onClick:()=>af(!1),variant:"ghost",fullWidth:!0,disabled:Y,children:"Cancel"})]})]})}),(0,d.jsx)(j.aF,{isOpen:aG,title:"Tailscale Funnel",onClose:()=>{ay||(aH(!1),aD(""),ar(null))},children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[null===aw&&(0,d.jsxs)("p",{className:"text-sm text-text-muted flex items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Checking..."]}),!1===aw&&!ay&&(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Tailscale is not installed. Install it to enable Funnel."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{onClick:a0,fullWidth:!0,children:"Install Tailscale"}),(0,d.jsx)(j.$n,{onClick:()=>aH(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),ay&&(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 text-sm text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Installing Tailscale..."]}),aA.length>0&&(0,d.jsx)("div",{ref:aK,className:"bg-black/5 dark:bg-white/5 rounded p-2 max-h-40 overflow-y-auto font-mono text-xs text-text-muted",children:aA.map((a,b)=>(0,d.jsx)("div",{children:a},b))})]}),!0===aw&&!ay&&(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600 dark:text-green-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"check_circle"}),"Tailscale installed"]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{onClick:()=>a4(),fullWidth:!0,children:"Connect"}),(0,d.jsx)(j.$n,{onClick:()=>aH(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),aq&&(0,d.jsx)(o,{status:aq})]})}),(0,d.jsx)(j.aF,{isOpen:aI,title:"Disable Tailscale",onClose:()=>!am&&aJ(!1),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Tailscale Funnel will be stopped. Remote access via Tailscale URL will stop working."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{onClick:a6,fullWidth:!0,disabled:am,variant:"danger",children:am?"Disabling...":"Disable"}),(0,d.jsx)(j.$n,{onClick:()=>aJ(!1),variant:"ghost",fullWidth:!0,disabled:am,children:"Cancel"})]})]})}),(0,d.jsx)(j.uo,{isOpen:!!w,onClose:()=>x(null),onConfirm:w?.onConfirm,title:w?.title||"Confirm",message:w?.message,variant:"danger"})]})}function n({label:a,url:b,copyId:c,copied:e,onCopy:f,badge:g,actions:h}){return(0,d.jsxs)("div",{className:"grid min-w-0 grid-cols-[minmax(0,1fr)_auto_auto] items-center gap-2.5 rounded-xl border border-border-subtle bg-bg/55 p-3 transition-colors hover:border-primary/20 sm:flex",children:[(0,d.jsx)("span",{className:`col-span-full inline-flex min-h-8 w-full shrink-0 items-center justify-center rounded-lg px-2.5 text-[11px] font-semibold uppercase tracking-[0.08em] sm:w-[96px] ${"CF"===g||"TS"===g?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:a}),(0,d.jsx)(j.pd,{"aria-label":`${a} endpoint URL`,value:b,readOnly:!0,className:"w-full min-w-0 font-mono text-sm sm:flex-1"}),(0,d.jsx)("button",{onClick:()=>f(b,c),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0","aria-label":`Copy ${a} endpoint URL`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:e===c?"check":"content_copy"})}),h]})}function o({status:a,className:b=""}){return(0,d.jsx)("div",{className:`p-2 rounded text-sm ${b} ${"success"===a.type?"bg-green-500/10 text-green-600 dark:text-green-400":"warning"===a.type?"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400":"info"===a.type?"bg-blue-500/10 text-blue-600 dark:text-blue-400":"bg-red-500/10 text-red-600 dark:text-red-400"}`,children:a.message.split(/(https?:\/\/[^\s]+)/g).map((a,b)=>/^https?:\/\//.test(a)?(0,d.jsx)("a",{href:a,target:"_blank",rel:"noreferrer",className:"underline font-medium",children:a},b):a)})}function p({text:a}){return(0,d.jsxs)("span",{className:"relative group inline-flex items-center",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted cursor-help",children:"help"}),(0,d.jsx)("span",{className:"pointer-events-none absolute right-0 top-full z-50 mt-2 w-[min(16rem,calc(100vw-2rem))] rounded bg-gray-900 px-2.5 py-1.5 text-xs text-white opacity-0 shadow-lg transition-opacity group-hover:opacity-100 dark:bg-gray-800",children:a})]})}function q({message:a,action:b}){return(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-amber-500/10 border border-amber-500/20 text-amber-700 dark:text-amber-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px] shrink-0 mt-0.5",children:"warning"}),(0,d.jsx)("p",{className:"text-xs flex-1",children:a}),b&&(0,d.jsx)("a",{href:b.href,className:"text-xs font-medium underline shrink-0 hover:opacity-80",onClick:b.href.startsWith("#")?a=>{a.preventDefault(),document.getElementById(b.href.slice(1))?.scrollIntoView({behavior:"smooth"})}:void 0,children:b.label})]})}m.propTypes={machineId:g().string.isRequired}},51747:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/firda/zevairouter/src/app/(dashboard)/dashboard/endpoint/EndpointPageClient.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/firda/zevairouter/src/app/(dashboard)/dashboard/endpoint/EndpointPageClient.js","default")},71885:(a,b,c)=>{Promise.resolve().then(c.bind(c,51747))},87250:(a,b,c)=>{"use strict";c.d(b,{D:()=>e});var d=c(54603);async function e(){return await (0,d.Xj)()}},95853:(a,b,c)=>{Promise.resolve().then(c.bind(c,43173))}};
|
|
3
|
+
This key will stop working immediately but can be resumed later.`,onConfirm:async()=>{x(null),a9(a.id,b)}}):a9(a.id,b)},title:a.isActive?"Pause key":"Resume key"})}),(0,d.jsx)("button",{disabled:y===`delete:${a.id}`,onClick:()=>{var b;return b=a.id,void(!y&&x({title:"Delete API Key",message:"Delete this API key?",onConfirm:async()=>{x(null),z(`delete:${b}`),B(null);try{let a=await fetch(`/api/keys/${b}`,{method:"DELETE"});if(!a.ok)throw Error(`Failed to delete key (${a.status})`);c(a=>a.filter(a=>a.id!==b)),D(a=>{let c=new Set(a);return c.delete(b),c}),F(a=>{if(!(b in a))return a;let c={...a};return delete c[b],c}),B({type:"success",message:"API key deleted"})}catch(a){B({type:"error",message:a.message})}finally{z(null)}}}))},className:"flex size-11 items-center justify-center rounded-xl text-red-500 opacity-100 transition-all hover:bg-red-500/10 sm:size-9 sm:rounded-lg sm:opacity-0 sm:group-hover:opacity-100","aria-label":`Delete ${a.name}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]})]},a.id)})})]}),(0,d.jsx)(j.aF,{isOpen:h,title:"Create API Key",onClose:()=>{r(!1),t("")},children:(0,d.jsxs)("form",{className:"flex flex-col gap-4",onSubmit:a8,children:[(0,d.jsx)(j.pd,{label:"Key Name",value:s,onChange:a=>t(a.target.value),placeholder:"Production Key"}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{type:"submit",fullWidth:!0,disabled:!s.trim()||"create"===y,children:"create"===y?"Creating...":"Create"}),(0,d.jsx)(j.$n,{type:"button",onClick:()=>{r(!1),t("")},variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,d.jsx)(j.aF,{isOpen:!!u,title:"API Key Created",onClose:()=>v(null),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4",children:[(0,d.jsx)("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 mb-2 font-medium",children:"Save this key now!"}),(0,d.jsx)("p",{className:"text-sm text-yellow-700 dark:text-yellow-300",children:"This is the only time you will see this key. Store it securely."})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.pd,{value:u||"",readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,d.jsx)(j.$n,{variant:"secondary",icon:"created_key"===aR?"check":"content_copy",onClick:()=>aS(u,"created_key"),children:"created_key"===aR?"Copied!":"Copy"})]}),(0,d.jsx)(j.$n,{onClick:()=>v(null),fullWidth:!0,children:"Done"})]})}),(0,d.jsx)(j.aF,{isOpen:ac,title:"Enable Tunnel",onClose:()=>ad(!1),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("div",{className:"bg-surface-2 border border-border-subtle rounded-lg p-4",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary",children:"cloud_upload"}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm text-text-main font-medium mb-1",children:"Cloudflare Tunnel"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Expose your local ZevaiRouter to the internet. No port forwarding, no static IP needed. Share endpoint URL with your team or use it in Cursor, Cline, and other AI tools from anywhere."})]})]})}),(0,d.jsx)("div",{className:"grid grid-cols-2 gap-3",children:l.map(a=>(0,d.jsxs)("div",{className:"flex flex-col items-center text-center p-3 rounded-lg bg-sidebar/50",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-xl text-primary mb-1",children:a.icon}),(0,d.jsx)("p",{className:"text-xs font-semibold",children:a.title}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:a.desc})]},a.title))}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Requires outbound port 7844 (TCP/UDP). Connection may take 10-30s."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{onClick:aZ,fullWidth:!0,children:"Start Tunnel"}),(0,d.jsx)(j.$n,{onClick:()=>ad(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,d.jsx)(j.aF,{isOpen:ae,title:"Disable Tunnel",onClose:()=>!Y&&af(!1),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"The Cloudflare tunnel will be disconnected. Remote access via tunnel URL will stop working."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{onClick:a$,fullWidth:!0,disabled:Y,variant:"danger",children:Y?"Disabling...":"Disable"}),(0,d.jsx)(j.$n,{onClick:()=>af(!1),variant:"ghost",fullWidth:!0,disabled:Y,children:"Cancel"})]})]})}),(0,d.jsx)(j.aF,{isOpen:aG,title:"Tailscale Funnel",onClose:()=>{ay||(aH(!1),aD(""),ar(null))},children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[null===aw&&(0,d.jsxs)("p",{className:"text-sm text-text-muted flex items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Checking..."]}),!1===aw&&!ay&&(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Tailscale is not installed. Install it to enable Funnel."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{onClick:a0,fullWidth:!0,children:"Install Tailscale"}),(0,d.jsx)(j.$n,{onClick:()=>aH(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),ay&&(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 text-sm text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Installing Tailscale..."]}),aA.length>0&&(0,d.jsx)("div",{ref:aK,className:"bg-black/5 dark:bg-white/5 rounded p-2 max-h-40 overflow-y-auto font-mono text-xs text-text-muted",children:aA.map((a,b)=>(0,d.jsx)("div",{children:a},b))})]}),!0===aw&&!ay&&(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600 dark:text-green-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"check_circle"}),"Tailscale installed"]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{onClick:()=>a4(),fullWidth:!0,children:"Connect"}),(0,d.jsx)(j.$n,{onClick:()=>aH(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),aq&&(0,d.jsx)(o,{status:aq})]})}),(0,d.jsx)(j.aF,{isOpen:aI,title:"Disable Tailscale",onClose:()=>!am&&aJ(!1),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Tailscale Funnel will be stopped. Remote access via Tailscale URL will stop working."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{onClick:a6,fullWidth:!0,disabled:am,variant:"danger",children:am?"Disabling...":"Disable"}),(0,d.jsx)(j.$n,{onClick:()=>aJ(!1),variant:"ghost",fullWidth:!0,disabled:am,children:"Cancel"})]})]})}),(0,d.jsx)(j.uo,{isOpen:!!w,onClose:()=>x(null),onConfirm:w?.onConfirm,title:w?.title||"Confirm",message:w?.message,variant:"danger"})]})}function n({label:a,url:b,copyId:c,copied:e,onCopy:f,badge:g,actions:h}){return(0,d.jsxs)("div",{className:"grid min-w-0 grid-cols-[minmax(0,1fr)_auto_auto] items-center gap-2.5 rounded-xl border border-border-subtle bg-bg/55 p-3 transition-colors hover:border-primary/20 sm:flex",children:[(0,d.jsx)("span",{className:`col-span-full inline-flex min-h-8 w-full shrink-0 items-center justify-center rounded-lg px-2.5 text-[11px] font-semibold uppercase tracking-[0.08em] sm:w-[96px] ${"CF"===g||"TS"===g?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:a}),(0,d.jsx)(j.pd,{"aria-label":`${a} endpoint URL`,value:b,readOnly:!0,className:"w-full min-w-0 font-mono text-sm sm:flex-1"}),(0,d.jsx)("button",{onClick:()=>f(b,c),className:"flex size-11 shrink-0 items-center justify-center rounded-xl text-text-muted transition-colors hover:bg-black/5 hover:text-primary dark:hover:bg-white/5 sm:size-9 sm:rounded-lg","aria-label":`Copy ${a} endpoint URL`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:e===c?"check":"content_copy"})}),h]})}function o({status:a,className:b=""}){return(0,d.jsx)("div",{className:`p-2 rounded text-sm ${b} ${"success"===a.type?"bg-green-500/10 text-green-600 dark:text-green-400":"warning"===a.type?"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400":"info"===a.type?"bg-blue-500/10 text-blue-600 dark:text-blue-400":"bg-red-500/10 text-red-600 dark:text-red-400"}`,children:a.message.split(/(https?:\/\/[^\s]+)/g).map((a,b)=>/^https?:\/\//.test(a)?(0,d.jsx)("a",{href:a,target:"_blank",rel:"noreferrer",className:"underline font-medium",children:a},b):a)})}function p({text:a}){return(0,d.jsxs)("span",{className:"relative group inline-flex items-center",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted cursor-help",children:"help"}),(0,d.jsx)("span",{className:"pointer-events-none absolute right-0 top-full z-50 mt-2 w-[min(16rem,calc(100vw-2rem))] rounded bg-gray-900 px-2.5 py-1.5 text-xs text-white opacity-0 shadow-lg transition-opacity group-hover:opacity-100 dark:bg-gray-800",children:a})]})}function q({message:a,action:b}){return(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-amber-500/10 border border-amber-500/20 text-amber-700 dark:text-amber-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px] shrink-0 mt-0.5",children:"warning"}),(0,d.jsx)("p",{className:"text-xs flex-1",children:a}),b&&(0,d.jsx)("a",{href:b.href,className:"inline-flex min-h-11 shrink-0 items-center text-xs font-medium underline hover:opacity-80 sm:min-h-0",onClick:b.href.startsWith("#")?a=>{a.preventDefault(),document.getElementById(b.href.slice(1))?.scrollIntoView({behavior:"smooth"})}:void 0,children:b.label})]})}m.propTypes={machineId:g().string.isRequired}},51747:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/firda/zevairouter/src/app/(dashboard)/dashboard/endpoint/EndpointPageClient.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/firda/zevairouter/src/app/(dashboard)/dashboard/endpoint/EndpointPageClient.js","default")},71885:(a,b,c)=>{Promise.resolve().then(c.bind(c,51747))},87250:(a,b,c)=>{"use strict";c.d(b,{D:()=>e});var d=c(54603);async function e(){return await (0,d.Xj)()}},95853:(a,b,c)=>{Promise.resolve().then(c.bind(c,43173))}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
exports.id=8306,exports.ids=[8306],exports.modules={30869:(a,b,c)=>{"use strict";c.d(b,{UY:()=>h,X3:()=>i,eh:()=>f.eh,fg:()=>e.fg,h0:()=>g});var d=c(39006),e=c(75681),f=c(81329);d.version;let g={npmPackageName:"zevairouter",installCmd:"npm i -g zevairouter",installCmdLatest:"npm i -g zevairouter@latest --prefer-online",shutdownCountdownSec:3,exitDelayMs:500,statusPort:20129,statusPollIntervalMs:1e3,statusLogTailLines:8,installRetries:3,installRetryDelayMs:5e3,lingerAfterDoneMs:3e4,waitForExitMinMs:5e3,waitForExitMaxMs:2e4,waitForExitCheckMs:500,appPort:1997},h={maxLines:200,pollIntervalMs:1e3},i={openrouter:"https://openrouter.ai/api/v1/chat/completions",glm:"https://api.z.ai/api/anthropic/v1/messages","glm-cn":"https://open.bigmodel.cn/api/coding/paas/v4/chat/completions",kimi:"https://api.kimi.com/coding/v1/messages",minimax:"https://api.minimax.io/anthropic/v1/messages","minimax-cn":"https://api.minimaxi.com/anthropic/v1/messages",alicode:"https://coding.dashscope.aliyuncs.com/v1/chat/completions","alicode-intl":"https://coding-intl.dashscope.aliyuncs.com/v1/chat/completions","volcengine-ark":"https://ark.cn-beijing.volces.com/api/coding/v3/chat/completions",byteplus:"https://ark.ap-southeast.bytepluses.com/api/coding/v3/chat/completions",openai:"https://api.openai.com/v1/chat/completions","vercel-ai-gateway":"https://ai-gateway.vercel.sh/v1/chat/completions",anthropic:"https://api.anthropic.com/v1/messages",gemini:"https://generativelanguage.googleapis.com/v1beta/models",ollama:"https://ollama.com/api/chat","ollama-local":"http://localhost:11434/api/chat"}},38238:(a,b,c)=>{"use strict";c.d(b,{P:()=>h});var d=c(89718),e=c(30869),f=c(54603);async function g(){let a=null;try{let b=await (0,d.PX)(!0);a=b.find(a=>!1!==a.isActive)?.key||null}catch{}let b={"Content-Type":"application/json"};return a&&(b.Authorization=`Bearer ${a}`),b["x-zevai-cli-token"]=await (0,f.Xj)("zevai-cli-auth"),b}async function h(a,b,c=`http://127.0.0.1:${process.env.PORT||e.h0.appPort}`){let d=await g(),f=Date.now();if("embedding"===b){let b=await fetch(`${c}/api/v1/embeddings`,{method:"POST",headers:d,body:JSON.stringify({model:a,input:"test"}),signal:AbortSignal.timeout(15e3)}),e=Date.now()-f,g=await b.text().catch(()=>""),h=null;try{h=g?JSON.parse(g):null}catch{}if(!b.ok){let a=h?.error?.message||h?.error||g;return{ok:!1,latencyMs:e,error:`HTTP ${b.status}${a?`: ${String(a).slice(0,240)}`:""}`,status:b.status}}return Array.isArray(h?.data)&&h.data.length>0&&Array.isArray(h.data[0]?.embedding)?{ok:!0,latencyMs:e,error:null,status:b.status}:{ok:!1,latencyMs:e,status:b.status,error:"Provider returned no embedding data"}}if("image"===b){let b=await fetch(`${c}/api/v1/images/generations`,{method:"POST",headers:d,body:JSON.stringify({model:a,prompt:"test"}),signal:AbortSignal.timeout(15e3)}),e=Date.now()-f,g=await b.text().catch(()=>""),h=null;try{h=g?JSON.parse(g):null}catch{}if(!b.ok){let a=h?.error?.message||h?.msg||h?.message||h?.error||g;return{ok:!1,latencyMs:e,error:`HTTP ${b.status}${a?`: ${String(a).slice(0,240)}`:""}`,status:b.status}}return Array.isArray(h?.data)&&h.data.length>0?{ok:!0,latencyMs:e,error:null,status:b.status}:{ok:!1,latencyMs:e,status:b.status,error:"Provider returned no image data for this model"}}if("stt"===b){let b,e,g,h,i=new FormData,j=(g=new DataView(e=new ArrayBuffer(44+(b=2*Math.max(1,Math.floor(4e3))))),(h=(a,b)=>{for(let c=0;c<b.length;c+=1)g.setUint8(a+c,b.charCodeAt(c))})(0,"RIFF"),g.setUint32(4,36+b,!0),h(8,"WAVE"),h(12,"fmt "),g.setUint32(16,16,!0),g.setUint16(20,1,!0),g.setUint16(22,1,!0),g.setUint32(24,16e3,!0),g.setUint32(28,32e3,!0),g.setUint16(32,2,!0),g.setUint16(34,16,!0),h(36,"data"),g.setUint32(40,b,!0),new Blob([e],{type:"audio/wav"}));i.append("file",j,"test.wav"),i.append("model",a);let k=await fetch(`${c}/api/v1/audio/transcriptions`,{method:"POST",headers:Object.fromEntries(Object.entries(d).filter(([a])=>"content-type"!==a.toLowerCase())),body:i,signal:AbortSignal.timeout(15e3)}),l=Date.now()-f,m=await k.text().catch(()=>""),n=null;try{n=m?JSON.parse(m):null}catch{}if(!k.ok){let a=n?.error?.message||n?.msg||n?.message||n?.error||m;return{ok:!1,latencyMs:l,error:`HTTP ${k.status}${a?`: ${String(a).slice(0,240)}`:""}`,status:k.status}}return("string"==typeof n?.text?n.text:"").trim()?{ok:!0,latencyMs:l,error:null,status:k.status}:{ok:!1,latencyMs:l,status:k.status,error:"Provider returned no transcription text for this model"}}let i=await fetch(`${c}/api/v1/chat/completions`,{method:"POST",headers:d,body:JSON.stringify({model:a,max_tokens:1,stream:!1,messages:[{role:"user",content:"hi"}]}),signal:AbortSignal.timeout(15e3)}),j=Date.now()-f,k=await i.text().catch(()=>""),l=null;try{l=k?JSON.parse(k):null}catch{}if(!i.ok){let a=l?.error?.message||l?.msg||l?.message||l?.error||k;return{ok:!1,latencyMs:j,error:`HTTP ${i.status}${a?`: ${String(a).slice(0,240)}`:""}`,status:i.status}}let m=l?.status,n=l?.msg||l?.message;if(null!=m&&"200"!==String(m)&&"0"!==String(m)&&n)return{ok:!1,latencyMs:j,status:i.status,error:`Provider status ${m}: ${String(n).slice(0,240)}`};if(l?.error){let a=l?.error?.message||l?.error||"Provider returned an error";return{ok:!1,latencyMs:j,status:i.status,error:String(a).slice(0,240)}}return Array.isArray(l?.choices)&&l.choices.length>0?{ok:!0,latencyMs:j,error:null,status:i.status}:{ok:!1,latencyMs:j,status:i.status,error:"Provider returned no completion choices for this model"}}},39006:a=>{"use strict";a.exports=JSON.parse('{"name":"zevairouter","version":"1.0.145","description":"Self-hosted AI router: many providers, one OpenAI-compatible /v1 endpoint and dashboard","bin":{"zevai":"./cli/cli.js"},"files":["cli/","src/","public/","scripts/","i18n/","assets/","images/","open-sse/","next.config.mjs","postcss.config.mjs","jsconfig.json","start.sh","package.json","README.md","LICENSE","CHANGELOG.md"],"scripts":{"dev":"next dev --webpack --port 1997","build":"next build --webpack","start":"node ./scripts/start-standalone.mjs","dev:bun":"bun --bun next dev --webpack --port 1997","build:bun":"bun --bun next build --webpack","start:bun":"bun ./.next/standalone/server.js","build:cli":"node cli/scripts/build-cli.js","release":"node cli/scripts/release.js","prepack":"node cli/scripts/build-cli.js","postinstall":"node cli/hooks/postinstall.js || exit 0"},"dependencies":{"@dnd-kit/core":"^6.3.1","@dnd-kit/modifiers":"^9.0.0","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@monaco-editor/react":"^4.7.0","@xterm/addon-fit":"^0.11.0","@xterm/addon-web-links":"^0.12.0","@xterm/xterm":"^6.0.0","@xyflow/react":"^12.10.1","bcryptjs":"^3.0.3","confbox":"^0.2.4","express":"^5.2.1","http-proxy-middleware":"^3.0.7","jose":"^6.1.3","marked":"^18.0.1","material-symbols":"^0.45.1","monaco-editor":"^0.55.1","next":"^16.2.12","node-forge":"^1.3.3","node-machine-id":"^1.1.12","open":"^11.0.0","ora":"^9.1.0","react":"19.2.4","react-dom":"19.2.4","react-is":"^19.2.7","recharts":"^3.7.0","selfsigned":"^5.5.0","socks":"^2.8.9","socks-proxy-agent":"^10.1.0","sql.js":"^1.14.1","undici":"^8.7.0","uuid":"^14.0.1","zustand":"^5.0.10"},"comment_optional_runtime":"Heavy packages are installed into ~/.zevai/runtime instead of the published tarball. Automation uses Playwright Chromium only; ZEVAI_MINIMAL_POSTINSTALL=1 skips its browser download. Other lazy runtimes are better-sqlite3 and node-pty.","overrides":{"dompurify":"^3.4.12","postcss":"^8.5.10"},"comment_overrides":"dompurify: monaco-editor@0.55.1 pins vulnerable dompurify@3.2.7 (multiple mXSS advisories, all fixed in 3.4.x). Override forces the patched 3.4.12 until monaco ships a stable release with the fix (currently only in 0.56.0-dev). We don\'t use dompurify directly; monaco only uses it to sanitize HTML hover/completion output.","devDependencies":{"@tailwindcss/postcss":"^4.1.18","better-sqlite3":"^12.6.2","esbuild":"^0.28.1","eslint":"^9","eslint-config-next":"16.2.9","postcss":"^8.5.10","tailwindcss":"^4"},"engines":{"node":">=22.5.0"},"keywords":["zevairouter","zevai","ai","router","proxy","kiro","codebuddy","claude","openai","api","quota","automation"],"license":"MIT","repository":{"type":"git","url":"https://github.com/Verifiedlabs/zevairouter"},"homepage":"https://github.com/Verifiedlabs/zevairouter"}')},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.DATA_DIR,"machine-id"),m=h().join(k.DATA_DIR,"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.DATA_DIR,{recursive:!0}),f().writeFileSync(l,o,{mode:384})}catch{}return o}(),e="zevai-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)}},78335:()=>{},81329:(a,b,c)=>{"use strict";c.d(b,{Xg:()=>d.Xg,eh:()=>e,vq:()=>d.vq});var d=c(44404);Object.entries(c(75681).AI_PROVIDERS).filter(([,a])=>a.passthroughModels).map(([a])=>a);let e=Object.entries(d.vq).flatMap(([a,b])=>b.map(b=>({provider:a,model:b.id,name:b.name})))},89718:(a,b,c)=>{"use strict";c.d(b,{CG:()=>d.CG,Dj:()=>d.Dj,Fh:()=>d.Fh,Iq:()=>d.Iq,K1:()=>d.K1,KJ:()=>d.KJ,KK:()=>d.KK,L:()=>d.L,L9:()=>d.L9,Lh:()=>d.Lh,Mc:()=>d.Mc,NR:()=>d.NR,PX:()=>d.PX,Pb:()=>d.Pb,Pc:()=>d.Pc,QI:()=>d.QI,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,dK:()=>d.dK,deleteModelAlias:()=>d.fv,ek:()=>d.ek,fK:()=>d.fK,getModelAliases:()=>d.OM,getProviderConnections:()=>d.P,getQuotaSnapshot:()=>d.LF,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,p3:()=>d.p3,qd:()=>d.qd,r4:()=>d.r4,tV:()=>d.tV,uL:()=>d.uL,ui:()=>d.ui,updateProviderConnection:()=>d.rj,uv:()=>d.uv,yF:()=>d.yF,yW:()=>d.yW,yg:()=>d.yg,zP:()=>d.zP,zY:()=>d.zY});var d=c(80601)},96487:()=>{}};
|
|
1
|
+
exports.id=8306,exports.ids=[8306],exports.modules={30869:(a,b,c)=>{"use strict";c.d(b,{UY:()=>h,X3:()=>i,eh:()=>f.eh,fg:()=>e.fg,h0:()=>g});var d=c(39006),e=c(75681),f=c(81329);d.version;let g={npmPackageName:"zevairouter",installCmd:"npm i -g zevairouter",installCmdLatest:"npm i -g zevairouter@latest --prefer-online",shutdownCountdownSec:3,exitDelayMs:500,statusPort:20129,statusPollIntervalMs:1e3,statusLogTailLines:8,installRetries:3,installRetryDelayMs:5e3,lingerAfterDoneMs:3e4,waitForExitMinMs:5e3,waitForExitMaxMs:2e4,waitForExitCheckMs:500,appPort:1997},h={maxLines:200,pollIntervalMs:1e3},i={openrouter:"https://openrouter.ai/api/v1/chat/completions",glm:"https://api.z.ai/api/anthropic/v1/messages","glm-cn":"https://open.bigmodel.cn/api/coding/paas/v4/chat/completions",kimi:"https://api.kimi.com/coding/v1/messages",minimax:"https://api.minimax.io/anthropic/v1/messages","minimax-cn":"https://api.minimaxi.com/anthropic/v1/messages",alicode:"https://coding.dashscope.aliyuncs.com/v1/chat/completions","alicode-intl":"https://coding-intl.dashscope.aliyuncs.com/v1/chat/completions","volcengine-ark":"https://ark.cn-beijing.volces.com/api/coding/v3/chat/completions",byteplus:"https://ark.ap-southeast.bytepluses.com/api/coding/v3/chat/completions",openai:"https://api.openai.com/v1/chat/completions","vercel-ai-gateway":"https://ai-gateway.vercel.sh/v1/chat/completions",anthropic:"https://api.anthropic.com/v1/messages",gemini:"https://generativelanguage.googleapis.com/v1beta/models",ollama:"https://ollama.com/api/chat","ollama-local":"http://localhost:11434/api/chat"}},38238:(a,b,c)=>{"use strict";c.d(b,{P:()=>h});var d=c(89718),e=c(30869),f=c(54603);async function g(){let a=null;try{let b=await (0,d.PX)(!0);a=b.find(a=>!1!==a.isActive)?.key||null}catch{}let b={"Content-Type":"application/json"};return a&&(b.Authorization=`Bearer ${a}`),b["x-zevai-cli-token"]=await (0,f.Xj)("zevai-cli-auth"),b}async function h(a,b,c=`http://127.0.0.1:${process.env.PORT||e.h0.appPort}`){let d=await g(),f=Date.now();if("embedding"===b){let b=await fetch(`${c}/api/v1/embeddings`,{method:"POST",headers:d,body:JSON.stringify({model:a,input:"test"}),signal:AbortSignal.timeout(15e3)}),e=Date.now()-f,g=await b.text().catch(()=>""),h=null;try{h=g?JSON.parse(g):null}catch{}if(!b.ok){let a=h?.error?.message||h?.error||g;return{ok:!1,latencyMs:e,error:`HTTP ${b.status}${a?`: ${String(a).slice(0,240)}`:""}`,status:b.status}}return Array.isArray(h?.data)&&h.data.length>0&&Array.isArray(h.data[0]?.embedding)?{ok:!0,latencyMs:e,error:null,status:b.status}:{ok:!1,latencyMs:e,status:b.status,error:"Provider returned no embedding data"}}if("image"===b){let b=await fetch(`${c}/api/v1/images/generations`,{method:"POST",headers:d,body:JSON.stringify({model:a,prompt:"test"}),signal:AbortSignal.timeout(15e3)}),e=Date.now()-f,g=await b.text().catch(()=>""),h=null;try{h=g?JSON.parse(g):null}catch{}if(!b.ok){let a=h?.error?.message||h?.msg||h?.message||h?.error||g;return{ok:!1,latencyMs:e,error:`HTTP ${b.status}${a?`: ${String(a).slice(0,240)}`:""}`,status:b.status}}return Array.isArray(h?.data)&&h.data.length>0?{ok:!0,latencyMs:e,error:null,status:b.status}:{ok:!1,latencyMs:e,status:b.status,error:"Provider returned no image data for this model"}}if("stt"===b){let b,e,g,h,i=new FormData,j=(g=new DataView(e=new ArrayBuffer(44+(b=2*Math.max(1,Math.floor(4e3))))),(h=(a,b)=>{for(let c=0;c<b.length;c+=1)g.setUint8(a+c,b.charCodeAt(c))})(0,"RIFF"),g.setUint32(4,36+b,!0),h(8,"WAVE"),h(12,"fmt "),g.setUint32(16,16,!0),g.setUint16(20,1,!0),g.setUint16(22,1,!0),g.setUint32(24,16e3,!0),g.setUint32(28,32e3,!0),g.setUint16(32,2,!0),g.setUint16(34,16,!0),h(36,"data"),g.setUint32(40,b,!0),new Blob([e],{type:"audio/wav"}));i.append("file",j,"test.wav"),i.append("model",a);let k=await fetch(`${c}/api/v1/audio/transcriptions`,{method:"POST",headers:Object.fromEntries(Object.entries(d).filter(([a])=>"content-type"!==a.toLowerCase())),body:i,signal:AbortSignal.timeout(15e3)}),l=Date.now()-f,m=await k.text().catch(()=>""),n=null;try{n=m?JSON.parse(m):null}catch{}if(!k.ok){let a=n?.error?.message||n?.msg||n?.message||n?.error||m;return{ok:!1,latencyMs:l,error:`HTTP ${k.status}${a?`: ${String(a).slice(0,240)}`:""}`,status:k.status}}return("string"==typeof n?.text?n.text:"").trim()?{ok:!0,latencyMs:l,error:null,status:k.status}:{ok:!1,latencyMs:l,status:k.status,error:"Provider returned no transcription text for this model"}}let i=await fetch(`${c}/api/v1/chat/completions`,{method:"POST",headers:d,body:JSON.stringify({model:a,max_tokens:1,stream:!1,messages:[{role:"user",content:"hi"}]}),signal:AbortSignal.timeout(15e3)}),j=Date.now()-f,k=await i.text().catch(()=>""),l=null;try{l=k?JSON.parse(k):null}catch{}if(!i.ok){let a=l?.error?.message||l?.msg||l?.message||l?.error||k;return{ok:!1,latencyMs:j,error:`HTTP ${i.status}${a?`: ${String(a).slice(0,240)}`:""}`,status:i.status}}let m=l?.status,n=l?.msg||l?.message;if(null!=m&&"200"!==String(m)&&"0"!==String(m)&&n)return{ok:!1,latencyMs:j,status:i.status,error:`Provider status ${m}: ${String(n).slice(0,240)}`};if(l?.error){let a=l?.error?.message||l?.error||"Provider returned an error";return{ok:!1,latencyMs:j,status:i.status,error:String(a).slice(0,240)}}return Array.isArray(l?.choices)&&l.choices.length>0?{ok:!0,latencyMs:j,error:null,status:i.status}:{ok:!1,latencyMs:j,status:i.status,error:"Provider returned no completion choices for this model"}}},39006:a=>{"use strict";a.exports=JSON.parse('{"name":"zevairouter","version":"1.0.147","description":"Self-hosted AI router: many providers, one OpenAI-compatible /v1 endpoint and dashboard","bin":{"zevai":"./cli/cli.js"},"files":["cli/","src/","public/","scripts/","i18n/","assets/","images/","open-sse/","next.config.mjs","postcss.config.mjs","jsconfig.json","start.sh","package.json","README.md","LICENSE","CHANGELOG.md"],"scripts":{"dev":"next dev --webpack --port 1997","build":"next build --webpack","start":"node ./scripts/start-standalone.mjs","dev:bun":"bun --bun next dev --webpack --port 1997","build:bun":"bun --bun next build --webpack","start:bun":"bun ./.next/standalone/server.js","build:cli":"node cli/scripts/build-cli.js","release":"node cli/scripts/release.js","prepack":"node cli/scripts/build-cli.js","postinstall":"node cli/hooks/postinstall.js || exit 0"},"dependencies":{"@dnd-kit/core":"^6.3.1","@dnd-kit/modifiers":"^9.0.0","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@monaco-editor/react":"^4.7.0","@xterm/addon-fit":"^0.11.0","@xterm/addon-web-links":"^0.12.0","@xterm/xterm":"^6.0.0","@xyflow/react":"^12.10.1","bcryptjs":"^3.0.3","confbox":"^0.2.4","express":"^5.2.1","http-proxy-middleware":"^3.0.7","jose":"^6.1.3","marked":"^18.0.1","material-symbols":"^0.45.1","monaco-editor":"^0.55.1","next":"^16.2.12","node-forge":"^1.3.3","node-machine-id":"^1.1.12","open":"^11.0.0","ora":"^9.1.0","react":"19.2.4","react-dom":"19.2.4","react-is":"^19.2.7","recharts":"^3.7.0","selfsigned":"^5.5.0","socks":"^2.8.9","socks-proxy-agent":"^10.1.0","sql.js":"^1.14.1","undici":"^8.7.0","uuid":"^14.0.1","zustand":"^5.0.10"},"comment_optional_runtime":"Heavy packages are installed into ~/.zevai/runtime instead of the published tarball. Automation uses Playwright Chromium only; ZEVAI_MINIMAL_POSTINSTALL=1 skips its browser download. Other lazy runtimes are better-sqlite3 and node-pty.","overrides":{"dompurify":"^3.4.12","postcss":"^8.5.10"},"comment_overrides":"dompurify: monaco-editor@0.55.1 pins vulnerable dompurify@3.2.7 (multiple mXSS advisories, all fixed in 3.4.x). Override forces the patched 3.4.12 until monaco ships a stable release with the fix (currently only in 0.56.0-dev). We don\'t use dompurify directly; monaco only uses it to sanitize HTML hover/completion output.","devDependencies":{"@tailwindcss/postcss":"^4.1.18","better-sqlite3":"^12.6.2","esbuild":"^0.28.1","eslint":"^9","eslint-config-next":"16.2.9","postcss":"^8.5.10","tailwindcss":"^4"},"engines":{"node":">=22.5.0"},"keywords":["zevairouter","zevai","ai","router","proxy","kiro","codebuddy","claude","openai","api","quota","automation"],"license":"MIT","repository":{"type":"git","url":"https://github.com/Verifiedlabs/zevairouter"},"homepage":"https://github.com/Verifiedlabs/zevairouter"}')},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.DATA_DIR,"machine-id"),m=h().join(k.DATA_DIR,"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.DATA_DIR,{recursive:!0}),f().writeFileSync(l,o,{mode:384})}catch{}return o}(),e="zevai-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)}},78335:()=>{},81329:(a,b,c)=>{"use strict";c.d(b,{Xg:()=>d.Xg,eh:()=>e,vq:()=>d.vq});var d=c(44404);Object.entries(c(75681).AI_PROVIDERS).filter(([,a])=>a.passthroughModels).map(([a])=>a);let e=Object.entries(d.vq).flatMap(([a,b])=>b.map(b=>({provider:a,model:b.id,name:b.name})))},89718:(a,b,c)=>{"use strict";c.d(b,{CG:()=>d.CG,Dj:()=>d.Dj,Fh:()=>d.Fh,Iq:()=>d.Iq,K1:()=>d.K1,KJ:()=>d.KJ,KK:()=>d.KK,L:()=>d.L,L9:()=>d.L9,Lh:()=>d.Lh,Mc:()=>d.Mc,NR:()=>d.NR,PX:()=>d.PX,Pb:()=>d.Pb,Pc:()=>d.Pc,QI:()=>d.QI,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,dK:()=>d.dK,deleteModelAlias:()=>d.fv,ek:()=>d.ek,fK:()=>d.fK,getModelAliases:()=>d.OM,getProviderConnections:()=>d.P,getQuotaSnapshot:()=>d.LF,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,p3:()=>d.p3,qd:()=>d.qd,r4:()=>d.r4,tV:()=>d.tV,uL:()=>d.uL,ui:()=>d.ui,updateProviderConnection:()=>d.rj,uv:()=>d.uv,yF:()=>d.yF,yW:()=>d.yW,yg:()=>d.yg,zP:()=>d.zP,zY:()=>d.zY});var d=c(80601)},96487:()=>{}};
|