switchboard-router 0.6.12 → 0.6.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/.next-cli-build/BUILD_ID +1 -1
- package/app/.next-cli-build/app-path-routes-manifest.json +9 -9
- package/app/.next-cli-build/build-manifest.json +2 -2
- package/app/.next-cli-build/prerender-manifest.json +3 -3
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/agent-library/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/agent-library/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/agent-library/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/routing/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/routing/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/routing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +3 -3
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +3 -3
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/[id]/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/[id]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error.html +1 -1
- package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_not-found.html +1 -1
- package/app/.next-cli-build/server/app/_not-found.rsc +3 -3
- package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/catalog/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/doctor/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/export/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/mcp/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/skills/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/sync/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/updates/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/aider-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/aider-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +4 -4
- package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/gemini-cli-settings/route.js +3 -3
- package/app/.next-cli-build/server/app/api/cli-tools/gemini-cli-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/grok-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/grok-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +3 -3
- package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/combos/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/combos/[id]/strategy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/combos/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/health/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/routing/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/usage/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/version/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/batch/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/cache/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/prepare/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/remove-unavailable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/verify/cancel/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/verify/cancel/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/verify/start/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/verify/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/verify/status/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/verify/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/routing/feedback/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/routing/insights/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/routing/learn/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/routing/stats/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/routing/versions/promote/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/routing/versions/rollback/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/skills/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/token-saver/vault-stats/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/callback.html +1 -1
- package/app/.next-cli-build/server/app/callback.rsc +3 -3
- package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/index.html +1 -1
- package/app/.next-cli-build/server/app/index.rsc +3 -3
- package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/landing.html +1 -1
- package/app/.next-cli-build/server/app/landing.rsc +3 -3
- package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/login.html +1 -1
- package/app/.next-cli-build/server/app/login.rsc +3 -3
- package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app-paths-manifest.json +9 -9
- package/app/.next-cli-build/server/chunks/194.js +1 -1
- package/app/.next-cli-build/server/chunks/{1062.js → 3787.js} +2 -2
- package/app/.next-cli-build/server/chunks/4126.js +1 -1
- package/app/.next-cli-build/server/chunks/4746.js +1 -1
- package/app/.next-cli-build/server/chunks/5821.js +1 -1
- package/app/.next-cli-build/server/chunks/7155.js +1 -1
- package/app/.next-cli-build/server/chunks/869.js +1 -1
- package/app/.next-cli-build/server/chunks/8998.js +6 -6
- package/app/.next-cli-build/server/chunks/9489.js +2 -2
- package/app/.next-cli-build/server/chunks/9696.js +5 -5
- package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
- package/app/.next-cli-build/server/pages/404.html +1 -1
- package/app/.next-cli-build/server/pages/500.html +1 -1
- package/app/.next-cli-build/server/server-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/server-reference-manifest.json +1 -1
- package/app/.next-cli-build/static/chunks/{1321-3803e2ef7718183d.js → 1321-f614c7c6e5ab4bcc.js} +1 -1
- package/app/.next-cli-build/static/chunks/{5497-d866b97bf9a716ba.js → 5497-3d546c1b7aa357b1.js} +5 -5
- package/app/.next-cli-build/static/chunks/594-e392353337efef19.js +64 -0
- package/app/.next-cli-build/static/chunks/6430-4c528cfc35666c11.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/agent-library/{page-d720efb4c9d427e6.js → page-62bea7b75b3f2692.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/basic-chat/{page-04509a38b9fd3dcf.js → page-1eb380280857cf20.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/[toolId]/{page-fa35870caaeabe20.js → page-9aa986f145130c08.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/{page-aa9c65a5e73a3f5d.js → page-a09d7692b3ea9179.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/{page-a8d77d24b4c71915.js → page-4bf0abe7c7119ac0.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/routing/{page-95f09ae849f539d6.js → page-1fc70bcd434deb73.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/console-log/{page-6678759c536b4008.js → page-fdc5377da12ec933.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/endpoint/page-b48bd39cb03c4985.js +3 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/{page-183cf5498e6d3e42.js → page-9e60537a4b8f5a0c.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/{page-b67e7e3b9acaf1cc.js → page-95bf830096d019fd.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/combo/[id]/{page-a4bad553cba810e7.js → page-45ebe6bb46c9f65e.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/{page-0568602ac2385103.js → page-7ac82c8930583633.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/web/{page-f6e3507247a819e5.js → page-961013b570bbeac6.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/mitm/{page-08fe6612a31239da.js → page-8619928e4b74f46b.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/profile/{page-a1ab95a02951c91d.js → page-b5b9038ea28e63b6.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-fa1088497ed93ca8.js → page-e023b0417bbc3b44.js} +2 -2
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/new/{page-608cdc11e7047159.js → page-fe7ccc9c117d7d38.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/{page-ad84a479883e6cc3.js → page-d3e35265648406f2.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/{page-f312c1076859630e.js → page-5ac3900baf3fe9ca.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/skills/[id]/{page-90277b8688f387c1.js → page-bb4af1ac9b13a514.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/skills/{page-33e127c15efc66a5.js → page-4382c14f28ddfc7f.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/token-saver/{page-0f74a450b98fa125.js → page-1b2b6b736fe98698.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/translator/{page-ad2eda4b48c9319b.js → page-92fe95bd4e6b3d0a.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/usage/{page-025d20cc7b091120.js → page-4c47b9660f3066e2.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/layout-d1fa5b81e1c386ab.js +1 -0
- package/app/package.json +1 -1
- package/package.json +1 -1
- package/app/.next-cli-build/static/chunks/1631-cb80453bf5d4173d.js +0 -1
- package/app/.next-cli-build/static/chunks/2176-8ad9ce4b3cb01006.js +0 -1
- package/app/.next-cli-build/static/chunks/2280-61262f8359f37a85.js +0 -64
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/endpoint/page-59e92d48daea1aed.js +0 -3
- package/app/.next-cli-build/static/chunks/app/(dashboard)/layout-acc24d6e7d8eb782.js +0 -1
- /package/app/.next-cli-build/static/{wG_l24NL6NtH6bKGFC8pf → y86nLCzoD011gXPeccvk9}/_buildManifest.js +0 -0
- /package/app/.next-cli-build/static/{wG_l24NL6NtH6bKGFC8pf → y86nLCzoD011gXPeccvk9}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3528],{5214:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorage",{enumerable:!0,get:function(){return r.workAsyncStorageInstance}});let r=n(17828)},17828:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorageInstance",{enumerable:!0,get:function(){return r}});let r=(0,n(64054).createAsyncLocalStorage)()},21957:(e,t,n)=>{"use strict";function r({moduleIds:e}){return null}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadChunks",{enumerable:!0,get:function(){return r}}),n(95155),n(47650),n(5214),n(2451),n(53887)},41112:(e,t,n)=>{"use strict";function r({reason:e,children:t}){return t}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSR",{enumerable:!0,get:function(){return r}}),n(1980)},51473:(e,t,n)=>{Promise.resolve().then(n.bind(n,69472))},64054:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={bindSnapshot:function(){return i},createAsyncLocalStorage:function(){return l},createSnapshot:function(){return d}};for(var r in n)Object.defineProperty(t,r,{enumerable:!0,get:n[r]});let a=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class s{disable(){throw a}getStore(){}run(){throw a}exit(){throw a}enterWith(){throw a}static bind(e){return e}}let o="u">typeof globalThis&&globalThis.AsyncLocalStorage;function l(){return o?new o:new s}function i(e){return o?o.bind(e):s.bind(e)}function d(){return o?o.snapshot():function(e,...t){return e(...t)}}},68635:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i}});let r=n(95155),a=n(12115),s=n(41112);function o(e){return{default:e&&"default"in e?e.default:e}}n(21957);let l={loader:()=>Promise.resolve(o(()=>null)),loading:null,ssr:!0},i=function(e){let t={...l,...e},n=(0,a.lazy)(()=>t.loader().then(o)),i=t.loading;function d(e){let o=i?(0,r.jsx)(i,{isLoading:!0,pastDelay:!0,error:null}):null,l=!t.ssr||!!t.loading,d=l?a.Suspense:a.Fragment,c=t.ssr?(0,r.jsxs)(r.Fragment,{children:[null,(0,r.jsx)(n,{...e})]}):(0,r.jsx)(s.BailoutToCSR,{reason:"next/dynamic",children:(0,r.jsx)(n,{...e})});return(0,r.jsx)(d,{...l?{fallback:o}:{},children:c})}return d.displayName="LoadableComponent",d}},69472:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>f});var r=n(95155),a=n(12115),s=n(35497),o=n(11059),l=n(75707),i=n.n(l),d=n(78559);let c=i()(()=>n.e(8202).then(n.bind(n,28202)),{loadableGenerated:{webpack:()=>[28202]},ssr:!1}),u=[{id:1,label:"Client Request",file:"1_req_client.json",lang:"json",desc:"Raw request from client"},{id:2,label:"Source Body",file:"2_req_source.json",lang:"json",desc:"After initial conversion"},{id:3,label:"OpenAI Intermediate",file:"3_req_openai.json",lang:"json",desc:"source → openai"},{id:4,label:"Target Request",file:"4_req_target.json",lang:"json",desc:"openai → target + URL + headers"},{id:5,label:"Provider Response",file:"5_res_provider.txt",lang:"text",desc:"Raw SSE from provider"},{id:6,label:"OpenAI Response",file:"6_res_openai.txt",lang:"text",desc:"target → openai (response)"},{id:7,label:"Client Response",file:"7_res_client.txt",lang:"text",desc:"Final response to client"}],p={minimap:{enabled:!1},fontSize:12,lineNumbers:"on",scrollBeyondLastLine:!1,wordWrap:"on",automaticLayout:!0};function f(){let[e,t]=(0,a.useState)({}),[n,l]=(0,a.useState)({1:!0}),[i,f]=(0,a.useState)({}),[x,g]=(0,a.useState)(null),h=(e,t)=>f(n=>({...n,[e]:t})),b=(e,n)=>t(t=>({...t,[e]:n})),y=e=>l(t=>{let n={};return u.forEach(e=>{n[e.id]=!1}),n[e]=!0,n}),j=async e=>{let t=u.find(t=>t.id===e);h(`load-${e}`,!0);try{let n=await fetch(`/api/translator/load?file=${t.file}`),r=await n.json();r.success?(b(e,r.content),1===e&&await _(r.content)):(0,d.s)(r.error||"File not found")}catch(e){(0,d.s)(e.message)}h(`load-${e}`,!1)},_=async e=>{try{let t="string"==typeof e?JSON.parse(e):e,n=await fetch("/api/translator/translate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({step:1,body:t})}),r=await n.json();r.success&&g(r.result)}catch{}},v=(e,t)=>fetch("/api/translator/save",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file:e,content:t})}).catch(()=>{}),O=async()=>{h("toOpenAI",!0);try{let t=e[1],n=JSON.parse(t);v("1_req_client.json",t),v("2_req_source.json",JSON.stringify({timestamp:new Date().toISOString(),headers:{},body:n.body||n},null,2));let r=await fetch("/api/translator/translate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({step:2,body:n})}),a=await r.json();if(!a.success)return void(0,d.s)(a.error);let s=JSON.stringify(a.result.body,null,2);b(3,s),y(3)}catch(e){(0,d.s)(e.message)}h("toOpenAI",!1)},S=async()=>{h("toTarget",!0);try{let t=e[3],n=JSON.parse(t);v("3_req_openai.json",t);let r=await fetch("/api/translator/translate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({step:3,body:{...n,provider:x?.provider,model:x?.model}})}),a=await r.json();if(!a.success)return void(0,d.s)(a.error);let s={...a.result,provider:x?.provider,model:x?.model};b(4,JSON.stringify(s,null,2)),y(4)}catch(e){(0,d.s)(e.message)}h("toTarget",!1)},w=async()=>{h("send",!0);try{let t=e[4],n=JSON.parse(t);v("4_req_target.json",t);let r=n.provider||x?.provider,a=n.model||x?.model;if(!r||!a)return void(0,d.s)("Missing provider or model. Please run step 1 first to detect them.");let s=await fetch("/api/translator/send",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:r,model:a,body:n.body||n})});if(!s.ok){let e=await s.json().catch(()=>({error:s.statusText}));(0,d.s)(e.error||"Send failed");return}let o=s.body.getReader(),l=new TextDecoder,i="";for(;;){let{done:e,value:t}=await o.read();if(e)break;i+=l.decode(t,{stream:!0})}b(5,i),y(5),await fetch("/api/translator/save",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file:"5_res_provider.txt",content:i})})}catch(e){(0,d.s)(e.message)}finally{h("send",!1)}},{copy:N}=(0,o.C)(),P=async t=>{e[t]&&N(e[t],`translator-step-${t}`)};return(0,r.jsxs)("div",{className:"p-8 space-y-3",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h1",{className:"text-2xl font-bold text-text-main",children:"Translator Debug"}),(0,r.jsx)("p",{className:"text-sm text-text-muted mt-1",children:"Replay request flow — matches log files"})]}),x&&(0,r.jsxs)("div",{className:"flex items-center gap-2 flex-wrap justify-end",children:[(0,r.jsx)(m,{label:"src",value:x.sourceFormat,color:"blue"}),(0,r.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,r.jsx)(m,{label:"dst",value:x.targetFormat,color:"orange"}),(0,r.jsx)(m,{label:"provider",value:x.provider,color:"green"}),(0,r.jsx)(m,{label:"model",value:x.model,color:"purple"})]})]}),u.map(t=>{var a;let o=1===(a=t.id)?(0,r.jsx)(s.$n,{size:"sm",icon:"arrow_forward",loading:i.toOpenAI,onClick:O,children:"→ OpenAI"}):3===a?(0,r.jsx)(s.$n,{size:"sm",icon:"arrow_forward",loading:i.toTarget,onClick:S,children:"→ Target"}):4===a?(0,r.jsx)(s.$n,{size:"sm",icon:"send",loading:i.send,onClick:w,children:"Send"}):null,d=!!n[t.id],u=e[t.id]||"";return(0,r.jsx)(s.Zp,{children:(0,r.jsxs)("div",{className:"p-4 space-y-3",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("button",{onClick:()=>{let e;return e=t.id,l(t=>({...t,[e]:!t[e]}))},className:"flex items-center gap-2 flex-1 text-left group",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px] text-text-muted group-hover:text-primary transition-colors",children:d?"expand_more":"chevron_right"}),(0,r.jsx)("span",{className:"text-xs font-mono text-text-muted/60 w-4",children:t.id}),(0,r.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:t.label}),(0,r.jsx)("span",{className:"text-xs text-text-muted/60 font-mono",children:t.file}),u&&(0,r.jsxs)("span",{className:"text-xs text-green-500",children:["(",u.length," chars)"]})]}),!d&&(0,r.jsxs)("div",{className:"flex gap-1 shrink-0",children:[(0,r.jsx)(s.$n,{size:"sm",variant:"ghost",icon:"folder_open",loading:i[`load-${t.id}`],onClick:()=>j(t.id)}),o]})]}),d&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"border border-border rounded-lg overflow-hidden",children:(0,r.jsx)(c,{height:"400px",defaultLanguage:"text"===t.lang?"plaintext":"json",value:u,onChange:e=>{b(t.id,e||""),1===t.id&&_(e||"")},theme:"vs-dark",options:p})}),(0,r.jsxs)("div",{className:"flex gap-2 flex-wrap",children:[(0,r.jsx)(s.$n,{size:"sm",variant:"outline",icon:"folder_open",loading:i[`load-${t.id}`],onClick:()=>j(t.id),children:"Load"}),(0,r.jsx)(s.$n,{size:"sm",variant:"outline",icon:"data_object",onClick:()=>(t=>{try{let n=JSON.parse(e[t]);b(t,JSON.stringify(n,null,2))}catch{}})(t.id),children:"Format"}),(0,r.jsx)(s.$n,{size:"sm",variant:"outline",icon:"content_copy",onClick:()=>P(t.id),children:"Copy"}),o]})]})]})},t.id)})]})}function m({label:e,value:t,color:n}){return(0,r.jsxs)("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs font-mono ${{blue:"bg-blue-500/10 text-blue-500",orange:"bg-orange-500/10 text-orange-500",green:"bg-green-500/10 text-green-500",purple:"bg-purple-500/10 text-purple-500"}[n]}`,children:[(0,r.jsxs)("span",{className:"text-text-muted/70 font-sans text-[10px]",children:[e,":"]}),t]})}},75707:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return a}});let r=n(73623)._(n(68635));function a(e,t){let n={};"function"==typeof e&&(n.loader=e);let a={...n,...t};return(0,r.default)({...a,modules:a.loadableGenerated?.modules})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}},e=>{e.O(0,[2574,3862,782,8500,2280,1321,7592,5497,8441,3794,7358],()=>e(e.s=51473)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3528],{5214:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorage",{enumerable:!0,get:function(){return r.workAsyncStorageInstance}});let r=n(17828)},17828:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorageInstance",{enumerable:!0,get:function(){return r}});let r=(0,n(64054).createAsyncLocalStorage)()},21957:(e,t,n)=>{"use strict";function r({moduleIds:e}){return null}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadChunks",{enumerable:!0,get:function(){return r}}),n(95155),n(47650),n(5214),n(2451),n(53887)},41112:(e,t,n)=>{"use strict";function r({reason:e,children:t}){return t}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSR",{enumerable:!0,get:function(){return r}}),n(1980)},51473:(e,t,n)=>{Promise.resolve().then(n.bind(n,69472))},64054:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={bindSnapshot:function(){return i},createAsyncLocalStorage:function(){return l},createSnapshot:function(){return d}};for(var r in n)Object.defineProperty(t,r,{enumerable:!0,get:n[r]});let a=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class s{disable(){throw a}getStore(){}run(){throw a}exit(){throw a}enterWith(){throw a}static bind(e){return e}}let o="u">typeof globalThis&&globalThis.AsyncLocalStorage;function l(){return o?new o:new s}function i(e){return o?o.bind(e):s.bind(e)}function d(){return o?o.snapshot():function(e,...t){return e(...t)}}},68635:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i}});let r=n(95155),a=n(12115),s=n(41112);function o(e){return{default:e&&"default"in e?e.default:e}}n(21957);let l={loader:()=>Promise.resolve(o(()=>null)),loading:null,ssr:!0},i=function(e){let t={...l,...e},n=(0,a.lazy)(()=>t.loader().then(o)),i=t.loading;function d(e){let o=i?(0,r.jsx)(i,{isLoading:!0,pastDelay:!0,error:null}):null,l=!t.ssr||!!t.loading,d=l?a.Suspense:a.Fragment,c=t.ssr?(0,r.jsxs)(r.Fragment,{children:[null,(0,r.jsx)(n,{...e})]}):(0,r.jsx)(s.BailoutToCSR,{reason:"next/dynamic",children:(0,r.jsx)(n,{...e})});return(0,r.jsx)(d,{...l?{fallback:o}:{},children:c})}return d.displayName="LoadableComponent",d}},69472:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>f});var r=n(95155),a=n(12115),s=n(35497),o=n(11059),l=n(75707),i=n.n(l),d=n(78559);let c=i()(()=>n.e(8202).then(n.bind(n,28202)),{loadableGenerated:{webpack:()=>[28202]},ssr:!1}),u=[{id:1,label:"Client Request",file:"1_req_client.json",lang:"json",desc:"Raw request from client"},{id:2,label:"Source Body",file:"2_req_source.json",lang:"json",desc:"After initial conversion"},{id:3,label:"OpenAI Intermediate",file:"3_req_openai.json",lang:"json",desc:"source → openai"},{id:4,label:"Target Request",file:"4_req_target.json",lang:"json",desc:"openai → target + URL + headers"},{id:5,label:"Provider Response",file:"5_res_provider.txt",lang:"text",desc:"Raw SSE from provider"},{id:6,label:"OpenAI Response",file:"6_res_openai.txt",lang:"text",desc:"target → openai (response)"},{id:7,label:"Client Response",file:"7_res_client.txt",lang:"text",desc:"Final response to client"}],p={minimap:{enabled:!1},fontSize:12,lineNumbers:"on",scrollBeyondLastLine:!1,wordWrap:"on",automaticLayout:!0};function f(){let[e,t]=(0,a.useState)({}),[n,l]=(0,a.useState)({1:!0}),[i,f]=(0,a.useState)({}),[x,g]=(0,a.useState)(null),h=(e,t)=>f(n=>({...n,[e]:t})),b=(e,n)=>t(t=>({...t,[e]:n})),y=e=>l(t=>{let n={};return u.forEach(e=>{n[e.id]=!1}),n[e]=!0,n}),j=async e=>{let t=u.find(t=>t.id===e);h(`load-${e}`,!0);try{let n=await fetch(`/api/translator/load?file=${t.file}`),r=await n.json();r.success?(b(e,r.content),1===e&&await _(r.content)):(0,d.s)(r.error||"File not found")}catch(e){(0,d.s)(e.message)}h(`load-${e}`,!1)},_=async e=>{try{let t="string"==typeof e?JSON.parse(e):e,n=await fetch("/api/translator/translate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({step:1,body:t})}),r=await n.json();r.success&&g(r.result)}catch{}},v=(e,t)=>fetch("/api/translator/save",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file:e,content:t})}).catch(()=>{}),O=async()=>{h("toOpenAI",!0);try{let t=e[1],n=JSON.parse(t);v("1_req_client.json",t),v("2_req_source.json",JSON.stringify({timestamp:new Date().toISOString(),headers:{},body:n.body||n},null,2));let r=await fetch("/api/translator/translate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({step:2,body:n})}),a=await r.json();if(!a.success)return void(0,d.s)(a.error);let s=JSON.stringify(a.result.body,null,2);b(3,s),y(3)}catch(e){(0,d.s)(e.message)}h("toOpenAI",!1)},S=async()=>{h("toTarget",!0);try{let t=e[3],n=JSON.parse(t);v("3_req_openai.json",t);let r=await fetch("/api/translator/translate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({step:3,body:{...n,provider:x?.provider,model:x?.model}})}),a=await r.json();if(!a.success)return void(0,d.s)(a.error);let s={...a.result,provider:x?.provider,model:x?.model};b(4,JSON.stringify(s,null,2)),y(4)}catch(e){(0,d.s)(e.message)}h("toTarget",!1)},w=async()=>{h("send",!0);try{let t=e[4],n=JSON.parse(t);v("4_req_target.json",t);let r=n.provider||x?.provider,a=n.model||x?.model;if(!r||!a)return void(0,d.s)("Missing provider or model. Please run step 1 first to detect them.");let s=await fetch("/api/translator/send",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:r,model:a,body:n.body||n})});if(!s.ok){let e=await s.json().catch(()=>({error:s.statusText}));(0,d.s)(e.error||"Send failed");return}let o=s.body.getReader(),l=new TextDecoder,i="";for(;;){let{done:e,value:t}=await o.read();if(e)break;i+=l.decode(t,{stream:!0})}b(5,i),y(5),await fetch("/api/translator/save",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file:"5_res_provider.txt",content:i})})}catch(e){(0,d.s)(e.message)}finally{h("send",!1)}},{copy:N}=(0,o.C)(),P=async t=>{e[t]&&N(e[t],`translator-step-${t}`)};return(0,r.jsxs)("div",{className:"p-8 space-y-3",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h1",{className:"text-2xl font-bold text-text-main",children:"Translator Debug"}),(0,r.jsx)("p",{className:"text-sm text-text-muted mt-1",children:"Replay request flow — matches log files"})]}),x&&(0,r.jsxs)("div",{className:"flex items-center gap-2 flex-wrap justify-end",children:[(0,r.jsx)(m,{label:"src",value:x.sourceFormat,color:"blue"}),(0,r.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,r.jsx)(m,{label:"dst",value:x.targetFormat,color:"orange"}),(0,r.jsx)(m,{label:"provider",value:x.provider,color:"green"}),(0,r.jsx)(m,{label:"model",value:x.model,color:"purple"})]})]}),u.map(t=>{var a;let o=1===(a=t.id)?(0,r.jsx)(s.$n,{size:"sm",icon:"arrow_forward",loading:i.toOpenAI,onClick:O,children:"→ OpenAI"}):3===a?(0,r.jsx)(s.$n,{size:"sm",icon:"arrow_forward",loading:i.toTarget,onClick:S,children:"→ Target"}):4===a?(0,r.jsx)(s.$n,{size:"sm",icon:"send",loading:i.send,onClick:w,children:"Send"}):null,d=!!n[t.id],u=e[t.id]||"";return(0,r.jsx)(s.Zp,{children:(0,r.jsxs)("div",{className:"p-4 space-y-3",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("button",{onClick:()=>{let e;return e=t.id,l(t=>({...t,[e]:!t[e]}))},className:"flex items-center gap-2 flex-1 text-left group",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px] text-text-muted group-hover:text-primary transition-colors",children:d?"expand_more":"chevron_right"}),(0,r.jsx)("span",{className:"text-xs font-mono text-text-muted/60 w-4",children:t.id}),(0,r.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:t.label}),(0,r.jsx)("span",{className:"text-xs text-text-muted/60 font-mono",children:t.file}),u&&(0,r.jsxs)("span",{className:"text-xs text-green-500",children:["(",u.length," chars)"]})]}),!d&&(0,r.jsxs)("div",{className:"flex gap-1 shrink-0",children:[(0,r.jsx)(s.$n,{size:"sm",variant:"ghost",icon:"folder_open",loading:i[`load-${t.id}`],onClick:()=>j(t.id)}),o]})]}),d&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"border border-border rounded-lg overflow-hidden",children:(0,r.jsx)(c,{height:"400px",defaultLanguage:"text"===t.lang?"plaintext":"json",value:u,onChange:e=>{b(t.id,e||""),1===t.id&&_(e||"")},theme:"vs-dark",options:p})}),(0,r.jsxs)("div",{className:"flex gap-2 flex-wrap",children:[(0,r.jsx)(s.$n,{size:"sm",variant:"outline",icon:"folder_open",loading:i[`load-${t.id}`],onClick:()=>j(t.id),children:"Load"}),(0,r.jsx)(s.$n,{size:"sm",variant:"outline",icon:"data_object",onClick:()=>(t=>{try{let n=JSON.parse(e[t]);b(t,JSON.stringify(n,null,2))}catch{}})(t.id),children:"Format"}),(0,r.jsx)(s.$n,{size:"sm",variant:"outline",icon:"content_copy",onClick:()=>P(t.id),children:"Copy"}),o]})]})]})},t.id)})]})}function m({label:e,value:t,color:n}){return(0,r.jsxs)("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs font-mono ${{blue:"bg-blue-500/10 text-blue-500",orange:"bg-orange-500/10 text-orange-500",green:"bg-green-500/10 text-green-500",purple:"bg-purple-500/10 text-purple-500"}[n]}`,children:[(0,r.jsxs)("span",{className:"text-text-muted/70 font-sans text-[10px]",children:[e,":"]}),t]})}},75707:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return a}});let r=n(73623)._(n(68635));function a(e,t){let n={};"function"==typeof e&&(n.loader=e);let a={...n,...t};return(0,r.default)({...a,modules:a.loadableGenerated?.modules})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}},e=>{e.O(0,[2574,3862,782,8500,594,1321,7592,5497,8441,3794,7358],()=>e(e.s=51473)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2825],{81772:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>y});var a=s(95155),n=s(12115),l=s(73321),r=s(35497),i=s(84588),o=s(92542),d=s(31474);function c({isOpen:e,onClose:t,title:s,children:l,width:r="md",className:i}){let o={sm:"w-[400px]",md:"w-[500px]",lg:"w-[600px]",xl:"w-[800px]",full:"w-full"};return((0,n.useEffect)(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),(0,n.useEffect)(()=>{let s=s=>{"Escape"===s.key&&e&&t()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[e,t]),e)?(0,a.jsxs)("div",{className:"fixed inset-0 z-50",children:[(0,a.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-[2px] fade-in cursor-pointer",onClick:t,"aria-hidden":"true"}),(0,a.jsxs)("div",{className:(0,d.cn)("absolute right-0 top-0 h-full bg-surface flex flex-col","shadow-[var(--shadow-elev)]","slide-in-right","border-l border-border-subtle",o[r]||o.md,i),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between p-6 border-b border-border-subtle flex-shrink-0",children:[(0,a.jsx)("div",{className:"flex items-center gap-3",children:s&&(0,a.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:s})}),(0,a.jsx)("button",{type:"button",onClick:t,className:"p-1.5 rounded-[10px] text-text-muted hover:bg-surface-2 hover:text-text-main transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,a.jsx)("div",{className:"flex-1 overflow-y-auto p-6 custom-scrollbar",children:l})]})]}):null}function x({currentPage:e,pageSize:t,totalItems:s,onPageChange:n,onPageSizeChange:l,className:r}){let i=Math.ceil(s/t),c=s>0?(e-1)*t+1:0,m=Math.min(e*t,s),h=(()=>{let t=[],s=Math.max(1,e-2),a=Math.min(i,s+5-1);a-s+1<5&&(s=Math.max(1,a-5+1));for(let e=s;e<=a;e++)t.push(e);return t})();return(0,a.jsxs)("div",{className:(0,d.cn)("flex flex-col sm:flex-row items-center justify-between gap-4 py-4 px-2",r),children:[s>0&&(0,a.jsxs)("div",{className:"text-sm text-text-muted",children:["Showing ",(0,a.jsx)("span",{className:"font-medium text-text-main",children:c})," to"," ",(0,a.jsx)("span",{className:"font-medium text-text-main",children:m})," of"," ",(0,a.jsx)("span",{className:"font-medium text-text-main",children:s})," results"]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-2 sm:gap-4",children:[l&&(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-sm text-text-muted",children:"Rows:"}),(0,a.jsx)("select",{value:t,onChange:e=>l(Number(e.target.value)),className:(0,d.cn)("h-9 rounded-lg border border-black/10 dark:border-white/10 bg-surface","text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20","cursor-pointer"),style:{colorScheme:"auto"},children:[10,20,50].map(e=>(0,a.jsx)("option",{value:e,children:e},e))})]}),i>1&&(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(o.default,{variant:"outline",size:"sm",onClick:()=>n(e-1),disabled:1===e,className:"w-9 px-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"chevron_left"})}),h[0]>1&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.default,{variant:"ghost",size:"sm",onClick:()=>n(1),className:"w-9 px-0 hidden sm:inline-flex",children:"1"}),h[0]>2&&(0,a.jsx)("span",{className:"text-text-muted px-1 hidden sm:inline",children:"..."})]}),h.map(t=>(0,a.jsx)(o.default,{variant:e===t?"primary":"ghost",size:"sm",onClick:()=>n(t),className:(0,d.cn)("w-9 px-0",e===t?"inline-flex":"hidden sm:inline-flex"),children:t},t)),h[h.length-1]<i&&(0,a.jsxs)(a.Fragment,{children:[h[h.length-1]<i-1&&(0,a.jsx)("span",{className:"text-text-muted px-1 hidden sm:inline",children:"..."}),(0,a.jsx)(o.default,{variant:"ghost",size:"sm",onClick:()=>n(i),className:"w-9 px-0 hidden sm:inline-flex",children:i})]}),(0,a.jsx)(o.default,{variant:"outline",size:"sm",onClick:()=>n(e+1),disabled:e===i,className:"w-9 px-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"chevron_right"})})]})]})]})}var m=s(88105),h=s(78559);let p=null,u=null;async function f(){if(p&&u)return{providerNameCache:p,providerNodesCache:u};let e=await fetch("/api/provider-nodes"),t=(await e.json()).nodes||[];for(let e of(u={},t))u[e.id]=e.name;return{providerNameCache:p={...m.Q2,...u},providerNodesCache:u}}function b(e,t){if(!e||!t)return e;let s=t[e];if("string"==typeof s)return s;if(s?.name)return s.name;let a=(0,m.zt)(e)||m.Q2[e];return a?.name||e}function j({title:e,children:t,defaultOpen:s=!1,icon:l=null}){let[r,i]=(0,n.useState)(s);return(0,a.jsxs)("div",{className:"border border-black/5 dark:border-white/5 rounded-lg overflow-hidden",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>i(!r),className:"w-full flex items-center justify-between p-3 bg-black/[0.02] dark:bg-white/[0.02] hover:bg-black/[0.04] dark:hover:bg-white/[0.04] transition-colors",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[l&&(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:l}),(0,a.jsx)("span",{className:"font-semibold text-sm text-text-main",children:e})]}),(0,a.jsx)("span",{className:(0,d.cn)("material-symbols-outlined text-[20px] text-text-muted transition-transform duration-200",r?"rotate-90":""),children:"chevron_right"})]}),r&&(0,a.jsx)("div",{className:"p-4 border-t border-black/5 dark:border-white/5",children:t})]})}function g(e){return e?.cached_tokens||e?.cache_read_input_tokens||0}function v(e){return e?.cache_creation_input_tokens||0}function N(e){let t=e?.prompt_tokens||e?.input_tokens||0,s=g(e);return t<s?s:t}function w(){let[e,t]=(0,n.useState)([]),[s,l]=(0,n.useState)({page:1,pageSize:20,totalItems:0,totalPages:0}),[r,m]=(0,n.useState)(!1),[p,u]=(0,n.useState)(null),[w,k]=(0,n.useState)(!1),[y,S]=(0,n.useState)([]),[C,D]=(0,n.useState)(null),[_,z]=(0,n.useState)({provider:"",startDate:"",endDate:""}),T=(0,n.useCallback)(async()=>{try{let e=await fetch("/api/usage/providers"),t=await e.json();S(t.providers||[]);let s=await f();D(s.providerNameCache)}catch(e){(0,h.s)("Failed to fetch providers:",e)}},[]),L=(0,n.useCallback)(async()=>{m(!0);try{let e=new URLSearchParams({page:s.page.toString(),pageSize:s.pageSize.toString()});_.provider&&e.append("provider",_.provider),_.startDate&&e.append("startDate",_.startDate),_.endDate&&e.append("endDate",_.endDate);let a=await fetch(`/api/usage/request-details?${e}`),n=await a.json();t(n.details||[]),l(e=>({...e,...n.pagination}))}catch(e){(0,h.s)("Failed to fetch request details:",e)}finally{m(!1)}},[s.page,s.pageSize,_]);return(0,n.useEffect)(()=>{T()},[T]),(0,n.useEffect)(()=>{L()},[L]),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6",children:[(0,a.jsx)(i.default,{padding:"md",children:(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,a.jsx)("label",{htmlFor:"provider-filter",className:"text-sm font-medium text-text-main",children:"Provider"}),(0,a.jsxs)("select",{id:"provider-filter",value:_.provider,onChange:e=>z({..._,provider:e.target.value}),className:(0,d.cn)("h-9 px-3 rounded-lg border border-black/10 dark:border-white/10 bg-surface","text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20","w-full min-w-0 cursor-pointer"),style:{colorScheme:"auto"},children:[(0,a.jsx)("option",{value:"",children:"All Providers"}),y.map(e=>(0,a.jsx)("option",{value:e.id,children:e.name},e.id))]})]}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,a.jsx)("label",{htmlFor:"start-date-filter",className:"text-sm font-medium text-text-main",children:"Start Date"}),(0,a.jsx)("input",{id:"start-date-filter",type:"datetime-local",value:_.startDate,onChange:e=>z({..._,startDate:e.target.value}),className:(0,d.cn)("h-9 px-3 rounded-lg border border-black/10 dark:border-white/10 bg-surface","w-full min-w-0 text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20")})]}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,a.jsx)("label",{htmlFor:"end-date-filter",className:"text-sm font-medium text-text-main",children:"End Date"}),(0,a.jsx)("input",{id:"end-date-filter",type:"datetime-local",value:_.endDate,onChange:e=>z({..._,endDate:e.target.value}),className:(0,d.cn)("h-9 px-3 rounded-lg border border-black/10 dark:border-white/10 bg-surface","w-full min-w-0 text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20")})]}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2 sm:col-span-2 lg:col-span-1",children:[(0,a.jsx)("span",{className:"hidden text-sm font-medium text-text-main opacity-0 lg:block","aria-hidden":"true",children:"Clear"}),(0,a.jsx)(o.default,{variant:"ghost",onClick:()=>{z({provider:"",startDate:"",endDate:""})},disabled:!_.provider&&!_.startDate&&!_.endDate,className:"w-full",children:"Clear Filters"})]})]})}),(0,a.jsxs)(i.default,{padding:"none",children:[(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full min-w-[880px]",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"border-b border-black/5 dark:border-white/5",children:[(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Timestamp"}),(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Model"}),(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Provider"}),(0,a.jsx)("th",{className:"text-right p-4 text-sm font-semibold text-text-main",children:"Input Tokens"}),(0,a.jsx)("th",{className:"text-right p-4 text-sm font-semibold text-text-main",children:"Cached"}),(0,a.jsx)("th",{className:"text-right p-4 text-sm font-semibold text-text-main",children:"Cache Creation"}),(0,a.jsx)("th",{className:"text-right p-4 text-sm font-semibold text-text-main",children:"Output Tokens"}),(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Latency"}),(0,a.jsx)("th",{className:"text-center p-4 text-sm font-semibold text-text-main",children:"Action"})]})}),(0,a.jsx)("tbody",{children:r?(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:"7",className:"p-8 text-center text-text-muted",children:(0,a.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-[20px]",children:"progress_activity"}),"Loading..."]})})}):0===e.length?(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:"7",className:"p-8 text-center text-text-muted",children:"No request details found"})}):e.map((e,t)=>(0,a.jsxs)("tr",{className:"border-b border-black/5 dark:border-white/5 last:border-b-0 hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors",children:[(0,a.jsx)("td",{className:"whitespace-nowrap p-4 text-sm text-text-main",children:new Date(e.timestamp).toLocaleString()}),(0,a.jsx)("td",{className:"max-w-[260px] truncate p-4 font-mono text-sm text-text-main",children:e.model}),(0,a.jsx)("td",{className:"max-w-[180px] truncate p-4 text-sm text-text-main",children:(0,a.jsx)("span",{className:"font-medium",children:b(e.provider,C)})}),(0,a.jsx)("td",{className:"p-4 text-sm text-text-main text-right font-mono",children:N(e.tokens).toLocaleString()}),(0,a.jsx)("td",{className:"p-4 text-sm text-text-main text-right font-mono",children:g(e.tokens)>0?g(e.tokens).toLocaleString():"—"}),(0,a.jsx)("td",{className:"p-4 text-sm text-text-main text-right font-mono",children:v(e.tokens)>0?v(e.tokens).toLocaleString():"—"}),(0,a.jsx)("td",{className:"p-4 text-sm text-text-main text-right font-mono",children:e.tokens?.completion_tokens?.toLocaleString()||0}),(0,a.jsx)("td",{className:"p-4 text-sm text-text-muted",children:(0,a.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,a.jsxs)("div",{children:["TTFT: ",(0,a.jsxs)("span",{className:"font-mono",children:[e.latency?.ttft||0,"ms"]})]}),(0,a.jsxs)("div",{children:["Total: ",(0,a.jsxs)("span",{className:"font-mono",children:[e.latency?.total||0,"ms"]})]})]})}),(0,a.jsx)("td",{className:"p-4 text-center",children:(0,a.jsx)(o.default,{variant:"outline",size:"sm",onClick:()=>{u(e),k(!0)},children:"Detail"})})]},`${e.id}-${t}`))})]})}),!r&&e.length>0&&(0,a.jsx)("div",{className:"border-t border-black/5 dark:border-white/5",children:(0,a.jsx)(x,{currentPage:s.page,pageSize:s.pageSize,totalItems:s.totalItems,onPageChange:e=>{l(t=>({...t,page:e}))},onPageSizeChange:e=>{l(t=>({...t,pageSize:e,page:1}))}})})]}),(0,a.jsx)(c,{isOpen:w,onClose:()=>k(!1),title:"Request Details",width:"lg",children:p&&(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"grid min-w-0 grid-cols-1 gap-4 text-sm sm:grid-cols-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"ID:"})," ",(0,a.jsx)("span",{className:"break-all font-mono text-text-main",children:p.id})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Timestamp:"})," ",(0,a.jsx)("span",{className:"text-text-main",children:new Date(p.timestamp).toLocaleString()})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Provider:"})," ",(0,a.jsx)("span",{className:"text-text-main font-medium",children:b(p.provider,C)})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Model:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:p.model})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Status:"})," ",(0,a.jsx)("span",{className:(0,d.cn)("font-medium","success"===p.status?"text-green-600":"text-red-600"),children:p.status})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Latency:"})," ",(0,a.jsxs)("span",{className:"text-text-main font-mono",children:["TTFT ",p.latency?.ttft||0,"ms / Total ",p.latency?.total||0,"ms"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Input Tokens:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:N(p.tokens).toLocaleString()})]}),g(p.tokens)>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Cached Tokens:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:g(p.tokens).toLocaleString()})]}),v(p.tokens)>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Cache Creation:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:v(p.tokens).toLocaleString()})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Output Tokens:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:p.tokens?.completion_tokens?.toLocaleString()||0})]})]}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)(j,{title:"1. Client Request (Input)",defaultOpen:!0,icon:"input",children:(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:JSON.stringify(p.request,null,2)})}),p.providerRequest&&(0,a.jsx)(j,{title:"2. Provider Request (Translated)",icon:"translate",children:(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:JSON.stringify(p.providerRequest,null,2)})}),p.providerResponse&&(0,a.jsx)(j,{title:"3. Provider Response (Raw)",icon:"data_object",children:(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:"object"==typeof p.providerResponse?JSON.stringify(p.providerResponse,null,2):p.providerResponse})}),(0,a.jsxs)(j,{title:"4. Client Response (Final)",defaultOpen:!0,icon:"output",children:[p.response?.thinking&&(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsxs)("h4",{className:"font-semibold text-text-main mb-2 flex items-center gap-2 text-xs uppercase tracking-wide opacity-70",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"psychology"}),"Thinking Process"]}),(0,a.jsx)("pre",{className:"max-h-[200px] max-w-full overflow-auto rounded-lg border border-amber-200 bg-amber-50 p-3 font-mono text-xs text-amber-900 dark:border-amber-800 dark:bg-amber-950/30 dark:text-amber-100 sm:p-4",children:p.response.thinking})]}),(0,a.jsx)("h4",{className:"font-semibold text-text-main mb-2 text-xs uppercase tracking-wide opacity-70",children:"Content"}),(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:p.response?.content||"[No content]"})]})]})]})})]})}let k=[{value:"today",label:"Today"},{value:"24h",label:"24h"},{value:"7d",label:"7D"},{value:"30d",label:"30D"},{value:"60d",label:"60D"}];function y(){return(0,a.jsx)(n.Suspense,{fallback:(0,a.jsx)(r.Qv,{}),children:(0,a.jsx)(S,{})})}function S(){let e=(0,l.useSearchParams)(),t=(0,l.useRouter)(),[s,i]=(0,n.useState)("today"),o=e.get("tab"),d=o&&["overview","logs","details"].includes(o)?o:"overview";return(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:px-0",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)(r.Iz,{options:[{value:"overview",label:"Overview"},{value:"details",label:"Details"}],value:d,onChange:s=>{if(s===d)return;let a=new URLSearchParams(e);a.set("tab",s),t.push(`/dashboard/usage?${a.toString()}`,{scroll:!1})},className:"w-full sm:w-auto"}),"overview"===d&&(0,a.jsx)(r.Iz,{options:k,value:s,onChange:i,size:"sm",className:"w-full sm:w-auto"})]}),"overview"===d&&(0,a.jsx)(n.Suspense,{fallback:(0,a.jsx)(r.Qv,{}),children:(0,a.jsx)(r.jK,{period:s,setPeriod:i,hidePeriodSelector:!0})}),"logs"===d&&(0,a.jsx)(r.gM,{}),"details"===d&&(0,a.jsx)(w,{})]})}},87618:(e,t,s)=>{Promise.resolve().then(s.bind(s,81772))}},e=>{e.O(0,[2574,3862,782,8500,2280,1321,7592,5497,8441,3794,7358],()=>e(e.s=87618)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2825],{81772:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>y});var a=s(95155),n=s(12115),l=s(73321),r=s(35497),i=s(84588),o=s(92542),d=s(31474);function c({isOpen:e,onClose:t,title:s,children:l,width:r="md",className:i}){let o={sm:"w-[400px]",md:"w-[500px]",lg:"w-[600px]",xl:"w-[800px]",full:"w-full"};return((0,n.useEffect)(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),(0,n.useEffect)(()=>{let s=s=>{"Escape"===s.key&&e&&t()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[e,t]),e)?(0,a.jsxs)("div",{className:"fixed inset-0 z-50",children:[(0,a.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-[2px] fade-in cursor-pointer",onClick:t,"aria-hidden":"true"}),(0,a.jsxs)("div",{className:(0,d.cn)("absolute right-0 top-0 h-full bg-surface flex flex-col","shadow-[var(--shadow-elev)]","slide-in-right","border-l border-border-subtle",o[r]||o.md,i),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between p-6 border-b border-border-subtle flex-shrink-0",children:[(0,a.jsx)("div",{className:"flex items-center gap-3",children:s&&(0,a.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:s})}),(0,a.jsx)("button",{type:"button",onClick:t,className:"p-1.5 rounded-[10px] text-text-muted hover:bg-surface-2 hover:text-text-main transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,a.jsx)("div",{className:"flex-1 overflow-y-auto p-6 custom-scrollbar",children:l})]})]}):null}function x({currentPage:e,pageSize:t,totalItems:s,onPageChange:n,onPageSizeChange:l,className:r}){let i=Math.ceil(s/t),c=s>0?(e-1)*t+1:0,m=Math.min(e*t,s),h=(()=>{let t=[],s=Math.max(1,e-2),a=Math.min(i,s+5-1);a-s+1<5&&(s=Math.max(1,a-5+1));for(let e=s;e<=a;e++)t.push(e);return t})();return(0,a.jsxs)("div",{className:(0,d.cn)("flex flex-col sm:flex-row items-center justify-between gap-4 py-4 px-2",r),children:[s>0&&(0,a.jsxs)("div",{className:"text-sm text-text-muted",children:["Showing ",(0,a.jsx)("span",{className:"font-medium text-text-main",children:c})," to"," ",(0,a.jsx)("span",{className:"font-medium text-text-main",children:m})," of"," ",(0,a.jsx)("span",{className:"font-medium text-text-main",children:s})," results"]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-2 sm:gap-4",children:[l&&(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-sm text-text-muted",children:"Rows:"}),(0,a.jsx)("select",{value:t,onChange:e=>l(Number(e.target.value)),className:(0,d.cn)("h-9 rounded-lg border border-black/10 dark:border-white/10 bg-surface","text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20","cursor-pointer"),style:{colorScheme:"auto"},children:[10,20,50].map(e=>(0,a.jsx)("option",{value:e,children:e},e))})]}),i>1&&(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(o.default,{variant:"outline",size:"sm",onClick:()=>n(e-1),disabled:1===e,className:"w-9 px-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"chevron_left"})}),h[0]>1&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.default,{variant:"ghost",size:"sm",onClick:()=>n(1),className:"w-9 px-0 hidden sm:inline-flex",children:"1"}),h[0]>2&&(0,a.jsx)("span",{className:"text-text-muted px-1 hidden sm:inline",children:"..."})]}),h.map(t=>(0,a.jsx)(o.default,{variant:e===t?"primary":"ghost",size:"sm",onClick:()=>n(t),className:(0,d.cn)("w-9 px-0",e===t?"inline-flex":"hidden sm:inline-flex"),children:t},t)),h[h.length-1]<i&&(0,a.jsxs)(a.Fragment,{children:[h[h.length-1]<i-1&&(0,a.jsx)("span",{className:"text-text-muted px-1 hidden sm:inline",children:"..."}),(0,a.jsx)(o.default,{variant:"ghost",size:"sm",onClick:()=>n(i),className:"w-9 px-0 hidden sm:inline-flex",children:i})]}),(0,a.jsx)(o.default,{variant:"outline",size:"sm",onClick:()=>n(e+1),disabled:e===i,className:"w-9 px-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"chevron_right"})})]})]})]})}var m=s(88105),h=s(78559);let p=null,u=null;async function f(){if(p&&u)return{providerNameCache:p,providerNodesCache:u};let e=await fetch("/api/provider-nodes"),t=(await e.json()).nodes||[];for(let e of(u={},t))u[e.id]=e.name;return{providerNameCache:p={...m.Q2,...u},providerNodesCache:u}}function b(e,t){if(!e||!t)return e;let s=t[e];if("string"==typeof s)return s;if(s?.name)return s.name;let a=(0,m.zt)(e)||m.Q2[e];return a?.name||e}function j({title:e,children:t,defaultOpen:s=!1,icon:l=null}){let[r,i]=(0,n.useState)(s);return(0,a.jsxs)("div",{className:"border border-black/5 dark:border-white/5 rounded-lg overflow-hidden",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>i(!r),className:"w-full flex items-center justify-between p-3 bg-black/[0.02] dark:bg-white/[0.02] hover:bg-black/[0.04] dark:hover:bg-white/[0.04] transition-colors",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[l&&(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:l}),(0,a.jsx)("span",{className:"font-semibold text-sm text-text-main",children:e})]}),(0,a.jsx)("span",{className:(0,d.cn)("material-symbols-outlined text-[20px] text-text-muted transition-transform duration-200",r?"rotate-90":""),children:"chevron_right"})]}),r&&(0,a.jsx)("div",{className:"p-4 border-t border-black/5 dark:border-white/5",children:t})]})}function g(e){return e?.cached_tokens||e?.cache_read_input_tokens||0}function v(e){return e?.cache_creation_input_tokens||0}function N(e){let t=e?.prompt_tokens||e?.input_tokens||0,s=g(e);return t<s?s:t}function w(){let[e,t]=(0,n.useState)([]),[s,l]=(0,n.useState)({page:1,pageSize:20,totalItems:0,totalPages:0}),[r,m]=(0,n.useState)(!1),[p,u]=(0,n.useState)(null),[w,k]=(0,n.useState)(!1),[y,S]=(0,n.useState)([]),[C,D]=(0,n.useState)(null),[_,z]=(0,n.useState)({provider:"",startDate:"",endDate:""}),T=(0,n.useCallback)(async()=>{try{let e=await fetch("/api/usage/providers"),t=await e.json();S(t.providers||[]);let s=await f();D(s.providerNameCache)}catch(e){(0,h.s)("Failed to fetch providers:",e)}},[]),L=(0,n.useCallback)(async()=>{m(!0);try{let e=new URLSearchParams({page:s.page.toString(),pageSize:s.pageSize.toString()});_.provider&&e.append("provider",_.provider),_.startDate&&e.append("startDate",_.startDate),_.endDate&&e.append("endDate",_.endDate);let a=await fetch(`/api/usage/request-details?${e}`),n=await a.json();t(n.details||[]),l(e=>({...e,...n.pagination}))}catch(e){(0,h.s)("Failed to fetch request details:",e)}finally{m(!1)}},[s.page,s.pageSize,_]);return(0,n.useEffect)(()=>{T()},[T]),(0,n.useEffect)(()=>{L()},[L]),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6",children:[(0,a.jsx)(i.default,{padding:"md",children:(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,a.jsx)("label",{htmlFor:"provider-filter",className:"text-sm font-medium text-text-main",children:"Provider"}),(0,a.jsxs)("select",{id:"provider-filter",value:_.provider,onChange:e=>z({..._,provider:e.target.value}),className:(0,d.cn)("h-9 px-3 rounded-lg border border-black/10 dark:border-white/10 bg-surface","text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20","w-full min-w-0 cursor-pointer"),style:{colorScheme:"auto"},children:[(0,a.jsx)("option",{value:"",children:"All Providers"}),y.map(e=>(0,a.jsx)("option",{value:e.id,children:e.name},e.id))]})]}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,a.jsx)("label",{htmlFor:"start-date-filter",className:"text-sm font-medium text-text-main",children:"Start Date"}),(0,a.jsx)("input",{id:"start-date-filter",type:"datetime-local",value:_.startDate,onChange:e=>z({..._,startDate:e.target.value}),className:(0,d.cn)("h-9 px-3 rounded-lg border border-black/10 dark:border-white/10 bg-surface","w-full min-w-0 text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20")})]}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,a.jsx)("label",{htmlFor:"end-date-filter",className:"text-sm font-medium text-text-main",children:"End Date"}),(0,a.jsx)("input",{id:"end-date-filter",type:"datetime-local",value:_.endDate,onChange:e=>z({..._,endDate:e.target.value}),className:(0,d.cn)("h-9 px-3 rounded-lg border border-black/10 dark:border-white/10 bg-surface","w-full min-w-0 text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20")})]}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2 sm:col-span-2 lg:col-span-1",children:[(0,a.jsx)("span",{className:"hidden text-sm font-medium text-text-main opacity-0 lg:block","aria-hidden":"true",children:"Clear"}),(0,a.jsx)(o.default,{variant:"ghost",onClick:()=>{z({provider:"",startDate:"",endDate:""})},disabled:!_.provider&&!_.startDate&&!_.endDate,className:"w-full",children:"Clear Filters"})]})]})}),(0,a.jsxs)(i.default,{padding:"none",children:[(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full min-w-[880px]",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"border-b border-black/5 dark:border-white/5",children:[(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Timestamp"}),(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Model"}),(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Provider"}),(0,a.jsx)("th",{className:"text-right p-4 text-sm font-semibold text-text-main",children:"Input Tokens"}),(0,a.jsx)("th",{className:"text-right p-4 text-sm font-semibold text-text-main",children:"Cached"}),(0,a.jsx)("th",{className:"text-right p-4 text-sm font-semibold text-text-main",children:"Cache Creation"}),(0,a.jsx)("th",{className:"text-right p-4 text-sm font-semibold text-text-main",children:"Output Tokens"}),(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Latency"}),(0,a.jsx)("th",{className:"text-center p-4 text-sm font-semibold text-text-main",children:"Action"})]})}),(0,a.jsx)("tbody",{children:r?(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:"7",className:"p-8 text-center text-text-muted",children:(0,a.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-[20px]",children:"progress_activity"}),"Loading..."]})})}):0===e.length?(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:"7",className:"p-8 text-center text-text-muted",children:"No request details found"})}):e.map((e,t)=>(0,a.jsxs)("tr",{className:"border-b border-black/5 dark:border-white/5 last:border-b-0 hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors",children:[(0,a.jsx)("td",{className:"whitespace-nowrap p-4 text-sm text-text-main",children:new Date(e.timestamp).toLocaleString()}),(0,a.jsx)("td",{className:"max-w-[260px] truncate p-4 font-mono text-sm text-text-main",children:e.model}),(0,a.jsx)("td",{className:"max-w-[180px] truncate p-4 text-sm text-text-main",children:(0,a.jsx)("span",{className:"font-medium",children:b(e.provider,C)})}),(0,a.jsx)("td",{className:"p-4 text-sm text-text-main text-right font-mono",children:N(e.tokens).toLocaleString()}),(0,a.jsx)("td",{className:"p-4 text-sm text-text-main text-right font-mono",children:g(e.tokens)>0?g(e.tokens).toLocaleString():"—"}),(0,a.jsx)("td",{className:"p-4 text-sm text-text-main text-right font-mono",children:v(e.tokens)>0?v(e.tokens).toLocaleString():"—"}),(0,a.jsx)("td",{className:"p-4 text-sm text-text-main text-right font-mono",children:e.tokens?.completion_tokens?.toLocaleString()||0}),(0,a.jsx)("td",{className:"p-4 text-sm text-text-muted",children:(0,a.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,a.jsxs)("div",{children:["TTFT: ",(0,a.jsxs)("span",{className:"font-mono",children:[e.latency?.ttft||0,"ms"]})]}),(0,a.jsxs)("div",{children:["Total: ",(0,a.jsxs)("span",{className:"font-mono",children:[e.latency?.total||0,"ms"]})]})]})}),(0,a.jsx)("td",{className:"p-4 text-center",children:(0,a.jsx)(o.default,{variant:"outline",size:"sm",onClick:()=>{u(e),k(!0)},children:"Detail"})})]},`${e.id}-${t}`))})]})}),!r&&e.length>0&&(0,a.jsx)("div",{className:"border-t border-black/5 dark:border-white/5",children:(0,a.jsx)(x,{currentPage:s.page,pageSize:s.pageSize,totalItems:s.totalItems,onPageChange:e=>{l(t=>({...t,page:e}))},onPageSizeChange:e=>{l(t=>({...t,pageSize:e,page:1}))}})})]}),(0,a.jsx)(c,{isOpen:w,onClose:()=>k(!1),title:"Request Details",width:"lg",children:p&&(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"grid min-w-0 grid-cols-1 gap-4 text-sm sm:grid-cols-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"ID:"})," ",(0,a.jsx)("span",{className:"break-all font-mono text-text-main",children:p.id})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Timestamp:"})," ",(0,a.jsx)("span",{className:"text-text-main",children:new Date(p.timestamp).toLocaleString()})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Provider:"})," ",(0,a.jsx)("span",{className:"text-text-main font-medium",children:b(p.provider,C)})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Model:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:p.model})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Status:"})," ",(0,a.jsx)("span",{className:(0,d.cn)("font-medium","success"===p.status?"text-green-600":"text-red-600"),children:p.status})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Latency:"})," ",(0,a.jsxs)("span",{className:"text-text-main font-mono",children:["TTFT ",p.latency?.ttft||0,"ms / Total ",p.latency?.total||0,"ms"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Input Tokens:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:N(p.tokens).toLocaleString()})]}),g(p.tokens)>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Cached Tokens:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:g(p.tokens).toLocaleString()})]}),v(p.tokens)>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Cache Creation:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:v(p.tokens).toLocaleString()})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Output Tokens:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:p.tokens?.completion_tokens?.toLocaleString()||0})]})]}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)(j,{title:"1. Client Request (Input)",defaultOpen:!0,icon:"input",children:(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:JSON.stringify(p.request,null,2)})}),p.providerRequest&&(0,a.jsx)(j,{title:"2. Provider Request (Translated)",icon:"translate",children:(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:JSON.stringify(p.providerRequest,null,2)})}),p.providerResponse&&(0,a.jsx)(j,{title:"3. Provider Response (Raw)",icon:"data_object",children:(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:"object"==typeof p.providerResponse?JSON.stringify(p.providerResponse,null,2):p.providerResponse})}),(0,a.jsxs)(j,{title:"4. Client Response (Final)",defaultOpen:!0,icon:"output",children:[p.response?.thinking&&(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsxs)("h4",{className:"font-semibold text-text-main mb-2 flex items-center gap-2 text-xs uppercase tracking-wide opacity-70",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"psychology"}),"Thinking Process"]}),(0,a.jsx)("pre",{className:"max-h-[200px] max-w-full overflow-auto rounded-lg border border-amber-200 bg-amber-50 p-3 font-mono text-xs text-amber-900 dark:border-amber-800 dark:bg-amber-950/30 dark:text-amber-100 sm:p-4",children:p.response.thinking})]}),(0,a.jsx)("h4",{className:"font-semibold text-text-main mb-2 text-xs uppercase tracking-wide opacity-70",children:"Content"}),(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:p.response?.content||"[No content]"})]})]})]})})]})}let k=[{value:"today",label:"Today"},{value:"24h",label:"24h"},{value:"7d",label:"7D"},{value:"30d",label:"30D"},{value:"60d",label:"60D"}];function y(){return(0,a.jsx)(n.Suspense,{fallback:(0,a.jsx)(r.Qv,{}),children:(0,a.jsx)(S,{})})}function S(){let e=(0,l.useSearchParams)(),t=(0,l.useRouter)(),[s,i]=(0,n.useState)("today"),o=e.get("tab"),d=o&&["overview","logs","details"].includes(o)?o:"overview";return(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:px-0",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)(r.Iz,{options:[{value:"overview",label:"Overview"},{value:"details",label:"Details"}],value:d,onChange:s=>{if(s===d)return;let a=new URLSearchParams(e);a.set("tab",s),t.push(`/dashboard/usage?${a.toString()}`,{scroll:!1})},className:"w-full sm:w-auto"}),"overview"===d&&(0,a.jsx)(r.Iz,{options:k,value:s,onChange:i,size:"sm",className:"w-full sm:w-auto"})]}),"overview"===d&&(0,a.jsx)(n.Suspense,{fallback:(0,a.jsx)(r.Qv,{}),children:(0,a.jsx)(r.jK,{period:s,setPeriod:i,hidePeriodSelector:!0})}),"logs"===d&&(0,a.jsx)(r.gM,{}),"details"===d&&(0,a.jsx)(w,{})]})}},87618:(e,t,s)=>{Promise.resolve().then(s.bind(s,81772))}},e=>{e.O(0,[2574,3862,782,8500,594,1321,7592,5497,8441,3794,7358],()=>e(e.s=87618)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9305],{19216:(e,s,n)=>{Promise.resolve().then(n.bind(n,96748)),Promise.resolve().then(n.bind(n,56319)),Promise.resolve().then(n.bind(n,56061)),Promise.resolve().then(n.bind(n,92542)),Promise.resolve().then(n.bind(n,29366)),Promise.resolve().then(n.bind(n,84588)),Promise.resolve().then(n.bind(n,40197)),Promise.resolve().then(n.bind(n,45455)),Promise.resolve().then(n.bind(n,30815)),Promise.resolve().then(n.bind(n,73579)),Promise.resolve().then(n.bind(n,92173)),Promise.resolve().then(n.bind(n,95088)),Promise.resolve().then(n.bind(n,8823)),Promise.resolve().then(n.bind(n,80752)),Promise.resolve().then(n.bind(n,23936)),Promise.resolve().then(n.bind(n,11910)),Promise.resolve().then(n.bind(n,44736)),Promise.resolve().then(n.bind(n,62899)),Promise.resolve().then(n.bind(n,94230)),Promise.resolve().then(n.bind(n,21931)),Promise.resolve().then(n.bind(n,91450)),Promise.resolve().then(n.bind(n,76361)),Promise.resolve().then(n.bind(n,25086)),Promise.resolve().then(n.bind(n,28815)),Promise.resolve().then(n.bind(n,28058)),Promise.resolve().then(n.bind(n,81127)),Promise.resolve().then(n.bind(n,72908)),Promise.resolve().then(n.bind(n,4823)),Promise.resolve().then(n.bind(n,90882)),Promise.resolve().then(n.bind(n,51825)),Promise.resolve().then(n.bind(n,23615)),Promise.resolve().then(n.bind(n,28067)),Promise.resolve().then(n.bind(n,98)),Promise.resolve().then(n.bind(n,92622)),Promise.resolve().then(n.bind(n,21110)),Promise.resolve().then(n.bind(n,38587)),Promise.resolve().then(n.bind(n,98542)),Promise.resolve().then(n.bind(n,97677)),Promise.resolve().then(n.bind(n,4809)),Promise.resolve().then(n.bind(n,28469))},28469:(e,s,n)=>{"use strict";n.d(s,{default:()=>l});var r=n(95155),i=n(12115),o=n(26430),t=n(35625);function l({children:e}){let[s]=(0,i.useState)(()=>new o.E({defaultOptions:{queries:{staleTime:3e4,refetchOnWindowFocus:!1,retry:1}}}));return(0,r.jsx)(t.Ht,{client:s,children:e})}}},e=>{e.O(0,[2574,3862,782,8500,594,6430,1321,7592,5497,8441,3794,7358],()=>e(e.s=19216)),_N_E=e.O()}]);
|
package/app/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1631],{1681:(t,e,i)=>{i.d(e,{t:()=>r});var s=i(98216),r=new class extends s.Q{#t=!0;#e;#i;constructor(){super(),this.#i=t=>{if("u">typeof window&&window.addEventListener){let e=()=>t(!0),i=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",i)}}}}onSubscribe(){this.#e||this.setEventListener(this.#i)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#i=t,this.#e?.(),this.#e=t(this.setOnline.bind(this))}setOnline(t){this.#t!==t&&(this.#t=t,this.listeners.forEach(e=>{e(t)}))}isOnline(){return this.#t}}},5858:(t,e,i)=>{i.d(e,{Cp:()=>y,EN:()=>f,F$:()=>p,GU:()=>j,MK:()=>l,S$:()=>r,ZM:()=>T,ZZ:()=>F,Zw:()=>a,d2:()=>c,f8:()=>m,gn:()=>o,hT:()=>O,j3:()=>u,lQ:()=>n,nJ:()=>d,nU:()=>h,ox:()=>q,pl:()=>C,y9:()=>P,yy:()=>S});var s=i(83599),r="u"<typeof window||"Deno"in globalThis;function n(){}function a(t,e){return"function"==typeof t?t(e):t}function o(t){return"number"==typeof t&&t>=0&&t!==1/0}function u(t,e){return Math.max(t+(e||0)-Date.now(),0)}function c(t,e){return"function"==typeof t?t(e):t}function h(t,e){return"function"==typeof t?t(e):t}function l(t,e){let{type:i="all",exact:s,fetchStatus:r,predicate:n,queryKey:a,stale:o}=t;if(a){if(s){if(e.queryHash!==p(a,e.options))return!1}else if(!y(e.queryKey,a))return!1}if("all"!==i){let t=e.isActive();if("active"===i&&!t||"inactive"===i&&t)return!1}return("boolean"!=typeof o||e.isStale()===o)&&(!r||r===e.state.fetchStatus)&&(!n||!!n(e))}function d(t,e){let{exact:i,status:s,predicate:r,mutationKey:n}=t;if(n){if(!e.options.mutationKey)return!1;if(i){if(f(e.options.mutationKey)!==f(n))return!1}else if(!y(e.options.mutationKey,n))return!1}return(!s||e.state.status===s)&&(!r||!!r(e))}function p(t,e){return(e?.queryKeyHashFn||f)(t)}function f(t){return JSON.stringify(t,(t,e)=>g(e)?Object.keys(e).sort().reduce((t,i)=>(t[i]=e[i],t),{}):e)}function y(t,e){return t===e||typeof t==typeof e&&!!t&&!!e&&"object"==typeof t&&"object"==typeof e&&Object.keys(e).every(i=>y(t[i],e[i]))}var v=Object.prototype.hasOwnProperty;function m(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(let i in t)if(t[i]!==e[i])return!1;return!0}function b(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function g(t){if(!w(t))return!1;let e=t.constructor;if(void 0===e)return!0;let i=e.prototype;return!!w(i)&&!!i.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(t)===Object.prototype}function w(t){return"[object Object]"===Object.prototype.toString.call(t)}function S(t){return new Promise(e=>{s.zs.setTimeout(e,t)})}function C(t,e,i){return"function"==typeof i.structuralSharing?i.structuralSharing(t,e):!1!==i.structuralSharing?function t(e,i,s=0){if(e===i)return e;if(s>500)return i;let r=b(e)&&b(i);if(!r&&!(g(e)&&g(i)))return i;let n=(r?e:Object.keys(e)).length,a=r?i:Object.keys(i),o=a.length,u=r?Array(o):{},c=0;for(let h=0;h<o;h++){let o=r?h:a[h],l=e[o],d=i[o];if(l===d){u[o]=l,(r?h<n:v.call(e,o))&&c++;continue}if(null===l||null===d||"object"!=typeof l||"object"!=typeof d){u[o]=d;continue}let p=t(l,d,s+1);u[o]=p,p===l&&c++}return n===o&&c===n?e:u}(t,e):e}function P(t,e,i=0){let s=[...t,e];return i&&s.length>i?s.slice(1):s}function F(t,e,i=0){let s=[e,...t];return i&&s.length>i?s.slice(0,-1):s}var O=Symbol();function T(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:t.queryFn&&t.queryFn!==O?t.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${t.queryHash}'`))}function j(t,e){return"function"==typeof t?t(...e):!!t}function q(t,e,i){let s,r=!1;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(s??=e(),r||(r=!0,s.aborted?i():s.addEventListener("abort",i,{once:!0})),s)}),t}},9846:(t,e,i)=>{i.d(e,{II:()=>l,cc:()=>h,v_:()=>c});var s=i(20562),r=i(1681),n=i(46062),a=i(20297),o=i(5858);function u(t){return Math.min(1e3*2**t,3e4)}function c(t){return(t??"online")!=="online"||r.t.isOnline()}var h=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function l(t){let e,i=!1,l=0,d=(0,n.T)(),p=()=>s.m.isFocused()&&("always"===t.networkMode||r.t.isOnline())&&t.canRun(),f=()=>c(t.networkMode)&&t.canRun(),y=t=>{"pending"===d.status&&(e?.(),d.resolve(t))},v=t=>{"pending"===d.status&&(e?.(),d.reject(t))},m=()=>new Promise(i=>{e=t=>{("pending"!==d.status||p())&&i(t)},t.onPause?.()}).then(()=>{e=void 0,"pending"===d.status&&t.onContinue?.()}),b=()=>{let e;if("pending"!==d.status)return;let s=0===l?t.initialPromise:void 0;try{e=s??t.fn()}catch(t){e=Promise.reject(t)}Promise.resolve(e).then(y).catch(e=>{if("pending"!==d.status)return;let s=t.retry??3*!a.H.isServer(),r=t.retryDelay??u,n="function"==typeof r?r(l,e):r,c=!0===s||"number"==typeof s&&l<s||"function"==typeof s&&s(l,e);i||!c?v(e):(l++,t.onFail?.(l,e),(0,o.yy)(n).then(()=>p()?void 0:m()).then(()=>{i?v(e):b()}))})};return{promise:d,status:()=>d.status,cancel:e=>{if("pending"===d.status){let i=new h(e);v(i),t.onCancel?.(i)}},continue:()=>(e?.(),d),cancelRetry:()=>{i=!0},continueRetry:()=>{i=!1},canStart:f,start:()=>(f()?b():m().then(b),d)}}},20297:(t,e,i)=>{let s;i.d(e,{H:()=>n});var r=i(5858),n=(s=()=>r.S$,{isServer:()=>s(),setIsServer(t){s=t}})},20562:(t,e,i)=>{i.d(e,{m:()=>r});var s=i(98216),r=new class extends s.Q{#s;#e;#i;constructor(){super(),this.#i=t=>{if("u">typeof window&&window.addEventListener){let e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#e||this.setEventListener(this.#i)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#i=t,this.#e?.(),this.#e=t(t=>{"boolean"==typeof t?this.setFocused(t):this.onFocus()})}setFocused(t){this.#s!==t&&(this.#s=t,this.onFocus())}onFocus(){let t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return"boolean"==typeof this.#s?this.#s:globalThis.document?.visibilityState!=="hidden"}}},31967:(t,e,i)=>{let s,r,n,a,o,u;i.d(e,{jG:()=>h});var c=i(83599).Zq,h=(s=[],r=0,n=t=>{t()},a=t=>{t()},o=c,{batch:t=>{let e;r++;try{e=t()}finally{let t;--r||(t=s,s=[],t.length&&o(()=>{a(()=>{t.forEach(t=>{n(t)})})}))}return e},batchCalls:t=>(...e)=>{u(()=>{t(...e)})},schedule:u=t=>{r?s.push(t):o(()=>{n(t)})},setNotifyFunction:t=>{n=t},setBatchNotifyFunction:t=>{a=t},setScheduler:t=>{o=t}})},35625:(t,e,i)=>{i.d(e,{Ht:()=>o,jE:()=>a});var s=i(12115),r=i(95155),n=s.createContext(void 0),a=t=>{let e=s.useContext(n);if(t)return t;if(!e)throw Error("No QueryClient set, use QueryClientProvider to set one");return e},o=({client:t,children:e})=>(s.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),(0,r.jsx)(n.Provider,{value:t,children:e}))},46062:(t,e,i)=>{i.d(e,{T:()=>s});function s(){let t,e,i=new Promise((i,s)=>{t=i,e=s});function s(t){Object.assign(i,t),delete i.resolve,delete i.reject}return i.status="pending",i.catch(()=>{}),i.resolve=e=>{s({status:"fulfilled",value:e}),t(e)},i.reject=t=>{s({status:"rejected",reason:t}),e(t)},i}},53390:(t,e,i)=>{i.d(e,{$:()=>o,s:()=>a});var s=i(31967),r=i(99190),n=i(9846),a=class extends r.k{#r;#n;#a;#o;constructor(t){super(),this.#r=t.client,this.mutationId=t.mutationId,this.#a=t.mutationCache,this.#n=[],this.state=t.state||o(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#n.includes(t)||(this.#n.push(t),this.clearGcTimeout(),this.#a.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#n=this.#n.filter(e=>e!==t),this.scheduleGc(),this.#a.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#n.length||("pending"===this.state.status?this.scheduleGc():this.#a.remove(this))}continue(){return this.#o?.continue()??this.execute(this.state.variables)}async execute(t){let e=()=>{this.#u({type:"continue"})},i={client:this.#r,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#o=(0,n.II)({fn:()=>this.options.mutationFn?this.options.mutationFn(t,i):Promise.reject(Error("No mutationFn found")),onFail:(t,e)=>{this.#u({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#u({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#a.canRun(this)});let s="pending"===this.state.status,r=!this.#o.canStart();try{if(s)e();else{this.#u({type:"pending",variables:t,isPaused:r}),this.#a.config.onMutate&&await this.#a.config.onMutate(t,this,i);let e=await this.options.onMutate?.(t,i);e!==this.state.context&&this.#u({type:"pending",context:e,variables:t,isPaused:r})}let n=await this.#o.start();return await this.#a.config.onSuccess?.(n,t,this.state.context,this,i),await this.options.onSuccess?.(n,t,this.state.context,i),await this.#a.config.onSettled?.(n,null,this.state.variables,this.state.context,this,i),await this.options.onSettled?.(n,null,t,this.state.context,i),this.#u({type:"success",data:n}),n}catch(e){try{await this.#a.config.onError?.(e,t,this.state.context,this,i)}catch(t){Promise.reject(t)}try{await this.options.onError?.(e,t,this.state.context,i)}catch(t){Promise.reject(t)}try{await this.#a.config.onSettled?.(void 0,e,this.state.variables,this.state.context,this,i)}catch(t){Promise.reject(t)}try{await this.options.onSettled?.(void 0,e,t,this.state.context,i)}catch(t){Promise.reject(t)}throw this.#u({type:"error",error:e}),e}finally{this.#a.runNext(this)}}#u(t){this.state=(e=>{switch(t.type){case"failed":return{...e,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...e,isPaused:!0};case"continue":return{...e,isPaused:!1};case"pending":return{...e,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...e,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...e,data:void 0,error:t.error,failureCount:e.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}})(this.state),s.jG.batch(()=>{this.#n.forEach(e=>{e.onMutationUpdate(t)}),this.#a.notify({mutation:this,type:"updated",action:t})})}};function o(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}},83599:(t,e,i)=>{i.d(e,{Zq:()=>n,zs:()=>r});var s={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},r=new class{#c=s;#h=!1;setTimeoutProvider(t){this.#c=t}setTimeout(t,e){return this.#c.setTimeout(t,e)}clearTimeout(t){this.#c.clearTimeout(t)}setInterval(t,e){return this.#c.setInterval(t,e)}clearInterval(t){this.#c.clearInterval(t)}};function n(t){setTimeout(t,0)}},85086:(t,e,i)=>{i.d(e,{X:()=>u,k:()=>c});var s=i(5858),r=i(31967),n=i(9846),a=i(99190);function o(t,{pages:e,pageParams:i}){let s=e.length-1;return e.length>0?t.getNextPageParam(e[s],e,i[s],i):void 0}var u=class extends a.k{#l;#d;#p;#f;#r;#o;#y;#v;constructor(t){super(),this.#v=!1,this.#y=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#r=t.client,this.#f=this.#r.getQueryCache(),this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#d=l(this.options),this.state=t.state??this.#d,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#l}get promise(){return this.#o?.promise}setOptions(t){if(this.options={...this.#y,...t},t?._type&&(this.#l=t._type),this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){let t=l(this.options);void 0!==t.data&&(this.setState(h(t.data,t.dataUpdatedAt)),this.#d=t)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#f.remove(this)}setData(t,e){let i=(0,s.pl)(this.state.data,t,this.options);return this.#u({data:i,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),i}setState(t){this.#u({type:"setState",state:t})}cancel(t){let e=this.#o?.promise;return this.#o?.cancel(t),e?e.then(s.lQ).catch(s.lQ):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#d}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>!1!==(0,s.nU)(t.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===s.hT||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(t=>"static"===(0,s.d2)(t.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(t=0){return void 0===this.state.data||"static"!==t&&(!!this.state.isInvalidated||!(0,s.j3)(this.state.dataUpdatedAt,t))}onFocus(){let t=this.observers.find(t=>t.shouldFetchOnWindowFocus());t?.refetch({cancelRefetch:!1}),this.#o?.continue()}onOnline(){let t=this.observers.find(t=>t.shouldFetchOnReconnect());t?.refetch({cancelRefetch:!1}),this.#o?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#f.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(this.#o&&(this.#v||this.#m()?this.#o.cancel({revert:!0}):this.#o.cancelRetry()),this.scheduleGc()),this.#f.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}#m(){return"paused"===this.state.fetchStatus&&"pending"===this.state.status}invalidate(){this.state.isInvalidated||this.#u({type:"invalidate"})}async fetch(t,e){var i;let r;if("idle"!==this.state.fetchStatus&&this.#o?.status()!=="rejected"){if(void 0!==this.state.data&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#o)return this.#o.continueRetry(),this.#o.promise}if(t&&this.setOptions(t),!this.options.queryFn){let t=this.observers.find(t=>t.options.queryFn);t&&this.setOptions(t.options)}let a=new AbortController,u=t=>{Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(this.#v=!0,a.signal)})},c=()=>{let t,i=(0,s.ZM)(this.options,e),r=(u(t={client:this.#r,queryKey:this.queryKey,meta:this.meta}),t);return(this.#v=!1,this.options.persister)?this.options.persister(i,r,this):i(r)},h=(u(r={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:c}),r),l="infinite"===this.#l?(i=this.options.pages,{onFetch:(t,e)=>{let r=t.options,n=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],u=t.state.data?.pageParams||[],c={pages:[],pageParams:[]},h=0,l=async()=>{let e=!1,l=(0,s.ZM)(t.options,t.fetchOptions),d=async(i,r,n)=>{let a;if(e)return Promise.reject(t.signal.reason);if(null==r&&i.pages.length)return Promise.resolve(i);let o=(a={client:t.client,queryKey:t.queryKey,pageParam:r,direction:n?"backward":"forward",meta:t.options.meta},(0,s.ox)(a,()=>t.signal,()=>e=!0),a),u=await l(o),{maxPages:c}=t.options,h=n?s.ZZ:s.y9;return{pages:h(i.pages,u,c),pageParams:h(i.pageParams,r,c)}};if(n&&a.length){let t="backward"===n,e={pages:a,pageParams:u},i=(t?function(t,{pages:e,pageParams:i}){return e.length>0?t.getPreviousPageParam?.(e[0],e,i[0],i):void 0}:o)(r,e);c=await d(e,i,t)}else{let t=i??a.length;do{let t=0===h?u[0]??r.initialPageParam:o(r,c);if(h>0&&null==t)break;c=await d(c,t),h++}while(h<t)}return c};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},e):t.fetchFn=l}}):this.options.behavior;l?.onFetch(h,this),this.#p=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==h.fetchOptions?.meta)&&this.#u({type:"fetch",meta:h.fetchOptions?.meta}),this.#o=(0,n.II)({initialPromise:e?.initialPromise,fn:h.fetchFn,onCancel:t=>{t instanceof n.cc&&t.revert&&this.setState({...this.#p,fetchStatus:"idle"}),a.abort()},onFail:(t,e)=>{this.#u({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#u({type:"pause"})},onContinue:()=>{this.#u({type:"continue"})},retry:h.options.retry,retryDelay:h.options.retryDelay,networkMode:h.options.networkMode,canRun:()=>!0});try{let t=await this.#o.start();if(void 0===t)throw Error(`${this.queryHash} data is undefined`);return this.setData(t),this.#f.config.onSuccess?.(t,this),this.#f.config.onSettled?.(t,this.state.error,this),t}catch(t){if(t instanceof n.cc){if(t.silent)return this.#o.promise;else if(t.revert){if(void 0===this.state.data)throw t;return this.state.data}}throw this.#u({type:"error",error:t}),this.#f.config.onError?.(t,this),this.#f.config.onSettled?.(this.state.data,t,this),t}finally{this.scheduleGc()}}#u(t){let e=e=>{switch(t.type){case"failed":return{...e,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...e,fetchStatus:"paused"};case"continue":return{...e,fetchStatus:"fetching"};case"fetch":return{...e,...c(e.data,this.options),fetchMeta:t.meta??null};case"success":let i={...e,...h(t.data,t.dataUpdatedAt),dataUpdateCount:e.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#p=t.manual?i:void 0,i;case"error":let s=t.error;return{...e,error:s,errorUpdateCount:e.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:e.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...e,isInvalidated:!0};case"setState":return{...e,...t.state}}};this.state=e(this.state),r.jG.batch(()=>{this.observers.forEach(t=>{t.onQueryUpdate()}),this.#f.notify({query:this,type:"updated",action:t})})}};function c(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:(0,n.v_)(e.networkMode)?"fetching":"paused",...void 0===t&&{error:null,status:"pending"}}}function h(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function l(t){let e="function"==typeof t.initialData?t.initialData():t.initialData,i=void 0!==e,s=i?"function"==typeof t.initialDataUpdatedAt?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:i?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}},98216:(t,e,i)=>{i.d(e,{Q:()=>s});var s=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}},99190:(t,e,i)=>{i.d(e,{k:()=>a});var s=i(83599),r=i(20297),n=i(5858),a=class{#b;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,n.gn)(this.gcTime)&&(this.#b=s.zs.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(r.H.isServer()?1/0:3e5))}clearGcTimeout(){void 0!==this.#b&&(s.zs.clearTimeout(this.#b),this.#b=void 0)}}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2176],{4109:(t,e,s)=>{let r;s.d(e,{I:()=>g});var i=s(20562),n=s(20297),u=s(31967),a=s(85086),h=s(98216),o=s(46062),c=s(5858),l=s(83599),d=class extends h.Q{constructor(t,e){super(),this.options=e,this.#t=t,this.#e=null,this.#s=(0,o.T)(),this.bindMethods(),this.setOptions(e)}#t;#r=void 0;#i=void 0;#n=void 0;#u;#a;#s;#e;#h;#o;#c;#l;#d;#p;#f=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#r.addObserver(this),p(this.#r,this.options)?this.#y():this.updateResult(),this.#R())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return f(this.#r,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return f(this.#r,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#m(),this.#b(),this.#r.removeObserver(this)}setOptions(t){let e=this.options,s=this.#r;if(this.options=this.#t.defaultQueryOptions(t),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof(0,c.nU)(this.options.enabled,this.#r))throw Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#v(),this.#r.setOptions(this.options),e._defaulted&&!(0,c.f8)(this.options,e)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#r,observer:this});let r=this.hasListeners();r&&y(this.#r,s,this.options,e)&&this.#y(),this.updateResult(),r&&(this.#r!==s||(0,c.nU)(this.options.enabled,this.#r)!==(0,c.nU)(e.enabled,this.#r)||(0,c.d2)(this.options.staleTime,this.#r)!==(0,c.d2)(e.staleTime,this.#r))&&this.#Q();let i=this.#O();r&&(this.#r!==s||(0,c.nU)(this.options.enabled,this.#r)!==(0,c.nU)(e.enabled,this.#r)||i!==this.#p)&&this.#g(i)}getOptimisticResult(t){var e,s;let r=this.#t.getQueryCache().build(this.#t,t),i=this.createResult(r,t);return e=this,s=i,(0,c.f8)(e.getCurrentResult(),s)||(this.#n=i,this.#a=this.options,this.#u=this.#r.state),i}getCurrentResult(){return this.#n}trackResult(t,e){return new Proxy(t,{get:(t,s)=>(this.trackProp(s),e?.(s),"promise"===s&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#s.status||this.#s.reject(Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(t,s))})}trackProp(t){this.#f.add(t)}getCurrentQuery(){return this.#r}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){let e=this.#t.defaultQueryOptions(t),s=this.#t.getQueryCache().build(this.#t,e);return s.fetch().then(()=>this.createResult(s,e))}fetch(t){return this.#y({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#n))}#y(t){this.#v();let e=this.#r.fetch(this.options,t);return t?.throwOnError||(e=e.catch(c.lQ)),e}#Q(){this.#m();let t=(0,c.d2)(this.options.staleTime,this.#r);if(n.H.isServer()||this.#n.isStale||!(0,c.gn)(t))return;let e=(0,c.j3)(this.#n.dataUpdatedAt,t);this.#l=l.zs.setTimeout(()=>{this.#n.isStale||this.updateResult()},e+1)}#O(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#r):this.options.refetchInterval)??!1}#g(t){this.#b(),this.#p=t,!n.H.isServer()&&!1!==(0,c.nU)(this.options.enabled,this.#r)&&(0,c.gn)(this.#p)&&0!==this.#p&&(this.#d=l.zs.setInterval(()=>{(this.options.refetchIntervalInBackground||i.m.isFocused())&&this.#y()},this.#p))}#R(){this.#Q(),this.#g(this.#O())}#m(){void 0!==this.#l&&(l.zs.clearTimeout(this.#l),this.#l=void 0)}#b(){void 0!==this.#d&&(l.zs.clearInterval(this.#d),this.#d=void 0)}createResult(t,e){let s,r=this.#r,i=this.options,n=this.#n,u=this.#u,h=this.#a,l=t!==r?t.state:this.#i,{state:d}=t,f={...d},m=!1;if(e._optimisticResults){let s=this.hasListeners(),n=!s&&p(t,e),u=s&&y(t,r,e,i);(n||u)&&(f={...f,...(0,a.k)(d.data,t.options)}),"isRestoring"===e._optimisticResults&&(f.fetchStatus="idle")}let{error:b,errorUpdatedAt:v,status:Q}=f;s=f.data;let O=!1;if(void 0!==e.placeholderData&&void 0===s&&"pending"===Q){let t;n?.isPlaceholderData&&e.placeholderData===h?.placeholderData?(t=n.data,O=!0):t="function"==typeof e.placeholderData?e.placeholderData(this.#c?.state.data,this.#c):e.placeholderData,void 0!==t&&(Q="success",s=(0,c.pl)(n?.data,t,e),m=!0)}if(e.select&&void 0!==s&&!O)if(n&&s===u?.data&&e.select===this.#h)s=this.#o;else try{this.#h=e.select,s=e.select(s),s=(0,c.pl)(n?.data,s,e),this.#o=s,this.#e=null}catch(t){this.#e=t}this.#e&&(b=this.#e,s=this.#o,v=Date.now(),Q="error");let g="fetching"===f.fetchStatus,I="pending"===Q,S="error"===Q,C=I&&g,E=void 0!==s,T={status:Q,fetchStatus:f.fetchStatus,isPending:I,isSuccess:"success"===Q,isError:S,isInitialLoading:C,isLoading:C,data:s,dataUpdatedAt:f.dataUpdatedAt,error:b,errorUpdatedAt:v,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:f.dataUpdateCount>l.dataUpdateCount||f.errorUpdateCount>l.errorUpdateCount,isFetching:g,isRefetching:g&&!I,isLoadingError:S&&!E,isPaused:"paused"===f.fetchStatus,isPlaceholderData:m,isRefetchError:S&&E,isStale:R(t,e),refetch:this.refetch,promise:this.#s,isEnabled:!1!==(0,c.nU)(e.enabled,t)};if(this.options.experimental_prefetchInRender){let e=void 0!==T.data,s="error"===T.status&&!e,i=t=>{s?t.reject(T.error):e&&t.resolve(T.data)},n=()=>{i(this.#s=T.promise=(0,o.T)())},u=this.#s;switch(u.status){case"pending":t.queryHash===r.queryHash&&i(u);break;case"fulfilled":(s||T.data!==u.value)&&n();break;case"rejected":s&&T.error===u.reason||n()}}return T}updateResult(){let t=this.#n,e=this.createResult(this.#r,this.options);if(this.#u=this.#r.state,this.#a=this.options,void 0!==this.#u.data&&(this.#c=this.#r),(0,c.f8)(e,t))return;this.#n=e;let s=()=>{if(!t)return!0;let{notifyOnChangeProps:e}=this.options,s="function"==typeof e?e():e;if("all"===s||!s&&!this.#f.size)return!0;let r=new Set(s??this.#f);return this.options.throwOnError&&r.add("error"),Object.keys(this.#n).some(e=>this.#n[e]!==t[e]&&r.has(e))};this.#I({listeners:s()})}#v(){let t=this.#t.getQueryCache().build(this.#t,this.options);if(t===this.#r)return;let e=this.#r;this.#r=t,this.#i=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#R()}#I(t){u.jG.batch(()=>{t.listeners&&this.listeners.forEach(t=>{t(this.#n)}),this.#t.getQueryCache().notify({query:this.#r,type:"observerResultsUpdated"})})}};function p(t,e){return!1!==(0,c.nU)(e.enabled,t)&&void 0===t.state.data&&("error"!==t.state.status||!1!==(0,c.nU)(e.retryOnMount,t))||void 0!==t.state.data&&f(t,e,e.refetchOnMount)}function f(t,e,s){if(!1!==(0,c.nU)(e.enabled,t)&&"static"!==(0,c.d2)(e.staleTime,t)){let r="function"==typeof s?s(t):s;return"always"===r||!1!==r&&R(t,e)}return!1}function y(t,e,s,r){return(t!==e||!1===(0,c.nU)(r.enabled,t))&&(!s.suspense||"error"!==t.state.status)&&R(t,s)}function R(t,e){return!1!==(0,c.nU)(e.enabled,t)&&t.isStaleByTime((0,c.d2)(e.staleTime,t))}var m=s(12115),b=s(35625);s(95155);var v=m.createContext((r=!1,{clearReset:()=>{r=!1},reset:()=>{r=!0},isReset:()=>r})),Q=m.createContext(!1);Q.Provider;var O=(t,e,s)=>e.fetchOptimistic(t).catch(()=>{s.clearReset()});function g(t,e){return function(t,e,s){let r,i=m.useContext(Q),a=m.useContext(v),h=(0,b.jE)(s),o=h.defaultQueryOptions(t);h.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let l=h.getQueryCache().get(o.queryHash),d=!1!==t.subscribed;if(o._optimisticResults=i?"isRestoring":d?"optimistic":void 0,o.suspense){let t=t=>"static"===t?t:Math.max(t??1e3,1e3),e=o.staleTime;o.staleTime="function"==typeof e?(...s)=>t(e(...s)):t(e),"number"==typeof o.gcTime&&(o.gcTime=Math.max(o.gcTime,1e3))}r=l?.state.error&&"function"==typeof o.throwOnError?(0,c.GU)(o.throwOnError,[l.state.error,l]):o.throwOnError,(o.suspense||o.experimental_prefetchInRender||r)&&!a.isReset()&&(o.retryOnMount=!1),m.useEffect(()=>{a.clearReset()},[a]);let p=!h.getQueryCache().get(o.queryHash),[f]=m.useState(()=>new e(h,o)),y=f.getOptimisticResult(o),R=!i&&d;if(m.useSyncExternalStore(m.useCallback(t=>{let e=R?f.subscribe(u.jG.batchCalls(t)):c.lQ;return f.updateResult(),e},[f,R]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),m.useEffect(()=>{f.setOptions(o)},[o,f]),o?.suspense&&y.isPending)throw O(o,f,a);if((({result:t,errorResetBoundary:e,throwOnError:s,query:r,suspense:i})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(i&&void 0===t.data||(0,c.GU)(s,[t.error,r])))({result:y,errorResetBoundary:a,throwOnError:o.throwOnError,query:l,suspense:o.suspense}))throw y.error;if(h.getDefaultOptions().queries?._experimental_afterQuery?.(o,y),o.experimental_prefetchInRender&&!n.H.isServer()&&y.isLoading&&y.isFetching&&!i){let t=p?O(o,f,a):l?.promise;t?.catch(c.lQ).finally(()=>{f.updateResult()})}return o.notifyOnChangeProps?y:f.trackResult(y)}(t,d,e)}},48934:(t,e,s)=>{s.d(e,{n:()=>c});var r=s(12115),i=s(53390),n=s(31967),u=s(98216),a=s(5858),h=class extends u.Q{#t;#n=void 0;#S;#C;constructor(t,e){super(),this.#t=t,this.setOptions(e),this.bindMethods(),this.#E()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){let e=this.options;this.options=this.#t.defaultMutationOptions(t),(0,a.f8)(this.options,e)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#S,observer:this}),e?.mutationKey&&this.options.mutationKey&&(0,a.EN)(e.mutationKey)!==(0,a.EN)(this.options.mutationKey)?this.reset():this.#S?.state.status==="pending"&&this.#S.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#S?.removeObserver(this)}onMutationUpdate(t){this.#E(),this.#I(t)}getCurrentResult(){return this.#n}reset(){this.#S?.removeObserver(this),this.#S=void 0,this.#E(),this.#I()}mutate(t,e){return this.#C=e,this.#S?.removeObserver(this),this.#S=this.#t.getMutationCache().build(this.#t,this.options),this.#S.addObserver(this),this.#S.execute(t)}#E(){let t=this.#S?.state??(0,i.$)();this.#n={...t,isPending:"pending"===t.status,isSuccess:"success"===t.status,isError:"error"===t.status,isIdle:"idle"===t.status,mutate:this.mutate,reset:this.reset}}#I(t){n.jG.batch(()=>{if(this.#C&&this.hasListeners()){let e=this.#n.variables,s=this.#n.context,r={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#C.onSuccess?.(t.data,e,s,r)}catch(t){Promise.reject(t)}try{this.#C.onSettled?.(t.data,null,e,s,r)}catch(t){Promise.reject(t)}}else if(t?.type==="error"){try{this.#C.onError?.(t.error,e,s,r)}catch(t){Promise.reject(t)}try{this.#C.onSettled?.(void 0,t.error,e,s,r)}catch(t){Promise.reject(t)}}}this.listeners.forEach(t=>{t(this.#n)})})}},o=s(35625);function c(t,e){let s=(0,o.jE)(e),[i]=r.useState(()=>new h(s,t));r.useEffect(()=>{i.setOptions(t)},[i,t]);let u=r.useSyncExternalStore(r.useCallback(t=>i.subscribe(n.jG.batchCalls(t)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),c=r.useCallback((t,e)=>{i.mutate(t,e).catch(a.lQ)},[i]);if(u.error&&(0,a.GU)(i.options.throwOnError,[u.error]))throw u.error;return{...u,mutate:c,mutateAsync:u.mutate}}}}]);
|