@aeolus-fleet/gateway 0.29.2 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -3
- package/dist/adapters/a2a/a2a-agents.d.ts +6 -0
- package/dist/adapters/a2a/a2a-agents.js +238 -0
- package/dist/adapters/a2a/a2a-agents.js.map +1 -0
- package/dist/adapters/a2a/agent-cards.d.ts +4 -0
- package/dist/adapters/a2a/agent-cards.js +90 -0
- package/dist/adapters/a2a/agent-cards.js.map +1 -0
- package/dist/adapters/crypto/agent-keys.d.ts +3 -0
- package/dist/adapters/crypto/agent-keys.js +13 -0
- package/dist/adapters/crypto/agent-keys.js.map +1 -0
- package/dist/adapters/crypto/call-keys.js +2 -0
- package/dist/adapters/crypto/call-keys.js.map +1 -1
- package/dist/adapters/fleet/core-version.d.ts +1 -1
- package/dist/adapters/fleet/core-version.js +1 -1
- package/dist/adapters/fleet/fleet-ships.d.ts +3 -1
- package/dist/adapters/fleet/fleet-ships.js +19 -10
- package/dist/adapters/fleet/fleet-ships.js.map +1 -1
- package/dist/adapters/fleet/rest-fleet-door.d.ts +2 -2
- package/dist/adapters/fleet/rest-fleet-door.js +29 -5
- package/dist/adapters/fleet/rest-fleet-door.js.map +1 -1
- package/dist/adapters/http/a2a-cards.d.ts +24 -0
- package/dist/adapters/http/a2a-cards.js +62 -0
- package/dist/adapters/http/a2a-cards.js.map +1 -0
- package/dist/adapters/http/a2a-endpoint.d.ts +28 -0
- package/dist/adapters/http/a2a-endpoint.js +424 -0
- package/dist/adapters/http/a2a-endpoint.js.map +1 -0
- package/dist/adapters/http/a2a-streams.d.ts +28 -0
- package/dist/adapters/http/a2a-streams.js +74 -0
- package/dist/adapters/http/a2a-streams.js.map +1 -0
- package/dist/adapters/http/a2a-tasks.d.ts +18 -0
- package/dist/adapters/http/a2a-tasks.js +117 -0
- package/dist/adapters/http/a2a-tasks.js.map +1 -0
- package/dist/adapters/http/front-door.js +8 -4
- package/dist/adapters/http/front-door.js.map +1 -1
- package/dist/adapters/http/live.d.ts +3 -1
- package/dist/adapters/http/live.js +6 -2
- package/dist/adapters/http/live.js.map +1 -1
- package/dist/adapters/http/oauth-routes.d.ts +1 -1
- package/dist/adapters/http/oauth-routes.js +16 -3
- package/dist/adapters/http/oauth-routes.js.map +1 -1
- package/dist/adapters/mcp/mcp-servers.js +2 -0
- package/dist/adapters/mcp/mcp-servers.js.map +1 -1
- package/dist/adapters/pagasae/email-channel.d.ts +8 -0
- package/dist/adapters/pagasae/email-channel.js +37 -0
- package/dist/adapters/pagasae/email-channel.js.map +1 -0
- package/dist/adapters/pagasae/pagasae-client.js +6 -2
- package/dist/adapters/pagasae/pagasae-client.js.map +1 -1
- package/dist/adapters/prisma/agent-calls.d.ts +3 -0
- package/dist/adapters/prisma/agent-calls.js +49 -0
- package/dist/adapters/prisma/agent-calls.js.map +1 -0
- package/dist/adapters/prisma/changes.d.ts +17 -8
- package/dist/adapters/prisma/changes.js +18 -5
- package/dist/adapters/prisma/changes.js.map +1 -1
- package/dist/adapters/prisma/client-calls.d.ts +1 -1
- package/dist/adapters/prisma/client-calls.js +83 -21
- package/dist/adapters/prisma/client-calls.js.map +1 -1
- package/dist/adapters/prisma/email-channels.d.ts +4 -0
- package/dist/adapters/prisma/email-channels.js +14 -0
- package/dist/adapters/prisma/email-channels.js.map +1 -0
- package/dist/adapters/prisma/fleet-forgetter.d.ts +1 -1
- package/dist/adapters/prisma/fleet-forgetter.js +2 -2
- package/dist/adapters/prisma/fleet-forgetter.js.map +1 -1
- package/dist/adapters/prisma/focused-pages.d.ts +4 -0
- package/dist/adapters/prisma/focused-pages.js +13 -0
- package/dist/adapters/prisma/focused-pages.js.map +1 -0
- package/dist/adapters/prisma/generated/browser.d.ts +45 -0
- package/dist/adapters/prisma/generated/client.d.ts +45 -0
- package/dist/adapters/prisma/generated/commonInputTypes.d.ts +54 -54
- package/dist/adapters/prisma/generated/internal/class.d.ts +99 -0
- package/dist/adapters/prisma/generated/internal/class.js +4 -4
- package/dist/adapters/prisma/generated/internal/class.js.map +1 -1
- package/dist/adapters/prisma/generated/internal/prismaNamespace.d.ts +783 -1
- package/dist/adapters/prisma/generated/internal/prismaNamespace.js +101 -3
- package/dist/adapters/prisma/generated/internal/prismaNamespace.js.map +1 -1
- package/dist/adapters/prisma/generated/internal/prismaNamespaceBrowser.d.ts +107 -0
- package/dist/adapters/prisma/generated/internal/prismaNamespaceBrowser.js +101 -3
- package/dist/adapters/prisma/generated/internal/prismaNamespaceBrowser.js.map +1 -1
- package/dist/adapters/prisma/generated/models/A2aAgentCall.d.ts +1203 -0
- package/dist/adapters/prisma/generated/models/A2aAgentCall.js +2 -0
- package/dist/adapters/prisma/generated/models/A2aAgentCall.js.map +1 -0
- package/dist/adapters/prisma/generated/models/A2aAgentReply.d.ts +1003 -0
- package/dist/adapters/prisma/generated/models/A2aAgentReply.js +2 -0
- package/dist/adapters/prisma/generated/models/A2aAgentReply.js.map +1 -0
- package/dist/adapters/prisma/generated/models/A2aPush.d.ts +1413 -0
- package/dist/adapters/prisma/generated/models/A2aPush.js +2 -0
- package/dist/adapters/prisma/generated/models/A2aPush.js.map +1 -0
- package/dist/adapters/prisma/generated/models/A2aPushConfig.d.ts +1322 -0
- package/dist/adapters/prisma/generated/models/A2aPushConfig.js +2 -0
- package/dist/adapters/prisma/generated/models/A2aPushConfig.js.map +1 -0
- package/dist/adapters/prisma/generated/models/A2aTask.d.ts +1002 -0
- package/dist/adapters/prisma/generated/models/A2aTask.js +2 -0
- package/dist/adapters/prisma/generated/models/A2aTask.js.map +1 -0
- package/dist/adapters/prisma/generated/models/ClientCall.d.ts +136 -15
- package/dist/adapters/prisma/generated/models/ClientCallReply.d.ts +0 -7
- package/dist/adapters/prisma/generated/models/EmailChannel.d.ts +946 -0
- package/dist/adapters/prisma/generated/models/EmailChannel.js +2 -0
- package/dist/adapters/prisma/generated/models/EmailChannel.js.map +1 -0
- package/dist/adapters/prisma/generated/models/FocusedPage.d.ts +974 -0
- package/dist/adapters/prisma/generated/models/FocusedPage.js +2 -0
- package/dist/adapters/prisma/generated/models/FocusedPage.js.map +1 -0
- package/dist/adapters/prisma/generated/models/IssuedToken.d.ts +47 -41
- package/dist/adapters/prisma/generated/models/OAuthClient.d.ts +32 -8
- package/dist/adapters/prisma/generated/models/Party.d.ts +90 -3
- package/dist/adapters/prisma/generated/models/WakeSent.d.ts +975 -0
- package/dist/adapters/prisma/generated/models/WakeSent.js +2 -0
- package/dist/adapters/prisma/generated/models/WakeSent.js.map +1 -0
- package/dist/adapters/prisma/generated/models/WebPushSubscription.d.ts +1115 -0
- package/dist/adapters/prisma/generated/models/WebPushSubscription.js +2 -0
- package/dist/adapters/prisma/generated/models/WebPushSubscription.js.map +1 -0
- package/dist/adapters/prisma/generated/models.d.ts +9 -0
- package/dist/adapters/prisma/oauth-stores.js +3 -2
- package/dist/adapters/prisma/oauth-stores.js.map +1 -1
- package/dist/adapters/prisma/party-store.js +35 -6
- package/dist/adapters/prisma/party-store.js.map +1 -1
- package/dist/adapters/prisma/person-crews.js +9 -0
- package/dist/adapters/prisma/person-crews.js.map +1 -1
- package/dist/adapters/prisma/push-store.d.ts +3 -0
- package/dist/adapters/prisma/push-store.js +102 -0
- package/dist/adapters/prisma/push-store.js.map +1 -0
- package/dist/adapters/prisma/waiter-locks.d.ts +4 -0
- package/dist/adapters/prisma/waiter-locks.js +72 -0
- package/dist/adapters/prisma/waiter-locks.js.map +1 -0
- package/dist/adapters/prisma/wakes-sent.d.ts +4 -0
- package/dist/adapters/prisma/wakes-sent.js +10 -0
- package/dist/adapters/prisma/wakes-sent.js.map +1 -0
- package/dist/adapters/prisma/web-push-subscriptions.d.ts +3 -0
- package/dist/adapters/prisma/web-push-subscriptions.js +33 -0
- package/dist/adapters/prisma/web-push-subscriptions.js.map +1 -0
- package/dist/adapters/trpc/router.d.ts +397 -9
- package/dist/adapters/trpc/router.js +237 -13
- package/dist/adapters/trpc/router.js.map +1 -1
- package/dist/adapters/web-push/web-push.d.ts +9 -0
- package/dist/adapters/web-push/web-push.js +70 -0
- package/dist/adapters/web-push/web-push.js.map +1 -0
- package/dist/adapters/webhooks/allowed-lookup.d.ts +14 -0
- package/dist/adapters/webhooks/allowed-lookup.js +28 -0
- package/dist/adapters/webhooks/allowed-lookup.js.map +1 -0
- package/dist/adapters/webhooks/host-resolver.d.ts +3 -0
- package/dist/adapters/webhooks/host-resolver.js +13 -0
- package/dist/adapters/webhooks/host-resolver.js.map +1 -0
- package/dist/adapters/webhooks/webhook-poster.d.ts +6 -0
- package/dist/adapters/webhooks/webhook-poster.js +67 -0
- package/dist/adapters/webhooks/webhook-poster.js.map +1 -0
- package/dist/app.d.ts +12 -0
- package/dist/app.js +273 -14
- package/dist/app.js.map +1 -1
- package/dist/bin/aeolus-gateway.js +3 -0
- package/dist/bin/aeolus-gateway.js.map +1 -1
- package/dist/config.d.ts +14 -0
- package/dist/config.js +24 -0
- package/dist/config.js.map +1 -1
- package/dist/core/a2a-in/authenticate-a2a-client.d.ts +23 -0
- package/dist/core/a2a-in/authenticate-a2a-client.js +21 -0
- package/dist/core/a2a-in/authenticate-a2a-client.js.map +1 -0
- package/dist/core/a2a-in/deliver-pushes.d.ts +24 -0
- package/dist/core/a2a-in/deliver-pushes.js +48 -0
- package/dist/core/a2a-in/deliver-pushes.js.map +1 -0
- package/dist/core/a2a-in/find-reached-ship.d.ts +18 -0
- package/dist/core/a2a-in/find-reached-ship.js +20 -0
- package/dist/core/a2a-in/find-reached-ship.js.map +1 -0
- package/dist/core/a2a-in/follow-a2a-task.d.ts +25 -0
- package/dist/core/a2a-in/follow-a2a-task.js +23 -0
- package/dist/core/a2a-in/follow-a2a-task.js.map +1 -0
- package/dist/core/a2a-in/inbound-message.d.ts +30 -0
- package/dist/core/a2a-in/inbound-message.js +33 -0
- package/dist/core/a2a-in/inbound-message.js.map +1 -0
- package/dist/core/a2a-in/list-a2a-tasks.d.ts +18 -0
- package/dist/core/a2a-in/list-a2a-tasks.js +14 -0
- package/dist/core/a2a-in/list-a2a-tasks.js.map +1 -0
- package/dist/core/a2a-in/list-push-configs.d.ts +20 -0
- package/dist/core/a2a-in/list-push-configs.js +18 -0
- package/dist/core/a2a-in/list-push-configs.js.map +1 -0
- package/dist/core/a2a-in/list-reached-ships.d.ts +25 -0
- package/dist/core/a2a-in/list-reached-ships.js +22 -0
- package/dist/core/a2a-in/list-reached-ships.js.map +1 -0
- package/dist/core/a2a-in/notice-task-changes.d.ts +19 -0
- package/dist/core/a2a-in/notice-task-changes.js +17 -0
- package/dist/core/a2a-in/notice-task-changes.js.map +1 -0
- package/dist/core/a2a-in/ports.d.ts +124 -0
- package/dist/core/a2a-in/ports.js +2 -0
- package/dist/core/a2a-in/ports.js.map +1 -0
- package/dist/core/a2a-in/push-config-view.d.ts +8 -0
- package/dist/core/a2a-in/push-config-view.js +2 -0
- package/dist/core/a2a-in/push-config-view.js.map +1 -0
- package/dist/core/a2a-in/push-to-webhooks.d.ts +19 -0
- package/dist/core/a2a-in/push-to-webhooks.js +19 -0
- package/dist/core/a2a-in/push-to-webhooks.js.map +1 -0
- package/dist/core/a2a-in/read-a2a-task.d.ts +12 -0
- package/dist/core/a2a-in/read-a2a-task.js +11 -0
- package/dist/core/a2a-in/read-a2a-task.js.map +1 -0
- package/dist/core/a2a-in/read-push-config.d.ts +16 -0
- package/dist/core/a2a-in/read-push-config.js +14 -0
- package/dist/core/a2a-in/read-push-config.js.map +1 -0
- package/dist/core/a2a-in/remove-push-config.d.ts +15 -0
- package/dist/core/a2a-in/remove-push-config.js +13 -0
- package/dist/core/a2a-in/remove-push-config.js.map +1 -0
- package/dist/core/a2a-in/send-a2a-message.d.ts +34 -0
- package/dist/core/a2a-in/send-a2a-message.js +106 -0
- package/dist/core/a2a-in/send-a2a-message.js.map +1 -0
- package/dist/core/a2a-in/set-push-config.d.ts +30 -0
- package/dist/core/a2a-in/set-push-config.js +27 -0
- package/dist/core/a2a-in/set-push-config.js.map +1 -0
- package/dist/core/a2a-in/subscribe-to-a2a-task.d.ts +18 -0
- package/dist/core/a2a-in/subscribe-to-a2a-task.js +17 -0
- package/dist/core/a2a-in/subscribe-to-a2a-task.js.map +1 -0
- package/dist/core/a2a-in/task-view.d.ts +51 -0
- package/dist/core/a2a-in/task-view.js +49 -0
- package/dist/core/a2a-in/task-view.js.map +1 -0
- package/dist/core/a2a-in/webhook-address.d.ts +7 -0
- package/dist/core/a2a-in/webhook-address.js +17 -0
- package/dist/core/a2a-in/webhook-address.js.map +1 -0
- package/dist/core/a2a-in/webhook.d.ts +6 -0
- package/dist/core/a2a-in/webhook.js +80 -0
- package/dist/core/a2a-in/webhook.js.map +1 -0
- package/dist/core/a2a-out/agent-endpoint.d.ts +10 -0
- package/dist/core/a2a-out/agent-endpoint.js +10 -0
- package/dist/core/a2a-out/agent-endpoint.js.map +1 -0
- package/dist/core/a2a-out/agent-event.d.ts +41 -0
- package/dist/core/a2a-out/agent-event.js +64 -0
- package/dist/core/a2a-out/agent-event.js.map +1 -0
- package/dist/core/a2a-out/agent-message.d.ts +36 -0
- package/dist/core/a2a-out/agent-message.js +36 -0
- package/dist/core/a2a-out/agent-message.js.map +1 -0
- package/dist/core/a2a-out/agent-statement.d.ts +10 -0
- package/dist/core/a2a-out/agent-statement.js +45 -0
- package/dist/core/a2a-out/agent-statement.js.map +1 -0
- package/dist/core/a2a-out/follow-agent-task.d.ts +40 -0
- package/dist/core/a2a-out/follow-agent-task.js +125 -0
- package/dist/core/a2a-out/follow-agent-task.js.map +1 -0
- package/dist/core/a2a-out/hand-a2a-message.d.ts +36 -0
- package/dist/core/a2a-out/hand-a2a-message.js +132 -0
- package/dist/core/a2a-out/hand-a2a-message.js.map +1 -0
- package/dist/core/a2a-out/mark-a2a-agent.d.ts +24 -0
- package/dist/core/a2a-out/mark-a2a-agent.js +24 -0
- package/dist/core/a2a-out/mark-a2a-agent.js.map +1 -0
- package/dist/core/a2a-out/ports.d.ts +200 -0
- package/dist/core/a2a-out/ports.js +2 -0
- package/dist/core/a2a-out/ports.js.map +1 -0
- package/dist/core/a2a-out/read-agent-statement.d.ts +13 -0
- package/dist/core/a2a-out/read-agent-statement.js +13 -0
- package/dist/core/a2a-out/read-agent-statement.js.map +1 -0
- package/dist/core/a2a-out/run-a2a-agent.d.ts +26 -0
- package/dist/core/a2a-out/run-a2a-agent.js +46 -0
- package/dist/core/a2a-out/run-a2a-agent.js.map +1 -0
- package/dist/core/a2a-out/state-a2a-agent.d.ts +26 -0
- package/dist/core/a2a-out/state-a2a-agent.js +31 -0
- package/dist/core/a2a-out/state-a2a-agent.js.map +1 -0
- package/dist/core/mcp-in/call-tool.js +2 -0
- package/dist/core/mcp-in/call-tool.js.map +1 -1
- package/dist/core/mcp-in/client-call.d.ts +35 -4
- package/dist/core/mcp-in/client-call.js +57 -10
- package/dist/core/mcp-in/client-call.js.map +1 -1
- package/dist/core/mcp-in/collect-replies.d.ts +4 -3
- package/dist/core/mcp-in/collect-replies.js +4 -0
- package/dist/core/mcp-in/collect-replies.js.map +1 -1
- package/dist/core/mcp-in/ports.d.ts +52 -3
- package/dist/core/mcp-out/hand-call.d.ts +5 -1
- package/dist/core/mcp-out/hand-call.js +9 -1
- package/dist/core/mcp-out/hand-call.js.map +1 -1
- package/dist/core/mcp-out/run-party.d.ts +29 -7
- package/dist/core/mcp-out/run-party.js +14 -6
- package/dist/core/mcp-out/run-party.js.map +1 -1
- package/dist/core/mcp-out/state-party.d.ts +4 -2
- package/dist/core/mcp-out/state-party.js +10 -3
- package/dist/core/mcp-out/state-party.js.map +1 -1
- package/dist/core/mcp-out/statement.d.ts +2 -1
- package/dist/core/mcp-out/statement.js.map +1 -1
- package/dist/core/oauth/exchange-id-jag.d.ts +28 -0
- package/dist/core/oauth/exchange-id-jag.js +66 -0
- package/dist/core/oauth/exchange-id-jag.js.map +1 -0
- package/dist/core/oauth/exchange-token.d.ts +25 -11
- package/dist/core/oauth/exchange-token.js +50 -3
- package/dist/core/oauth/exchange-token.js.map +1 -1
- package/dist/core/oauth/ports.d.ts +17 -6
- package/dist/core/oauth/register-client.js +1 -1
- package/dist/core/oauth/register-client.js.map +1 -1
- package/dist/core/parties/add-a2a-agent.d.ts +34 -0
- package/dist/core/parties/add-a2a-agent.js +45 -0
- package/dist/core/parties/add-a2a-agent.js.map +1 -0
- package/dist/core/parties/add-a2a-client.d.ts +30 -0
- package/dist/core/parties/add-a2a-client.js +47 -0
- package/dist/core/parties/add-a2a-client.js.map +1 -0
- package/dist/core/parties/add-client-party.d.ts +38 -0
- package/dist/core/parties/add-client-party.js +40 -0
- package/dist/core/parties/add-client-party.js.map +1 -0
- package/dist/core/parties/approve-party.d.ts +43 -2
- package/dist/core/parties/approve-party.js +9 -5
- package/dist/core/parties/approve-party.js.map +1 -1
- package/dist/core/parties/approver.d.ts +7 -0
- package/dist/core/parties/approver.js +9 -0
- package/dist/core/parties/approver.js.map +1 -0
- package/dist/core/parties/check-server.d.ts +2 -1
- package/dist/core/parties/check-server.js +1 -1
- package/dist/core/parties/check-server.js.map +1 -1
- package/dist/core/parties/crew-party.d.ts +18 -4
- package/dist/core/parties/crew-party.js +36 -4
- package/dist/core/parties/crew-party.js.map +1 -1
- package/dist/core/parties/party.d.ts +23 -1
- package/dist/core/parties/party.js +17 -4
- package/dist/core/parties/party.js.map +1 -1
- package/dist/core/parties/ports.d.ts +16 -0
- package/dist/core/parties/read-party-tools.d.ts +4 -3
- package/dist/core/parties/read-party-tools.js +4 -2
- package/dist/core/parties/read-party-tools.js.map +1 -1
- package/dist/core/parties/shown-party.d.ts +8 -0
- package/dist/core/parties/shown-party.js +4 -0
- package/dist/core/parties/shown-party.js.map +1 -1
- package/dist/core/parties/switch-tool.d.ts +29 -0
- package/dist/core/parties/switch-tool.js +33 -0
- package/dist/core/parties/switch-tool.js.map +1 -0
- package/dist/core/parties/tool-switches.d.ts +27 -0
- package/dist/core/parties/tool-switches.js +17 -0
- package/dist/core/parties/tool-switches.js.map +1 -0
- package/dist/core/people/answer-delivery.d.ts +2 -1
- package/dist/core/people/answer-delivery.js.map +1 -1
- package/dist/core/people/done-delivery.d.ts +2 -1
- package/dist/core/people/done-delivery.js.map +1 -1
- package/dist/core/people/focus-page.d.ts +18 -0
- package/dist/core/people/focus-page.js +20 -0
- package/dist/core/people/focus-page.js.map +1 -0
- package/dist/core/people/open-delivery.d.ts +3 -1
- package/dist/core/people/open-delivery.js +2 -0
- package/dist/core/people/open-delivery.js.map +1 -1
- package/dist/core/people/opened-of.d.ts +7 -2
- package/dist/core/people/opened-of.js +6 -1
- package/dist/core/people/opened-of.js.map +1 -1
- package/dist/core/people/person-crew.d.ts +2 -0
- package/dist/core/people/person-crew.js +6 -2
- package/dist/core/people/person-crew.js.map +1 -1
- package/dist/core/people/ports.d.ts +151 -3
- package/dist/core/people/read-wake-channels.d.ts +42 -0
- package/dist/core/people/read-wake-channels.js +21 -0
- package/dist/core/people/read-wake-channels.js.map +1 -0
- package/dist/core/people/turn-email-channel.d.ts +21 -0
- package/dist/core/people/turn-email-channel.js +22 -0
- package/dist/core/people/turn-email-channel.js.map +1 -0
- package/dist/core/people/turn-off-web-push.d.ts +13 -0
- package/dist/core/people/turn-off-web-push.js +14 -0
- package/dist/core/people/turn-off-web-push.js.map +1 -0
- package/dist/core/people/turn-on-web-push.d.ts +35 -0
- package/dist/core/people/turn-on-web-push.js +49 -0
- package/dist/core/people/turn-on-web-push.js.map +1 -0
- package/dist/core/people/wait-on-person-ship.d.ts +44 -0
- package/dist/core/people/wait-on-person-ship.js +92 -0
- package/dist/core/people/wait-on-person-ship.js.map +1 -0
- package/dist/core/people/wake-person.d.ts +40 -0
- package/dist/core/people/wake-person.js +74 -0
- package/dist/core/people/wake-person.js.map +1 -0
- package/dist/core/people/web-push-channel.d.ts +17 -0
- package/dist/core/people/web-push-channel.js +35 -0
- package/dist/core/people/web-push-channel.js.map +1 -0
- package/dist/core/requests/decide-request.d.ts +0 -2
- package/dist/core/requests/decide-request.js +3 -6
- package/dist/core/requests/decide-request.js.map +1 -1
- package/dist/core/requests/list-to-decide.js +1 -1
- package/dist/core/requests/list-to-decide.js.map +1 -1
- package/dist/core/shared/errors.d.ts +1 -1
- package/dist/core/shared/errors.js.map +1 -1
- package/dist/core/sign-in/ports.d.ts +13 -0
- package/dist/core/vault/credential.d.ts +6 -2
- package/dist/party-workers.d.ts +9 -1
- package/dist/party-workers.js +37 -5
- package/dist/party-workers.js.map +1 -1
- package/dist/person-waiters.d.ts +30 -0
- package/dist/person-waiters.js +89 -0
- package/dist/person-waiters.js.map +1 -0
- package/package.json +7 -3
- package/src/adapters/prisma/migrations/20261023120000_party_bearer_hash/migration.sql +4 -0
- package/src/adapters/prisma/migrations/20261023130000_client_credentials/migration.sql +5 -0
- package/src/adapters/prisma/migrations/20261023200000_a2a_tasks/migration.sql +20 -0
- package/src/adapters/prisma/migrations/20261023210000_tool_switches/migration.sql +2 -0
- package/src/adapters/prisma/migrations/20261024090000_a2a_pushes/migration.sql +37 -0
- package/src/adapters/prisma/migrations/20261024100000_party_is_repeatable/migration.sql +2 -0
- package/src/adapters/prisma/migrations/20261024110000_a2a_agent_calls/migration.sql +29 -0
- package/src/adapters/prisma/migrations/20261024115000_wakes/migration.sql +17 -0
- package/src/adapters/prisma/migrations/20261024120000_focused_pages/migration.sql +11 -0
- package/src/adapters/prisma/migrations/20261024130000_web_push_subscriptions/migration.sql +14 -0
- package/src/adapters/prisma/schema.prisma +159 -5
- package/web/.next/BUILD_ID +1 -1
- package/web/.next/app-path-routes-manifest.json +3 -0
- package/web/.next/build-manifest.json +27 -3
- package/web/.next/diagnostics/route-bundle-stats.json +75 -42
- package/web/.next/fallback-build-manifest.json +3 -3
- package/web/.next/next-minimal-server.js.nft.json +1 -1
- package/web/.next/next-server.js.nft.json +1 -1
- package/web/.next/prerender-manifest.json +3 -3
- package/web/.next/routes-manifest.json +18 -0
- package/web/.next/server/app/(console)/outside-parties/[name]/change/page/server-reference-manifest.json +23 -3
- package/web/.next/server/app/(console)/outside-parties/[name]/change/page.js +10 -8
- package/web/.next/server/app/(console)/outside-parties/[name]/change/page.js.nft.json +1 -1
- package/web/.next/server/app/(console)/outside-parties/[name]/change/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(console)/outside-parties/[name]/page/server-reference-manifest.json +22 -2
- package/web/.next/server/app/(console)/outside-parties/[name]/page.js +8 -5
- package/web/.next/server/app/(console)/outside-parties/[name]/page.js.nft.json +1 -1
- package/web/.next/server/app/(console)/outside-parties/[name]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(console)/outside-parties/[name]/retire/page/server-reference-manifest.json +23 -3
- package/web/.next/server/app/(console)/outside-parties/[name]/retire/page.js +9 -6
- package/web/.next/server/app/(console)/outside-parties/[name]/retire/page.js.nft.json +1 -1
- package/web/.next/server/app/(console)/outside-parties/[name]/retire/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(console)/outside-parties/add/page/server-reference-manifest.json +26 -6
- package/web/.next/server/app/(console)/outside-parties/add/page.js +10 -5
- package/web/.next/server/app/(console)/outside-parties/add/page.js.nft.json +1 -1
- package/web/.next/server/app/(console)/outside-parties/add/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(console)/outside-parties/add-a2a-agent/page/app-paths-manifest.json +3 -0
- package/web/.next/server/app/(console)/outside-parties/add-a2a-agent/page/build-manifest.json +23 -0
- package/web/.next/server/app/(console)/outside-parties/add-a2a-agent/page/next-font-manifest.json +11 -0
- package/web/.next/server/app/(console)/outside-parties/add-a2a-agent/page/react-loadable-manifest.json +1 -0
- package/web/.next/server/app/(console)/outside-parties/add-a2a-agent/page/server-reference-manifest.json +25 -0
- package/web/.next/server/app/(console)/outside-parties/add-a2a-agent/page.js +20 -0
- package/web/.next/server/app/(console)/outside-parties/add-a2a-agent/page.js.map +5 -0
- package/web/.next/server/app/(console)/outside-parties/add-a2a-agent/page.js.nft.json +1 -0
- package/web/.next/server/app/(console)/outside-parties/add-a2a-agent/page_client-reference-manifest.js +3 -0
- package/web/.next/server/app/(console)/outside-parties/add-a2a-client/page/app-paths-manifest.json +3 -0
- package/web/.next/server/app/(console)/outside-parties/add-a2a-client/page/build-manifest.json +23 -0
- package/web/.next/server/app/(console)/outside-parties/add-a2a-client/page/next-font-manifest.json +11 -0
- package/web/.next/server/app/(console)/outside-parties/add-a2a-client/page/react-loadable-manifest.json +1 -0
- package/web/.next/server/app/(console)/outside-parties/add-a2a-client/page/server-reference-manifest.json +25 -0
- package/web/.next/server/app/(console)/outside-parties/add-a2a-client/page.js +21 -0
- package/web/.next/server/app/(console)/outside-parties/add-a2a-client/page.js.map +5 -0
- package/web/.next/server/app/(console)/outside-parties/add-a2a-client/page.js.nft.json +1 -0
- package/web/.next/server/app/(console)/outside-parties/add-a2a-client/page_client-reference-manifest.js +3 -0
- package/web/.next/server/app/(console)/outside-parties/page/server-reference-manifest.json +2 -2
- package/web/.next/server/app/(console)/outside-parties/page.js +3 -3
- package/web/.next/server/app/(console)/outside-parties/page.js.nft.json +1 -1
- package/web/.next/server/app/(console)/outside-parties/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(console)/overview/changes/route.js +3 -2
- package/web/.next/server/app/(console)/overview/changes/route.js.nft.json +1 -1
- package/web/.next/server/app/(console)/overview/focus/route/app-paths-manifest.json +3 -0
- package/web/.next/server/app/(console)/overview/focus/route/build-manifest.json +12 -0
- package/web/.next/server/app/(console)/overview/focus/route/server-reference-manifest.json +4 -0
- package/web/.next/server/app/(console)/overview/focus/route.js +7 -0
- package/web/.next/server/app/(console)/overview/focus/route.js.map +5 -0
- package/web/.next/server/app/(console)/overview/focus/route.js.nft.json +1 -0
- package/web/.next/server/app/(console)/overview/focus/route_client-reference-manifest.js +3 -0
- package/web/.next/server/app/(console)/overview/page/server-reference-manifest.json +34 -4
- package/web/.next/server/app/(console)/overview/page.js +3 -3
- package/web/.next/server/app/(console)/overview/page.js.nft.json +1 -1
- package/web/.next/server/app/(console)/overview/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(console)/overview/requests/[requestId]/page/server-reference-manifest.json +2 -2
- package/web/.next/server/app/(console)/overview/requests/[requestId]/page.js +2 -2
- package/web/.next/server/app/(console)/overview/requests/[requestId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(console)/overview/requests/[requestId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(console)/parties/page/server-reference-manifest.json +8 -8
- package/web/.next/server/app/(console)/parties/page.js +2 -2
- package/web/.next/server/app/(console)/parties/page.js.nft.json +1 -1
- package/web/.next/server/app/(console)/parties/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(console)/sign-in/failed/page/server-reference-manifest.json +1 -1
- package/web/.next/server/app/(console)/sign-in/failed/page.js +3 -3
- package/web/.next/server/app/(console)/sign-in/failed/page.js.nft.json +1 -1
- package/web/.next/server/app/(console)/sign-in/failed/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/_global-error/page.js +3 -3
- package/web/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/web/.next/server/app/_global-error.html +1 -1
- package/web/.next/server/app/_global-error.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
- package/web/.next/server/app/_not-found/page.js +3 -3
- package/web/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/authorize/failed/page/server-reference-manifest.json +1 -1
- package/web/.next/server/app/authorize/failed/page.js +2 -2
- package/web/.next/server/app/authorize/failed/page.js.nft.json +1 -1
- package/web/.next/server/app/authorize/failed/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/authorize/pick/page/server-reference-manifest.json +1 -1
- package/web/.next/server/app/authorize/pick/page.js +2 -2
- package/web/.next/server/app/authorize/pick/page.js.nft.json +1 -1
- package/web/.next/server/app/authorize/pick/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/authorize/waiting/approval/page/server-reference-manifest.json +1 -1
- package/web/.next/server/app/authorize/waiting/approval/page.js +2 -2
- package/web/.next/server/app/authorize/waiting/approval/page.js.nft.json +1 -1
- package/web/.next/server/app/authorize/waiting/approval/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app-paths-manifest.json +3 -0
- package/web/.next/server/chunks/0b9d__next-internal_server_app_(console)_overview_focus_route_actions_10hgyjvv-6fus.js +3 -0
- package/web/.next/server/chunks/[externals]__0fgpzedhhntg9._.js +3 -0
- package/web/.next/server/chunks/[externals]__0fgpzedhhntg9._.js.map +1 -0
- package/web/.next/server/chunks/{[root-of-the-server]__0k8jiujb_0xtx._.js → [root-of-the-server]__0ykc8bq_c06a1._.js} +22 -22
- package/web/.next/server/chunks/[root-of-the-server]__0ykc8bq_c06a1._.js.map +1 -0
- package/web/.next/server/chunks/_04is-uopj3op9._.js +3 -0
- package/web/.next/server/chunks/_04is-uopj3op9._.js.map +1 -0
- package/web/.next/server/chunks/_1-fw4-pwzazl4._.js +3 -0
- package/web/.next/server/chunks/_1-fw4-pwzazl4._.js.map +1 -0
- package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_outside-parties_[name]_change_page_actions_04td11fxohsfm.js +3 -0
- package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_outside-parties_[name]_change_page_actions_04td11fxohsfm.js.map +1 -0
- package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_outside-parties_[name]_page_actions_0u-45itza1ls7.js +3 -0
- package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_outside-parties_[name]_page_actions_0u-45itza1ls7.js.map +1 -0
- package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_outside-parties_[name]_retire_page_actions_0s7ps6i0ts7v5.js +3 -0
- package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_outside-parties_[name]_retire_page_actions_0s7ps6i0ts7v5.js.map +1 -0
- package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_outside-parties_add-a2a-client_page_actions_0d_wgiu94c32e.js +3 -0
- package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_outside-parties_add-a2a-client_page_actions_0d_wgiu94c32e.js.map +1 -0
- package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_outside-parties_add_page_actions_0yfz_dfn-8uo7.js +3 -0
- package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_outside-parties_add_page_actions_0yfz_dfn-8uo7.js.map +1 -0
- package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_overview_requests_[requestId]_page_actions_0uki9j3mtuz9e.js +1 -1
- package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_overview_requests_[requestId]_page_actions_0uki9j3mtuz9e.js.map +1 -1
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__12_to1hq55n1y._.js → [root-of-the-server]__0-og0bl8lr2xq._.js} +2 -2
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__12_to1hq55n1y._.js.map → [root-of-the-server]__0-og0bl8lr2xq._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__07udzu2zwg_74._.js +3 -0
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__1yydhn6iokbm4._.js.map → [root-of-the-server]__07udzu2zwg_74._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__197il4swfpq1a._.js → [root-of-the-server]__0a68v9ynev4q6._.js} +2 -2
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__197il4swfpq1a._.js.map → [root-of-the-server]__0a68v9ynev4q6._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0k3g0p3t9t0c-._.js +4 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0k3g0p3t9t0c-._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0l2_dk9d4o01n._.js +3 -0
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__1vkw2kvzx6fpw._.js.map → [root-of-the-server]__0l2_dk9d4o01n._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0m57jyae0dn_7._.js +3 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0m57jyae0dn_7._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0n2us07jk-78w._.js +4 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0n2us07jk-78w._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0rr5u24i9tjyc._.js +3 -0
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__1imel8atfb770._.js.map → [root-of-the-server]__0rr5u24i9tjyc._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__10y66e1xx8xiq._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__10y66e1xx8xiq._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__11w36a4le04vy._.js +3 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__11w36a4le04vy._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1dtyycvqa6uht._.js +4 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1dtyycvqa6uht._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1gb-3dttuacyz._.js +3 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1gb-3dttuacyz._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1k25lo5ka4mgd._.js +3 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1k25lo5ka4mgd._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1m9atpy0vkbmj._.js +3 -0
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__0dywrno7zb0r_._.js.map → [root-of-the-server]__1m9atpy0vkbmj._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1n_sq_58wdluh._.js +3 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1n_sq_58wdluh._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1w5swo8gmjyx6._.js +3 -0
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__216xd8otb96uo._.js.map → [root-of-the-server]__1w5swo8gmjyx6._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1wl0vw-n8lbkn._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1yjb00o7x58xv._.js +3 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1yjb00o7x58xv._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_0-lfpqqlgfhzj._.js +3 -0
- package/web/.next/server/chunks/ssr/_0-lfpqqlgfhzj._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_00hfzlqn1og18._.js +1 -1
- package/web/.next/server/chunks/ssr/_00hfzlqn1og18._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_0bhvvyz0q_0ja._.js +4 -0
- package/web/.next/server/chunks/ssr/_0bhvvyz0q_0ja._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_0pyd1_y7w8ngp._.js +1 -1
- package/web/.next/server/chunks/ssr/_0pyd1_y7w8ngp._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_0xickgbbju_9-._.js +1 -1
- package/web/.next/server/chunks/ssr/_0xickgbbju_9-._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_1_wav28san6dm._.js +4 -0
- package/web/.next/server/chunks/ssr/_1_wav28san6dm._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_1pjtire7rqla0._.js +1 -1
- package/web/.next/server/chunks/ssr/_1pjtire7rqla0._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_1qbsmlji34yph._.js +1 -1
- package/web/.next/server/chunks/ssr/_1qbsmlji34yph._.js.map +1 -1
- package/web/.next/server/chunks/ssr/node_modules_1wdusod3fyk3s._.js +3 -0
- package/web/.next/server/chunks/ssr/node_modules_1wdusod3fyk3s._.js.map +1 -0
- package/web/.next/server/chunks/ssr/node_modules_next_08hq6z46rczo0._.js +1 -1
- package/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_08lcy-jnk5o43.js +1 -1
- package/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_08lcy-jnk5o43.js.map +1 -1
- package/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0e8cobt3o_8ur.js +3 -0
- package/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0e8cobt3o_8ur.js.map +1 -0
- package/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0gzed-epom5si.js +3 -0
- package/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0gzed-epom5si.js.map +1 -0
- package/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1bt2ioufqh6fl.js +1 -1
- package/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1bt2ioufqh6fl.js.map +1 -1
- package/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1o0-ipfysjmro.js +1 -1
- package/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1o0-ipfysjmro.js.map +1 -1
- package/web/.next/server/chunks/ssr/web_0-ufi2al5ubig._.js +3 -0
- package/web/.next/server/chunks/ssr/web_0-ufi2al5ubig._.js.map +1 -0
- package/web/.next/server/chunks/ssr/web_0_jk9eione6lx._.js +3 -0
- package/web/.next/server/chunks/ssr/web_0_jk9eione6lx._.js.map +1 -0
- package/web/.next/server/chunks/ssr/web_0wys4l6za8umr._.js +3 -0
- package/web/.next/server/chunks/ssr/web_0wys4l6za8umr._.js.map +1 -0
- package/web/.next/server/chunks/ssr/web_1ga4pbv72m0ad._.js +1 -1
- package/web/.next/server/chunks/ssr/web_1ga4pbv72m0ad._.js.map +1 -1
- package/web/.next/server/chunks/ssr/web__next-internal_server_app_(console)_overview_page_actions_18on1ziyg1nzy.js +1 -1
- package/web/.next/server/chunks/ssr/web__next-internal_server_app_(console)_overview_page_actions_18on1ziyg1nzy.js.map +1 -1
- package/web/.next/server/chunks/ssr/web_app_(console)_parties_page_tsx_0pp63ghly3eyp._.js +1 -1
- package/web/.next/server/chunks/ssr/web_app_(console)_parties_page_tsx_0pp63ghly3eyp._.js.map +1 -1
- package/web/.next/server/chunks/ssr/web_features_085cv0gogrxxf._.js +1 -1
- package/web/.next/server/chunks/ssr/web_features_085cv0gogrxxf._.js.map +1 -1
- package/web/.next/server/chunks/ssr/web_features_0ahlkugj7fu3n._.js +3 -0
- package/web/.next/server/chunks/ssr/web_features_0ahlkugj7fu3n._.js.map +1 -0
- package/web/.next/server/chunks/ssr/web_features_0i_kwiszuiqcp._.js +3 -0
- package/web/.next/server/chunks/ssr/web_features_0i_kwiszuiqcp._.js.map +1 -0
- package/web/.next/server/chunks/ssr/web_features_0xnlgtw8bfqaa._.js +3 -0
- package/web/.next/server/chunks/ssr/web_features_0xnlgtw8bfqaa._.js.map +1 -0
- package/web/.next/server/chunks/ssr/web_features_1--8ungjj--ht._.js +3 -0
- package/web/.next/server/chunks/ssr/web_features_1--8ungjj--ht._.js.map +1 -0
- package/web/.next/server/chunks/ssr/web_features_19v3mlx8c_h1-._.js +3 -0
- package/web/.next/server/chunks/ssr/web_features_19v3mlx8c_h1-._.js.map +1 -0
- package/web/.next/server/chunks/ssr/web_features_1_2m6l73qk7qw._.js +3 -0
- package/web/.next/server/chunks/ssr/web_features_1_2m6l73qk7qw._.js.map +1 -0
- package/web/.next/server/chunks/ssr/web_features_1qq_ruz59ldc9._.js +3 -0
- package/web/.next/server/chunks/ssr/web_features_1qq_ruz59ldc9._.js.map +1 -0
- package/web/.next/server/chunks/ssr/web_features_add-a2a-agent_ui_a2a-agent-form_tsx_0z8t1aalwzyl7._.js +3 -0
- package/web/.next/server/chunks/ssr/web_features_add-a2a-agent_ui_a2a-agent-form_tsx_0z8t1aalwzyl7._.js.map +1 -0
- package/web/.next/server/chunks/ssr/web_features_add-a2a-client_ui_a2a-client-form_tsx_1anv88g385nwe._.js +3 -0
- package/web/.next/server/chunks/ssr/web_features_add-a2a-client_ui_a2a-client-form_tsx_1anv88g385nwe._.js.map +1 -0
- package/web/.next/server/chunks/ssr/web_features_add-server_ui_add-server_tsx_1jnmar5xju49k._.js +1 -1
- package/web/.next/server/chunks/ssr/web_features_add-server_ui_add-server_tsx_1jnmar5xju49k._.js.map +1 -1
- package/web/.next/server/chunks/ssr/web_features_forms_1d1jyea2jni9o._.js +3 -0
- package/web/.next/server/chunks/ssr/web_features_forms_1d1jyea2jni9o._.js.map +1 -0
- package/web/.next/server/chunks/ssr/web_features_forms_form-state_ts_2142hiopykfk1._.js +3 -0
- package/web/.next/server/chunks/ssr/web_features_forms_form-state_ts_2142hiopykfk1._.js.map +1 -0
- package/web/.next/server/chunks/ssr/web_features_forms_ui_credential-fields_tsx_0l-w19zg-7x4b._.js +3 -0
- package/web/.next/server/chunks/ssr/web_features_forms_ui_credential-fields_tsx_0l-w19zg-7x4b._.js.map +1 -0
- package/web/.next/server/chunks/ssr/web_features_frame_ui_gateway-header_tsx_0e9tekx4jf7ng._.js +1 -1
- package/web/.next/server/chunks/ssr/web_features_frame_ui_gateway-header_tsx_0e9tekx4jf7ng._.js.map +1 -1
- package/web/.next/server/chunks/ssr/web_features_outside-parties_ui_switch-card_tsx_1_xnu9bm4tc-_._.js +1 -1
- package/web/.next/server/chunks/ssr/web_features_outside-parties_ui_switch-card_tsx_1_xnu9bm4tc-_._.js.map +1 -1
- package/web/.next/server/chunks/ssr/web_features_outside-party_actions_ts_102ar5pdowf8s._.js +1 -1
- package/web/.next/server/chunks/ssr/web_features_outside-party_actions_ts_102ar5pdowf8s._.js.map +1 -1
- package/web/.next/server/chunks/ssr/web_features_outside-party_ui_20x5u9bhxeehi._.js +3 -0
- package/web/.next/server/chunks/ssr/web_features_outside-party_ui_20x5u9bhxeehi._.js.map +1 -0
- package/web/.next/server/chunks/ssr/web_features_overview_16dyz2ngvs14b._.js +1 -1
- package/web/.next/server/chunks/ssr/web_features_overview_16dyz2ngvs14b._.js.map +1 -1
- package/web/.next/server/chunks/ssr/web_features_overview_hooks_overview-actions_ts_0-wrat07d1y5g._.js +1 -1
- package/web/.next/server/chunks/ssr/web_features_overview_hooks_overview-actions_ts_0-wrat07d1y5g._.js.map +1 -1
- package/web/.next/server/chunks/ssr/web_features_overview_state_1wuk95dw2_whp._.js +3 -0
- package/web/.next/server/chunks/ssr/web_features_overview_state_1wuk95dw2_whp._.js.map +1 -0
- package/web/.next/server/chunks/ssr/web_features_overview_state_decision-panel_tsx_0kpd26ggtr6h_._.js +1 -1
- package/web/.next/server/chunks/ssr/web_features_overview_state_decision-panel_tsx_0kpd26ggtr6h_._.js.map +1 -1
- package/web/.next/server/chunks/ssr/web_features_parties_actions_ts_0r-tbfsig2ty-._.js +1 -1
- package/web/.next/server/chunks/ssr/web_features_parties_actions_ts_0r-tbfsig2ty-._.js.map +1 -1
- package/web/.next/server/middleware-build-manifest.js +27 -3
- package/web/.next/server/next-font-manifest.js +1 -1
- package/web/.next/server/next-font-manifest.json +8 -0
- package/web/.next/server/pages/500.html +1 -1
- package/web/.next/server/preview-props.json +3 -3
- package/web/.next/server/server-reference-manifest.js +1 -1
- package/web/.next/server/server-reference-manifest.json +124 -22
- package/web/.next/static/chunks/00njqo86bx2kb.js +1 -0
- package/web/.next/static/chunks/047i2x2j--shk.css +3 -0
- package/web/.next/static/chunks/0g4cpamshfwmn.js +1 -0
- package/web/.next/static/chunks/0j84uiid6fsim.js +1 -0
- package/web/.next/static/chunks/1aa1d23q1vokr.js +1 -0
- package/web/.next/static/chunks/1jvae6c-4jwji.js +1 -0
- package/web/.next/static/chunks/23ud2e13dn8f4.js +1 -0
- package/web/.next/static/chunks/2_41h3v090ur9.js +1 -0
- package/web/.next/static/chunks/31vy122d9fvme.js +1 -0
- package/web/.next/static/chunks/3apnqdh48__yw.js +1 -0
- package/web/.next/static/chunks/3okm5g88ig1l3.js +1 -0
- package/web/.next/trace +1 -1
- package/web/.next/trace-build +1 -1
- package/web/.next/types/routes.d.ts +5 -2
- package/web/.next/types/validator.ts +44 -0
- package/web/public/wake-worker.js +17 -0
- package/web/.next/server/chunks/[externals]__12s2uxrv8n30f._.js +0 -3
- package/web/.next/server/chunks/[root-of-the-server]__0k8jiujb_0xtx._.js.map +0 -1
- package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_outside-parties_add_page_actions_10eg3jn_qq_u_.js +0 -3
- package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_outside-parties_add_page_actions_10eg3jn_qq_u_.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0-liudmjwlqmo._.js +0 -4
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0-liudmjwlqmo._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0dywrno7zb0r_._.js +0 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0hosi33y5xecr._.js +0 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0hosi33y5xecr._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0k-sy-ven9f2f._.js +0 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0k-sy-ven9f2f._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1imel8atfb770._.js +0 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1rmy72sai5-kh._.js +0 -4
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1rmy72sai5-kh._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1vkw2kvzx6fpw._.js +0 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1yydhn6iokbm4._.js +0 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1yyfc4xf3xa-s._.js +0 -4
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1yyfc4xf3xa-s._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__216xd8otb96uo._.js +0 -3
- package/web/.next/server/chunks/ssr/_080ao10j8x4km._.js +0 -4
- package/web/.next/server/chunks/ssr/_080ao10j8x4km._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_1gb_kwx9jg1et._.js +0 -4
- package/web/.next/server/chunks/ssr/_1gb_kwx9jg1et._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_1ulh8nd8_yv_3._.js +0 -4
- package/web/.next/server/chunks/ssr/_1ulh8nd8_yv_3._.js.map +0 -1
- package/web/.next/server/chunks/ssr/node_modules_next_dist_compiled_@opentelemetry_api_index_1oy1nwhip-98t.js +0 -3
- package/web/.next/server/chunks/ssr/node_modules_next_dist_compiled_@opentelemetry_api_index_1oy1nwhip-98t.js.map +0 -1
- package/web/.next/server/chunks/ssr/web_06ue1l1ujajps._.js +0 -3
- package/web/.next/server/chunks/ssr/web_06ue1l1ujajps._.js.map +0 -1
- package/web/.next/server/chunks/ssr/web_1_rm1ivvp726s._.js +0 -3
- package/web/.next/server/chunks/ssr/web_1_rm1ivvp726s._.js.map +0 -1
- package/web/.next/server/chunks/ssr/web_features_0k3zd1eymtkgq._.js +0 -3
- package/web/.next/server/chunks/ssr/web_features_0k3zd1eymtkgq._.js.map +0 -1
- package/web/.next/server/chunks/ssr/web_features_forms_03k1kg82ux_ee._.js +0 -3
- package/web/.next/server/chunks/ssr/web_features_forms_03k1kg82ux_ee._.js.map +0 -1
- package/web/.next/server/chunks/ssr/web_features_forms_1-88lvs4ivi73._.js +0 -3
- package/web/.next/server/chunks/ssr/web_features_forms_1-88lvs4ivi73._.js.map +0 -1
- package/web/.next/server/chunks/ssr/web_features_forms_15gausi3cpweg._.js +0 -3
- package/web/.next/server/chunks/ssr/web_features_forms_15gausi3cpweg._.js.map +0 -1
- package/web/.next/server/chunks/ssr/web_features_outside-party_ui_outside-party_tsx_06a94oekz1ckq._.js +0 -3
- package/web/.next/server/chunks/ssr/web_features_outside-party_ui_outside-party_tsx_06a94oekz1ckq._.js.map +0 -1
- package/web/.next/server/chunks/ssr/web_features_overview_state_inbox-panel_tsx_03hlegjsc27sb._.js +0 -3
- package/web/.next/server/chunks/ssr/web_features_overview_state_inbox-panel_tsx_03hlegjsc27sb._.js.map +0 -1
- package/web/.next/static/chunks/1l1gmjf-hz7u_.css +0 -3
- package/web/.next/static/chunks/1ma7v1viiz247.js +0 -1
- package/web/.next/static/chunks/1tfvu44eel7g5.js +0 -1
- package/web/.next/static/chunks/2bg4wnfhuftsq.js +0 -1
- package/web/.next/static/chunks/2yplpvvjibfqw.js +0 -1
- package/web/.next/static/chunks/34syicr_5c5u1.js +0 -1
- package/web/.next/static/chunks/43zbq11isnos4.js +0 -1
- /package/web/.next/server/chunks/{[externals]__12s2uxrv8n30f._.js.map → 0b9d__next-internal_server_app_(console)_overview_focus_route_actions_10hgyjvv-6fus.js.map} +0 -0
- /package/web/.next/static/{ESz77-eaR5ViaU4LRqo0i → Az1CqrzgGHMZVR4nw9717}/_buildManifest.js +0 -0
- /package/web/.next/static/{ESz77-eaR5ViaU4LRqo0i → Az1CqrzgGHMZVR4nw9717}/_clientMiddlewareManifest.js +0 -0
- /package/web/.next/static/{ESz77-eaR5ViaU4LRqo0i → Az1CqrzgGHMZVR4nw9717}/_ssgManifest.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../node_modules/next/src/client/components/forbidden.ts","../../../../node_modules/next/src/client/components/hooks-server-context.ts","../../../../node_modules/next/src/client/components/http-access-fallback/http-access-fallback.ts","../../../../node_modules/next/src/client/components/is-next-router-error.ts","../../../../node_modules/next/src/client/components/navigation.react-server.ts","../../../../node_modules/next/src/client/components/not-found.ts","../../../../node_modules/next/src/client/components/readonly-url-search-params.ts","../../../../node_modules/next/src/client/components/redirect-error.ts","../../../../node_modules/next/src/client/components/redirect-status-code.ts","../../../../node_modules/next/src/client/components/redirect.ts","../../../../node_modules/next/src/client/components/server-async-storage.ts","../../../../node_modules/next/src/client/components/static-generation-bailout.ts","../../../../node_modules/next/src/client/components/unauthorized.ts","../../../../node_modules/next/src/client/components/unstable-rethrow.ts","../../../../node_modules/next/dist/compiled/%40edge-runtime/cookies/index.js","../../../../node_modules/next/dist/esm/server/lib/trace/span-store.js","../../../../node_modules/next/dist/esm/server/app-render/async-local-storage.js","../../../../node_modules/next/dist/esm/build/templates/app-route.js","../../../../node_modules/next/dist/esm/server/app-render/dynamic-rendering.js","../../../../node_modules/next/dist/esm/client/components/hooks-server-context.js","../../../../node_modules/next/dist/esm/client/components/static-generation-bailout.js","../../../../node_modules/next/dist/esm/server/lib/clone-response.js","../../../../node_modules/next/dist/esm/server/lib/lru-cache.js","../../../../node_modules/next/dist/esm/lib/picocolors.js","../../../../node_modules/next/dist/esm/shared/lib/i18n/normalize-locale-path.js","../../../../node_modules/next/dist/esm/server/web/spec-extension/cookies.js","../../../../node_modules/next/dist/esm/server/lib/encode-header-safe.js","../../../../node_modules/next/dist/esm/shared/lib/utils/reflect-utils.js","../../../../node_modules/next/dist/esm/server/lib/trace/constants.js","../../../../node_modules/next/dist/esm/client/components/redirect-status-code.js","../../../../node_modules/next/dist/esm/server/normalizers/wrap-normalizer-fn.js","../../../../node_modules/next/dist/esm/lib/framework/boundary-constants.js","../../../../node_modules/next/dist/esm/server/app-render/instant-validation/boundary-constants.js","../../../../node_modules/next/dist/esm/shared/lib/request-insights.js","../../../../node_modules/next/dist/esm/server/response-cache/types.js","../../../../node_modules/next/dist/esm/lib/constants.js","../../../../node_modules/next/dist/esm/shared/lib/promise-with-resolvers.js","../../../../node_modules/next/dist/esm/server/web/error.js","../../../../node_modules/next/dist/esm/server/route-kind.js","../../../../node_modules/next/dist/esm/shared/lib/segment.js","../../../../node_modules/next/dist/esm/shared/lib/server-reference-info.js","../../../../node_modules/next/dist/esm/shared/lib/invariant-error.js","../../../../node_modules/next/dist/esm/server/instrumentation/utils.js","../../../../node_modules/next/dist/esm/shared/lib/i18n/detect-domain-locale.js","../../../../node_modules/next/dist/esm/server/lib/trace/request-insights-identity.js","../../../../node_modules/next/dist/esm/shared/lib/router/utils/cache-busting-search-param.js","../../../../node_modules/next/dist/esm/server/request-meta.js","../../../../node_modules/next/dist/esm/server/lib/cache-control.js","../../../../node_modules/next/dist/esm/server/lib/trace/tracer.js","../../../../node_modules/next/dist/esm/server/lib/trace/request-insights.js","../../../../node_modules/next/dist/esm/build/output/log.js","../../../../node_modules/next/dist/esm/server/base-http/index.js","../../../../node_modules/next/dist/esm/server/app-render/staged-rendering.js","../../../../node_modules/next/dist/esm/server/normalizers/underscore-normalizer.js","../../../../node_modules/next/dist/esm/server/base-http/node.js","../../../../node_modules/next/dist/esm/server/render-result.js","../../../../node_modules/next/dist/esm/shared/lib/router/utils/get-next-pathname-info.js","../../../../node_modules/next/dist/esm/shared/lib/page-path/ensure-leading-slash.js","../../../../node_modules/next/dist/esm/server/api-utils/get-cookie-parser.js","../../../../node_modules/next/dist/esm/server/normalizers/normalizers.js","../../../../node_modules/next/dist/esm/server/web/next-url.js","../../../../node_modules/next/dist/esm/server/dynamic-rendering-utils.js","../../../../node_modules/next/dist/esm/server/web/spec-extension/adapters/next-request.js","../../../../node_modules/next/dist/esm/shared/lib/router/utils/format-next-pathname-info.js","../../../../node_modules/next/dist/esm/server/api-utils/index.js","../../../../node_modules/next/dist/esm/server/web/spec-extension/request.js","../../../../node_modules/next/dist/esm/server/response-cache/utils.js","../../../../node_modules/next/dist/esm/server/pipe-readable.js","../../../../node_modules/next/dist/esm/server/normalizers/built/app/app-pathname-normalizer.js","../../../../node_modules/next/dist/esm/shared/lib/router/utils/parse-path.js","../../../../node_modules/next/dist/esm/shared/lib/router/utils/add-path-prefix.js","../../../../node_modules/next/dist/esm/lib/batcher.js","../../../../node_modules/next/dist/esm/server/lib/dedupe-fetch.js","../../../../node_modules/next/dist/esm/server/lib/route-cache-key.js","../../../../node_modules/next/dist/esm/shared/lib/router/utils/add-path-suffix.js","../../../../node_modules/next/dist/esm/lib/scheduler.js","../../../../node_modules/next/dist/esm/shared/lib/get-hostname.js","../../../../node_modules/next/dist/esm/shared/lib/is-thenable.js","../../../../node_modules/next/dist/esm/shared/lib/router/utils/add-locale.js","../../../../node_modules/next/dist/esm/server/response-cache/index.js","../../../../node_modules/next/dist/esm/shared/lib/router/utils/remove-trailing-slash.js","../../../../node_modules/next/dist/esm/shared/lib/router/utils/path-has-prefix.js","../../../../node_modules/next/dist/esm/server/app-render/manifests-singleton.js","../../../../node_modules/next/dist/esm/shared/lib/router/utils/remove-path-prefix.js","../../../../node_modules/next/dist/esm/server/stream-utils/node-web-streams-helper.js","../../../../node_modules/next/dist/esm/server/send-response.js","../../../../node_modules/next/dist/esm/server/web/utils.js","../../../../node_modules/next/dist/esm/server/base-http/helpers.js","../../../../node_modules/next/dist/esm/shared/lib/page-path/normalize-page-path.js","../../../../node_modules/next/dist/esm/server/lib/patch-fetch.js","../../../../node_modules/next/dist/esm/shared/lib/router/utils/app-paths.js","../../../../node_modules/next/src/lib/framework/boundary-constants.tsx","../../../../node_modules/next/src/lib/scheduler.ts","../../../../node_modules/next/src/server/app-render/blocking-route-messages.ts","../../../../node_modules/next/src/server/app-render/dynamic-rendering.ts","../../../../node_modules/next/src/server/app-render/instant-validation/boundary-constants.ts","../../../../node_modules/next/src/server/app-render/instant-validation/boundary-tracking.tsx","../../../../node_modules/next/src/server/app-render/segment-config/ensure-static.ts","../../../../node_modules/next/src/server/app-render/staged-rendering.ts","../../../../node_modules/next/src/server/create-deduped-by-callsite-server-error-logger.ts","../../../../node_modules/next/src/server/dynamic-rendering-utils.ts","../../../../node_modules/next/src/server/lib/app-dir-module.ts","../../../../node_modules/next/src/server/request/cookies.ts","../../../../node_modules/next/src/server/request/draft-mode.ts","../../../../node_modules/next/src/server/request/headers.ts","../../../../node_modules/next/src/server/request/utils.ts","../../../../node_modules/next/src/server/route-modules/app-page/module.compiled.js","../../../../node_modules/next/src/server/route-modules/app-page/vendored/rsc/react.ts","../../../../node_modules/next/src/server/use-cache/use-cache-messages.ts","../../../../node_modules/next/src/server/web/spec-extension/adapters/headers.ts","../../../../node_modules/next/src/server/web/spec-extension/adapters/reflect.ts","../../../../node_modules/next/src/server/web/spec-extension/adapters/request-cookies.ts","../../../../node_modules/next/src/server/web/spec-extension/cookies.ts","../../../../node_modules/next/src/shared/lib/action-revalidation-kind.ts","../../../../node_modules/next/src/shared/lib/instant-messages.ts","../../../../node_modules/next/src/shared/lib/invariant-error.ts","../../../../node_modules/next/src/shared/lib/lazy-dynamic/bailout-to-csr.ts","../../../../node_modules/next/src/shared/lib/lazy-dynamic/react-browser-bailout.ts","../../../../node_modules/next/src/shared/lib/promise-with-resolvers.ts","../../../../node_modules/next/src/shared/lib/router/utils/parse-loader-tree.ts","../../../../node_modules/next/src/shared/lib/segment.ts","../../../../node_modules/next/dist/api/navigation.react-server.js","../../../../node_modules/zod/v4/core/registries.js","../../../../node_modules/zod/v4/core/core.js","../../../../node_modules/%40trpc/client/dist/objectSpread2-weooBxVk.mjs","../../../../node_modules/zod/v4/core/doc.js","../../../../node_modules/zod/v4/core/versions.js","../../../../node_modules/zod/v4/locales/en.js","../../../../node_modules/zod/v4/core/memoizer.js","../../../../node_modules/zod/v4/core/to-json-schema.js","../../../../node_modules/zod/v4/core/errors.js","../../../../node_modules/%40trpc/server/src/unstable-core-do-not-import/createProxy.ts","../../../../node_modules/zod/v4/classic/parse.js","../../../../node_modules/zod/v4/core/util.js","../../../../web/app/%28console%29/overview/changes/route.ts","../../../../node_modules/zod/v4/core/parse.js","../../../../node_modules/zod/v4/classic/errors.js","../../../../node_modules/%40trpc/client/src/links/internals/createChain.ts","../../../../node_modules/%40trpc/server/src/unstable-core-do-not-import/error/formatter.ts","../../../../node_modules/%40trpc/client/src/getFetch.ts","../../../../node_modules/%40trpc/server/src/observable/observable.ts","../../../../node_modules/zod/v4/core/api.js","../../../../node_modules/zod/v4/core/json-schema-processors.js","../../../../node_modules/%40trpc/client/src/links/loggerLink.ts","../../../../node_modules/%40trpc/server/src/observable/operators.ts","../../../../node_modules/zod/v4/core/checks.js","../../../../node_modules/%40trpc/server/src/unstable-core-do-not-import/http/parseConnectionParams.ts","../../../../node_modules/%40trpc/server/src/unstable-core-do-not-import/utils.ts","../../../../web/lib/gateway-api/page-api.ts","../../../../node_modules/%40trpc/client/src/links/wsLink/wsClient/encoder.ts","../../../../node_modules/zod/v4/core/regexes.js","../../../../node_modules/%40aeolus-fleet/common/src/schemas/account-token.ts","../../../../node_modules/zod/v4/core/schemas.js","../../../../node_modules/%40trpc/client/src/links/internals/contentTypes.ts","../../../../node_modules/%40trpc/client/src/TRPCClientError.ts","../../../../node_modules/zod/v4/classic/schemas.js","../../../../node_modules/%40trpc/server/src/unstable-core-do-not-import/error/TRPCError.ts","../../../../node_modules/%40trpc/client/src/internals/transformer.ts","../../../../node_modules/%40aeolus-fleet/common/src/ids/index.ts","../../../../web/features/overview/hooks/follow-changes.ts","../../../../web/lib/gateway-api/gateway-api.ts","../../../../node_modules/%40trpc/client/src/internals/TRPCUntypedClient.ts","../../../../node_modules/%40trpc/client/src/links/wsLink/wsClient/options.ts","../../../../node_modules/%40trpc/client/src/links/httpLink.ts","../../../../node_modules/%40aeolus-fleet/common/src/fleet/index.ts","../../../../web/lib/gateway-api/page-account.ts","../../../../node_modules/%40trpc/client/src/internals/signals.ts","../../../../node_modules/%40trpc/client/src/links/splitLink.ts","../../../../node_modules/%40trpc/client/src/internals/dataLoader.ts","../../../../node_modules/%40trpc/server/src/unstable-core-do-not-import/http/contentType.ts","../../../../node_modules/%40trpc/client/src/links/internals/urlWithConnectionParams.ts","../../../../node_modules/%40trpc/client/src/links/wsLink/wsClient/utils.ts","../../../../node_modules/%40trpc/server/src/unstable-core-do-not-import/transformer.ts","../../../../node_modules/%40trpc/server/src/unstable-core-do-not-import/http/getHTTPStatusCode.ts","../../../../node_modules/%40trpc/client/src/links/internals/httpUtils.ts","../../../../node_modules/%40trpc/server/src/unstable-core-do-not-import/rpc/codes.ts","../../../../node_modules/%40trpc/client/src/createTRPCUntypedClient.ts","../../../../node_modules/%40trpc/client/src/createTRPCClient.ts","../../../../node_modules/%40trpc/client/src/links/httpBatchLink.ts","../../../../node_modules/%40trpc/client/src/links/wsLink/wsClient/requestManager.ts","../../../../node_modules/%40trpc/server/src/unstable-core-do-not-import/router.ts","../../../../node_modules/%40trpc/server/src/observable/behaviorSubject.ts","../../../../node_modules/%40trpc/client/src/links/httpBatchStreamLink.ts","../../../../node_modules/%40trpc/server/src/unstable-core-do-not-import/error/getErrorShape.ts","../../../../node_modules/%40trpc/client/src/links/wsLink/wsClient/wsConnection.ts","../../../../node_modules/%40trpc/server/src/unstable-core-do-not-import/http/abortError.ts","../../../../node_modules/%40trpc/server/src/vendor/is-plain-object.ts","../../../../node_modules/%40trpc/client/src/internals/inputWithTrackedEventId.ts","../../../../node_modules/%40trpc/server/src/vendor/unpromise/unpromise.ts","../../../../node_modules/%40trpc/client/src/links/httpSubscriptionLink.ts","../../../../node_modules/%40trpc/server/src/unstable-core-do-not-import/stream/tracked.ts","../../../../node_modules/%40trpc/client/src/links/wsLink/wsClient/wsClient.ts","../../../../node_modules/%40trpc/client/src/links/retryLink.ts","../../../../node_modules/%40trpc/server/src/unstable-core-do-not-import/stream/utils/disposable.ts","../../../../node_modules/%40trpc/server/src/unstable-core-do-not-import/stream/utils/timerResource.ts","../../../../node_modules/%40trpc/client/src/links/wsLink/createWsClient.ts","../../../../node_modules/%40trpc/client/src/links/wsLink/wsLink.ts","../../../../node_modules/%40trpc/client/src/links/localLink.ts","../../../../node_modules/%40trpc/server/src/unstable-core-do-not-import/stream/utils/asyncIterable.ts","../../../../node_modules/%40trpc/server/src/unstable-core-do-not-import/stream/utils/createDeferred.ts","../../../../node_modules/%40trpc/server/src/unstable-core-do-not-import/stream/utils/mergeAsyncIterables.ts","../../../../node_modules/%40trpc/server/src/unstable-core-do-not-import/stream/utils/readableStreamFrom.ts","../../../../node_modules/%40trpc/server/src/unstable-core-do-not-import/stream/utils/withPing.ts","../../../../node_modules/%40trpc/server/src/unstable-core-do-not-import/stream/jsonl.ts","../../../../node_modules/%40trpc/server/src/unstable-core-do-not-import/stream/sse.ts","../../../../node_modules/%40trpc/server/src/unstable-core-do-not-import/http/resolveResponse.ts","../../../../node_modules/next/dist/compiled/%40opentelemetry/api/index.js","../../../../node_modules/next/dist/compiled/cookie/index.js","../../../../node_modules/next/src/server/route-modules/app-route/module.compiled.js","../../../../node_modules/next/headers.js"],"sourcesContent":["import {\n HTTP_ERROR_FALLBACK_ERROR_CODE,\n type HTTPAccessFallbackError,\n} from './http-access-fallback/http-access-fallback'\n\n// TODO: Add `forbidden` docs\n/**\n * @experimental\n * This function allows you to render the [forbidden.js file](https://nextjs.org/docs/app/api-reference/file-conventions/forbidden)\n * within a route segment as well as inject a tag.\n *\n * `forbidden()` can be used in\n * [Server Components](https://nextjs.org/docs/app/building-your-application/rendering/server-components),\n * [Route Handlers](https://nextjs.org/docs/app/building-your-application/routing/route-handlers), and\n * [Server Actions](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations).\n *\n * Read more: [Next.js Docs: `forbidden`](https://nextjs.org/docs/app/api-reference/functions/forbidden)\n */\n\nconst DIGEST = `${HTTP_ERROR_FALLBACK_ERROR_CODE};403`\n\nexport function forbidden(): never {\n if (!process.env.__NEXT_EXPERIMENTAL_AUTH_INTERRUPTS) {\n throw new Error(\n `\\`forbidden()\\` is experimental and only allowed to be enabled when \\`experimental.authInterrupts\\` is enabled.`\n )\n }\n\n const error = new Error(DIGEST) as HTTPAccessFallbackError\n ;(error as HTTPAccessFallbackError).digest = DIGEST\n throw error\n}\n","const DYNAMIC_ERROR_CODE = 'DYNAMIC_SERVER_USAGE'\n\nexport class DynamicServerError extends Error {\n digest: typeof DYNAMIC_ERROR_CODE = DYNAMIC_ERROR_CODE\n\n constructor(public readonly description: string) {\n super(`Dynamic server usage: ${description}`)\n }\n}\n\nexport function isDynamicServerError(err: unknown): err is DynamicServerError {\n if (\n typeof err !== 'object' ||\n err === null ||\n !('digest' in err) ||\n typeof err.digest !== 'string'\n ) {\n return false\n }\n\n return err.digest === DYNAMIC_ERROR_CODE\n}\n","export const HTTPAccessErrorStatus = {\n NOT_FOUND: 404,\n FORBIDDEN: 403,\n UNAUTHORIZED: 401,\n}\n\nconst ALLOWED_CODES = new Set(Object.values(HTTPAccessErrorStatus))\n\nexport const HTTP_ERROR_FALLBACK_ERROR_CODE = 'NEXT_HTTP_ERROR_FALLBACK'\n\nexport type HTTPAccessFallbackError = Error & {\n digest: `${typeof HTTP_ERROR_FALLBACK_ERROR_CODE};${string}`\n}\n\n/**\n * Checks an error to determine if it's an error generated by\n * the HTTP navigation APIs `notFound()`, `forbidden()` or `unauthorized()`.\n *\n * @param error the error that may reference a HTTP access error\n * @returns true if the error is a HTTP access error\n */\nexport function isHTTPAccessFallbackError(\n error: unknown\n): error is HTTPAccessFallbackError {\n if (\n typeof error !== 'object' ||\n error === null ||\n !('digest' in error) ||\n typeof error.digest !== 'string'\n ) {\n return false\n }\n const [prefix, httpStatus] = error.digest.split(';')\n\n return (\n prefix === HTTP_ERROR_FALLBACK_ERROR_CODE &&\n ALLOWED_CODES.has(Number(httpStatus))\n )\n}\n\nexport function getAccessFallbackHTTPStatus(\n error: HTTPAccessFallbackError\n): number {\n const httpStatus = error.digest.split(';')[1]\n return Number(httpStatus)\n}\n\nexport function getAccessFallbackErrorTypeByStatus(\n status: number\n): 'not-found' | 'forbidden' | 'unauthorized' | undefined {\n switch (status) {\n case 401:\n return 'unauthorized'\n case 403:\n return 'forbidden'\n case 404:\n return 'not-found'\n default:\n return\n }\n}\n","import {\n isHTTPAccessFallbackError,\n type HTTPAccessFallbackError,\n} from './http-access-fallback/http-access-fallback'\nimport { isRedirectError, type RedirectError } from './redirect-error'\n\n/**\n * Returns true if the error is a navigation signal error. These errors are\n * thrown by user code to perform navigation operations and interrupt the React\n * render.\n */\nexport function isNextRouterError(\n error: unknown\n): error is RedirectError | HTTPAccessFallbackError {\n return isRedirectError(error) || isHTTPAccessFallbackError(error)\n}\n","import { ReadonlyURLSearchParams } from './readonly-url-search-params'\n\nexport function unstable_isUnrecognizedActionError(): boolean {\n throw new Error(\n '`unstable_isUnrecognizedActionError` can only be used on the client.'\n )\n}\n\nexport { redirect, permanentRedirect } from './redirect'\nexport { notFound } from './not-found'\nexport { forbidden } from './forbidden'\nexport { unauthorized } from './unauthorized'\nexport { unstable_rethrow } from './unstable-rethrow'\nexport { ReadonlyURLSearchParams }\n\nexport const RedirectType = {\n push: 'push',\n replace: 'replace',\n} as const\n","import {\n HTTP_ERROR_FALLBACK_ERROR_CODE,\n type HTTPAccessFallbackError,\n} from './http-access-fallback/http-access-fallback'\n\n/**\n * This function allows you to render the [not-found.js file](https://nextjs.org/docs/app/api-reference/file-conventions/not-found)\n * within a route segment as well as inject a tag.\n *\n * `notFound()` can be used in\n * [Server Components](https://nextjs.org/docs/app/building-your-application/rendering/server-components),\n * [Route Handlers](https://nextjs.org/docs/app/building-your-application/routing/route-handlers), and\n * [Server Actions](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations).\n *\n * - In a Server Component, this will insert a `<meta name=\"robots\" content=\"noindex\" />` meta tag and set the status code to 404.\n * - In a Route Handler or Server Action, it will serve a 404 to the caller.\n *\n * Read more: [Next.js Docs: `notFound`](https://nextjs.org/docs/app/api-reference/functions/not-found)\n */\n\nconst DIGEST = `${HTTP_ERROR_FALLBACK_ERROR_CODE};404`\n\nexport function notFound(): never {\n const error = new Error(DIGEST) as HTTPAccessFallbackError\n ;(error as HTTPAccessFallbackError).digest = DIGEST\n\n throw error\n}\n","/**\n * ReadonlyURLSearchParams implementation shared between client and server.\n * This file is intentionally not marked as 'use client' or 'use server'\n * so it can be imported by both environments.\n */\n\n/** @internal */\nclass ReadonlyURLSearchParamsError extends Error {\n constructor() {\n super(\n 'Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams'\n )\n }\n}\n\n/**\n * A read-only version of URLSearchParams that throws errors when mutation methods are called.\n * This ensures that the URLSearchParams returned by useSearchParams() cannot be mutated.\n */\nexport class ReadonlyURLSearchParams extends URLSearchParams {\n /** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams */\n append() {\n throw new ReadonlyURLSearchParamsError()\n }\n /** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams */\n delete() {\n throw new ReadonlyURLSearchParamsError()\n }\n /** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams */\n set() {\n throw new ReadonlyURLSearchParamsError()\n }\n /** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams */\n sort() {\n throw new ReadonlyURLSearchParamsError()\n }\n}\n","import { RedirectStatusCode } from './redirect-status-code'\n\nexport const REDIRECT_ERROR_CODE = 'NEXT_REDIRECT'\n\nexport type RedirectType = 'push' | 'replace'\n\nexport type RedirectError = Error & {\n digest: `${typeof REDIRECT_ERROR_CODE};${RedirectType};${string};${RedirectStatusCode};`\n}\n\n/**\n * Checks an error to determine if it's an error generated by the\n * `redirect(url)` helper.\n *\n * @param error the error that may reference a redirect error\n * @returns true if the error is a redirect error\n */\nexport function isRedirectError(error: unknown): error is RedirectError {\n if (\n typeof error !== 'object' ||\n error === null ||\n !('digest' in error) ||\n typeof error.digest !== 'string'\n ) {\n return false\n }\n\n const digest = error.digest.split(';')\n const [errorCode, type] = digest\n const destination = digest.slice(2, -2).join(';')\n const status = digest.at(-2)\n\n const statusCode = Number(status)\n\n return (\n errorCode === REDIRECT_ERROR_CODE &&\n (type === 'replace' || type === 'push') &&\n typeof destination === 'string' &&\n !isNaN(statusCode) &&\n statusCode in RedirectStatusCode\n )\n}\n","export enum RedirectStatusCode {\n SeeOther = 303,\n TemporaryRedirect = 307,\n PermanentRedirect = 308,\n}\n","import { RedirectStatusCode } from './redirect-status-code'\nimport {\n type RedirectType,\n type RedirectError,\n isRedirectError,\n REDIRECT_ERROR_CODE,\n} from './redirect-error'\nimport { actionAsyncStorage } from './server-async-storage'\n\nexport function getRedirectError(\n url: string,\n type: RedirectType,\n statusCode: RedirectStatusCode = RedirectStatusCode.TemporaryRedirect\n): RedirectError {\n const error = new Error(REDIRECT_ERROR_CODE) as RedirectError\n error.digest = `${REDIRECT_ERROR_CODE};${type};${url};${statusCode};`\n return error\n}\n\n/**\n * This function allows you to redirect the user to another URL. It can be used in\n * [Server Components](https://nextjs.org/docs/app/building-your-application/rendering/server-components),\n * [Route Handlers](https://nextjs.org/docs/app/building-your-application/routing/route-handlers), and\n * [Server Actions](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations).\n *\n * - In a Server Component, this will insert a meta tag to redirect the user to the target page.\n * - In a Route Handler, it will serve a 307 to the caller.\n * - In a Server Action, it will perform a client-side navigation when JavaScript is available or serve a 303 for a progressive enhancement form submission.\n * - In a Server Action, type defaults to 'push' and 'replace' elsewhere.\n *\n * Read more: [Next.js Docs: `redirect`](https://nextjs.org/docs/app/api-reference/functions/redirect)\n */\nexport function redirect(\n /** The URL to redirect to */\n url: string,\n type?: RedirectType\n): never {\n type ??= actionAsyncStorage?.getStore()?.isAction ? 'push' : 'replace'\n\n throw getRedirectError(url, type, RedirectStatusCode.TemporaryRedirect)\n}\n\n/**\n * This function allows you to redirect the user to another URL. It can be used in\n * [Server Components](https://nextjs.org/docs/app/building-your-application/rendering/server-components),\n * [Route Handlers](https://nextjs.org/docs/app/building-your-application/routing/route-handlers), and\n * [Server Actions](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations).\n *\n * - In a Server Component, this will insert a meta tag to redirect the user to the target page.\n * - In a Route Handler, it will serve a 308 to the caller.\n * - In a Server Action, it will perform a client-side navigation when JavaScript is available or serve a 303 for a progressive enhancement form submission.\n *\n * Read more: [Next.js Docs: `redirect`](https://nextjs.org/docs/app/api-reference/functions/redirect)\n */\nexport function permanentRedirect(\n /** The URL to redirect to */\n url: string,\n type: RedirectType = 'replace'\n): never {\n throw getRedirectError(url, type, RedirectStatusCode.PermanentRedirect)\n}\n\n/**\n * Returns the encoded URL from the error if it's a RedirectError, null\n * otherwise. Note that this does not validate the URL returned.\n *\n * @param error the error that may be a redirect error\n * @return the url if the error was a redirect error\n */\nexport function getURLFromRedirectError(error: RedirectError): string\nexport function getURLFromRedirectError(error: unknown): string | null {\n if (!isRedirectError(error)) return null\n\n // Slices off the beginning of the digest that contains the code and the\n // separating ';'.\n return error.digest.split(';').slice(2, -2).join(';')\n}\n\nexport function getRedirectTypeFromError(error: RedirectError): RedirectType {\n if (!isRedirectError(error)) {\n throw new Error('Not a redirect error')\n }\n\n return error.digest.split(';', 2)[1] as RedirectType\n}\n\nexport function getRedirectStatusCodeFromError(error: RedirectError): number {\n if (!isRedirectError(error)) {\n throw new Error('Not a redirect error')\n }\n\n return Number(error.digest.split(';').at(-2))\n}\n","// Client-safe access to the server-only async-storage singletons. On the\n// server these re-export the real storages; in the browser bundle this module\n// is aliased to `./server-async-storage.browser` (see\n// scripts/generate-browser-variant-aliases.mjs), which exports `undefined`\n// stubs so the AsyncLocalStorage modules are never bundled into the client.\n// Consumers must guard usage so the stubs are not dereferenced in the browser.\nexport { actionAsyncStorage } from '../../server/app-render/action-async-storage.external'\nexport { workAsyncStorage } from '../../server/app-render/work-async-storage.external'\nexport { workUnitAsyncStorage } from '../../server/app-render/work-unit-async-storage.external'\n","const NEXT_STATIC_GEN_BAILOUT = 'NEXT_STATIC_GEN_BAILOUT'\n\nexport class StaticGenBailoutError extends Error {\n public readonly code = NEXT_STATIC_GEN_BAILOUT\n}\n\nexport function isStaticGenBailoutError(\n error: unknown\n): error is StaticGenBailoutError {\n if (typeof error !== 'object' || error === null || !('code' in error)) {\n return false\n }\n\n return error.code === NEXT_STATIC_GEN_BAILOUT\n}\n","import {\n HTTP_ERROR_FALLBACK_ERROR_CODE,\n type HTTPAccessFallbackError,\n} from './http-access-fallback/http-access-fallback'\n\n// TODO: Add `unauthorized` docs\n/**\n * @experimental\n * This function allows you to render the [unauthorized.js file](https://nextjs.org/docs/app/api-reference/file-conventions/unauthorized)\n * within a route segment as well as inject a tag.\n *\n * `unauthorized()` can be used in\n * [Server Components](https://nextjs.org/docs/app/building-your-application/rendering/server-components),\n * [Route Handlers](https://nextjs.org/docs/app/building-your-application/routing/route-handlers), and\n * [Server Actions](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations).\n *\n *\n * Read more: [Next.js Docs: `unauthorized`](https://nextjs.org/docs/app/api-reference/functions/unauthorized)\n */\n\nconst DIGEST = `${HTTP_ERROR_FALLBACK_ERROR_CODE};401`\n\nexport function unauthorized(): never {\n if (!process.env.__NEXT_EXPERIMENTAL_AUTH_INTERRUPTS) {\n throw new Error(\n `\\`unauthorized()\\` is experimental and only allowed to be used when \\`experimental.authInterrupts\\` is enabled.`\n )\n }\n\n const error = new Error(DIGEST) as HTTPAccessFallbackError\n ;(error as HTTPAccessFallbackError).digest = DIGEST\n throw error\n}\n","import { isHangingPromiseRejectionError } from '../../server/dynamic-rendering-utils'\nimport { isBailoutToCSRError } from '../../shared/lib/lazy-dynamic/bailout-to-csr'\nimport { isNextRouterError } from './is-next-router-error'\nimport { isPrerenderInterruptedError } from '../../server/app-render/dynamic-rendering'\nimport { isDynamicServerError } from './hooks-server-context'\n\n/**\n * This function should be used to rethrow internal Next.js errors so that they can be handled by the framework.\n * When wrapping an API that uses errors to interrupt control flow, you should use this function before you do any error handling.\n * This function will rethrow the error if it is a Next.js error so it can be handled, otherwise it will do nothing.\n *\n * In the browser bundle this module is aliased to `./unstable-rethrow.browser`, which performs a\n * subset of these checks (the server-only ones can never occur in the browser). This default\n * module holds the full server logic and is used on every server runtime (Node, edge) and in any\n * context where the alias does not apply.\n *\n * Read more: [Next.js Docs: `unstable_rethrow`](https://nextjs.org/docs/app/api-reference/functions/unstable_rethrow)\n */\nexport function unstable_rethrow(error: unknown): void {\n if (\n isNextRouterError(error) ||\n isBailoutToCSRError(error) ||\n isDynamicServerError(error) ||\n isHangingPromiseRejectionError(error) ||\n isPrerenderInterruptedError(error)\n ) {\n throw error\n }\n\n if (error instanceof Error && 'cause' in error) {\n unstable_rethrow(error.cause)\n }\n}\n","\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/index.ts\nvar src_exports = {};\n__export(src_exports, {\n RequestCookies: () => RequestCookies,\n ResponseCookies: () => ResponseCookies,\n parseCookie: () => parseCookie,\n parseSetCookie: () => parseSetCookie,\n stringifyCookie: () => stringifyCookie\n});\nmodule.exports = __toCommonJS(src_exports);\n\n// src/serialize.ts\nfunction stringifyCookie(c) {\n var _a;\n const attrs = [\n \"path\" in c && c.path && `Path=${c.path}`,\n \"expires\" in c && (c.expires || c.expires === 0) && `Expires=${(typeof c.expires === \"number\" ? new Date(c.expires) : c.expires).toUTCString()}`,\n \"maxAge\" in c && typeof c.maxAge === \"number\" && `Max-Age=${c.maxAge}`,\n \"domain\" in c && c.domain && `Domain=${c.domain}`,\n \"secure\" in c && c.secure && \"Secure\",\n \"httpOnly\" in c && c.httpOnly && \"HttpOnly\",\n \"sameSite\" in c && c.sameSite && `SameSite=${c.sameSite}`,\n \"partitioned\" in c && c.partitioned && \"Partitioned\",\n \"priority\" in c && c.priority && `Priority=${c.priority}`\n ].filter(Boolean);\n const stringified = `${c.name}=${encodeURIComponent((_a = c.value) != null ? _a : \"\")}`;\n return attrs.length === 0 ? stringified : `${stringified}; ${attrs.join(\"; \")}`;\n}\nfunction parseCookie(cookie) {\n const map = /* @__PURE__ */ new Map();\n for (const pair of cookie.split(/; */)) {\n if (!pair)\n continue;\n const splitAt = pair.indexOf(\"=\");\n if (splitAt === -1) {\n map.set(pair, \"true\");\n continue;\n }\n const [key, value] = [pair.slice(0, splitAt), pair.slice(splitAt + 1)];\n try {\n map.set(key, decodeURIComponent(value != null ? value : \"true\"));\n } catch {\n }\n }\n return map;\n}\nfunction parseSetCookie(setCookie) {\n if (!setCookie) {\n return void 0;\n }\n const [[name, value], ...attributes] = parseCookie(setCookie);\n const {\n domain,\n expires,\n httponly,\n maxage,\n path,\n samesite,\n secure,\n partitioned,\n priority\n } = Object.fromEntries(\n attributes.map(([key, value2]) => [\n key.toLowerCase().replace(/-/g, \"\"),\n value2\n ])\n );\n const cookie = {\n name,\n value: decodeURIComponent(value),\n domain,\n ...expires && { expires: new Date(expires) },\n ...httponly && { httpOnly: true },\n ...typeof maxage === \"string\" && { maxAge: Number(maxage) },\n path,\n ...samesite && { sameSite: parseSameSite(samesite) },\n ...secure && { secure: true },\n ...priority && { priority: parsePriority(priority) },\n ...partitioned && { partitioned: true }\n };\n return compact(cookie);\n}\nfunction compact(t) {\n const newT = {};\n for (const key in t) {\n if (t[key]) {\n newT[key] = t[key];\n }\n }\n return newT;\n}\nvar SAME_SITE = [\"strict\", \"lax\", \"none\"];\nfunction parseSameSite(string) {\n string = string.toLowerCase();\n return SAME_SITE.includes(string) ? string : void 0;\n}\nvar PRIORITY = [\"low\", \"medium\", \"high\"];\nfunction parsePriority(string) {\n string = string.toLowerCase();\n return PRIORITY.includes(string) ? string : void 0;\n}\nfunction splitCookiesString(cookiesString) {\n if (!cookiesString)\n return [];\n var cookiesStrings = [];\n var pos = 0;\n var start;\n var ch;\n var lastComma;\n var nextStart;\n var cookiesSeparatorFound;\n function skipWhitespace() {\n while (pos < cookiesString.length && /\\s/.test(cookiesString.charAt(pos))) {\n pos += 1;\n }\n return pos < cookiesString.length;\n }\n function notSpecialChar() {\n ch = cookiesString.charAt(pos);\n return ch !== \"=\" && ch !== \";\" && ch !== \",\";\n }\n while (pos < cookiesString.length) {\n start = pos;\n cookiesSeparatorFound = false;\n while (skipWhitespace()) {\n ch = cookiesString.charAt(pos);\n if (ch === \",\") {\n lastComma = pos;\n pos += 1;\n skipWhitespace();\n nextStart = pos;\n while (pos < cookiesString.length && notSpecialChar()) {\n pos += 1;\n }\n if (pos < cookiesString.length && cookiesString.charAt(pos) === \"=\") {\n cookiesSeparatorFound = true;\n pos = nextStart;\n cookiesStrings.push(cookiesString.substring(start, lastComma));\n start = pos;\n } else {\n pos = lastComma + 1;\n }\n } else {\n pos += 1;\n }\n }\n if (!cookiesSeparatorFound || pos >= cookiesString.length) {\n cookiesStrings.push(cookiesString.substring(start, cookiesString.length));\n }\n }\n return cookiesStrings;\n}\n\n// src/request-cookies.ts\nvar RequestCookies = class {\n constructor(requestHeaders) {\n /** @internal */\n this._parsed = /* @__PURE__ */ new Map();\n this._headers = requestHeaders;\n const header = requestHeaders.get(\"cookie\");\n if (header) {\n const parsed = parseCookie(header);\n for (const [name, value] of parsed) {\n this._parsed.set(name, { name, value });\n }\n }\n }\n [Symbol.iterator]() {\n return this._parsed[Symbol.iterator]();\n }\n /**\n * The amount of cookies received from the client\n */\n get size() {\n return this._parsed.size;\n }\n get(...args) {\n const name = typeof args[0] === \"string\" ? args[0] : args[0].name;\n return this._parsed.get(name);\n }\n getAll(...args) {\n var _a;\n const all = Array.from(this._parsed);\n if (!args.length) {\n return all.map(([_, value]) => value);\n }\n const name = typeof args[0] === \"string\" ? args[0] : (_a = args[0]) == null ? void 0 : _a.name;\n return all.filter(([n]) => n === name).map(([_, value]) => value);\n }\n has(name) {\n return this._parsed.has(name);\n }\n set(...args) {\n const [name, value] = args.length === 1 ? [args[0].name, args[0].value] : args;\n const map = this._parsed;\n map.set(name, { name, value });\n this._headers.set(\n \"cookie\",\n Array.from(map).map(([_, value2]) => stringifyCookie(value2)).join(\"; \")\n );\n return this;\n }\n /**\n * Delete the cookies matching the passed name or names in the request.\n */\n delete(names) {\n const map = this._parsed;\n const result = !Array.isArray(names) ? map.delete(names) : names.map((name) => map.delete(name));\n this._headers.set(\n \"cookie\",\n Array.from(map).map(([_, value]) => stringifyCookie(value)).join(\"; \")\n );\n return result;\n }\n /**\n * Delete all the cookies in the cookies in the request.\n */\n clear() {\n this.delete(Array.from(this._parsed.keys()));\n return this;\n }\n /**\n * Format the cookies in the request as a string for logging\n */\n [Symbol.for(\"edge-runtime.inspect.custom\")]() {\n return `RequestCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`;\n }\n toString() {\n return [...this._parsed.values()].map((v) => `${v.name}=${encodeURIComponent(v.value)}`).join(\"; \");\n }\n};\n\n// src/response-cookies.ts\nvar ResponseCookies = class {\n constructor(responseHeaders) {\n /** @internal */\n this._parsed = /* @__PURE__ */ new Map();\n var _a, _b, _c;\n this._headers = responseHeaders;\n const setCookie = (_c = (_b = (_a = responseHeaders.getSetCookie) == null ? void 0 : _a.call(responseHeaders)) != null ? _b : responseHeaders.get(\"set-cookie\")) != null ? _c : [];\n const cookieStrings = Array.isArray(setCookie) ? setCookie : splitCookiesString(setCookie);\n for (const cookieString of cookieStrings) {\n const parsed = parseSetCookie(cookieString);\n if (parsed)\n this._parsed.set(parsed.name, parsed);\n }\n }\n /**\n * {@link https://wicg.github.io/cookie-store/#CookieStore-get CookieStore#get} without the Promise.\n */\n get(...args) {\n const key = typeof args[0] === \"string\" ? args[0] : args[0].name;\n return this._parsed.get(key);\n }\n /**\n * {@link https://wicg.github.io/cookie-store/#CookieStore-getAll CookieStore#getAll} without the Promise.\n */\n getAll(...args) {\n var _a;\n const all = Array.from(this._parsed.values());\n if (!args.length) {\n return all;\n }\n const key = typeof args[0] === \"string\" ? args[0] : (_a = args[0]) == null ? void 0 : _a.name;\n return all.filter((c) => c.name === key);\n }\n has(name) {\n return this._parsed.has(name);\n }\n /**\n * {@link https://wicg.github.io/cookie-store/#CookieStore-set CookieStore#set} without the Promise.\n */\n set(...args) {\n const [name, value, cookie] = args.length === 1 ? [args[0].name, args[0].value, args[0]] : args;\n const map = this._parsed;\n map.set(name, normalizeCookie({ name, value, ...cookie }));\n replace(map, this._headers);\n return this;\n }\n /**\n * {@link https://wicg.github.io/cookie-store/#CookieStore-delete CookieStore#delete} without the Promise.\n */\n delete(...args) {\n const [name, options] = typeof args[0] === \"string\" ? [args[0]] : [args[0].name, args[0]];\n return this.set({ ...options, name, value: \"\", expires: /* @__PURE__ */ new Date(0) });\n }\n [Symbol.for(\"edge-runtime.inspect.custom\")]() {\n return `ResponseCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`;\n }\n toString() {\n return [...this._parsed.values()].map(stringifyCookie).join(\"; \");\n }\n};\nfunction replace(bag, headers) {\n headers.delete(\"set-cookie\");\n for (const [, value] of bag) {\n const serialized = stringifyCookie(value);\n headers.append(\"set-cookie\", serialized);\n }\n}\nfunction normalizeCookie(cookie = { name: \"\", value: \"\" }) {\n if (typeof cookie.expires === \"number\") {\n cookie.expires = new Date(cookie.expires);\n }\n if (cookie.maxAge) {\n cookie.expires = new Date(Date.now() + cookie.maxAge * 1e3);\n }\n if (cookie.path === null || cookie.path === void 0) {\n cookie.path = \"/\";\n }\n return cookie;\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n RequestCookies,\n ResponseCookies,\n parseCookie,\n parseSetCookie,\n stringifyCookie\n});\n","let spanRecorderForTest;\nexport function recordSpan(record) {\n if (!isLocalSpanRecordingEnabled()) {\n return;\n }\n const spanRecord = {\n timestamp: getCurrentTimestamp(),\n ...record\n };\n spanRecorderForTest == null ? void 0 : spanRecorderForTest(spanRecord);\n if (isRequestInsightsEnabled() && spanRecord.requestId) {\n const { recordRequestInsightSpan } = require('./request-insights');\n recordRequestInsightSpan(spanRecord);\n }\n}\nexport function setSpanRecorderForTest(recorder) {\n spanRecorderForTest = recorder;\n}\nexport function isLocalSpanRecordingEnabled() {\n if (!process.env.__NEXT_DEV_SERVER) {\n return false;\n }\n return spanRecorderForTest !== undefined || isRequestInsightsEnabled();\n}\nexport function isRequestInsightsEnabled() {\n if (!process.env.__NEXT_DEV_SERVER) {\n return false;\n }\n const value = process.env.__NEXT_REQUEST_INSIGHTS;\n return isEnabledEnvValue(value);\n}\nfunction isEnabledEnvValue(value) {\n return value === '1' || value === 'true' || value === true;\n}\nfunction getCurrentTimestamp() {\n return performance.timeOrigin + performance.now();\n}\n\n//# sourceMappingURL=span-store.js.map","const sharedAsyncLocalStorageNotAvailableError = new Error('Invariant: AsyncLocalStorage accessed in runtime where it is not available');\nclass FakeAsyncLocalStorage {\n disable() {\n throw sharedAsyncLocalStorageNotAvailableError;\n }\n getStore() {\n // This fake implementation of AsyncLocalStorage always returns `undefined`.\n return undefined;\n }\n run() {\n throw sharedAsyncLocalStorageNotAvailableError;\n }\n exit() {\n throw sharedAsyncLocalStorageNotAvailableError;\n }\n enterWith() {\n throw sharedAsyncLocalStorageNotAvailableError;\n }\n static bind(fn) {\n return fn;\n }\n}\nconst maybeGlobalAsyncLocalStorage = typeof globalThis !== 'undefined' && globalThis.AsyncLocalStorage;\nexport function createAsyncLocalStorage() {\n if (maybeGlobalAsyncLocalStorage) {\n return new maybeGlobalAsyncLocalStorage();\n }\n return new FakeAsyncLocalStorage();\n}\n/**\n * Returns the storage registered under `name`, and creates it on first use.\n *\n * These storages must be singletons within a realm. A store that is entered\n * through one reference to a storage must be readable through every other\n * reference to it. If it is not, code that runs inside the scope sees no store\n * at all. Module identity does not guarantee this. A realm can evaluate the\n * same `next` file more than once if the package is reachable through more than\n * one path, and then each evaluation creates a storage of its own. A global\n * symbol keeps the singleton intact for any number of copies. Worker threads\n * and edge sandboxes still get separate storages, because each of them has its\n * own `globalThis`.\n *\n * Module identity broke this way in `next dev`. A bug in Node's\n * `fs.realpathSync` can return a path with its symlinks unresolved, and the\n * module loader keys the module cache on that path. On a pnpm install it then\n * resolves `next/dist/...` through the `node_modules/next` symlink instead of\n * the real path, so the file is evaluated a second time. See\n * https://github.com/nodejs/node/pull/65113. Node versions without that fix\n * stay affected.\n *\n * The key includes the Next.js version, so two different versions of Next.js in\n * the same realm keep separate storages. Their store shapes might not be\n * compatible.\n */ export function getOrCreateGlobalAsyncLocalStorage(name) {\n const key = Symbol.for(`@next/${name}@${\"16.4.2\"}`);\n const globalStore = globalThis;\n return globalStore[key] ??= createAsyncLocalStorage();\n}\nexport function bindSnapshot(// WARNING: Don't pass a named function to this argument! See: https://github.com/facebook/react/pull/34911\nfn) {\n if (maybeGlobalAsyncLocalStorage) {\n return maybeGlobalAsyncLocalStorage.bind(fn);\n }\n return FakeAsyncLocalStorage.bind(fn);\n}\nexport function createSnapshot() {\n if (maybeGlobalAsyncLocalStorage) {\n return maybeGlobalAsyncLocalStorage.snapshot();\n }\n return function(fn, ...args) {\n return fn(...args);\n };\n}\n\n//# sourceMappingURL=async-local-storage.js.map","import { AppRouteRouteModule } from \"next/dist/esm/server/route-modules/app-route/module.compiled\";\nimport { RouteKind } from \"next/dist/esm/server/route-kind\";\nimport { patchFetch as _patchFetch } from \"next/dist/esm/server/lib/patch-fetch\";\nimport { addRequestMeta, getRequestMeta, setRequestMeta } from \"next/dist/esm/server/request-meta\";\nimport { getTracer, SpanKind, SpanStatusCode } from \"next/dist/esm/server/lib/trace/tracer\";\nimport { setManifestsSingleton } from \"next/dist/esm/server/app-render/manifests-singleton\";\nimport { normalizeAppPath } from \"next/dist/esm/shared/lib/router/utils/app-paths\";\nimport { NodeNextRequest, NodeNextResponse } from \"next/dist/esm/server/base-http/node\";\nimport { NextRequestAdapter, signalFromNodeResponse } from \"next/dist/esm/server/web/spec-extension/adapters/next-request\";\nimport { BaseServerSpan } from \"next/dist/esm/server/lib/trace/constants\";\nimport { getRevalidateReason } from \"next/dist/esm/server/instrumentation/utils\";\nimport { sendResponse } from \"next/dist/esm/server/send-response\";\nimport { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from \"next/dist/esm/server/web/utils\";\nimport { getCacheControlHeader } from \"next/dist/esm/server/lib/cache-control\";\nimport { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from \"next/dist/esm/lib/constants\";\nimport { NoFallbackError } from \"next/dist/esm/shared/lib/no-fallback-error.external\";\nimport { isRouteCacheOwner } from \"next/dist/esm/server/lib/route-cache-key\";\nimport { CachedRouteKind } from \"next/dist/esm/server/response-cache\";\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\nconst nextConfigOutput = \"\"\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: \"/(console)/overview/changes/route\",\n pathname: \"/overview/changes\",\n filename: \"route\",\n bundlePath: \"\"\n },\n distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',\n relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',\n resolvedPagePath: \"[project]/web/app/(console)/overview/changes/route.ts\",\n nextConfigOutput,\n // The lazy require factory ensures that:\n // - In dev: devRequestTimingInternalsEnd is set before userland executes,\n // correctly attributing module load time to application-code rather than\n // framework internals.\n // - In all modes: async modules (route files with top-level await) are\n // handled correctly — require() returns a Promise for such modules, which\n // ensureUserland() awaits before the first request is handled.\n userland: ()=>require(\"INNER_APP_ROUTE\"),\n // In Turbopack dev mode, also provide a synchronous per-request getter so\n // server HMR updates are picked up without re-executing the entry chunk.\n // Using require() (synchronous) avoids adding async overhead that would be\n // incorrectly attributed to application-code time in devRequestTiming.\n ...process.env.TURBOPACK && process.env.__NEXT_DEV_SERVER ? {\n getUserland: ()=>require(\"INNER_APP_ROUTE\")\n } : {}\n});\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage\n });\n}\nexport { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, };\nexport async function handler(req, res, ctx) {\n if (ctx.requestMeta) {\n setRequestMeta(req, ctx.requestMeta);\n }\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());\n }\n let srcPage = \"/(console)/overview/changes/route\";\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/';\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/';\n }\n const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE;\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode\n });\n if (!prepareResult) {\n res.statusCode = 400;\n res.end('Bad Request');\n ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());\n return null;\n }\n const { buildId, deploymentId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest, previewProps } = prepareResult;\n const normalizedSrcPage = normalizeAppPath(srcPage);\n // Only this route's prerenders can establish ISR or admit generated params.\n const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]) && (routeModule.isDev || isRouteCacheOwner(resolvedPathname, routeModule.cacheOwner, prerenderManifest.routes[resolvedPathname]));\n let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || isPrerendered);\n const render404 = async ()=>{\n // TODO: should route-module itself handle rendering the 404\n if (routerServerContext == null ? void 0 : routerServerContext.render404) {\n await routerServerContext.render404(req, res, parsedUrl, false);\n } else {\n res.end('This page could not be found');\n }\n return null;\n };\n if (isIsr && !isDraftMode) {\n const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n if (nextConfig.adapterPath) {\n return await render404();\n }\n throw new NoFallbackError();\n }\n }\n }\n let cacheKey = null;\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname;\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey;\n }\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest\n });\n }\n const method = req.method || 'GET';\n const tracer = getTracer();\n const activeSpan = tracer.getActiveScopeSpan();\n const isWrappedByNextServer = Boolean(routerServerContext == null ? void 0 : routerServerContext.isWrappedByNextServer);\n const isMinimalMode = Boolean(getRequestMeta(req, 'minimalMode'));\n const incrementalCache = getRequestMeta(req, 'incrementalCache') || await routeModule.getIncrementalCache(req, nextConfig, previewProps, prerenderManifest, isMinimalMode);\n incrementalCache == null ? void 0 : incrementalCache.resetRequestCache();\n globalThis.__incrementalCache = incrementalCache;\n const context = {\n params,\n previewProps,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts),\n useCacheTimeout: nextConfig.experimental.useCacheTimeout,\n durableUseCacheEntries: Boolean(nextConfig.experimental.durableUseCacheEntries)\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n validationLevel: nextConfig.experimental.instantInsights.validationLevel,\n isDraftMode,\n incrementalCache,\n hmrRefreshHash: getRequestMeta(req, 'hmrRefreshHash'),\n cacheLifeProfiles: nextConfig.cacheLife,\n staticPageGenerationTimeout: nextConfig.staticPageGenerationTimeout,\n waitUntil: ctx.waitUntil,\n onClose: (cb)=>{\n res.on('close', cb);\n },\n onAfterTaskError: undefined\n },\n sharedContext: {\n buildId,\n deploymentId\n }\n };\n const nodeNextReq = new NodeNextRequest(req);\n const nodeNextRes = new NodeNextResponse(res);\n const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res));\n const responseGenerator = async ({ previousCacheEntry })=>{\n try {\n if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {\n res.statusCode = 404;\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED');\n res.end('This page could not be found');\n return null;\n }\n const response = cacheKey === null ? await routeModule.handle(nextReq, context) : await routeModule.prerender(nextReq, context);\n req.fetchMetrics = context.renderOpts.fetchMetrics;\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil;\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil);\n pendingWaitUntil = undefined;\n }\n }\n const cacheTags = context.renderOpts.collectedTags;\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob();\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers);\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags;\n }\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type;\n }\n const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;\n const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? // route has a numeric `revalidate` but didn't declare an\n // explicit `expire` (e.g. via `cacheLife`). This mirrors the\n // build-time fallback in `build/index.ts` so cache entries\n // and the response Cache-Control header agree on the route's\n // effective expire. Routes that opt out of revalidation\n // (`revalidate: false`) or that are dynamic (`revalidate: 0`)\n // keep `expire: undefined`.\n revalidate !== false && revalidate > 0 ? nextConfig.expireTime : undefined : context.renderOpts.collectedExpire;\n // Create the cache entry for the response.\n const cacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers\n },\n cacheControl: {\n revalidate,\n expire\n }\n };\n return cacheEntry;\n } else {\n // send response without caching if not ISR\n await sendResponse(nodeNextReq, nodeNextRes, response, pendingWaitUntil);\n return null;\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration: cacheKey !== null,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n throw err;\n }\n };\n const handleResponse = async (currentSpan, parentSpan)=>{\n try {\n var _cacheEntry_value;\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n previewProps,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil,\n isMinimalMode\n });\n if (cacheEntry !== null && 'error' in cacheEntry) {\n throw cacheEntry.error;\n }\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return;\n }\n if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) {\n var _cacheEntry_value1;\n throw new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`);\n }\n if (!isMinimalMode) {\n res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');\n }\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');\n }\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers);\n if (!(isMinimalMode && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER);\n }\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {\n headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl));\n }\n await sendResponse(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200\n }));\n return;\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration: cacheKey !== null,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n // rethrow so that we can handle serving error page\n // If this is during static generation, throw the error again.\n if (isIsr) throw err;\n // Otherwise, send a 500 response unless the original response has\n // already committed. In that case, preserve its status code for\n // telemetry while still recording the failure and terminating a response\n // that the failed pipeline left open.\n if (res.headersSent) {\n if (currentSpan) {\n const error = err instanceof Error ? err : new Error('Unknown app route error');\n currentSpan.recordException(error);\n currentSpan.setStatus({\n code: SpanStatusCode.ERROR,\n message: error.message\n });\n currentSpan.setAttribute('error.type', error.name);\n }\n if (!res.writableEnded && !res.destroyed) {\n res.end();\n }\n } else {\n await sendResponse(nodeNextReq, nodeNextRes, new Response(null, {\n status: 500\n }));\n }\n return;\n } finally{\n ;\n (()=>{\n if (!currentSpan) {\n return;\n }\n let statusCode = res.statusCode;\n currentSpan.setAttributes({\n 'http.status_code': statusCode,\n 'next.rsc': false\n });\n if (statusCode && statusCode >= 500) {\n // For 5xx status codes: SHOULD be set to 'Error' span status.\n // x-ref: https://opentelemetry.io/docs/specs/semconv/http/http-spans/#status\n currentSpan.setStatus({\n code: SpanStatusCode.ERROR\n });\n // For span status 'Error', SHOULD set 'error.type' attribute.\n currentSpan.setAttribute('error.type', statusCode.toString());\n }\n const rootSpanAttributes = tracer.getRootSpanAttributes();\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return;\n }\n if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) {\n console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);\n return;\n }\n const route = rootSpanAttributes.get('next.route') || normalizedSrcPage;\n const name = `${method} ${route}`;\n currentSpan.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name\n });\n currentSpan.updateName(name);\n // Propagate http.route to the parent span if one exists (e.g.\n // a platform-created HTTP span in adapter deployments).\n if (parentSpan && parentSpan !== currentSpan) {\n parentSpan.setAttribute('http.route', route);\n parentSpan.updateName(name);\n }\n })();\n }\n };\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (isWrappedByNextServer && activeSpan) {\n await handleResponse(activeSpan, undefined);\n } else {\n let parentSpan = tracer.getActiveScopeSpan();\n await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url\n }\n }, (span)=>handleResponse(span, parentSpan)), undefined, !isWrappedByNextServer);\n }\n}\n\n//# sourceMappingURL=app-route.js.map\n","/**\n * The functions provided by this module are used to communicate certain properties\n * about the currently running code so that Next.js can make decisions on how to handle\n * the current execution in different rendering modes such as pre-rendering, resuming, and SSR.\n *\n * Today Next.js treats all code as potentially static. Certain APIs may only make sense when dynamically rendering.\n * Traditionally this meant deopting the entire render to dynamic however with PPR we can now deopt parts\n * of a React tree as dynamic while still keeping other parts static. There are really two different kinds of\n * Dynamic indications.\n *\n * The first is simply an intention to be dynamic. unstable_noStore is an example of this where\n * the currently executing code simply declares that the current scope is dynamic but if you use it\n * inside unstable_cache it can still be cached. This type of indication can be removed if we ever\n * make the default dynamic to begin with because the only way you would ever be static is inside\n * a cache scope which this indication does not affect.\n *\n * The second is an indication that a dynamic data source was read. This is a stronger form of dynamic\n * because it means that it is inappropriate to cache this at all. using a dynamic data source inside\n * unstable_cache should error. If you want to use some dynamic data inside unstable_cache you should\n * read that data outside the cache and pass it in as an argument to the cached function.\n */ // Once postpone is in stable we should switch to importing the postpone export directly\nimport React from 'react';\nimport { DynamicServerError } from '../../client/components/hooks-server-context';\nimport { StaticGenBailoutError } from '../../client/components/static-generation-bailout';\nimport { getStagedRenderingController } from './work-unit-async-storage.external';\nimport { isClientHookDynamicError } from '../dynamic-rendering-utils';\nimport { METADATA_BOUNDARY_NAME, VIEWPORT_BOUNDARY_NAME, OUTLET_BOUNDARY_NAME, ROOT_LAYOUT_BOUNDARY_NAME } from '../../lib/framework/boundary-constants';\nimport { scheduleOnNextTick } from '../../lib/scheduler';\nimport { createRuntimeBodyError, createDynamicBodyError, createRuntimeBodyErrorInNavigation, createNavigationBodyErrorInNavigation, createPrefetchBodyErrorInNavigation, createDynamicBodyErrorInNavigation, createDynamicOrRuntimeBodyError, createRuntimeMetadataError, createDynamicMetadataError, createRuntimeViewportError, createNavigationViewportError, createPrefetchViewportError, createDynamicViewportError, createDynamicOrRuntimeViewportError, createDynamicOrRuntimeMetadataError, logBuildDebugHint, createLinkBodyErrorInNavigation, createLinkMetadataError, createLinkViewportError, createNavigationMetadataError, createPrefetchMetadataError, createNonPrerenderableMetadataErrorInStaticRoute, createNonPrerenderableViewportErrorInStaticRoute, createNonPrerenderableBodyErrorInStaticRoute, createRuntimeBodyErrorInStaticRoute, createDynamicBodyErrorInStaticRoute, createRuntimeMetadataErrorInStaticRoute, createDynamicMetadataErrorInStaticRoute, createRuntimeViewportErrorInStaticRoute, createDynamicViewportErrorInStaticRoute } from './blocking-route-messages';\nimport { InvariantError } from '../../shared/lib/invariant-error';\nimport { INSTANT_VALIDATION_BOUNDARY_NAME, INSTANT_SLOT_MARKER_PREFIX, INSTANT_SLOT_MARKER_SUFFIX } from './instant-validation/boundary-constants';\nimport { allRequiredBoundariesRendered } from './instant-validation/boundary-tracking';\nimport { createUnrenderedSegmentError } from '../../shared/lib/instant-messages';\nimport { getReactBrowserBailoutReason } from '../../shared/lib/lazy-dynamic/react-browser-bailout';\nexport function createDynamicTrackingState(isDebugDynamicAccesses) {\n return {\n isDebugDynamicAccesses,\n dynamicAccesses: [],\n syncDynamicErrorWithStack: null,\n syncDynamicErrorWithStackPostMicrotask: false\n };\n}\nexport function createDynamicValidationState() {\n return {\n hasSuspenseAboveBody: false,\n hasDynamicMetadata: false,\n dynamicMetadata: null,\n hasDynamicViewport: false,\n hasAllowedDynamic: false,\n dynamicErrors: []\n };\n}\nfunction getPendingClientSyncDynamicError(clientDynamic) {\n return clientDynamic.syncDynamicErrorWithStackPostMicrotask ? null : clientDynamic.syncDynamicErrorWithStack;\n}\nexport function getFirstDynamicReason(trackingState) {\n var _trackingState_dynamicAccesses_;\n return (_trackingState_dynamicAccesses_ = trackingState.dynamicAccesses[0]) == null ? void 0 : _trackingState_dynamicAccesses_.expression;\n}\n/**\n * This function communicates that the current scope should be treated as dynamic.\n *\n * In most cases this function is a no-op but if called during\n * a PPR prerender it will postpone the current sub-tree and calling\n * it during a normal prerender will cause the entire prerender to abort\n */ export function markCurrentScopeAsDynamic(store, workUnitStore, expression) {\n if (workUnitStore) {\n switch(workUnitStore.type){\n case 'cache':\n case 'unstable-cache':\n // Inside cache scopes, marking a scope as dynamic has no effect,\n // because the outer cache scope creates a cache boundary. This is\n // subtly different from reading a dynamic data source, which is\n // forbidden inside a cache scope.\n return;\n case 'private-cache':\n // A private cache scope is already dynamic by definition.\n return;\n case 'prerender-legacy':\n case 'request':\n case 'build-time-generator':\n break;\n default:\n workUnitStore;\n }\n }\n // If we're forcing dynamic rendering or we're forcing static rendering, we\n // don't need to do anything here because the entire page is already dynamic\n // or it's static and it should not throw or postpone here.\n if (store.forceDynamic || store.forceStatic) return;\n if (store.dynamicShouldError) {\n throw new StaticGenBailoutError(`Route ${store.route} with \\`dynamic = \"error\"\\` couldn't be rendered statically because it used \\`${expression}\\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`);\n }\n if (workUnitStore) {\n switch(workUnitStore.type){\n case 'prerender-legacy':\n workUnitStore.revalidate = 0;\n // We aren't prerendering, but we are generating a static page. We need\n // to bail out of static generation.\n const err = new DynamicServerError(`Route ${store.route} couldn't be rendered statically because it used ${expression}. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`);\n store.dynamicUsageDescription = expression;\n store.dynamicUsageStack = err.stack;\n throw err;\n case 'request':\n markRequestStoreAsDynamic(workUnitStore);\n break;\n case 'build-time-generator':\n break;\n default:\n workUnitStore;\n }\n }\n}\n/**\n * This function is meant to be used when prerendering without cacheComponents or PPR.\n * When called during a build it will cause Next.js to consider the route as dynamic.\n *\n * @internal\n */ export function throwToInterruptStaticGeneration(expression, store, prerenderStore) {\n // We aren't prerendering but we are generating a static page. We need to bail out of static generation\n const err = new DynamicServerError(`Route ${store.route} couldn't be rendered statically because it used \\`${expression}\\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`);\n prerenderStore.revalidate = 0;\n store.dynamicUsageDescription = expression;\n store.dynamicUsageStack = err.stack;\n throw err;\n}\n/**\n * This function should be used to track whether something dynamic happened even when\n * we are in a dynamic render. This is useful for Dev where all renders are dynamic but\n * we still track whether dynamic APIs were accessed for helpful messaging\n *\n * @internal\n */ export function trackDynamicDataInDynamicRender(workUnitStore) {\n switch(workUnitStore.type){\n case 'cache':\n case 'unstable-cache':\n // Inside cache scopes, marking a scope as dynamic has no effect,\n // because the outer cache scope creates a cache boundary. This is\n // subtly different from reading a dynamic data source, which is\n // forbidden inside a cache scope.\n return;\n case 'private-cache':\n // A private cache scope is already dynamic by definition.\n return;\n case 'prerender':\n case 'prerender-runtime':\n case 'prerender-legacy':\n case 'prerender-client':\n case 'validation-client':\n case 'build-time-generator':\n break;\n case 'request':\n markRequestStoreAsDynamic(workUnitStore);\n break;\n default:\n workUnitStore;\n }\n}\nfunction markRequestStoreAsDynamic(requestStore) {\n if (process.env.__NEXT_DEV_SERVER && requestStore.phase === 'render') {\n requestStore.usedDynamic = true;\n }\n}\nfunction abortOnSynchronousDynamicDataAccess(route, expression, prerenderStore) {\n const reason = `Route ${route} needs to bail out of prerendering at this point because it used ${expression}.`;\n const error = createPrerenderInterruptedError(reason);\n prerenderStore.controller.abort(error);\n const dynamicTracking = prerenderStore.dynamicTracking;\n if (dynamicTracking) {\n dynamicTracking.dynamicAccesses.push({\n // When we aren't debugging, we don't need to create another error for the\n // stack trace.\n stack: dynamicTracking.isDebugDynamicAccesses ? new Error().stack : undefined,\n expression\n });\n }\n}\nexport function abortOnSynchronousPlatformIOAccess(route, expression, errorWithStack, prerenderStore) {\n const dynamicTracking = prerenderStore.dynamicTracking;\n if (dynamicTracking && dynamicTracking.syncDynamicErrorWithStack === null) {\n dynamicTracking.syncDynamicErrorWithStack = errorWithStack;\n // React completes the task that is currently rendering before scheduled\n // abort cleanup. Client tracking can attribute the sync IO only during\n // that current task; server tracking keeps the error regardless.\n queueMicrotask(()=>{\n dynamicTracking.syncDynamicErrorWithStackPostMicrotask = true;\n });\n }\n abortOnSynchronousDynamicDataAccess(route, expression, prerenderStore);\n}\n/**\n * use this function when prerendering with cacheComponents. If we are doing a\n * prospective prerender we don't actually abort because we want to discover\n * all caches for the shell. If this is the actual prerender we do abort.\n *\n * This function accepts a prerenderStore but the caller should ensure we're\n * actually running in cacheComponents mode.\n *\n * @internal\n */ export function abortAndThrowOnSynchronousRequestDataAccess(route, expression, errorWithStack, prerenderStore) {\n const prerenderSignal = prerenderStore.controller.signal;\n if (prerenderSignal.aborted === false) {\n // TODO it would be better to move this aborted check into the callsite so we can avoid making\n // the error object when it isn't relevant to the aborting of the prerender however\n // since we need the throw semantics regardless of whether we abort it is easier to land\n // this way. See how this was handled with `abortOnSynchronousPlatformIOAccess` for a closer\n // to ideal implementation\n abortOnSynchronousDynamicDataAccess(route, expression, prerenderStore);\n // Preserve the exact server-side dynamic access for final validation after\n // interrupting this render.\n const dynamicTracking = prerenderStore.dynamicTracking;\n if (dynamicTracking) {\n if (dynamicTracking.syncDynamicErrorWithStack === null) {\n dynamicTracking.syncDynamicErrorWithStack = errorWithStack;\n }\n }\n }\n throw createPrerenderInterruptedError(`Route ${route} needs to bail out of prerendering at this point because it used ${expression}.`);\n}\nconst NEXT_PRERENDER_INTERRUPTED = 'NEXT_PRERENDER_INTERRUPTED';\nfunction createPrerenderInterruptedError(message) {\n const error = new Error(message);\n error.digest = NEXT_PRERENDER_INTERRUPTED;\n return error;\n}\nexport function isPrerenderInterruptedError(error) {\n return typeof error === 'object' && error !== null && error.digest === NEXT_PRERENDER_INTERRUPTED && 'name' in error && 'message' in error && error instanceof Error;\n}\nexport function accessedDynamicData(dynamicAccesses) {\n return dynamicAccesses.length > 0;\n}\nexport function consumeDynamicAccess(serverDynamic, clientDynamic) {\n // We mutate because we only call this once we are no longer writing\n // to the dynamicTrackingState and it's more efficient than creating a new\n // array.\n serverDynamic.dynamicAccesses.push(...clientDynamic.dynamicAccesses);\n return serverDynamic.dynamicAccesses;\n}\nexport function formatDynamicAPIAccesses(dynamicAccesses) {\n return dynamicAccesses.filter((access)=>typeof access.stack === 'string' && access.stack.length > 0).map(({ expression, stack })=>{\n stack = stack.split('\\n')// Remove the \"Error: \" prefix from the first line of the stack trace as\n // well as the first 4 lines of the stack trace which is the distance\n // from the user code and the `new Error().stack` call.\n .slice(4).filter((line)=>{\n // Exclude Next.js internals from the stack trace.\n if (line.includes('node_modules/next/')) {\n return false;\n }\n // Exclude anonymous functions from the stack trace.\n if (line.includes(' (<anonymous>)')) {\n return false;\n }\n // Exclude Node.js internals from the stack trace.\n if (line.includes(' (node:')) {\n return false;\n }\n return true;\n }).join('\\n');\n return `Dynamic API Usage Debug - ${expression}:\\n${stack}`;\n });\n}\nexport function createHangingInputAbortSignal(workUnitStore) {\n switch(workUnitStore.type){\n case 'prerender':\n case 'prerender-runtime':\n const controller = new AbortController();\n if (workUnitStore.cacheSignal) {\n // If we have a cacheSignal it means we're in a prospective render. If\n // the input we're waiting on is coming from another cache, we do want\n // to wait for it so that we can resolve this cache entry too.\n workUnitStore.cacheSignal.inputReady().then(()=>{\n controller.abort();\n });\n } else {\n // Otherwise we're in the final render and we should already have all\n // our caches filled.\n // If the prerender uses stages, we have wait until the final stage.\n // if an input didn't resolve at that point, then we can assume it never will.\n //\n // We might still be waiting on some microtasks so we\n // wait one tick before giving up. When we give up, we still want to\n // render the content of this cache as deeply as we can so that we can\n // suspend as deeply as possible in the tree or not at all if we don't\n // end up waiting for the input.\n const stagedRendering = getStagedRenderingController(workUnitStore);\n if (stagedRendering && stagedRendering.finalStage !== null) {\n stagedRendering.waitForStage(stagedRendering.finalStage).then(()=>scheduleOnNextTick(()=>controller.abort()), noop);\n } else {\n scheduleOnNextTick(()=>controller.abort());\n }\n }\n return controller.signal;\n case 'prerender-client':\n case 'validation-client':\n case 'prerender-legacy':\n case 'request':\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n case 'build-time-generator':\n return undefined;\n default:\n workUnitStore;\n }\n}\nfunction noop() {}\nexport function annotateDynamicAccess(expression, prerenderStore) {\n const dynamicTracking = prerenderStore.dynamicTracking;\n if (dynamicTracking) {\n dynamicTracking.dynamicAccesses.push({\n stack: dynamicTracking.isDebugDynamicAccesses ? new Error().stack : undefined,\n expression\n });\n }\n}\nconst hasSuspenseRegex = /\\n\\s+at Suspense \\(<anonymous>\\)/;\n// Common implicit body tags that React will treat as body when placed directly in html\nconst bodyAndImplicitTags = 'body|div|main|section|article|aside|header|footer|nav|form|p|span|h1|h2|h3|h4|h5|h6';\n// Detects when RootLayoutBoundary (our framework marker component) appears\n// after Suspense in the component stack, indicating the root layout is wrapped\n// within a Suspense boundary. Ensures no body/html/implicit-body components are in between.\n//\n// Example matches:\n// at Suspense (<anonymous>)\n// at __next_root_layout_boundary__ (<anonymous>)\n//\n// Or with other components in between (but not body/html/implicit-body):\n// at Suspense (<anonymous>)\n// at SomeComponent (<anonymous>)\n// at __next_root_layout_boundary__ (<anonymous>)\nconst hasSuspenseBeforeRootLayoutWithoutBodyOrImplicitBodyRegex = new RegExp(`\\\\n\\\\s+at Suspense \\\\(<anonymous>\\\\)(?:(?!\\\\n\\\\s+at (?:${bodyAndImplicitTags}) \\\\(<anonymous>\\\\))[\\\\s\\\\S])*?\\\\n\\\\s+at ${ROOT_LAYOUT_BOUNDARY_NAME} \\\\([^\\\\n]*\\\\)`);\nconst hasMetadataRegex = new RegExp(`\\\\n\\\\s+at ${METADATA_BOUNDARY_NAME}[\\\\n\\\\s]`);\nconst hasViewportRegex = new RegExp(`\\\\n\\\\s+at ${VIEWPORT_BOUNDARY_NAME}[\\\\n\\\\s]`);\nconst hasOutletRegex = new RegExp(`\\\\n\\\\s+at ${OUTLET_BOUNDARY_NAME}[\\\\n\\\\s]`);\nconst hasInstantValidationBoundaryRegex = new RegExp(`\\\\n\\\\s+at ${INSTANT_VALIDATION_BOUNDARY_NAME}[\\\\n\\\\s]`);\nconst slotMarkerRegex = new RegExp(`\\\\n\\\\s+at ${INSTANT_SLOT_MARKER_PREFIX}(\\\\d+)${INSTANT_SLOT_MARKER_SUFFIX}[\\\\n\\\\s]`);\n/** Look up the config factory for the slot this error belongs to.\n * Checks the component stack for a slot marker (__next_instant_slot_N__)\n * and returns the config at that index. Falls back to index 0 (root\n * config) when no slot marker is found or the slot has no config. */ function resolveInstantStack(componentStack, dynamicValidation) {\n const { slotStacks } = dynamicValidation;\n if (slotStacks.length > 1) {\n const match = slotMarkerRegex.exec(componentStack);\n if (match) {\n // Slot markers are 0-indexed in the component name but\n // slotStacks is 1-indexed (index 0 is the root config).\n const slotIndex = parseInt(match[1], 10) + 1;\n const slotStack = slotStacks[slotIndex];\n if (slotStack != null) {\n return slotStack;\n }\n }\n }\n // Fall back to root config (index 0)\n return slotStacks[0] ?? null;\n}\n/**\n * Inspects the component stack of an outlet boundary to discover whether the\n * user placed a Suspense boundary above the document body, and records the\n * opt-in on `dynamicValidation.hasSuspenseAboveBody` if so.\n *\n * The outlet itself isn't a meaningful source of dynamic — it only resolves\n * when metadata/viewport are dynamic, which we track via their own boundaries.\n * However, the outlet renders alongside the page content, so its stack passes\n * through the user's layout chain (typically reaching into `<body>` via the\n * root layout). That makes the outlet stack our best opportunity to spot a\n * Suspense boundary above the body, even when no real body content is dynamic.\n * Without this, a route whose only dynamic source is `generateViewport()` would\n * miss the Suspense-above-body opt-in, because the viewport's stack lives in\n * the head and never sees the user's root layout.\n *\n * We deliberately only set `hasSuspenseAboveBody`, not `hasAllowedDynamic`. The\n * latter tracks whether the body has dynamic content that's been wrapped in\n * Suspense (i.e., the page is partially dynamic). The outlet rendering tells us\n * about the structural opt-in for an empty shell, not about the body being\n * partially dynamic. The distinction matters because dynamic metadata is only\n * acceptable when the page is partially dynamic (via real body holes), and we\n * don't want this outlet-based detection to mask that case.\n */ function trackOutletSuspenseAboveBody(componentStack, dynamicValidation) {\n if (hasSuspenseBeforeRootLayoutWithoutBodyOrImplicitBodyRegex.test(componentStack)) {\n dynamicValidation.hasSuspenseAboveBody = true;\n }\n}\nexport function trackDynamicAccessInStaticRoute(dynamicReason, workStore, componentStack, dynamicValidation, clientDynamic, isServerPartial, kind) {\n const syncDynamicError = getPendingClientSyncDynamicError(clientDynamic);\n if (hasOutletRegex.test(componentStack)) {\n trackOutletSuspenseAboveBody(componentStack, dynamicValidation);\n return;\n }\n if (hasMetadataRegex.test(componentStack)) {\n dynamicValidation.dynamicErrors.push(addErrorContext(createMetadataErrorInStaticRoute(kind, workStore.route), componentStack, null));\n return;\n }\n if (hasViewportRegex.test(componentStack)) {\n dynamicValidation.dynamicErrors.push(addErrorContext(createViewportErrorInStaticRoute(kind, workStore.route), componentStack, null));\n return;\n }\n let hasSuspense = false;\n if (hasSuspenseBeforeRootLayoutWithoutBodyOrImplicitBodyRegex.test(componentStack)) {\n // this error had a Suspense boundary above it, and it's above the body as well.\n dynamicValidation.hasSuspenseAboveBody = true;\n hasSuspense = true;\n } else if (hasSuspenseRegex.test(componentStack)) {\n // this error had a Suspense boundary above it.\n hasSuspense = true;\n }\n if (hasSuspense) {\n if (!isServerPartial) {\n // If we don't have holes caused by server data, then any holes must be caused\n // by client-only code, which is allowed.\n dynamicValidation.hasAllowedDynamic = true;\n return;\n }\n // We have holes that may be caused by server data.\n if (syncDynamicError || isClientHookDynamicError(dynamicReason)) {\n // We know this hole wasn't caused by server data, so it's allowed\n // (because it's wrapped in a Suspense)\n dynamicValidation.hasAllowedDynamic = true;\n return;\n }\n // Any remaining hole may be caused by a server hole.\n // These are not allowed even with Suspense.\n // (NOTE: this may misreport valid client dynamic holes as server holes)\n dynamicValidation.dynamicErrors.push(addErrorContext(createBodyErrorInStaticRoute(kind, workStore.route), componentStack, null));\n return;\n }\n if (syncDynamicError) {\n dynamicValidation.dynamicErrors.push(syncDynamicError);\n return;\n }\n if (isClientHookDynamicError(dynamicReason)) {\n dynamicValidation.dynamicErrors.push(addErrorContext(dynamicReason, componentStack, null));\n return;\n }\n const error = addErrorContext(isServerPartial ? // (NOTE: this may misreport client dynamic holes as server holes)\n createBodyErrorInStaticRoute(kind, workStore.route) : // that server data is complete\n createBodyError(kind, workStore.route), componentStack, null);\n dynamicValidation.dynamicErrors.push(error);\n}\nexport function trackAllowedDynamicAccess(dynamicReason, workStore, componentStack, dynamicValidation, clientDynamic) {\n const dynamicHoleKind = 6;\n const syncDynamicError = getPendingClientSyncDynamicError(clientDynamic);\n if (hasOutletRegex.test(componentStack)) {\n trackOutletSuspenseAboveBody(componentStack, dynamicValidation);\n return;\n } else if (hasMetadataRegex.test(componentStack)) {\n dynamicValidation.hasDynamicMetadata = true;\n return;\n } else if (hasViewportRegex.test(componentStack)) {\n dynamicValidation.hasDynamicViewport = true;\n return;\n } else if (hasSuspenseBeforeRootLayoutWithoutBodyOrImplicitBodyRegex.test(componentStack)) {\n // For Suspense within body, the prelude wouldn't be empty so it wouldn't violate the empty static shells rule.\n // But if you have Suspense above body, the prelude is empty but we allow that because having Suspense\n // is an explicit signal from the user that they acknowledge the empty shell and want dynamic rendering.\n dynamicValidation.hasAllowedDynamic = true;\n dynamicValidation.hasSuspenseAboveBody = true;\n return;\n } else if (hasSuspenseRegex.test(componentStack)) {\n // this error had a Suspense boundary above it so we don't need to report it as a source\n // of disallowed\n dynamicValidation.hasAllowedDynamic = true;\n return;\n } else if (syncDynamicError) {\n dynamicValidation.dynamicErrors.push(syncDynamicError);\n return;\n }\n if (isClientHookDynamicError(dynamicReason)) {\n dynamicValidation.dynamicErrors.push(addErrorContext(dynamicReason, componentStack, null));\n return;\n }\n const error = addErrorContext(createBodyError(dynamicHoleKind, workStore.route), componentStack, null);\n dynamicValidation.dynamicErrors.push(error);\n return;\n}\nexport var DynamicHoleKind = /*#__PURE__*/ function(DynamicHoleKind) {\n /** We know that this hole is caused by runtime data. */ DynamicHoleKind[DynamicHoleKind[\"Runtime\"] = 1] = \"Runtime\";\n /** We know that this hole is caused by link data. */ DynamicHoleKind[DynamicHoleKind[\"Link\"] = 2] = \"Link\";\n /** We know that this hole is caused by navigation(). */ DynamicHoleKind[DynamicHoleKind[\"Navigation\"] = 3] = \"Navigation\";\n /** We know that this hole is caused by prefetch(). */ DynamicHoleKind[DynamicHoleKind[\"Prefetch\"] = 4] = \"Prefetch\";\n /** We know that this hole is caused by dynamic data. */ DynamicHoleKind[DynamicHoleKind[\"Dynamic\"] = 5] = \"Dynamic\";\n /** We know that this hole is caused by runtime or dynamic data, but don't know which. */ DynamicHoleKind[DynamicHoleKind[\"RuntimeOrDynamic\"] = 6] = \"RuntimeOrDynamic\";\n return DynamicHoleKind;\n}({});\nexport function createInstantValidationState(slotStacks) {\n return {\n hasDynamicMetadata: false,\n hasAllowedClientDynamicAboveBoundary: false,\n dynamicMetadata: null,\n hasDynamicViewport: false,\n hasAllowedDynamic: false,\n dynamicErrors: [],\n validationPreventingErrors: [],\n thrownErrorsOutsideBoundary: [],\n slotStacks\n };\n}\nexport function trackDynamicHoleInNavigation(dynamicReason, workStore, componentStack, dynamicValidation, clientDynamic, kind, boundaryState) {\n const syncDynamicError = getPendingClientSyncDynamicError(clientDynamic);\n if (hasOutletRegex.test(componentStack)) {\n // We don't need to track that this is dynamic. It is only so when something else is also dynamic.\n return;\n }\n // Resolve the config stack for this specific error. If the error\n // is inside a slot marker, use that slot's config. Otherwise fall\n // back to the default.\n const effectiveCreateInstantStack = resolveInstantStack(componentStack, dynamicValidation);\n if (hasMetadataRegex.test(componentStack)) {\n const error = addErrorContext(createMetadataError(kind, workStore.route), componentStack, effectiveCreateInstantStack);\n dynamicValidation.dynamicMetadata = error;\n return;\n }\n if (hasViewportRegex.test(componentStack)) {\n const error = addErrorContext(createViewportError(kind, workStore.route), componentStack, effectiveCreateInstantStack);\n dynamicValidation.dynamicErrors.push(error);\n return;\n }\n const boundaryLocation = hasInstantValidationBoundaryRegex.exec(componentStack);\n if (!boundaryLocation) {\n // We don't see the validation boundary in the component stack,\n // so this hole must be coming from a shared parent.\n // Shared parents are fully resolved and don't have RSC holes,\n // but they can still suspend in a client component during SSR.\n // If we managed to render all the validation boundaries, that means\n // that the client holes aren't blocking validation and we can disregard them.\n // Note that we don't even care whether they have suspense or not.\n if (allRequiredBoundariesRendered(boundaryState)) {\n dynamicValidation.hasAllowedClientDynamicAboveBoundary = true;\n dynamicValidation.hasAllowedDynamic = true // Holes outside the boundary contribute to allowing dynamic metadata\n ;\n return;\n } else {\n // TODO(instant-validation) TODO(NAR-787)\n // If shared parents blocked us from validating, we should only log\n // the errors from the innermost (segments), i.e. omit layouts whose\n // slots managed to render (because clearly they didn't block validation)\n const message = `Route \"${workStore.route}\": Could not validate \\`instant\\` because a Client Component in a parent segment prevented the page from rendering.`;\n const error = addErrorContext(new Error(message), componentStack, effectiveCreateInstantStack);\n dynamicValidation.validationPreventingErrors.push(error);\n return;\n }\n } else {\n // The hole originates inside the validation boundary.\n //\n // Check if we have a Suspense above the hole, but below the validation boundary.\n // If we do, then this dynamic usage wouldn't block a navigation to this subtree.\n // Conversely, if the nearest suspense is above the validation boundary, then this subtree would block.\n //\n // Note that in the component stack, children come before parents.\n //\n // Valid:\n // ...\n // at Suspense\n // ...\n // at __next_prefetch_validation_boundary__\n //\n // Invalid:\n // ...\n // at __next_prefetch_validation_boundary__\n // ...\n // at Suspense\n //\n const suspenseLocation = hasSuspenseRegex.exec(componentStack);\n if (suspenseLocation) {\n if (suspenseLocation.index < boundaryLocation.index) {\n dynamicValidation.hasAllowedDynamic = true;\n return;\n } else {\n // invalid - fallthrough\n }\n }\n }\n if (syncDynamicError) {\n if (effectiveCreateInstantStack !== null && syncDynamicError.cause === undefined) {\n syncDynamicError.cause = effectiveCreateInstantStack();\n }\n dynamicValidation.dynamicErrors.push(syncDynamicError);\n return;\n }\n if (isClientHookDynamicError(dynamicReason)) {\n dynamicValidation.dynamicErrors.push(addErrorContext(dynamicReason, componentStack, effectiveCreateInstantStack));\n return;\n }\n const error = addErrorContext(createBodyErrorInNavigation(kind, workStore.route), componentStack, effectiveCreateInstantStack);\n dynamicValidation.dynamicErrors.push(error);\n return;\n}\nfunction createBodyError(kind, route) {\n switch(kind){\n case 1:\n return createRuntimeBodyError(route);\n case 5:\n return createDynamicBodyError(route);\n case 6:\n return createDynamicOrRuntimeBodyError(route);\n }\n}\nfunction createBodyErrorInNavigation(kind, route) {\n switch(kind){\n case 1:\n return createRuntimeBodyErrorInNavigation(route);\n case 2:\n return createLinkBodyErrorInNavigation(route);\n case 3:\n return createNavigationBodyErrorInNavigation(route);\n case 4:\n return createPrefetchBodyErrorInNavigation(route);\n case 5:\n return createDynamicBodyErrorInNavigation(route);\n }\n}\nfunction createMetadataError(kind, route) {\n switch(kind){\n case 1:\n return createRuntimeMetadataError(route);\n case 2:\n return createLinkMetadataError(route);\n case 3:\n return createNavigationMetadataError(route);\n case 4:\n return createPrefetchMetadataError(route);\n case 5:\n return createDynamicMetadataError(route);\n case 6:\n return createDynamicOrRuntimeMetadataError(route);\n }\n}\nfunction createViewportError(kind, route) {\n switch(kind){\n case 1:\n return createRuntimeViewportError(route);\n case 2:\n return createLinkViewportError(route);\n case 3:\n return createNavigationViewportError(route);\n case 4:\n return createPrefetchViewportError(route);\n case 5:\n return createDynamicViewportError(route);\n case 6:\n return createDynamicOrRuntimeViewportError(route);\n }\n}\nfunction createBodyErrorInStaticRoute(kind, route) {\n switch(kind){\n case 1:\n return createRuntimeBodyErrorInStaticRoute(route);\n case 5:\n return createDynamicBodyErrorInStaticRoute(route);\n case 6:\n return createNonPrerenderableBodyErrorInStaticRoute(route);\n }\n}\nfunction createMetadataErrorInStaticRoute(kind, route) {\n switch(kind){\n case 1:\n return createRuntimeMetadataErrorInStaticRoute(route);\n case 5:\n return createDynamicMetadataErrorInStaticRoute(route);\n case 6:\n return createNonPrerenderableMetadataErrorInStaticRoute(route);\n }\n}\nfunction createViewportErrorInStaticRoute(kind, route) {\n switch(kind){\n case 1:\n return createRuntimeViewportErrorInStaticRoute(route);\n case 5:\n return createDynamicViewportErrorInStaticRoute(route);\n case 6:\n return createNonPrerenderableViewportErrorInStaticRoute(route);\n }\n}\nexport function trackThrownErrorInNavigation(workStore, dynamicValidation, thrownValue, componentStack, reactBrowserBailout) {\n const boundaryLocation = hasInstantValidationBoundaryRegex.exec(componentStack);\n if (!boundaryLocation) {\n // There's no validation boundary on the component stack.\n // This error may have blocked a boundary from rendering.\n // Wrap the error to provide component context.\n // This helps for errors from node_modules which would otherwise\n // have no useful stack information due to ignore-listing,\n // e.g. next/dynamic with `ssr: false`.\n if (reactBrowserBailout) {\n // React preserves Next's branded bailout reason as the error cause.\n // Replace the internal wrapper before storing the user-facing diagnostic.\n const browserBailoutReason = getReactBrowserBailoutReason(thrownValue);\n if (browserBailoutReason !== undefined) {\n const browserBailoutError = thrownValue;\n browserBailoutError.cause = browserBailoutReason;\n }\n }\n const error = addErrorContext(new Error('An error occurred while attempting to validate instant UI. This error may be preventing the validation from completing.', {\n cause: thrownValue\n }), componentStack, null);\n dynamicValidation.thrownErrorsOutsideBoundary.push(error);\n } else {\n // There's validation boundary on the component stack,\n // so we know this error didn't block a validation boundary from rendering.\n // However, this error might be hiding be hiding dynamic content that would\n // cause validation to fail.\n const suspenseLocation = hasSuspenseRegex.exec(componentStack);\n if (suspenseLocation) {\n if (suspenseLocation.index < boundaryLocation.index) {\n // There's a Suspense below the validation boundary but above this error's location.\n // This subtree can't fail instant validation because any potential\n // dynamic holes would be guarded by the Suspense anyway,\n // so we can allow this.\n return;\n } else {\n // invalid - fallthrough\n }\n }\n if (reactBrowserBailout) {\n // React preserves Next's branded bailout reason as the error cause.\n // Replace the internal wrapper before storing the user-facing diagnostic.\n const browserBailoutReason = getReactBrowserBailoutReason(thrownValue);\n if (browserBailoutReason !== undefined) {\n const browserBailoutError = thrownValue;\n browserBailoutError.cause = browserBailoutReason;\n }\n }\n const message = `Route \"${workStore.route}\": Could not validate \\`instant\\` because an error prevented the target segment from rendering.`;\n const error = addErrorContext(new Error(message, {\n cause: thrownValue\n }), componentStack, null // TODO(instant-validation-build): conflicting use of cause\n );\n dynamicValidation.validationPreventingErrors.push(error);\n }\n}\nexport function trackDynamicHoleInStaticShell(dynamicReason, workStore, componentStack, dynamicValidation, clientDynamic, kind) {\n const syncDynamicError = getPendingClientSyncDynamicError(clientDynamic);\n if (hasOutletRegex.test(componentStack)) {\n trackOutletSuspenseAboveBody(componentStack, dynamicValidation);\n return;\n } else if (hasMetadataRegex.test(componentStack)) {\n const error = addErrorContext(createMetadataError(kind, workStore.route), componentStack, null);\n dynamicValidation.dynamicMetadata = error;\n return;\n } else if (hasViewportRegex.test(componentStack)) {\n const error = addErrorContext(createViewportError(kind, workStore.route), componentStack, null);\n dynamicValidation.dynamicErrors.push(error);\n return;\n } else if (hasSuspenseBeforeRootLayoutWithoutBodyOrImplicitBodyRegex.test(componentStack)) {\n // For Suspense within body, the prelude wouldn't be empty so it wouldn't violate the empty static shells rule.\n // But if you have Suspense above body, the prelude is empty but we allow that because having Suspense\n // is an explicit signal from the user that they acknowledge the empty shell and want dynamic rendering.\n dynamicValidation.hasAllowedDynamic = true;\n dynamicValidation.hasSuspenseAboveBody = true;\n return;\n } else if (hasSuspenseRegex.test(componentStack)) {\n // this error had a Suspense boundary above it so we don't need to report it as a source\n // of disallowed\n dynamicValidation.hasAllowedDynamic = true;\n return;\n } else if (syncDynamicError) {\n dynamicValidation.dynamicErrors.push(syncDynamicError);\n return;\n }\n if (isClientHookDynamicError(dynamicReason)) {\n dynamicValidation.dynamicErrors.push(addErrorContext(dynamicReason, componentStack, null));\n return;\n }\n const error = addErrorContext(kind === 1 ? createRuntimeBodyError(workStore.route) : createDynamicBodyError(workStore.route), componentStack, null);\n dynamicValidation.dynamicErrors.push(error);\n return;\n}\n/**\n * In dev mode, we prefer using the owner stack, otherwise the provided\n * component stack is used.\n */ function addErrorContext(error, componentStack, createInstantStack) {\n const ownerStack = process.env.NODE_ENV !== 'production' && React.captureOwnerStack ? React.captureOwnerStack() : null;\n if (createInstantStack !== null) {\n error.cause = createInstantStack();\n }\n // TODO go back to owner stack here if available. This is temporarily using componentStack to get the right\n //\n error.stack = error.name + ': ' + error.message + (ownerStack || componentStack);\n return error;\n}\nexport var PreludeState = /*#__PURE__*/ function(PreludeState) {\n PreludeState[PreludeState[\"Full\"] = 0] = \"Full\";\n PreludeState[PreludeState[\"Empty\"] = 1] = \"Empty\";\n PreludeState[PreludeState[\"Errored\"] = 2] = \"Errored\";\n return PreludeState;\n}({});\nexport function logDisallowedDynamicError(workStore, error) {\n console.error(error);\n logBuildDebugHint(workStore.route);\n}\nexport function throwIfSyncIOUsed(workStore, serverDynamic) {\n if (serverDynamic.syncDynamicErrorWithStack) {\n logDisallowedDynamicError(workStore, serverDynamic.syncDynamicErrorWithStack);\n throw new StaticGenBailoutError();\n }\n}\nexport function throwIfDisallowedDynamic(workStore, prelude, dynamicValidation, serverDynamic, allowEmptyStaticShell) {\n const dynamicHoleKind = 6;\n throwIfSyncIOUsed(workStore, serverDynamic);\n // The dynamic metadata error is a mistake-detection signal. It fires when the\n // rest of the shell is otherwise fully static apart from metadata, suggesting\n // the dynamic data access in `generateMetadata` was probably unintentional.\n // That condition is independent of whether the user or build phase accepted\n // an empty shell, so we surface it before any opt-in bypass.\n if (prelude === 0 && dynamicValidation.hasAllowedDynamic === false && dynamicValidation.hasDynamicMetadata) {\n console.error(createMetadataError(dynamicHoleKind, workStore.route).message);\n throw new StaticGenBailoutError();\n }\n // Either flag expresses \"this shell is allowed to be empty/blocking\":\n // - `allowEmptyStaticShell` covers `instant = false` (user opt-in)\n // and the build-phase fallback-shell case.\n // - `hasSuspenseAboveBody` is the structural opt-in inside the user's root\n // layout.\n // Treat them as synonyms for the purpose of bypassing shell-failure errors.\n if (allowEmptyStaticShell || dynamicValidation.hasSuspenseAboveBody) {\n return;\n }\n if (prelude !== 0) {\n // We didn't have any sync bailouts but there may be user code which\n // blocked the root. We would have captured these during the prerender\n // and can log them here and then terminate the build/validating render\n const dynamicErrors = dynamicValidation.dynamicErrors;\n if (dynamicErrors.length > 0) {\n for(let i = 0; i < dynamicErrors.length; i++){\n logDisallowedDynamicError(workStore, dynamicErrors[i]);\n }\n throw new StaticGenBailoutError();\n }\n // If we got this far then the only other thing that could be blocking\n // the root is dynamic Viewport. If this is dynamic then\n // you need to opt into that by adding a Suspense boundary above the body\n // to indicate your are ok with fully dynamic rendering.\n if (dynamicValidation.hasDynamicViewport) {\n console.error(createViewportError(dynamicHoleKind, workStore.route).message);\n throw new StaticGenBailoutError();\n }\n if (prelude === 1) {\n // If we ever get this far then we messed up the tracking of invalid dynamic.\n // We still adhere to the constraint that you must produce a shell but invite the\n // user to report this as a bug in Next.js.\n console.error(`Route \"${workStore.route}\" did not produce a static shell and Next.js was unable to determine a reason. This is a bug in Next.js.`);\n throw new StaticGenBailoutError();\n }\n }\n}\nexport function throwIfDisallowedDynamicInStaticRoute(workStore, prelude, dynamicValidation, serverDynamic, isFallbackShell, allowEmptyStaticShell, isServerPartial) {\n const reasons = getDisallowedReasonsInStaticRoute(workStore, prelude, dynamicValidation, serverDynamic, isFallbackShell, allowEmptyStaticShell, isServerPartial);\n if (reasons.length > 0) {\n for (const reason of reasons){\n logDisallowedDynamicError(workStore, reason);\n }\n throw new StaticGenBailoutError();\n }\n}\nexport function getDisallowedReasonsInStaticRoute(workStore, prelude, dynamicValidation, serverDynamic, isFallbackShell, allowEmptyStaticShell, isServerPartial) {\n if (serverDynamic && serverDynamic.syncDynamicErrorWithStack) {\n return [\n serverDynamic.syncDynamicErrorWithStack\n ];\n }\n // We do a fallback shell prerender, but it's not meant to be validated --\n // we just need it to create the relevant prerender outputs.\n if (isFallbackShell) {\n return [];\n }\n // Suspense-above-body and `instant = false` bypass reporting\n // that the shell is blocked. However, if we have non-prerenderable server\n // data, we still have to error, regardless of those two.\n if (!isServerPartial && (allowEmptyStaticShell || dynamicValidation.hasSuspenseAboveBody)) {\n return [];\n }\n const { dynamicErrors } = dynamicValidation;\n if (dynamicErrors.length > 0) {\n return dynamicErrors;\n }\n // Dynamic data may have been passed into a client component without calling `use()`,\n // in which case we wouldn't see it during the prerender, but still need to error.\n // Fall back to a generic error message.\n if (isServerPartial) {\n return [\n new Error(`Route \"${workStore.route}\": Next.js encountered data that is not available during a static prerender, but is unable to provide a location.`)\n ];\n }\n if (prelude === 1 || prelude === 2) {\n // We've somehow ended up with an empty prelude but no dynamic errors.\n // We must've messed up the tracking somehow.\n return [\n new InvariantError(`Route \"${workStore.route}\" did not produce a static shell and Next.js was unable to determine a reason.`)\n ];\n }\n return [];\n}\nexport function getStaticShellDisallowedDynamicReasons(workStore, prelude, dynamicValidation, allowEmptyStaticShell) {\n // The dynamic metadata error is a mistake-detection signal. It fires when the\n // rest of the shell is otherwise fully static apart from metadata, suggesting\n // the dynamic data access in `generateMetadata` was probably unintentional.\n // That condition is independent of whether the user or build phase accepted\n // an empty shell, so we surface it before any opt-in bypass.\n if (prelude === 0 && dynamicValidation.hasAllowedDynamic === false && dynamicValidation.dynamicErrors.length === 0 && dynamicValidation.dynamicMetadata) {\n return [\n dynamicValidation.dynamicMetadata\n ];\n }\n // Either flag expresses \"this shell is allowed to be empty/blocking\":\n // - `allowEmptyStaticShell` covers `instant = false` (user opt-in)\n // and the build-phase fallback-shell case.\n // - `hasSuspenseAboveBody` is the structural opt-in inside the user's root\n // layout.\n // Treat them as synonyms for the purpose of bypassing shell-failure errors.\n if (allowEmptyStaticShell || dynamicValidation.hasSuspenseAboveBody) {\n return [];\n }\n if (prelude !== 0) {\n // We didn't have any sync bailouts but there may be user code which\n // blocked the root. We would have captured these during the prerender\n // and can log them here and then terminate the build/validating render\n const dynamicErrors = dynamicValidation.dynamicErrors;\n if (dynamicErrors.length > 0) {\n return dynamicErrors;\n }\n if (prelude === 1) {\n // If we ever get this far then we messed up the tracking of invalid dynamic.\n // We still adhere to the constraint that you must produce a shell but invite the\n // user to report this as a bug in Next.js.\n return [\n new InvariantError(`Route \"${workStore.route}\" did not produce a static shell and Next.js was unable to determine a reason.`)\n ];\n }\n }\n // We had a non-empty prelude and there are no dynamic holes\n return [];\n}\nexport function getNavigationDisallowedDynamicReasons(workStore, prelude, dynamicValidation, validationSampleTracking, boundaryState, devRenderDidError) {\n // If we have errors related to missing samples, those should take precedence over everything else.\n if (validationSampleTracking) {\n const { missingSampleErrors } = validationSampleTracking;\n if (missingSampleErrors.length > 0) {\n return missingSampleErrors;\n }\n }\n const { validationPreventingErrors } = dynamicValidation;\n if (validationPreventingErrors.length > 0) {\n if (process.env.__NEXT_DEV_SERVER && devRenderDidError) {\n // The dev render already surfaced server errors to the user.\n // The same errors likely caused validation to be inconclusive,\n // so reporting them again as validation failures would be noisy.\n return [];\n }\n return validationPreventingErrors;\n }\n // NOTE: We don't care about Suspense above body here,\n // we're only concerned with the validation boundary\n if (prelude !== 0) {\n const dynamicErrors = dynamicValidation.dynamicErrors;\n if (dynamicErrors.length > 0) {\n return dynamicErrors;\n }\n if (prelude === 1 && !dynamicValidation.hasAllowedClientDynamicAboveBoundary && allRequiredBoundariesRendered(boundaryState)) {\n // If we ever get this far then we messed up the tracking of invalid\n // dynamic. (When boundaries are missing the deferred fallback below\n // will surface a more useful error.)\n return new InvariantError(`Route \"${workStore.route}\" failed to render during instant validation and Next.js was unable to determine a reason.`);\n }\n } else {\n const dynamicErrors = dynamicValidation.dynamicErrors;\n if (dynamicErrors.length > 0) {\n return dynamicErrors;\n }\n if (dynamicValidation.hasAllowedDynamic === false && dynamicValidation.dynamicMetadata) {\n return [\n dynamicValidation.dynamicMetadata\n ];\n }\n }\n // Missing boundaries on their own aren't a strong signal — a parent\n // layout may legitimately omit a slot. Defer this so the caller can\n // try shallower validation depths first; if every depth comes up\n // empty we still want to surface this so the user is made aware that\n // validation didn't complete. When we add a markers API, the\n // marker-based variant of this check can become strict again.\n if (!allRequiredBoundariesRendered(boundaryState)) {\n const { thrownErrorsOutsideBoundary } = dynamicValidation;\n const rootInstantStack = dynamicValidation.slotStacks[0];\n if (thrownErrorsOutsideBoundary.length === 0) {\n const missingFiles = [];\n for (const [id, filePaths] of boundaryState.requiredIds){\n if (!boundaryState.renderedIds.has(id)) {\n for (const filePath of filePaths){\n let normalized = filePath.replace(/^\\[project\\][\\\\/]?/, '').replace(process.cwd() + '/', '').replace(process.cwd() + '\\\\', '');\n missingFiles.push(normalized);\n }\n }\n }\n missingFiles.sort();\n return createUnrenderedSegmentError(workStore.route, missingFiles);\n } else if (process.env.__NEXT_DEV_SERVER && devRenderDidError) {\n // Errors outside the boundary likely blocked it from rendering,\n // but they're already being reported to the user via the dev\n // render. Suppress the validation failure to avoid noise.\n return [];\n } else if (thrownErrorsOutsideBoundary.length === 1) {\n const message = `Route \"${workStore.route}\": Could not validate \\`instant\\` because the target segment was prevented from rendering, likely due to the following error.`;\n const error = rootInstantStack !== null ? rootInstantStack() : new Error();\n error.name = 'Error';\n error.message = message;\n return new AggregateError([\n error,\n thrownErrorsOutsideBoundary[0]\n ]);\n } else {\n const message = `Route \"${workStore.route}\": Could not validate \\`instant\\` because the target segment was prevented from rendering, likely due to one of the following errors.`;\n const error = rootInstantStack !== null ? rootInstantStack() : new Error();\n error.name = 'Error';\n error.message = message;\n return new AggregateError([\n error,\n ...thrownErrorsOutsideBoundary\n ]);\n }\n }\n // We had a non-empty prelude and there are no dynamic holes\n return [];\n}\n\n//# sourceMappingURL=dynamic-rendering.js.map","const DYNAMIC_ERROR_CODE = 'DYNAMIC_SERVER_USAGE';\nexport class DynamicServerError extends Error {\n constructor(description){\n super(`Dynamic server usage: ${description}`), this.description = description, this.digest = DYNAMIC_ERROR_CODE;\n }\n}\nexport function isDynamicServerError(err) {\n if (typeof err !== 'object' || err === null || !('digest' in err) || typeof err.digest !== 'string') {\n return false;\n }\n return err.digest === DYNAMIC_ERROR_CODE;\n}\n\n//# sourceMappingURL=hooks-server-context.js.map","const NEXT_STATIC_GEN_BAILOUT = 'NEXT_STATIC_GEN_BAILOUT';\nexport class StaticGenBailoutError extends Error {\n constructor(...args){\n super(...args), this.code = NEXT_STATIC_GEN_BAILOUT;\n }\n}\nexport function isStaticGenBailoutError(error) {\n if (typeof error !== 'object' || error === null || !('code' in error)) {\n return false;\n }\n return error.code === NEXT_STATIC_GEN_BAILOUT;\n}\n\n//# sourceMappingURL=static-generation-bailout.js.map","const noop = ()=>{};\nlet registry;\nif (globalThis.FinalizationRegistry) {\n registry = new FinalizationRegistry((weakRef)=>{\n const stream = weakRef.deref();\n if (stream && !stream.locked) {\n stream.cancel('Response object has been garbage collected').then(noop);\n }\n });\n}\n/**\n * Clones a response by teeing the body so we can return two independent\n * ReadableStreams from it. This avoids the bug in the undici library around\n * response cloning.\n *\n * After cloning, the original response's body will be consumed and closed.\n *\n * @see https://github.com/vercel/next.js/pull/73274\n *\n * @param original - The original response to clone.\n * @returns A tuple containing two independent clones of the original response.\n */ export function cloneResponse(original) {\n // If the response has no body, then we can just return the original response\n // twice because it's immutable.\n if (!original.body) {\n return [\n original,\n original\n ];\n }\n const [body1, body2] = original.body.tee();\n const cloned1 = new Response(body1, {\n status: original.status,\n statusText: original.statusText,\n headers: original.headers\n });\n Object.defineProperty(cloned1, 'url', {\n value: original.url,\n // How the original response.url behaves\n configurable: true,\n enumerable: true,\n writable: false\n });\n const cloned2 = new Response(body2, {\n status: original.status,\n statusText: original.statusText,\n headers: original.headers\n });\n Object.defineProperty(cloned2, 'url', {\n value: original.url,\n // How the original response.url behaves\n configurable: true,\n enumerable: true,\n writable: false\n });\n // The Fetch Standard allows users to skip consuming the response body by\n // relying on garbage collection to release connection resources.\n // https://github.com/nodejs/undici?tab=readme-ov-file#garbage-collection\n //\n // To cancel the stream you then need to cancel both resulting branches.\n // Teeing a stream will generally lock it for the duration, preventing other\n // readers from locking it.\n // https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/tee\n if (registry) {\n if (cloned1.body) {\n registry.register(cloned1, new WeakRef(cloned1.body));\n }\n if (cloned2.body) {\n registry.register(cloned2, new WeakRef(cloned2.body));\n }\n }\n return [\n cloned1,\n cloned2\n ];\n}\n\n//# sourceMappingURL=clone-response.js.map","/**\n * Node in the doubly-linked list used for LRU tracking.\n * Each node represents a cache entry with bidirectional pointers.\n */ class LRUNode {\n constructor(key, data, size){\n this.prev = null;\n this.next = null;\n this.key = key;\n this.data = data;\n this.size = size;\n }\n}\n/**\n * Sentinel node used for head/tail boundaries.\n * These nodes don't contain actual cache data but simplify list operations.\n */ class SentinelNode {\n constructor(){\n this.prev = null;\n this.next = null;\n }\n}\n/**\n * LRU (Least Recently Used) Cache implementation using a doubly-linked list\n * and hash map for O(1) operations.\n *\n * Algorithm:\n * - Uses a doubly-linked list to maintain access order (most recent at head)\n * - Hash map provides O(1) key-to-node lookup\n * - Sentinel head/tail nodes simplify edge case handling\n * - Size-based eviction supports custom size calculation functions\n *\n * Data Structure Layout:\n * HEAD <-> [most recent] <-> ... <-> [least recent] <-> TAIL\n *\n * Operations:\n * - get(): Move accessed node to head (mark as most recent)\n * - set(): Add new node at head, evict from tail if over capacity\n * - Eviction: Remove least recent node (tail.prev) when size exceeds limit\n */ export class LRUCache {\n constructor(maxSize, calculateSize, onEvict){\n this.cache = new Map();\n this.totalSize = 0;\n this.maxSize = maxSize;\n this.calculateSize = calculateSize;\n this.onEvict = onEvict;\n // Create sentinel nodes to simplify doubly-linked list operations\n // HEAD <-> TAIL (empty list)\n this.head = new SentinelNode();\n this.tail = new SentinelNode();\n this.head.next = this.tail;\n this.tail.prev = this.head;\n }\n /**\n * Adds a node immediately after the head (marks as most recently used).\n * Used when inserting new items or when an item is accessed.\n * PRECONDITION: node must be disconnected (prev/next should be null)\n */ addToHead(node) {\n node.prev = this.head;\n node.next = this.head.next;\n // head.next is always non-null (points to tail or another node)\n this.head.next.prev = node;\n this.head.next = node;\n }\n /**\n * Removes a node from its current position in the doubly-linked list.\n * Updates the prev/next pointers of adjacent nodes to maintain list integrity.\n * PRECONDITION: node must be connected (prev/next are non-null)\n */ removeNode(node) {\n // Connected nodes always have non-null prev/next\n node.prev.next = node.next;\n node.next.prev = node.prev;\n }\n /**\n * Moves an existing node to the head position (marks as most recently used).\n * This is the core LRU operation - accessed items become most recent.\n */ moveToHead(node) {\n this.removeNode(node);\n this.addToHead(node);\n }\n /**\n * Removes and returns the least recently used node (the one before tail).\n * This is called during eviction when the cache exceeds capacity.\n * PRECONDITION: cache is not empty (ensured by caller)\n */ removeTail() {\n const lastNode = this.tail.prev;\n // tail.prev is always non-null and always LRUNode when cache is not empty\n this.removeNode(lastNode);\n return lastNode;\n }\n /**\n * Sets a key-value pair in the cache.\n * If the key exists, updates the value and moves to head.\n * If new, adds at head and evicts from tail if necessary.\n *\n * Time Complexity:\n * - O(1) for uniform item sizes\n * - O(k) where k is the number of items evicted (can be O(N) for variable sizes)\n */ set(key, value) {\n const size = (this.calculateSize == null ? void 0 : this.calculateSize.call(this, value, key)) ?? 1;\n if (size <= 0) {\n throw new Error(`LRUCache: calculateSize returned ${size}, but size must be > 0. ` + `Items with size 0 would never be evicted, causing unbounded cache growth.`);\n }\n if (size > this.maxSize) {\n console.warn('Single item size exceeds maxSize');\n return false;\n }\n const existing = this.cache.get(key);\n if (existing) {\n // Update existing node: adjust size and move to head (most recent)\n existing.data = value;\n this.totalSize = this.totalSize - existing.size + size;\n existing.size = size;\n this.moveToHead(existing);\n } else {\n // Add new node at head (most recent position)\n const newNode = new LRUNode(key, value, size);\n this.cache.set(key, newNode);\n this.addToHead(newNode);\n this.totalSize += size;\n }\n // Evict least recently used items until under capacity\n while(this.totalSize > this.maxSize && this.cache.size > 0){\n const tail = this.removeTail();\n this.cache.delete(tail.key);\n this.totalSize -= tail.size;\n this.onEvict == null ? void 0 : this.onEvict.call(this, tail.key, tail.data);\n }\n return true;\n }\n /**\n * Checks if a key exists in the cache.\n * This is a pure query operation - does NOT update LRU order.\n *\n * Time Complexity: O(1)\n */ has(key) {\n return this.cache.has(key);\n }\n /**\n * Retrieves a value by key and marks it as most recently used.\n * Moving to head maintains the LRU property for future evictions.\n *\n * Time Complexity: O(1)\n */ get(key) {\n const node = this.cache.get(key);\n if (!node) return undefined;\n // Mark as most recently used by moving to head\n this.moveToHead(node);\n return node.data;\n }\n /**\n * Returns an iterator over the cache entries. The order is outputted in the\n * order of most recently used to least recently used.\n */ *[Symbol.iterator]() {\n let current = this.head.next;\n while(current && current !== this.tail){\n // Between head and tail, current is always LRUNode\n const node = current;\n yield [\n node.key,\n node.data\n ];\n current = current.next;\n }\n }\n /**\n * Removes a specific key from the cache.\n * Updates both the hash map and doubly-linked list.\n *\n * Note: This is an explicit removal and does NOT trigger the `onEvict`\n * callback. Use this for intentional deletions where eviction tracking\n * is not needed.\n *\n * Time Complexity: O(1)\n */ remove(key) {\n const node = this.cache.get(key);\n if (!node) return;\n this.removeNode(node);\n this.cache.delete(key);\n this.totalSize -= node.size;\n }\n /**\n * Returns the number of items in the cache.\n */ get size() {\n return this.cache.size;\n }\n /**\n * Returns the current total size of all cached items.\n * This uses the custom size calculation if provided.\n */ get currentSize() {\n return this.totalSize;\n }\n}\n\n//# sourceMappingURL=lru-cache.js.map","// ISC License\n// Copyright (c) 2021 Alexey Raspopov, Kostiantyn Denysov, Anton Verinov\n// Permission to use, copy, modify, and/or distribute this software for any\n// purpose with or without fee is hereby granted, provided that the above\n// copyright notice and this permission notice appear in all copies.\n// THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n//\n// https://github.com/alexeyraspopov/picocolors/blob/b6261487e7b81aaab2440e397a356732cad9e342/picocolors.js#L1\nvar _globalThis;\nconst { env, stdout } = ((_globalThis = globalThis) == null ? void 0 : _globalThis.process) ?? {};\nconst enabled = env && !env.NO_COLOR && (env.FORCE_COLOR || (stdout == null ? void 0 : stdout.isTTY) && !env.CI && env.TERM !== 'dumb');\nexport const isColorSupported = Boolean(enabled);\n// Whether stdout ends up on a terminal: directly, or through the CLI, which\n// pipes a child's output while the upgrade menu is open.\nexport const stdoutIsTerminal = Boolean(stdout == null ? void 0 : stdout.isTTY) || env.NEXT_PRIVATE_PROMPT_OUTPUT === '1';\nconst replaceClose = (str, close, replace, index)=>{\n const start = str.substring(0, index) + replace;\n const end = str.substring(index + close.length);\n const nextIndex = end.indexOf(close);\n return ~nextIndex ? start + replaceClose(end, close, replace, nextIndex) : start + end;\n};\nconst formatter = (open, close, replace = open)=>{\n if (!enabled) return String;\n return (input)=>{\n const string = '' + input;\n const index = string.indexOf(close, open.length);\n return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;\n };\n};\nexport const reset = enabled ? (s)=>`\\x1b[0m${s}\\x1b[0m` : String;\nexport const bold = formatter('\\x1b[1m', '\\x1b[22m', '\\x1b[22m\\x1b[1m');\nexport const dim = formatter('\\x1b[2m', '\\x1b[22m', '\\x1b[22m\\x1b[2m');\nexport const italic = formatter('\\x1b[3m', '\\x1b[23m');\nexport const underline = formatter('\\x1b[4m', '\\x1b[24m');\nexport const inverse = formatter('\\x1b[7m', '\\x1b[27m');\nexport const hidden = formatter('\\x1b[8m', '\\x1b[28m');\nexport const strikethrough = formatter('\\x1b[9m', '\\x1b[29m');\nexport const black = formatter('\\x1b[30m', '\\x1b[39m');\nexport const red = formatter('\\x1b[31m', '\\x1b[39m');\nexport const green = formatter('\\x1b[32m', '\\x1b[39m');\nexport const yellow = formatter('\\x1b[33m', '\\x1b[39m');\nexport const blue = formatter('\\x1b[34m', '\\x1b[39m');\nexport const magenta = formatter('\\x1b[35m', '\\x1b[39m');\nexport const purple = formatter('\\x1b[38;2;173;127;168m', '\\x1b[39m');\nexport const cyan = formatter('\\x1b[36m', '\\x1b[39m');\nexport const white = formatter('\\x1b[37m', '\\x1b[39m');\nexport const gray = formatter('\\x1b[90m', '\\x1b[39m');\nexport const bgBlack = formatter('\\x1b[40m', '\\x1b[49m');\nexport const bgRed = formatter('\\x1b[41m', '\\x1b[49m');\nexport const bgGreen = formatter('\\x1b[42m', '\\x1b[49m');\nexport const bgYellow = formatter('\\x1b[43m', '\\x1b[49m');\nexport const bgBlue = formatter('\\x1b[44m', '\\x1b[49m');\nexport const bgMagenta = formatter('\\x1b[45m', '\\x1b[49m');\nexport const bgCyan = formatter('\\x1b[46m', '\\x1b[49m');\nexport const bgWhite = formatter('\\x1b[47m', '\\x1b[49m');\n\n//# sourceMappingURL=picocolors.js.map","/**\n * A cache of lowercased locales for each list of locales. This is stored as a\n * WeakMap so if the locales are garbage collected, the cache entry will be\n * removed as well.\n */ const cache = new WeakMap();\n/**\n * For a pathname that may include a locale from a list of locales, it\n * removes the locale from the pathname returning it alongside with the\n * detected locale.\n *\n * @param pathname A pathname that may include a locale.\n * @param locales A list of locales.\n * @returns The detected locale and pathname without locale\n */ export function normalizeLocalePath(pathname, locales) {\n // If locales is undefined, return the pathname as is.\n if (!locales) return {\n pathname\n };\n // Get the cached lowercased locales or create a new cache entry.\n let lowercasedLocales = cache.get(locales);\n if (!lowercasedLocales) {\n lowercasedLocales = locales.map((locale)=>locale.toLowerCase());\n cache.set(locales, lowercasedLocales);\n }\n let detectedLocale;\n // The first segment will be empty, because it has a leading `/`. If\n // there is no further segment, there is no locale (or it's the default).\n const segments = pathname.split('/', 2);\n // If there's no second segment (ie, the pathname is just `/`), there's no\n // locale.\n if (!segments[1]) return {\n pathname\n };\n // The second segment will contain the locale part if any.\n const segment = segments[1].toLowerCase();\n // See if the segment matches one of the locales. If it doesn't, there is\n // no locale (or it's the default).\n const index = lowercasedLocales.indexOf(segment);\n if (index < 0) return {\n pathname\n };\n // Return the case-sensitive locale.\n detectedLocale = locales[index];\n // Remove the `/${locale}` part of the pathname.\n pathname = pathname.slice(detectedLocale.length + 1) || '/';\n return {\n pathname,\n detectedLocale\n };\n}\n\n//# sourceMappingURL=normalize-locale-path.js.map","export { RequestCookies, ResponseCookies, stringifyCookie } from 'next/dist/compiled/@edge-runtime/cookies';\n\n//# sourceMappingURL=cookies.js.map","/**\n * Percent-encode every character other than horizontal tab and printable ASCII\n * so a value can be safely serialized into an HTTP header.\n *\n * Node's `validateHeaderValue` and `fetch`'s ByteString conversion accept\n * different character ranges. Restricting values to `\\t\\x20-\\x7e` produces a\n * conservative representation that both can serialize. Characters outside a\n * transport's accepted range (Hebrew, Arabic, Chinese, emoji, …) would\n * otherwise throw `ERR_INVALID_CHAR` or a `TypeError`, which crashes ISR or\n * fails a cache read on every affected request.\n *\n * Cache tags are encoded at the public boundaries — tag construction\n * (`getImplicitTags`, `validateTags`) and invalidation input\n * (`revalidatePath`, `revalidateTag`, `updateTag`) — so storage, comparison,\n * and the wire all see the same canonical form.\n *\n * The class is narrower than either transport accepts. Everything inside it\n * passes through byte-for-byte, including `,`, `/`, `%`, `[`, `]`, `_`, `-` and\n * `\\t`, which preserves the comma-separated header format and the\n * dynamic-segment markers in derived tags (`_N_T_/[slug]/page`).\n *\n * Properties:\n * - Fast-path: input that already fits the class is returned unchanged. This\n * makes the encoder idempotent on already-encoded `%xx` sequences.\n * - Matches *runs* of out-of-class code units so surrogate pairs (e.g. an\n * emoji) are handed to `encodeURIComponent` as a complete code point — a\n * per-code-unit regex would split the pair and throw `URIError`.\n */ const OUT_OF_CLASS_CHAR = /[^\\t\\x20-\\x7e]/;\nconst OUT_OF_CLASS_RUN = /[^\\t\\x20-\\x7e]+/g;\nexport function encodeHeaderSafe(value) {\n return OUT_OF_CLASS_CHAR.test(value) ? value.replace(OUT_OF_CLASS_RUN, (run)=>encodeURIComponent(run)) : value;\n}\n\n//# sourceMappingURL=encode-header-safe.js.map","// This regex will have fast negatives meaning valid identifiers may not pass\n// this test. However this is only used during static generation to provide hints\n// about why a page bailed out of some or all prerendering and we can use bracket notation\n// for example while `ಠ_ಠ` is a valid identifier it's ok to print `searchParams['ಠ_ಠ']`\n// even if this would have been fine too `searchParams.ಠ_ಠ`\nconst isDefinitelyAValidIdentifier = /^[A-Za-z_$][A-Za-z0-9_$]*$/;\nexport function describeStringPropertyAccess(target, prop) {\n if (isDefinitelyAValidIdentifier.test(prop)) {\n return `\\`${target}.${prop}\\``;\n }\n return `\\`${target}[${JSON.stringify(prop)}]\\``;\n}\nexport function describeHasCheckingStringProperty(target, prop) {\n const stringifiedProp = JSON.stringify(prop);\n return `\\`Reflect.has(${target}, ${stringifiedProp})\\`, \\`${stringifiedProp} in ${target}\\`, or similar`;\n}\nexport const wellKnownProperties = new Set([\n 'hasOwnProperty',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'toString',\n 'valueOf',\n 'toLocaleString',\n // Promise prototype\n 'then',\n 'catch',\n 'finally',\n // React Promise extension\n 'status',\n // 'value',\n // 'error',\n // React introspection\n 'displayName',\n '_debugInfo',\n // Common tested properties\n 'toJSON',\n '$$typeof',\n '__esModule',\n // Tested by flight when checking for iterables\n '@@iterator'\n]);\n\n//# sourceMappingURL=reflect-utils.js.map","/**\n * Contains predefined constants for the trace span name in next/server.\n *\n * Currently, next/server/tracer is internal implementation only for tracking\n * next.js's implementation only with known span names defined here.\n **/ // eslint typescript has a bug with TS enums\nvar BaseServerSpan = /*#__PURE__*/ function(BaseServerSpan) {\n BaseServerSpan[\"handleRequest\"] = \"BaseServer.handleRequest\";\n BaseServerSpan[\"run\"] = \"BaseServer.run\";\n BaseServerSpan[\"pipe\"] = \"BaseServer.pipe\";\n BaseServerSpan[\"getStaticHTML\"] = \"BaseServer.getStaticHTML\";\n BaseServerSpan[\"render\"] = \"BaseServer.render\";\n BaseServerSpan[\"renderToResponseWithComponents\"] = \"BaseServer.renderToResponseWithComponents\";\n BaseServerSpan[\"renderToResponse\"] = \"BaseServer.renderToResponse\";\n BaseServerSpan[\"renderToHTML\"] = \"BaseServer.renderToHTML\";\n BaseServerSpan[\"renderError\"] = \"BaseServer.renderError\";\n BaseServerSpan[\"renderErrorToResponse\"] = \"BaseServer.renderErrorToResponse\";\n BaseServerSpan[\"renderErrorToHTML\"] = \"BaseServer.renderErrorToHTML\";\n BaseServerSpan[\"render404\"] = \"BaseServer.render404\";\n return BaseServerSpan;\n}(BaseServerSpan || {});\nvar LoadComponentsSpan = /*#__PURE__*/ function(LoadComponentsSpan) {\n LoadComponentsSpan[\"loadDefaultErrorComponents\"] = \"LoadComponents.loadDefaultErrorComponents\";\n LoadComponentsSpan[\"loadComponents\"] = \"LoadComponents.loadComponents\";\n LoadComponentsSpan[\"loadRouteModule\"] = \"LoadComponents.loadRouteModule\";\n return LoadComponentsSpan;\n}(LoadComponentsSpan || {});\nvar InstrumentationSpan = /*#__PURE__*/ function(InstrumentationSpan) {\n InstrumentationSpan[\"loadModule\"] = \"Instrumentation.loadModule\";\n InstrumentationSpan[\"register\"] = \"Instrumentation.register\";\n return InstrumentationSpan;\n}(InstrumentationSpan || {});\nvar NextServerSpan = /*#__PURE__*/ function(NextServerSpan) {\n NextServerSpan[\"getRequestHandler\"] = \"NextServer.getRequestHandler\";\n NextServerSpan[\"getRequestHandlerWithMetadata\"] = \"NextServer.getRequestHandlerWithMetadata\";\n NextServerSpan[\"getServer\"] = \"NextServer.getServer\";\n NextServerSpan[\"getServerRequestHandler\"] = \"NextServer.getServerRequestHandler\";\n NextServerSpan[\"createServer\"] = \"createServer.createServer\";\n return NextServerSpan;\n}(NextServerSpan || {});\nvar NextNodeServerSpan = /*#__PURE__*/ function(NextNodeServerSpan) {\n NextNodeServerSpan[\"compression\"] = \"NextNodeServer.compression\";\n NextNodeServerSpan[\"getBuildId\"] = \"NextNodeServer.getBuildId\";\n NextNodeServerSpan[\"createComponentTree\"] = \"NextNodeServer.createComponentTree\";\n NextNodeServerSpan[\"clientComponentLoading\"] = \"NextNodeServer.clientComponentLoading\";\n NextNodeServerSpan[\"getLayoutOrPageModule\"] = \"NextNodeServer.getLayoutOrPageModule\";\n NextNodeServerSpan[\"generateStaticRoutes\"] = \"NextNodeServer.generateStaticRoutes\";\n NextNodeServerSpan[\"generateFsStaticRoutes\"] = \"NextNodeServer.generateFsStaticRoutes\";\n NextNodeServerSpan[\"generatePublicRoutes\"] = \"NextNodeServer.generatePublicRoutes\";\n NextNodeServerSpan[\"generateImageRoutes\"] = \"NextNodeServer.generateImageRoutes.route\";\n NextNodeServerSpan[\"sendRenderResult\"] = \"NextNodeServer.sendRenderResult\";\n NextNodeServerSpan[\"proxyRequest\"] = \"NextNodeServer.proxyRequest\";\n NextNodeServerSpan[\"runApi\"] = \"NextNodeServer.runApi\";\n NextNodeServerSpan[\"render\"] = \"NextNodeServer.render\";\n NextNodeServerSpan[\"renderHTML\"] = \"NextNodeServer.renderHTML\";\n NextNodeServerSpan[\"imageOptimizer\"] = \"NextNodeServer.imageOptimizer\";\n NextNodeServerSpan[\"getPagePath\"] = \"NextNodeServer.getPagePath\";\n NextNodeServerSpan[\"getRoutesManifest\"] = \"NextNodeServer.getRoutesManifest\";\n NextNodeServerSpan[\"findPageComponents\"] = \"NextNodeServer.findPageComponents\";\n NextNodeServerSpan[\"getFontManifest\"] = \"NextNodeServer.getFontManifest\";\n NextNodeServerSpan[\"getServerComponentManifest\"] = \"NextNodeServer.getServerComponentManifest\";\n NextNodeServerSpan[\"getRequestHandler\"] = \"NextNodeServer.getRequestHandler\";\n NextNodeServerSpan[\"renderToHTML\"] = \"NextNodeServer.renderToHTML\";\n NextNodeServerSpan[\"renderError\"] = \"NextNodeServer.renderError\";\n NextNodeServerSpan[\"renderErrorToHTML\"] = \"NextNodeServer.renderErrorToHTML\";\n NextNodeServerSpan[\"render404\"] = \"NextNodeServer.render404\";\n NextNodeServerSpan[\"startResponse\"] = \"NextNodeServer.startResponse\";\n // nested inner span, does not require parent scope name\n NextNodeServerSpan[\"route\"] = \"route\";\n NextNodeServerSpan[\"onProxyReq\"] = \"onProxyReq\";\n NextNodeServerSpan[\"apiResolver\"] = \"apiResolver\";\n NextNodeServerSpan[\"internalFetch\"] = \"internalFetch\";\n return NextNodeServerSpan;\n}(NextNodeServerSpan || {});\nvar StartServerSpan = /*#__PURE__*/ function(StartServerSpan) {\n StartServerSpan[\"startServer\"] = \"startServer.startServer\";\n return StartServerSpan;\n}(StartServerSpan || {});\nvar RenderSpan = /*#__PURE__*/ function(RenderSpan) {\n RenderSpan[\"getServerSideProps\"] = \"Render.getServerSideProps\";\n RenderSpan[\"getStaticProps\"] = \"Render.getStaticProps\";\n RenderSpan[\"renderToString\"] = \"Render.renderToString\";\n RenderSpan[\"renderDocument\"] = \"Render.renderDocument\";\n RenderSpan[\"createBodyResult\"] = \"Render.createBodyResult\";\n return RenderSpan;\n}(RenderSpan || {});\nvar AppRenderSpan = /*#__PURE__*/ function(AppRenderSpan) {\n AppRenderSpan[\"renderToString\"] = \"AppRender.renderToString\";\n AppRenderSpan[\"renderToReadableStream\"] = \"AppRender.renderToReadableStream\";\n AppRenderSpan[\"getBodyResult\"] = \"AppRender.getBodyResult\";\n AppRenderSpan[\"fetch\"] = \"AppRender.fetch\";\n AppRenderSpan[\"waitShellReady\"] = \"AppRender.waitShellReady\";\n AppRenderSpan[\"renderToNodeFizzStream\"] = \"AppRender.renderToNodeFizzStream\";\n AppRenderSpan[\"instantInsights\"] = \"AppRender.instantInsights\";\n AppRenderSpan[\"instantInsightsPrepareValidation\"] = \"AppRender.instantInsights.prepareValidation\";\n AppRenderSpan[\"instantInsightsRunValidation\"] = \"AppRender.instantInsights.runValidation\";\n return AppRenderSpan;\n}(AppRenderSpan || {});\nvar DevBundlerServiceSpan = /*#__PURE__*/ function(DevBundlerServiceSpan) {\n DevBundlerServiceSpan[\"ensurePage\"] = \"DevBundlerService.ensurePage\";\n return DevBundlerServiceSpan;\n}(DevBundlerServiceSpan || {});\nvar RouterSpan = /*#__PURE__*/ function(RouterSpan) {\n RouterSpan[\"executeRoute\"] = \"Router.executeRoute\";\n return RouterSpan;\n}(RouterSpan || {});\nvar NodeSpan = /*#__PURE__*/ function(NodeSpan) {\n NodeSpan[\"runHandler\"] = \"Node.runHandler\";\n return NodeSpan;\n}(NodeSpan || {});\nvar AppRouteRouteHandlersSpan = /*#__PURE__*/ function(AppRouteRouteHandlersSpan) {\n AppRouteRouteHandlersSpan[\"runHandler\"] = \"AppRouteRouteHandlers.runHandler\";\n return AppRouteRouteHandlersSpan;\n}(AppRouteRouteHandlersSpan || {});\nvar AppRouteRouteModuleSpan = /*#__PURE__*/ function(AppRouteRouteModuleSpan) {\n AppRouteRouteModuleSpan[\"loadUserland\"] = \"AppRouteRouteModule.loadUserland\";\n return AppRouteRouteModuleSpan;\n}(AppRouteRouteModuleSpan || {});\nvar RouteModuleSpan = /*#__PURE__*/ function(RouteModuleSpan) {\n RouteModuleSpan[\"prepare\"] = \"RouteModule.prepare\";\n RouteModuleSpan[\"loadManifests\"] = \"RouteModule.loadManifests\";\n return RouteModuleSpan;\n}(RouteModuleSpan || {});\nvar ResolveMetadataSpan = /*#__PURE__*/ function(ResolveMetadataSpan) {\n ResolveMetadataSpan[\"generateMetadata\"] = \"ResolveMetadata.generateMetadata\";\n ResolveMetadataSpan[\"generateViewport\"] = \"ResolveMetadata.generateViewport\";\n return ResolveMetadataSpan;\n}(ResolveMetadataSpan || {});\nvar MiddlewareSpan = /*#__PURE__*/ function(MiddlewareSpan) {\n MiddlewareSpan[\"execute\"] = \"Middleware.execute\";\n return MiddlewareSpan;\n}(MiddlewareSpan || {});\n// This list is used to filter out spans that are not relevant to the user\nexport const NextVanillaSpanAllowlist = new Set([\n \"Middleware.execute\",\n \"BaseServer.handleRequest\",\n \"Render.getServerSideProps\",\n \"Render.getStaticProps\",\n \"AppRender.fetch\",\n \"AppRender.getBodyResult\",\n \"LoadComponents.loadRouteModule\",\n \"Render.renderDocument\",\n \"Node.runHandler\",\n \"AppRouteRouteHandlers.runHandler\",\n \"AppRouteRouteModule.loadUserland\",\n \"RouteModule.prepare\",\n \"Instrumentation.loadModule\",\n \"Instrumentation.register\",\n \"ResolveMetadata.generateMetadata\",\n \"ResolveMetadata.generateViewport\",\n \"NextNodeServer.createComponentTree\",\n \"NextNodeServer.findPageComponents\",\n \"NextNodeServer.getLayoutOrPageModule\",\n \"NextNodeServer.startResponse\",\n \"NextNodeServer.clientComponentLoading\"\n]);\n// These Spans are allowed to be always logged\n// when the otel log prefix env is set\nexport const LogSpanAllowList = new Set([\n \"NextNodeServer.findPageComponents\",\n \"NextNodeServer.createComponentTree\",\n \"NextNodeServer.clientComponentLoading\"\n]);\nexport { BaseServerSpan, LoadComponentsSpan, InstrumentationSpan, NextServerSpan, NextNodeServerSpan, StartServerSpan, RenderSpan, RouterSpan, AppRenderSpan, DevBundlerServiceSpan, NodeSpan, AppRouteRouteHandlersSpan, AppRouteRouteModuleSpan, RouteModuleSpan, ResolveMetadataSpan, MiddlewareSpan, };\n\n//# sourceMappingURL=constants.js.map","export var RedirectStatusCode = /*#__PURE__*/ function(RedirectStatusCode) {\n RedirectStatusCode[RedirectStatusCode[\"SeeOther\"] = 303] = \"SeeOther\";\n RedirectStatusCode[RedirectStatusCode[\"TemporaryRedirect\"] = 307] = \"TemporaryRedirect\";\n RedirectStatusCode[RedirectStatusCode[\"PermanentRedirect\"] = 308] = \"PermanentRedirect\";\n return RedirectStatusCode;\n}({});\n\n//# sourceMappingURL=redirect-status-code.js.map","export function wrapNormalizerFn(fn) {\n return {\n normalize: fn\n };\n}\n\n//# sourceMappingURL=wrap-normalizer-fn.js.map","export const METADATA_BOUNDARY_NAME = '__next_metadata_boundary__';\nexport const VIEWPORT_BOUNDARY_NAME = '__next_viewport_boundary__';\nexport const OUTLET_BOUNDARY_NAME = '__next_outlet_boundary__';\nexport const ROOT_LAYOUT_BOUNDARY_NAME = '__next_root_layout_boundary__';\n\n//# sourceMappingURL=boundary-constants.js.map","export const INSTANT_VALIDATION_BOUNDARY_NAME = '__next_instant_validation_boundary__';\nexport const INSTANT_SLOT_MARKER_PREFIX = '__next_instant_slot_';\nexport const INSTANT_SLOT_MARKER_SUFFIX = '__';\n\n//# sourceMappingURL=boundary-constants.js.map","export function getRequestInsightKind(insight) {\n return insight.kind ?? 'request';\n}\nexport function getRequestInsightKey(insight) {\n return `${getRequestInsightKind(insight)}:${insight.requestId}`;\n}\n\n//# sourceMappingURL=request-insights.js.map","export var CachedRouteKind = /*#__PURE__*/ function(CachedRouteKind) {\n CachedRouteKind[\"APP_PAGE\"] = \"APP_PAGE\";\n CachedRouteKind[\"APP_ROUTE\"] = \"APP_ROUTE\";\n CachedRouteKind[\"PAGES\"] = \"PAGES\";\n CachedRouteKind[\"FETCH\"] = \"FETCH\";\n CachedRouteKind[\"REDIRECT\"] = \"REDIRECT\";\n CachedRouteKind[\"IMAGE\"] = \"IMAGE\";\n return CachedRouteKind;\n}({});\nexport var IncrementalCacheKind = /*#__PURE__*/ function(IncrementalCacheKind) {\n IncrementalCacheKind[\"APP_PAGE\"] = \"APP_PAGE\";\n IncrementalCacheKind[\"APP_ROUTE\"] = \"APP_ROUTE\";\n IncrementalCacheKind[\"PAGES\"] = \"PAGES\";\n IncrementalCacheKind[\"FETCH\"] = \"FETCH\";\n IncrementalCacheKind[\"IMAGE\"] = \"IMAGE\";\n return IncrementalCacheKind;\n}({});\n\n//# sourceMappingURL=types.js.map","export const TEXT_PLAIN_CONTENT_TYPE_HEADER = 'text/plain';\nexport const HTML_CONTENT_TYPE_HEADER = 'text/html; charset=utf-8';\nexport const JSON_CONTENT_TYPE_HEADER = 'application/json; charset=utf-8';\nexport const NEXT_QUERY_PARAM_PREFIX = 'nxtP';\nexport const NEXT_INTERCEPTION_MARKER_PREFIX = 'nxtI';\nexport const MATCHED_PATH_HEADER = 'x-matched-path';\nexport const PRERENDER_REVALIDATE_HEADER = 'x-prerender-revalidate';\nexport const PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER = 'x-prerender-revalidate-if-generated';\nexport const RSC_SEGMENTS_DIR_SUFFIX = '.segments';\nexport const RSC_SEGMENT_SUFFIX = '.segment.rsc';\nexport const RSC_SUFFIX = '.rsc';\nexport const ACTION_SUFFIX = '.action';\nexport const NEXT_DATA_SUFFIX = '.json';\nexport const NEXT_META_SUFFIX = '.meta';\nexport const NEXT_BODY_SUFFIX = '.body';\nexport const NEXT_NAV_DEPLOYMENT_ID_HEADER = 'x-nextjs-deployment-id';\nexport const NEXT_CACHE_TAGS_HEADER = 'x-next-cache-tags';\nexport const NEXT_CACHE_REVALIDATED_TAGS_HEADER = 'x-next-revalidated-tags';\nexport const NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER = 'x-next-revalidate-tag-token';\nexport const NEXT_RESUME_HEADER = 'next-resume';\nexport const NEXT_RESUME_STATE_LENGTH_HEADER = 'x-next-resume-state-length';\n// if these change make sure we update the related\n// documentation as well\nexport const NEXT_CACHE_TAG_MAX_ITEMS = 128;\nexport const NEXT_CACHE_TAG_MAX_LENGTH = 256;\nexport const NEXT_CACHE_SOFT_TAG_MAX_LENGTH = 1024;\nexport const NEXT_CACHE_IMPLICIT_TAG_ID = '_N_T_';\nexport const NEXT_CACHE_ROOT_PARAM_TAG_ID = '_N_RP_';\n// in seconds\nexport const CACHE_ONE_YEAR_SECONDS = 31536000;\n// in seconds, represents revalidate=false. I.e. never revaliate.\n// We use this value since it can be represented as a V8 SMI for optimal performance.\n// It can also be serialized as JSON if it ever leaks accidentally as an actual value.\nexport const INFINITE_CACHE = 0xfffffffe;\n// Patterns to detect middleware files\nexport const MIDDLEWARE_FILENAME = 'middleware';\nexport const MIDDLEWARE_LOCATION_REGEXP = `(?:src/)?${MIDDLEWARE_FILENAME}`;\n// Patterns to detect proxy files (replacement for middleware)\nexport const PROXY_FILENAME = 'proxy';\nexport const PROXY_LOCATION_REGEXP = `(?:src/)?${PROXY_FILENAME}`;\n// Pattern to detect instrumentation hooks file\nexport const INSTRUMENTATION_HOOK_FILENAME = 'instrumentation';\n// Because on Windows absolute paths in the generated code can break because of numbers, eg 1 in the path,\n// we have to use a private alias\nexport const PAGES_DIR_ALIAS = 'private-next-pages';\nexport const DOT_NEXT_ALIAS = 'private-dot-next';\nexport const ROOT_DIR_ALIAS = 'private-next-root-dir';\nexport const APP_DIR_ALIAS = 'private-next-app-dir';\nexport const RSC_MOD_REF_PROXY_ALIAS = 'private-next-rsc-mod-ref-proxy';\nexport const RSC_ACTION_VALIDATE_ALIAS = 'private-next-rsc-action-validate';\nexport const RSC_ACTION_PROXY_ALIAS = 'private-next-rsc-server-reference';\nexport const RSC_CACHE_WRAPPER_ALIAS = 'private-next-rsc-cache-wrapper';\nexport const RSC_DYNAMIC_IMPORT_WRAPPER_ALIAS = 'private-next-rsc-track-dynamic-import';\nexport const RSC_ACTION_ENCRYPTION_ALIAS = 'private-next-rsc-action-encryption';\nexport const RSC_ACTION_CLIENT_WRAPPER_ALIAS = 'private-next-rsc-action-client-wrapper';\nexport const PUBLIC_DIR_MIDDLEWARE_CONFLICT = `You can not have a '_next' folder inside of your public folder. This conflicts with the internal '/_next' route. https://nextjs.org/docs/messages/public-next-folder-conflict`;\nexport const SSG_GET_INITIAL_PROPS_CONFLICT = `You can not use getInitialProps with getStaticProps. To use SSG, please remove your getInitialProps`;\nexport const SERVER_PROPS_GET_INIT_PROPS_CONFLICT = `You can not use getInitialProps with getServerSideProps. Please remove getInitialProps.`;\nexport const SERVER_PROPS_SSG_CONFLICT = `You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps`;\nexport const STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR = `can not have getInitialProps/getServerSideProps, https://nextjs.org/docs/messages/404-get-initial-props`;\nexport const SERVER_PROPS_EXPORT_ERROR = `pages with \\`getServerSideProps\\` can not be exported. See more info here: https://nextjs.org/docs/messages/gssp-export`;\nexport const GSP_NO_RETURNED_VALUE = 'Your `getStaticProps` function did not return an object. Did you forget to add a `return`?';\nexport const GSSP_NO_RETURNED_VALUE = 'Your `getServerSideProps` function did not return an object. Did you forget to add a `return`?';\nexport const UNSTABLE_REVALIDATE_RENAME_ERROR = 'The `unstable_revalidate` property is available for general use.\\n' + 'Please use `revalidate` instead.';\nexport const GSSP_COMPONENT_MEMBER_ERROR = `can not be attached to a page's component and must be exported from the page. See more info here: https://nextjs.org/docs/messages/gssp-component-member`;\nexport const NON_STANDARD_NODE_ENV = `You are using a non-standard \"NODE_ENV\" value in your environment. This creates inconsistencies in the project and is strongly advised against. Read more: https://nextjs.org/docs/messages/non-standard-node-env`;\nexport const SSG_FALLBACK_EXPORT_ERROR = `Pages with \\`fallback\\` enabled in \\`getStaticPaths\\` can not be exported. See more info here: https://nextjs.org/docs/messages/ssg-fallback-true-export`;\nexport const ESLINT_DEFAULT_DIRS = [\n 'app',\n 'pages',\n 'components',\n 'lib',\n 'src'\n];\nexport const SERVER_RUNTIME = {\n edge: 'edge',\n experimentalEdge: 'experimental-edge',\n nodejs: 'nodejs'\n};\nexport const WEB_SOCKET_MAX_RECONNECTIONS = 12;\n/**\n * The names of the webpack layers. These layers are the primitives for the\n * webpack chunks.\n */ const WEBPACK_LAYERS_NAMES = {\n /**\n * The layer for the shared code between the client and server bundles.\n */ shared: 'shared',\n /**\n * The layer for server-only runtime and picking up `react-server` export conditions.\n * Including app router RSC pages and app router custom routes and metadata routes.\n */ reactServerComponents: 'rsc',\n /**\n * Server Side Rendering layer for app (ssr).\n */ serverSideRendering: 'ssr',\n /**\n * The browser client bundle layer for actions.\n */ actionBrowser: 'action-browser',\n /**\n * The Node.js bundle layer for the API routes.\n */ apiNode: 'api-node',\n /**\n * The Edge Lite bundle layer for the API routes.\n */ apiEdge: 'api-edge',\n /**\n * The layer for the middleware code.\n */ middleware: 'middleware',\n /**\n * The layer for the instrumentation hooks.\n */ instrument: 'instrument',\n /**\n * The layer for assets on the edge.\n */ edgeAsset: 'edge-asset',\n /**\n * The browser client bundle layer for App directory.\n */ appPagesBrowser: 'app-pages-browser',\n /**\n * The browser client bundle layer for Pages directory.\n */ pagesDirBrowser: 'pages-dir-browser',\n /**\n * The Edge Lite bundle layer for Pages directory.\n */ pagesDirEdge: 'pages-dir-edge',\n /**\n * The Node.js bundle layer for Pages directory.\n */ pagesDirNode: 'pages-dir-node'\n};\nconst WEBPACK_LAYERS = {\n ...WEBPACK_LAYERS_NAMES,\n GROUP: {\n builtinReact: [\n WEBPACK_LAYERS_NAMES.reactServerComponents,\n WEBPACK_LAYERS_NAMES.actionBrowser\n ],\n serverOnly: [\n WEBPACK_LAYERS_NAMES.reactServerComponents,\n WEBPACK_LAYERS_NAMES.actionBrowser,\n WEBPACK_LAYERS_NAMES.instrument,\n WEBPACK_LAYERS_NAMES.middleware\n ],\n neutralTarget: [\n // pages api\n WEBPACK_LAYERS_NAMES.apiNode,\n WEBPACK_LAYERS_NAMES.apiEdge\n ],\n clientOnly: [\n WEBPACK_LAYERS_NAMES.serverSideRendering,\n WEBPACK_LAYERS_NAMES.appPagesBrowser\n ],\n bundled: [\n WEBPACK_LAYERS_NAMES.reactServerComponents,\n WEBPACK_LAYERS_NAMES.actionBrowser,\n WEBPACK_LAYERS_NAMES.serverSideRendering,\n WEBPACK_LAYERS_NAMES.appPagesBrowser,\n WEBPACK_LAYERS_NAMES.shared,\n WEBPACK_LAYERS_NAMES.instrument,\n WEBPACK_LAYERS_NAMES.middleware\n ],\n appPages: [\n // app router pages and layouts\n WEBPACK_LAYERS_NAMES.reactServerComponents,\n WEBPACK_LAYERS_NAMES.serverSideRendering,\n WEBPACK_LAYERS_NAMES.appPagesBrowser,\n WEBPACK_LAYERS_NAMES.actionBrowser\n ]\n }\n};\nconst WEBPACK_RESOURCE_QUERIES = {\n edgeSSREntry: '__next_edge_ssr_entry__',\n metadata: '__next_metadata__',\n metadataRoute: '__next_metadata_route__',\n metadataImageMeta: '__next_metadata_image_meta__'\n};\nexport { WEBPACK_LAYERS, WEBPACK_RESOURCE_QUERIES };\n\n//# sourceMappingURL=constants.js.map","export function createPromiseWithResolvers() {\n // Shim of Stage 4 Promise.withResolvers proposal\n let resolve;\n let reject;\n const promise = new Promise((res, rej)=>{\n resolve = res;\n reject = rej;\n });\n return {\n resolve: resolve,\n reject: reject,\n promise\n };\n}\n\n//# sourceMappingURL=promise-with-resolvers.js.map","export class PageSignatureError extends Error {\n constructor({ page }){\n super(`The middleware \"${page}\" accepts an async API directly with the form:\n \n export function middleware(request, event) {\n return NextResponse.redirect('/new-location')\n }\n \n Read more: https://nextjs.org/docs/messages/middleware-new-signature\n `);\n }\n}\nexport class RemovedPageError extends Error {\n constructor(){\n super(`The request.page has been deprecated in favour of \\`URLPattern\\`.\n Read more: https://nextjs.org/docs/messages/middleware-request-page\n `);\n }\n}\nexport class RemovedUAError extends Error {\n constructor(){\n super(`The request.ua has been removed in favour of \\`userAgent\\` function.\n Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent\n `);\n }\n}\n\n//# sourceMappingURL=error.js.map","export var RouteKind = /*#__PURE__*/ function(RouteKind) {\n /**\n * `PAGES` represents all the React pages that are under `pages/`.\n */ RouteKind[\"PAGES\"] = \"PAGES\";\n /**\n * `PAGES_API` represents all the API routes under `pages/api/`.\n */ RouteKind[\"PAGES_API\"] = \"PAGES_API\";\n /**\n * `APP_PAGE` represents all the React pages that are under `app/` with the\n * filename of `page.{j,t}s{,x}`.\n */ RouteKind[\"APP_PAGE\"] = \"APP_PAGE\";\n /**\n * `APP_ROUTE` represents all the API routes and metadata routes that are under `app/` with the\n * filename of `route.{j,t}s{,x}`.\n */ RouteKind[\"APP_ROUTE\"] = \"APP_ROUTE\";\n /**\n * `IMAGE` represents all the images that are generated by `next/image`.\n */ RouteKind[\"IMAGE\"] = \"IMAGE\";\n return RouteKind;\n}({});\n\n//# sourceMappingURL=route-kind.js.map","export function getSegmentValue(segment) {\n return Array.isArray(segment) ? segment[1] : segment;\n}\nexport function isGroupSegment(segment) {\n // Use array[0] for performant purpose\n return segment[0] === '(' && segment.endsWith(')');\n}\nexport function isParallelRouteSegment(segment) {\n return segment.startsWith('@') && segment !== '@children';\n}\nexport function computeSelectedLayoutSegment(segments, parallelRouteKey) {\n if (!segments || segments.length === 0) {\n return null;\n }\n // For 'children', use first segment; for other parallel routes, use last segment\n const rawSegment = parallelRouteKey === 'children' ? segments[0] : segments[segments.length - 1];\n // If the default slot is showing, return null since it's not technically \"selected\" (it's a fallback)\n // Returning an internal value like `__DEFAULT__` would be confusing\n return rawSegment === DEFAULT_SEGMENT_KEY ? null : rawSegment;\n}\n/** Get the canonical parameters from the current level to the leaf node. */ export function getSelectedLayoutSegmentPath(tree, parallelRouteKey, first = true, segmentPath = []) {\n let node;\n if (first) {\n // Use the provided parallel route key on the first parallel route\n node = tree[1][parallelRouteKey];\n } else {\n // After first parallel route prefer children, if there's no children pick the first parallel route.\n const parallelRoutes = tree[1];\n node = parallelRoutes.children ?? Object.values(parallelRoutes)[0];\n }\n if (!node) return segmentPath;\n const segment = node[0];\n let segmentValue = getSegmentValue(segment);\n if (!segmentValue || segmentValue === PAGE_SEGMENT_KEY) {\n return segmentPath;\n }\n segmentPath.push(segmentValue);\n return getSelectedLayoutSegmentPath(node, parallelRouteKey, false, segmentPath);\n}\nexport const PAGE_SEGMENT_KEY = '__PAGE__';\nexport const DEFAULT_SEGMENT_KEY = '__DEFAULT__';\nexport const NOT_FOUND_SEGMENT_KEY = '/_not-found';\n\n//# sourceMappingURL=segment.js.map","export const SERVER_REFERENCE_ID_LENGTH = 42;\nexport function mightBeServerReferenceId(id) {\n return id.length === SERVER_REFERENCE_ID_LENGTH;\n}\n/**\n * Extracts info about the server reference for the given server reference ID by\n * parsing the first byte of the hex-encoded ID.\n *\n * ```\n * Bit positions: [7] [6] [5] [4] [3] [2] [1] [0]\n * Bits: typeBit argMask restArgs\n * ```\n *\n * If the `typeBit` is `1` the server reference represents a `\"use cache\"`\n * function, otherwise a server action.\n *\n * The `argMask` encodes whether the function uses the argument at the\n * respective position.\n *\n * The `restArgs` bit indicates whether the function uses a rest parameter. It's\n * also set to 1 if the function has more than 6 args.\n *\n * @param id hex-encoded server reference ID\n */ export function extractInfoFromServerReferenceId(id) {\n const infoByte = parseInt(id.slice(0, 2), 16);\n const typeBit = infoByte >> 7 & 0x1;\n const argMask = infoByte >> 1 & 0x3f;\n const restArgs = infoByte & 0x1;\n const usedArgs = Array(6);\n for(let index = 0; index < 6; index++){\n const bitPosition = 5 - index;\n const bit = argMask >> bitPosition & 0x1;\n usedArgs[index] = bit === 1;\n }\n return {\n type: typeBit === 1 ? 'use-cache' : 'server-action',\n usedArgs: usedArgs,\n hasRestArgs: restArgs === 1\n };\n}\n/**\n * Creates a sparse array containing only the used arguments based on the\n * provided action info.\n */ export function omitUnusedArgs(args, info) {\n const filteredArgs = new Array(args.length);\n let length = 0;\n for(let index = 0; index < args.length; index++){\n if (index < 6 && info.usedArgs[index] || // This assumes that the server reference info byte has the restArgs bit\n // set to 1 if there are more than 6 args.\n index >= 6 && info.hasRestArgs) {\n filteredArgs[index] = args[index];\n length = index + 1;\n }\n }\n // Trim trailing unused args from the array.\n filteredArgs.length = length;\n return filteredArgs;\n}\n\n//# sourceMappingURL=server-reference-info.js.map","export class InvariantError extends Error {\n constructor(message, options){\n super(`Invariant: ${message.endsWith('.') ? message : message + '.'} This is a bug in Next.js.`, options);\n this.name = 'InvariantError';\n }\n}\n\n//# sourceMappingURL=invariant-error.js.map","export function getRevalidateReason(params) {\n if (params.isOnDemandRevalidate) {\n return 'on-demand';\n }\n if (params.isStaticGeneration) {\n return 'stale';\n }\n return undefined;\n}\n\n//# sourceMappingURL=utils.js.map","export function detectDomainLocale(domainItems, hostname, detectedLocale) {\n if (!domainItems) return;\n if (detectedLocale) {\n detectedLocale = detectedLocale.toLowerCase();\n }\n for (const item of domainItems){\n // remove port if present\n const domainHostname = item.domain?.split(':', 1)[0].toLowerCase();\n if (hostname === domainHostname || detectedLocale === item.defaultLocale.toLowerCase() || item.locales?.some((locale)=>locale.toLowerCase() === detectedLocale)) {\n return item;\n }\n }\n}\n\n//# sourceMappingURL=detect-domain-locale.js.map","import { getOrCreateGlobalAsyncLocalStorage } from '../../app-render/async-local-storage';\n// This storage covers the part of BaseServer request handling that runs before\n// App Render creates workAsyncStorage. Once available, workStore remains the\n// primary identity source for locally recorded spans.\nfunction getRequestInsightsIdentityStorage() {\n return getOrCreateGlobalAsyncLocalStorage('request-insights-identity-storage');\n}\nexport function runWithRequestInsightsIdentity(identity, fn) {\n return getRequestInsightsIdentityStorage().run(identity, fn);\n}\nexport function getRequestInsightsIdentity() {\n return getRequestInsightsIdentityStorage().getStore();\n}\n\n//# sourceMappingURL=request-insights-identity.js.map","import { hexHash } from '../../hash';\nconst CACHE_BUSTING_SEARCH_PARAM_DIGEST_BYTES = 12;\nconst textEncoder = new TextEncoder();\nfunction encodeCacheBustingSearchParam(bytes) {\n let binary = '';\n for(let i = 0; i < bytes.length; i++){\n binary += String.fromCharCode(bytes[i]);\n }\n return btoa(binary).replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=+$/, '');\n}\nfunction normalizeCacheBustingInput(value) {\n if (value === undefined) {\n return '0';\n }\n return Array.isArray(value) ? value.join(',') : value;\n}\nfunction createCacheBustingSearchParamInput(prefetchHeader, segmentPrefetchHeader, stateTreeHeader, nextUrlHeader) {\n if ((prefetchHeader === undefined || prefetchHeader === '0') && segmentPrefetchHeader === undefined && stateTreeHeader === undefined && nextUrlHeader === undefined) {\n return null;\n }\n return [\n prefetchHeader ?? '0',\n normalizeCacheBustingInput(segmentPrefetchHeader),\n normalizeCacheBustingInput(stateTreeHeader),\n normalizeCacheBustingInput(nextUrlHeader)\n ].join(',');\n}\nasync function computeCacheBustingSearchParamFromInput(input) {\n // Truncate SHA-256 to 96 bits to keep `_rsc` compact\n const digest = await globalThis.crypto.subtle.digest('SHA-256', textEncoder.encode(input));\n return encodeCacheBustingSearchParam(new Uint8Array(digest).subarray(0, CACHE_BUSTING_SEARCH_PARAM_DIGEST_BYTES));\n}\nexport async function computeCacheBustingSearchParam(prefetchHeader, segmentPrefetchHeader, stateTreeHeader, nextUrlHeader) {\n const input = createCacheBustingSearchParamInput(prefetchHeader, segmentPrefetchHeader, stateTreeHeader, nextUrlHeader);\n if (input === null) {\n return '';\n }\n return computeCacheBustingSearchParamFromInput(input);\n}\nexport function computeLegacyCacheBustingSearchParam(prefetchHeader, segmentPrefetchHeader, stateTreeHeader, nextUrlHeader) {\n const input = createCacheBustingSearchParamInput(prefetchHeader, segmentPrefetchHeader, stateTreeHeader, nextUrlHeader);\n if (input === null) {\n return '';\n }\n return hexHash(input);\n}\n\n//# sourceMappingURL=cache-busting-search-param.js.map","// FIXME: (wyattjoh) this is a temporary solution to allow us to pass data between bundled modules\nexport const NEXT_REQUEST_META = Symbol.for('NextInternalRequestMeta');\nexport function getRequestMeta(req, key) {\n const meta = req[NEXT_REQUEST_META] || {};\n return typeof key === 'string' ? meta[key] : meta;\n}\n/**\n * Sets the request metadata.\n *\n * @param req the request to set the metadata on\n * @param meta the metadata to set\n * @returns the mutated request metadata\n */ export function setRequestMeta(req, meta) {\n req[NEXT_REQUEST_META] = meta;\n return meta;\n}\n/**\n * Adds a value to the request metadata.\n *\n * @param request the request to mutate\n * @param key the key to set\n * @param value the value to set\n * @returns the mutated request metadata\n */ export function addRequestMeta(request, key, value) {\n const meta = getRequestMeta(request);\n meta[key] = value;\n return setRequestMeta(request, meta);\n}\n/**\n * Removes a key from the request metadata.\n *\n * @param request the request to mutate\n * @param key the key to remove\n * @returns the mutated request metadata\n */ export function removeRequestMeta(request, key) {\n const meta = getRequestMeta(request);\n delete meta[key];\n return setRequestMeta(request, meta);\n}\n\n//# sourceMappingURL=request-meta.js.map","import { CACHE_ONE_YEAR_SECONDS } from '../../lib/constants';\nexport function getCacheControlHeader({ revalidate, expire }) {\n const swrHeader = typeof revalidate === 'number' && expire !== undefined && revalidate < expire ? `, stale-while-revalidate=${expire - revalidate}` : '';\n if (revalidate === 0) {\n return 'private, no-cache, no-store, max-age=0, must-revalidate';\n } else if (typeof revalidate === 'number') {\n return `s-maxage=${revalidate}${swrHeader}`;\n }\n return `s-maxage=${CACHE_ONE_YEAR_SECONDS}${swrHeader}`;\n}\n\n//# sourceMappingURL=cache-control.js.map","import { LogSpanAllowList, NextVanillaSpanAllowlist } from './constants';\nimport { isThenable } from '../../../shared/lib/is-thenable';\nconst NEXT_OTEL_PERFORMANCE_PREFIX = process.env.NEXT_OTEL_PERFORMANCE_PREFIX;\nconst LOCAL_SPAN_RECORDER_KEY = Symbol.for('@next/local-span-recorder');\nlet api;\nfunction getLocalSpanRecorder() {\n if (process.env.__NEXT_DEV_SERVER) {\n return globalThis[LOCAL_SPAN_RECORDER_KEY];\n } else {\n return undefined;\n }\n}\n// we want to allow users to use their own version of @opentelemetry/api if they\n// want to, so we try to require it first, and if it fails we fall back to the\n// version that is bundled with Next.js\n// this is because @opentelemetry/api has to be synced with the version of\n// @opentelemetry/tracing that is used, and we don't want to force users to use\n// the version that is bundled with Next.js.\n// the API is ~stable, so this should be fine\nif (process.env.NEXT_RUNTIME === 'edge') {\n api = require('@opentelemetry/api');\n} else {\n try {\n api = require('@opentelemetry/api');\n } catch (err) {\n api = require('next/dist/compiled/@opentelemetry/api');\n }\n}\nconst { context, propagation, trace, SpanStatusCode, SpanKind, ROOT_CONTEXT } = api;\nexport class BubbledError extends Error {\n constructor(bubble, result){\n super(), this.bubble = bubble, this.result = result;\n }\n}\nexport function isBubbledError(error) {\n if (typeof error !== 'object' || error === null) return false;\n return error instanceof BubbledError;\n}\nconst closeSpanWithError = (span, error, endTime)=>{\n if (isBubbledError(error) && error.bubble) {\n span.setAttribute('next.bubble', true);\n } else {\n if (error) {\n span.recordException(error);\n span.setAttribute('error.type', error.name);\n }\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: error == null ? void 0 : error.message\n });\n }\n span.end(endTime);\n};\n/** we use this map to propagate attributes from nested spans to the top span */ const rootSpanAttributesStore = new Map();\nconst rootSpanIdKey = api.createContextKey('next.rootSpanId');\nlet lastSpanId = 0;\nconst getSpanId = ()=>lastSpanId++;\nconst clientTraceDataSetter = {\n set (carrier, key, value) {\n carrier.push({\n key,\n value\n });\n }\n};\nclass NextTracerImpl {\n /**\n * Returns an instance to the trace with configured name.\n * Since wrap / trace can be defined in any place prior to actual trace subscriber initialization,\n * This should be lazily evaluated.\n */ getTracerInstance() {\n return trace.getTracer('next.js', \"16.4.2\");\n }\n isOpenTelemetryEnabled() {\n var _tracerProvider_getDelegate_constructor, _tracerProvider_getDelegate;\n const activeSpan = trace.getSpan(context.active());\n if (activeSpan == null ? void 0 : activeSpan.isRecording()) {\n return true;\n }\n const tracerProvider = trace.getTracerProvider();\n if (!('getDelegate' in tracerProvider)) {\n return true;\n }\n return (tracerProvider.getDelegate == null ? void 0 : (_tracerProvider_getDelegate = tracerProvider.getDelegate.call(tracerProvider)) == null ? void 0 : (_tracerProvider_getDelegate_constructor = _tracerProvider_getDelegate.constructor) == null ? void 0 : _tracerProvider_getDelegate_constructor.name) !== 'NoopTracerProvider';\n }\n getContext() {\n return context;\n }\n getTracePropagationData() {\n const activeContext = context.active();\n const entries = [];\n propagation.inject(activeContext, entries, clientTraceDataSetter);\n return entries;\n }\n getActiveScopeSpan() {\n const localSpanRecorder = getLocalSpanRecorder();\n const activeLocalSpan = localSpanRecorder == null ? void 0 : localSpanRecorder.getActiveLocalSpan();\n if (activeLocalSpan && (localSpanRecorder == null ? void 0 : localSpanRecorder.isOpenTelemetryIsolatedSpan(activeLocalSpan))) {\n return activeLocalSpan;\n }\n const activeSpan = trace.getSpan(context.active());\n if (activeSpan || !process.env.__NEXT_DEV_SERVER) {\n return activeSpan;\n }\n return activeLocalSpan;\n }\n /**\n * Run `fn` with the active span cleared, so spans created inside become new\n * roots (or parent to incoming propagated context). Used for in-process\n * Node.js middleware so its span is a sibling of the request span, matching\n * edge middleware which runs in a detached sandbox.\n */ runWithDetachedContext(fn) {\n if (!NEXT_OTEL_PERFORMANCE_PREFIX && !this.isOpenTelemetryEnabled()) {\n return fn();\n }\n return context.with(ROOT_CONTEXT, fn);\n }\n withPropagatedContext(carrier, fn, getter, force = false) {\n const activeContext = context.active();\n if (!NEXT_OTEL_PERFORMANCE_PREFIX && !this.isOpenTelemetryEnabled() && !trace.getSpanContext(activeContext)) {\n return fn();\n }\n if (force) {\n const remoteContext = propagation.extract(ROOT_CONTEXT, carrier, getter);\n if (trace.getSpanContext(remoteContext)) {\n return context.with(remoteContext, fn);\n }\n // Preserve the current active span while still merging any extracted\n // baggage/context values from the carrier.\n const mergedContext = propagation.extract(activeContext, carrier, getter);\n return context.with(mergedContext, fn);\n }\n if (trace.getSpanContext(activeContext)) {\n // Active span is already set, too late to propagate.\n return fn();\n }\n const remoteContext = propagation.extract(activeContext, carrier, getter);\n return context.with(remoteContext, fn);\n }\n trace(...args) {\n const [type, fnOrOptions, fnOrEmpty] = args;\n const tracingEnabled = Boolean(NEXT_OTEL_PERFORMANCE_PREFIX) || this.isOpenTelemetryEnabled();\n const localSpanRecorder = getLocalSpanRecorder();\n const localSpanRecordingEnabled = (localSpanRecorder == null ? void 0 : localSpanRecorder.isLocalSpanRecordingEnabled()) ?? false;\n if (!tracingEnabled && !localSpanRecordingEnabled) {\n return typeof fnOrOptions === 'function' ? fnOrOptions() : fnOrEmpty();\n }\n // coerce options form overload\n const { fn, options } = typeof fnOrOptions === 'function' ? {\n fn: fnOrOptions,\n options: {}\n } : {\n fn: fnOrEmpty,\n options: {\n ...fnOrOptions\n }\n };\n const spanName = options.spanName ?? type;\n const parentSpan = options.parentSpan ?? this.getActiveScopeSpan();\n const isolatedParentSpan = parentSpan && (localSpanRecorder == null ? void 0 : localSpanRecorder.isOpenTelemetryIsolatedSpan(parentSpan)) ? parentSpan : undefined;\n const shouldDelegateSpan = !isolatedParentSpan && (NextVanillaSpanAllowlist.has(type) || process.env.NEXT_OTEL_VERBOSE === '1');\n const shouldTraceSpan = shouldDelegateSpan || ((localSpanRecorder == null ? void 0 : localSpanRecorder.isRequestInsightsEnabled()) ?? false);\n if (!shouldTraceSpan || options.hideSpan) {\n return fn();\n }\n // Trying to get active scoped span to assign parent. If option specifies parent span manually, will try to use it.\n let spanContext = isolatedParentSpan ? context.active() : this.getSpanContext(parentSpan);\n if (!spanContext) {\n spanContext = (context == null ? void 0 : context.active()) ?? ROOT_CONTEXT;\n }\n // Check if there's already a root span in the store for this trace\n // We are intentionally not checking whether there is an active context\n // from outside of nextjs to ensure that we can provide the same level\n // of telemetry when using a custom server\n const existingRootSpanId = spanContext.getValue(rootSpanIdKey);\n const isRootSpan = typeof existingRootSpanId !== 'number' || !rootSpanAttributesStore.has(existingRootSpanId);\n const spanId = getSpanId();\n options.attributes = {\n 'next.span_category': 'nextjs',\n 'next.span_name': spanName,\n 'next.span_type': type,\n ...options.attributes\n };\n return context.with(spanContext.setValue(rootSpanIdKey, spanId), ()=>this.runWithActiveSpan(spanName, options, spanContext, tracingEnabled && shouldDelegateSpan, localSpanRecordingEnabled, isolatedParentSpan, (span)=>{\n let startTime;\n if (NEXT_OTEL_PERFORMANCE_PREFIX && type && LogSpanAllowList.has(type)) {\n startTime = 'performance' in globalThis && 'measure' in performance ? globalThis.performance.now() : undefined;\n }\n let cleanedUp = false;\n const onCleanup = ()=>{\n if (cleanedUp) return;\n cleanedUp = true;\n rootSpanAttributesStore.delete(spanId);\n if (startTime) {\n performance.measure(`${NEXT_OTEL_PERFORMANCE_PREFIX}:next-${(type.split('.').pop() || '').replace(/[A-Z]/g, (match)=>'-' + match.toLowerCase())}`, {\n start: startTime,\n end: performance.now()\n });\n }\n };\n if (isRootSpan) {\n rootSpanAttributesStore.set(spanId, new Map(Object.entries(options.attributes ?? {})));\n }\n if (fn.length > 1) {\n try {\n return fn(span, (err)=>{\n if (err) {\n closeSpanWithError(span, err, options.endTime);\n } else {\n span.end(options.endTime);\n }\n });\n } catch (err) {\n closeSpanWithError(span, err, options.endTime);\n throw err;\n } finally{\n onCleanup();\n }\n }\n try {\n const result = fn(span);\n if (isThenable(result)) {\n // If there's error make sure it throws\n return result.then((res)=>{\n span.end(options.endTime);\n // Need to pass down the promise result,\n // it could be react stream response with error { error, stream }\n return res;\n }).catch((err)=>{\n closeSpanWithError(span, err, options.endTime);\n throw err;\n }).finally(onCleanup);\n } else {\n span.end(options.endTime);\n onCleanup();\n }\n return result;\n } catch (err) {\n closeSpanWithError(span, err, options.endTime);\n onCleanup();\n throw err;\n }\n }));\n }\n runWithActiveSpan(spanName, options, parentContext, tracingEnabled, localSpanRecordingEnabled, isolatedParentSpan, fn) {\n if (tracingEnabled) {\n return this.getTracerInstance().startActiveSpan(spanName, options, (span)=>fn(localSpanRecordingEnabled ? this.createLocalRecordingSpan(spanName, options, parentContext, span, isolatedParentSpan) : span));\n }\n const span = this.createLocalRecordingSpan(spanName, options, parentContext, undefined, isolatedParentSpan);\n const localSpanRecorder = getLocalSpanRecorder();\n return localSpanRecorder.withLocalSpan(span, ()=>localSpanRecorder.isOpenTelemetryIsolatedSpan(span) ? fn(span) : context.with(trace.setSpan(context.active(), span), fn, undefined, span));\n }\n createLocalRecordingSpan(name, options, parentContext, delegateSpan, isolatedParentSpan) {\n const parentSpanContext = (isolatedParentSpan == null ? void 0 : isolatedParentSpan.spanContext()) ?? trace.getSpanContext(parentContext);\n const delegateSpanContext = delegateSpan == null ? void 0 : delegateSpan.spanContext();\n return getLocalSpanRecorder().createLocalSpan({\n name,\n attributes: options.attributes,\n links: options.links,\n startTime: options.startTime,\n delegateSpan,\n traceId: (delegateSpanContext == null ? void 0 : delegateSpanContext.traceId) ?? (parentSpanContext == null ? void 0 : parentSpanContext.traceId),\n spanId: delegateSpanContext == null ? void 0 : delegateSpanContext.spanId,\n parentSpanId: parentSpanContext == null ? void 0 : parentSpanContext.spanId,\n isolateOpenTelemetry: isolatedParentSpan !== undefined\n });\n }\n wrap(...args) {\n const tracer = this;\n const [name, options, fn] = args.length === 3 ? args : [\n args[0],\n {},\n args[1]\n ];\n if (!NextVanillaSpanAllowlist.has(name) && process.env.NEXT_OTEL_VERBOSE !== '1' && !process.env.__NEXT_DEV_SERVER) {\n return fn;\n }\n return function() {\n let optionsObj = options;\n if (typeof optionsObj === 'function' && typeof fn === 'function') {\n optionsObj = optionsObj.apply(this, arguments);\n }\n const lastArgId = arguments.length - 1;\n const cb = arguments[lastArgId];\n if (typeof cb === 'function') {\n const scopeBoundCb = tracer.getContext().bind(context.active(), cb);\n return tracer.trace(name, optionsObj, (_span, done)=>{\n arguments[lastArgId] = function(err) {\n done == null ? void 0 : done(err);\n return scopeBoundCb.apply(this, arguments);\n };\n return fn.apply(this, arguments);\n });\n } else {\n return tracer.trace(name, optionsObj, ()=>fn.apply(this, arguments));\n }\n };\n }\n startSpan(...args) {\n const [type, passedOptions] = args;\n const options = passedOptions ? {\n ...passedOptions,\n attributes: {\n 'next.span_category': 'nextjs',\n ...passedOptions.attributes\n }\n } : {\n attributes: {\n 'next.span_category': 'nextjs'\n }\n };\n const localSpanRecorder = getLocalSpanRecorder();\n const parentSpan = options.parentSpan ?? this.getActiveScopeSpan();\n const isolatedParentSpan = parentSpan && (localSpanRecorder == null ? void 0 : localSpanRecorder.isOpenTelemetryIsolatedSpan(parentSpan)) ? parentSpan : undefined;\n const parentContext = (isolatedParentSpan ? undefined : this.getSpanContext(parentSpan)) ?? context.active();\n const localSpanRecordingEnabled = (localSpanRecorder == null ? void 0 : localSpanRecorder.isLocalSpanRecordingEnabled()) ?? false;\n if (!localSpanRecordingEnabled) {\n return this.getTracerInstance().startSpan(type, options, parentContext);\n }\n const delegateSpan = !isolatedParentSpan && this.isOpenTelemetryEnabled() ? this.getTracerInstance().startSpan(type, options, parentContext) : undefined;\n return this.createLocalRecordingSpan(type, options, parentContext, delegateSpan, isolatedParentSpan);\n }\n getSpanContext(parentSpan) {\n const spanContext = parentSpan ? trace.setSpan(context.active(), parentSpan) : undefined;\n return spanContext;\n }\n getRootSpanAttributes() {\n const spanId = context.active().getValue(rootSpanIdKey);\n return rootSpanAttributesStore.get(spanId);\n }\n setRootSpanAttribute(key, value) {\n const spanId = context.active().getValue(rootSpanIdKey);\n const attributes = rootSpanAttributesStore.get(spanId);\n if (attributes && !attributes.has(key)) {\n attributes.set(key, value);\n }\n if (process.env.__NEXT_DEV_SERVER) {\n var _getLocalSpanRecorder;\n const localSpan = (_getLocalSpanRecorder = getLocalSpanRecorder()) == null ? void 0 : _getLocalSpanRecorder.getActiveLocalSpan();\n if (localSpan) {\n localSpan.setAttribute(key, value);\n }\n }\n }\n withSpan(span, fn) {\n const recorder = getLocalSpanRecorder();\n if (recorder == null ? void 0 : recorder.isLocalRecordingSpan(span)) {\n return recorder.withLocalSpan(span, ()=>recorder.isOpenTelemetryIsolatedSpan(span) ? fn() : context.with(trace.setSpan(context.active(), span), fn));\n }\n return context.with(trace.setSpan(context.active(), span), fn);\n }\n}\nconst getTracer = (()=>{\n const tracer = new NextTracerImpl();\n return ()=>tracer;\n})();\nexport { getTracer, SpanStatusCode, SpanKind };\n\n//# sourceMappingURL=tracer.js.map","import { getRequestInsightKey, getRequestInsightKind } from '../../../shared/lib/request-insights';\nexport { isRequestInsightsEnabled } from './span-store';\nconst MAX_REQUEST_INSIGHTS = 100;\nconst REQUEST_INSIGHTS_STORE_KEY = Symbol.for('@next/request-insights-store');\nconst CLIENT_COMPONENT_LOADING_SPAN_TYPE = 'NextNodeServer.clientComponentLoading';\nconst REDACTED_VALUE = 'redacted';\nconst SAFE_SPAN_ATTRIBUTE_KEYS = new Set([\n 'http.method',\n 'http.route',\n 'http.status_code',\n 'http.url',\n 'net.peer.name',\n 'net.peer.port',\n 'next.fetch.cache_reason',\n 'next.fetch.cache_status',\n 'next.fetch.idx',\n 'next.route',\n 'next.rsc',\n 'next.segment',\n 'next.span_category',\n 'next.span_name',\n 'next.span_type'\n]);\nconst SENSITIVE_PARAM_NAME_RE = /(?:^|[_-])(?:access[_-]?token|api[_-]?key|auth|authorization|code|cookie|credential|id[_-]?token|jwt|key|password|secret|session|signature|sig|token)(?:$|[_-])/i;\nclass InMemoryRequestInsightsStore {\n recordSpan(span) {\n var _span_attributes;\n if (!span.requestId) {\n return;\n }\n const insight = this.getOrCreateRequest({\n requestId: span.requestId,\n kind: span.requestInsightKind,\n htmlRequestId: span.htmlRequestId,\n route: span.route,\n url: span.url\n }, span.startTime ?? span.timestamp);\n const spanStartTime = span.startTime ?? span.timestamp;\n insight.htmlRequestId = span.htmlRequestId ?? insight.htmlRequestId;\n insight.route = insight.route ?? span.route;\n insight.url = insight.url ?? sanitizeUrl(span.url);\n this.updateTiming(insight, spanStartTime, span.durationMs, ((_span_attributes = span.attributes) == null ? void 0 : _span_attributes['next.span_type']) === 'BaseServer.handleRequest');\n insight.status = insight.status === 'error' || span.status === 'error' ? 'error' : span.status === 'ok' ? 'ok' : insight.status;\n insight.spans.push({\n name: span.name,\n startTime: spanStartTime,\n durationMs: span.durationMs,\n status: span.status,\n traceId: span.traceId,\n spanId: span.spanId,\n parentSpanId: span.parentSpanId,\n attributes: sanitizeSpanAttributes(span.attributes),\n links: sanitizeSpanLinks(span.links),\n events: sanitizeSpanEvents(span.events),\n error: span.error\n });\n const fetch = getFetchInsight(span);\n if (fetch) {\n this.recordFetchForInsight(insight, fetch);\n }\n this.notify(insight);\n }\n recordFetch(identity, fetch) {\n if (!identity.requestId) {\n return;\n }\n const fetchStartTime = fetch.startTime ?? getCurrentTimestamp();\n const insight = this.getOrCreateRequest(identity, fetchStartTime);\n this.updateTiming(insight, fetchStartTime, fetch.durationMs, false);\n this.recordFetchForInsight(insight, sanitizeFetchInsight(fetch));\n this.notify(insight);\n }\n getSnapshot() {\n return {\n requests: this.requestOrder.map((insightKey)=>this.requests.get(insightKey)).filter((request)=>request !== undefined)\n };\n }\n subscribe(listener) {\n this.listeners.add(listener);\n return ()=>{\n this.listeners.delete(listener);\n };\n }\n clear() {\n this.requests.clear();\n this.requestTimings.clear();\n this.requestOrder.length = 0;\n }\n updateTiming(insight, startTime, durationMs, isRequestSpan) {\n const insightKey = getRequestInsightKey(insight);\n if (isRequestSpan && durationMs !== undefined) {\n const requestTiming = {\n startTime,\n durationMs\n };\n this.requestTimings.set(insightKey, requestTiming);\n insight.startTime = requestTiming.startTime;\n insight.durationMs = requestTiming.durationMs;\n return;\n }\n const requestTiming = this.requestTimings.get(insightKey);\n if (requestTiming) {\n insight.startTime = requestTiming.startTime;\n insight.durationMs = requestTiming.durationMs;\n return;\n }\n const endTime = startTime + (durationMs ?? 0);\n const requestEndTime = insight.startTime + (insight.durationMs ?? 0);\n insight.startTime = Math.min(insight.startTime, startTime);\n insight.durationMs = Math.max(requestEndTime, endTime) - insight.startTime;\n }\n notify(insight) {\n for (const listener of this.listeners){\n listener(insight);\n }\n }\n getOrCreateRequest(identity, startTime) {\n const requestId = identity.requestId;\n const insightKey = getRequestInsightKey({\n requestId,\n kind: identity.kind\n });\n let insight = this.requests.get(insightKey);\n if (!insight) {\n insight = {\n requestId,\n kind: getRequestInsightKind(identity),\n htmlRequestId: identity.htmlRequestId ?? requestId,\n route: identity.route,\n url: sanitizeUrl(identity.url),\n startTime,\n status: 'pending',\n spans: [],\n fetches: []\n };\n this.requests.set(insightKey, insight);\n this.requestOrder.push(insightKey);\n this.trim();\n }\n insight.htmlRequestId = identity.htmlRequestId ?? insight.htmlRequestId;\n insight.route = insight.route ?? identity.route;\n insight.url = insight.url ?? sanitizeUrl(identity.url);\n insight.startTime = Math.min(insight.startTime, startTime);\n return insight;\n }\n recordFetchForInsight(insight, fetch) {\n if (insight.fetches.some((existingFetch)=>existingFetch.url === fetch.url && (existingFetch.index !== undefined && fetch.index !== undefined ? existingFetch.index === fetch.index : existingFetch.startTime === fetch.startTime))) {\n return;\n }\n insight.fetches.push(sanitizeFetchInsight(fetch));\n }\n trim() {\n while(this.requestOrder.length > MAX_REQUEST_INSIGHTS){\n const insightKey = this.requestOrder.shift();\n if (insightKey) {\n this.requests.delete(insightKey);\n this.requestTimings.delete(insightKey);\n }\n }\n }\n constructor(){\n this.requests = new Map();\n this.requestTimings = new Map();\n this.requestOrder = [];\n this.listeners = new Set();\n }\n}\nexport function recordRequestInsightSpan(span) {\n var _span_attributes;\n if (((_span_attributes = span.attributes) == null ? void 0 : _span_attributes['next.span_type']) === CLIENT_COMPONENT_LOADING_SPAN_TYPE) {\n return;\n }\n getRequestInsightsStore().recordSpan(span);\n}\nexport function recordRequestInsightFetch(identity, fetch) {\n getRequestInsightsStore().recordFetch(identity, fetch);\n}\nexport function getRequestInsightsSnapshot() {\n return getRequestInsightsStore().getSnapshot();\n}\nexport function subscribeRequestInsights(listener) {\n return getRequestInsightsStore().subscribe(listener);\n}\nexport function clearRequestInsightsForTest() {\n getRequestInsightsStore().clear();\n}\nfunction getRequestInsightsStore() {\n const globalStore = globalThis;\n return globalStore[REQUEST_INSIGHTS_STORE_KEY] ??= new InMemoryRequestInsightsStore();\n}\nfunction getFetchInsight(span) {\n const attributes = span.attributes;\n if (!attributes || attributes['next.span_type'] !== 'AppRender.fetch') {\n return null;\n }\n return {\n url: sanitizeUrl(getStringAttribute(attributes['http.url']) ?? span.url),\n method: getStringAttribute(attributes['http.method']),\n statusCode: getNumberAttribute(attributes['http.status_code']),\n startTime: span.startTime ?? span.timestamp,\n durationMs: span.durationMs,\n cacheStatus: getStringAttribute(attributes['next.fetch.cache_status']),\n cacheReason: getStringAttribute(attributes['next.fetch.cache_reason']),\n index: getNumberAttribute(attributes['next.fetch.idx'])\n };\n}\nfunction sanitizeFetchInsight(fetch) {\n return {\n ...fetch,\n url: sanitizeUrl(fetch.url)\n };\n}\nfunction getCurrentTimestamp() {\n return performance.timeOrigin + performance.now();\n}\nfunction sanitizeSpanAttributes(attributes) {\n if (!attributes) {\n return undefined;\n }\n const sanitized = {};\n for (const [key, value] of Object.entries(attributes)){\n if (!SAFE_SPAN_ATTRIBUTE_KEYS.has(key)) {\n continue;\n }\n sanitized[key] = key === 'http.url' ? sanitizeUrlAttribute(value) : value;\n }\n return Object.keys(sanitized).length > 0 ? sanitized : undefined;\n}\nfunction sanitizeSpanEvents(events) {\n return events == null ? void 0 : events.map((event)=>({\n ...event,\n attributes: sanitizeSpanAttributes(event.attributes)\n }));\n}\nfunction sanitizeSpanLinks(links) {\n return links == null ? void 0 : links.map((link)=>({\n ...link,\n attributes: sanitizeSpanAttributes(link.attributes)\n }));\n}\nfunction sanitizeUrlAttribute(value) {\n return typeof value === 'string' ? sanitizeUrl(value) ?? '' : value;\n}\nfunction sanitizeUrl(value) {\n if (!value) {\n return value;\n }\n const isRelativeUrl = value.startsWith('/');\n try {\n const url = isRelativeUrl ? new URL(value, 'http://n') : new URL(value);\n url.username = '';\n url.password = '';\n for (const name of Array.from(url.searchParams.keys())){\n if (SENSITIVE_PARAM_NAME_RE.test(name)) {\n url.searchParams.set(name, REDACTED_VALUE);\n }\n }\n return isRelativeUrl ? `${url.pathname}${url.search}${url.hash}` : url.href;\n } catch {\n return value;\n }\n}\nfunction getStringAttribute(value) {\n return typeof value === 'string' ? value : undefined;\n}\nfunction getNumberAttribute(value) {\n return typeof value === 'number' ? value : undefined;\n}\n\n//# sourceMappingURL=request-insights.js.map","import { bold, green, magenta, red, yellow, white } from '../../lib/picocolors';\nimport { LRUCache } from '../../server/lib/lru-cache';\nexport const prefixes = {\n wait: white(bold('○')),\n error: red(bold('⨯')),\n warn: yellow(bold('⚠')),\n ready: '▲',\n info: white(bold(' ')),\n event: green(bold('✓')),\n trace: magenta(bold('»'))\n};\nconst LOGGING_METHOD = {\n log: 'log',\n warn: 'warn',\n error: 'error'\n};\nfunction prefixedLog(prefixType, ...message) {\n if ((message[0] === '' || message[0] === undefined) && message.length === 1) {\n message.shift();\n }\n const consoleMethod = prefixType in LOGGING_METHOD ? LOGGING_METHOD[prefixType] : 'log';\n const prefix = prefixes[prefixType];\n // If there's no message, don't print the prefix but a new line\n if (message.length === 0) {\n console[consoleMethod]('');\n } else {\n // Ensure if there's ANSI escape codes it's concatenated into one string.\n // Chrome DevTool can only handle color if it's in one string.\n if (message.length === 1 && typeof message[0] === 'string') {\n console[consoleMethod](prefix + ' ' + message[0]);\n } else {\n console[consoleMethod](prefix, ...message);\n }\n }\n}\nexport function bootstrap(message) {\n console.log(message);\n}\nexport function wait(...message) {\n prefixedLog('wait', ...message);\n}\nexport function error(...message) {\n prefixedLog('error', ...message);\n}\nexport function warn(...message) {\n prefixedLog('warn', ...message);\n}\nexport function ready(...message) {\n prefixedLog('ready', ...message);\n}\nexport function info(...message) {\n prefixedLog('info', ...message);\n}\nexport function event(...message) {\n prefixedLog('event', ...message);\n}\nexport function trace(...message) {\n prefixedLog('trace', ...message);\n}\nconst warnOnceCache = new LRUCache(10000, (value)=>value.length);\nexport function warnOnce(...message) {\n const key = message.join(' ');\n if (!warnOnceCache.has(key)) {\n warnOnceCache.set(key, key);\n warn(...message);\n }\n}\nconst errorOnceCache = new LRUCache(10000, (value)=>value.length);\nexport function errorOnce(...message) {\n const key = message.join(' ');\n if (!errorOnceCache.has(key)) {\n errorOnceCache.set(key, key);\n error(...message);\n }\n}\n\n//# sourceMappingURL=log.js.map","import { RedirectStatusCode } from '../../client/components/redirect-status-code';\nimport { getCookieParser } from '../api-utils/get-cookie-parser';\nexport class BaseNextRequest {\n constructor(method, url, body){\n this.method = method;\n this.url = url;\n this.body = body;\n }\n // Utils implemented using the abstract methods above\n get cookies() {\n if (this._cookies) return this._cookies;\n return this._cookies = getCookieParser(this.headers)();\n }\n}\nexport class BaseNextResponse {\n constructor(destination){\n this.destination = destination;\n }\n // Utils implemented using the abstract methods above\n redirect(destination, statusCode) {\n this.setHeader('Location', destination);\n this.statusCode = statusCode;\n // Since IE11 doesn't support the 308 header add backwards\n // compatibility using refresh header\n if (statusCode === RedirectStatusCode.PermanentRedirect) {\n this.setHeader('Refresh', `0;url=${destination}`);\n }\n return this;\n }\n}\n\n//# sourceMappingURL=index.js.map","import { InvariantError } from '../../shared/lib/invariant-error';\nimport { createPromiseWithResolvers } from '../../shared/lib/promise-with-resolvers';\nexport var RenderStage = /*#__PURE__*/ function(RenderStage) {\n RenderStage[RenderStage[\"Before\"] = 1] = \"Before\";\n //\n RenderStage[RenderStage[\"ShellStatic\"] = 10] = \"ShellStatic\";\n /** Discrimination-only stage: `prefetch()` in validation renders (static) */ RenderStage[RenderStage[\"PrefetchStatic_prefetchApi\"] = 11] = \"PrefetchStatic_prefetchApi\";\n RenderStage[RenderStage[\"PrefetchStatic\"] = 12] = \"PrefetchStatic\";\n RenderStage[RenderStage[\"NavigationStatic\"] = 13] = \"NavigationStatic\";\n RenderStage[RenderStage[\"Static\"] = 14] = \"Static\";\n //\n RenderStage[RenderStage[\"ShellRuntime\"] = 20] = \"ShellRuntime\";\n /** Discrimination-only stage: `prefetch()` in validation renders (runtime) */ RenderStage[RenderStage[\"PrefetchRuntime_prefetchApi\"] = 21] = \"PrefetchRuntime_prefetchApi\";\n RenderStage[RenderStage[\"PrefetchRuntime\"] = 22] = \"PrefetchRuntime\";\n RenderStage[RenderStage[\"NavigationRuntime\"] = 23] = \"NavigationRuntime\";\n //\n RenderStage[RenderStage[\"Dynamic\"] = 30] = \"Dynamic\";\n RenderStage[RenderStage[\"Abandoned\"] = 40] = \"Abandoned\";\n return RenderStage;\n}({});\nexport const RENDER_STAGE_ADVANCE_ORDER = [\n 10,\n 11,\n 12,\n 13,\n 14,\n 20,\n 21,\n 22,\n 23,\n 30\n];\nexport function getNextStage(stage) {\n return RENDER_STAGE_ADVANCE_ORDER[RENDER_STAGE_ADVANCE_ORDER.indexOf(stage) + 1];\n}\nexport function isAdvanceableRenderStage(stage) {\n return 1 < stage && stage <= 30;\n}\nexport var SyncIOMode = /*#__PURE__*/ function(SyncIOMode) {\n /** Sync IO does not error in any stage. */ SyncIOMode[SyncIOMode[\"Untracked\"] = 1] = \"Untracked\";\n /** Before `partialPrefetching`: Sync IO errors in static stages, and is allowed otherwise. */ SyncIOMode[SyncIOMode[\"AllowedInRuntimeOrDynamic\"] = 2] = \"AllowedInRuntimeOrDynamic\";\n /** After `partialPrefetching`: Sync IO errors in all stages other than dynamic. */ SyncIOMode[SyncIOMode[\"AllowedInDynamic\"] = 3] = \"AllowedInDynamic\";\n return SyncIOMode;\n}({});\nexport class StagedRenderingController {\n constructor({ abortSignal, abandonController, syncIO, finalStage }){\n this.currentStage = 1;\n this.syncInterruptReason = null;\n this.triggers = createAdvanceableStageTriggers();\n this.abortSignal = abortSignal;\n this.abandonController = abandonController;\n this.syncIOMode = syncIO;\n this.finalStage = finalStage;\n if (abortSignal) {\n abortSignal.addEventListener('abort', ()=>{\n // Reject all stage promises that haven't already been resolved.\n // `cancelStageTrigger` is a noop if the trigger already resolved.\n const { reason } = abortSignal;\n for (const trigger of Object.values(this.triggers)){\n cancelStageTrigger(trigger, reason);\n }\n }, {\n once: true\n });\n }\n if (abandonController) {\n abandonController.signal.addEventListener('abort', ()=>{\n this.abandonRender();\n }, {\n once: true\n });\n }\n }\n /**\n * Schedules a callback that will execute synchronously when the controller is advanced\n * to `stage` or past it, before any promises for that stage are resolved.\n * If the controller is already past `stage`, the callback is executed immediately.\n * */ onStage(stage, callback) {\n addSyncTriggerListener(this.triggers[stage], callback);\n }\n shouldTrackSyncInterrupt() {\n const { syncIOMode, currentStage } = this;\n switch(syncIOMode){\n case 1:\n {\n return false;\n }\n case 2:\n {\n // Legacy: track Sync IO only in static stages.\n // Do not track it before the render, or in runtime/dynamic stages.\n return currentStage > 1 && currentStage <= 14;\n }\n case 3:\n {\n // Track sync IO in all cacheable stages.\n // This means all stages except:\n // - before the render\n // - in the dynamic stage\n return currentStage > 1 && currentStage < 30;\n }\n }\n }\n /** Note: only call this if `shouldTrackSyncInterrupt()` returned true */ syncInterruptCurrentStageWithReason(reason) {\n const { currentStage } = this;\n if (currentStage === 1 || currentStage === 30 || currentStage === 40) {\n // Not interruptible. Defensive noop.\n return;\n }\n // If Sync IO occurs during an abandonable render, we trigger the abandon.\n // The abandon listener will call abandonRender which advances through\n // stages to let caches fill before marking as Abandoned.\n if (this.abandonController) {\n this.abandonController.abort();\n return;\n }\n if (this.abortSignal) {\n // If this is an abortable render, we capture the interruption reason and stop advancing.\n // We don't release any more promises.\n // The caller is expected to abort the signal.\n this.syncInterruptReason = reason;\n this.currentStage = 40;\n return;\n }\n // If we're in a non-abandonable & non-abortable render,\n // we need to advance to the Dynamic stage and capture the interruption reason.\n // (in dev, this will be the restarted render)\n this.syncInterruptReason = reason;\n this.advanceStage(30);\n }\n getSyncInterruptReason() {\n return this.syncInterruptReason;\n }\n getStageEndTime(stage) {\n return this.triggers[getNextStage(stage)].triggeredAt ?? Infinity;\n }\n abandonRender() {\n // In staged rendering, only the initial render is abandonable.\n // We can abandon the initial render if\n // 1. We notice a cache miss, and need to wait for caches to fill\n // 2. A sync IO error occurs, and the render should be interrupted\n // (this might be a lazy intitialization of a module,\n // so we still want to restart in this case and see if it still occurs)\n // In either case, we'll be doing another render after this one,\n // so we only want to unblock the next stage, not Dynamic, because\n // unblocking the dynamic stage would likely lead to wasted (uncached) IO.\n const { currentStage } = this;\n if (currentStage === 1) {\n throw new InvariantError(\"A render that hasn't started yet cannot be abandoned\");\n }\n if (currentStage === 30 || currentStage === 40) {\n // We shouldn't ever trigger an abandon in these. Defensive noop.\n return;\n }\n // Resolve all stages after the current one, up to runtime (excluding dynamic)\n const nextStageIx = RENDER_STAGE_ADVANCE_ORDER.indexOf(currentStage) + 1;\n const dynamicStageIx = RENDER_STAGE_ADVANCE_ORDER.indexOf(30);\n for(let i = nextStageIx; i < dynamicStageIx; i++){\n this.resolveStage(RENDER_STAGE_ADVANCE_ORDER[i]);\n }\n this.currentStage = 40;\n }\n advanceStage(targetStage) {\n if (this.finalStage !== null && targetStage > this.finalStage) {\n throw new InvariantError(`Attempted to advance to stage ${RenderStage[targetStage]} but the render is limited to ${RenderStage[this.finalStage]}`);\n }\n const { currentStage } = this;\n if (currentStage === 30 || currentStage === 40) {\n // Terminal stages, nowhere left to advance.\n return;\n }\n // If we're already at the target stage or beyond, do nothing.\n if (targetStage <= currentStage) {\n return;\n }\n this.currentStage = targetStage;\n // Resolve all stages between the current stage and the target.\n const nextStageIx = currentStage === 1 ? 0 : RENDER_STAGE_ADVANCE_ORDER.indexOf(currentStage) + 1;\n const targetStageIx = RENDER_STAGE_ADVANCE_ORDER.indexOf(targetStage);\n for(let i = nextStageIx; i <= targetStageIx; i++){\n this.resolveStage(RENDER_STAGE_ADVANCE_ORDER[i]);\n }\n }\n resolveStage(stage) {\n fireStageTrigger(this.triggers[stage]);\n }\n getStagePromise(stage) {\n return this.triggers[stage].promise;\n }\n waitForStage(stage) {\n return this.getStagePromise(stage);\n }\n delayUntilStage(stage, displayName, resolvedValue) {\n const stagePromise = this.getStagePromise(stage);\n const promise = process.env.NODE_ENV === 'development' ? makeDevtoolsIOPromiseFromIOTrigger(stagePromise, displayName, resolvedValue) : stagePromise.then(()=>resolvedValue);\n // Analogously to `makeDynamicHangingPromise`, we might reject this promise if the signal is invoked.\n // (e.g. in the case where we don't want want the render to proceed to the dynamic stage and abort it).\n // We shouldn't consider this an unhandled rejection, so we attach a noop catch handler here to suppress this warning.\n if (this.abortSignal) {\n promise.catch(ignoreReject);\n }\n return promise;\n }\n}\nfunction createAdvanceableStageTriggers() {\n const triggers = {};\n for (const stage of RENDER_STAGE_ADVANCE_ORDER){\n triggers[stage] = createStageTrigger();\n }\n return triggers;\n}\nfunction ignoreReject() {}\n// TODO(restart-on-cache-miss): the layering of `delayUntilStage`,\n// `makeDevtoolsIOPromiseFromIOTrigger` and and `makeDevtoolsIOAwarePromise`\n// is confusing, we should clean it up.\nfunction makeDevtoolsIOPromiseFromIOTrigger(ioTrigger, displayName, resolvedValue) {\n // If we create a `new Promise` and give it a displayName\n // (with no userspace code above us in the stack)\n // React Devtools will use it as the IO cause when determining \"suspended by\".\n // In particular, it should shadow any inner IO that resolved/rejected the promise\n // (in case of staged rendering, this will be the `setTimeout` that triggers the relevant stage)\n const promise = new Promise((resolve, reject)=>{\n ioTrigger.then(resolve.bind(null, resolvedValue), reject);\n });\n if (displayName !== undefined) {\n // @ts-expect-error\n promise.displayName = displayName;\n }\n return promise;\n}\nfunction addSyncTriggerListener(trigger, listener) {\n if (trigger.state === 'pending') {\n trigger._listeners.push(listener);\n } else {\n listener();\n }\n}\nfunction createStageTrigger() {\n const { promise, resolve, reject } = createPromiseWithResolvers();\n return {\n state: 'pending',\n triggeredAt: null,\n promise,\n _listeners: [],\n _resolvePromise: resolve,\n _rejectPromise: reject\n };\n}\nfunction fireStageTrigger(trigger) {\n if (trigger.state !== 'pending') {\n return;\n }\n trigger.state = 'triggered';\n trigger.triggeredAt = performance.now() + performance.timeOrigin;\n try {\n const { _listeners: listeners } = trigger;\n for(let i = 0; i < listeners.length; i++){\n listeners[i]();\n }\n listeners.length = 0;\n } finally{\n trigger._resolvePromise();\n }\n}\nfunction cancelStageTrigger(trigger, reason) {\n if (trigger.state !== 'pending') {\n return;\n }\n trigger.state = 'cancelled';\n // we didn't trigger, so don't save `triggeredAt`.\n // We're not gonna fire the listeners, we may as well free them.\n trigger._listeners.length = 0;\n // Suppress unhandled rejection warnings for promises that no one is awaiting.\n trigger.promise.catch(ignoreReject);\n trigger._rejectPromise(reason);\n}\n\n//# sourceMappingURL=staged-rendering.js.map","/**\n * UnderscoreNormalizer replaces all instances of %5F with _.\n */ export class UnderscoreNormalizer {\n normalize(pathname) {\n return pathname.replace(/%5F/g, '_');\n }\n}\n\n//# sourceMappingURL=underscore-normalizer.js.map","import { SYMBOL_CLEARED_COOKIES } from '../api-utils';\nimport { NEXT_REQUEST_META } from '../request-meta';\nimport { BaseNextRequest, BaseNextResponse } from './index';\nlet prop;\nexport class NodeNextRequest extends BaseNextRequest {\n static #_ = prop = _NEXT_REQUEST_META = NEXT_REQUEST_META;\n constructor(_req){\n var _this__req;\n super(_req.method.toUpperCase(), _req.url, _req), this._req = _req, this.headers = this._req.headers, this.fetchMetrics = (_this__req = this._req) == null ? void 0 : _this__req.fetchMetrics, this[_NEXT_REQUEST_META] = this._req[NEXT_REQUEST_META] || {}, this.streaming = false;\n }\n get originalRequest() {\n // Need to mimic these changes to the original req object for places where we use it:\n // render.tsx, api/ssg requests\n this._req[NEXT_REQUEST_META] = this[NEXT_REQUEST_META];\n this._req.url = this.url;\n this._req.cookies = this.cookies;\n return this._req;\n }\n set originalRequest(value) {\n this._req = value;\n }\n /**\n * Returns the request body as a Web Readable Stream. The body here can only\n * be read once as the body will start flowing as soon as the data handler\n * is attached.\n *\n * @internal\n */ stream() {\n if (this.streaming) {\n throw new Error('Invariant: NodeNextRequest.stream() can only be called once');\n }\n this.streaming = true;\n return new ReadableStream({\n start: (controller)=>{\n this._req.on('data', (chunk)=>{\n controller.enqueue(new Uint8Array(chunk));\n });\n this._req.on('end', ()=>{\n controller.close();\n });\n this._req.on('error', (err)=>{\n controller.error(err);\n });\n }\n });\n }\n}\nexport class NodeNextResponse extends BaseNextResponse {\n get originalResponse() {\n if (SYMBOL_CLEARED_COOKIES in this) {\n this._res[SYMBOL_CLEARED_COOKIES] = this[SYMBOL_CLEARED_COOKIES];\n }\n return this._res;\n }\n constructor(_res){\n super(_res), this._res = _res, this.textBody = undefined;\n }\n get sent() {\n return this._res.finished || this._res.headersSent;\n }\n get statusCode() {\n return this._res.statusCode;\n }\n set statusCode(value) {\n this._res.statusCode = value;\n }\n get statusMessage() {\n return this._res.statusMessage;\n }\n set statusMessage(value) {\n this._res.statusMessage = value;\n }\n setHeader(name, value) {\n this._res.setHeader(name, value);\n return this;\n }\n removeHeader(name) {\n this._res.removeHeader(name);\n return this;\n }\n getHeaderValues(name) {\n const values = this._res.getHeader(name);\n if (values === undefined) return undefined;\n return (Array.isArray(values) ? values : [\n values\n ]).map((value)=>value.toString());\n }\n hasHeader(name) {\n return this._res.hasHeader(name);\n }\n getHeader(name) {\n const values = this.getHeaderValues(name);\n return Array.isArray(values) ? values.join(',') : undefined;\n }\n getHeaders() {\n return this._res.getHeaders();\n }\n appendHeader(name, value) {\n const currentValues = this.getHeaderValues(name) ?? [];\n if (!currentValues.includes(value)) {\n this._res.setHeader(name, [\n ...currentValues,\n value\n ]);\n }\n return this;\n }\n body(value) {\n this.textBody = value;\n return this;\n }\n send() {\n this._res.end(this.textBody);\n }\n onClose(callback) {\n this.originalResponse.on('close', callback);\n }\n}\nvar _NEXT_REQUEST_META;\n\n//# sourceMappingURL=node.js.map","import { chainStreams, streamFromBuffer, streamFromString, streamToString } from './stream-utils/node-web-streams-helper';\nimport { isAbortError, pipeToNodeResponse, pipeNodeReadableToNodeResponse } from './pipe-readable';\nimport { InvariantError } from '../shared/lib/invariant-error';\nfunction isNodeReadable(value) {\n return value !== null && typeof value === 'object' && typeof value.pipe === 'function' && typeof value.on === 'function' && !(value instanceof ReadableStream);\n}\nexport default class RenderResult {\n static #_ = /**\n * A render result that represents an empty response. This is used to\n * represent a response that was not found or was already sent.\n */ this.EMPTY = new RenderResult(null, {\n metadata: {},\n contentType: null\n });\n /**\n * Creates a new RenderResult instance from a static response.\n *\n * @param value the static response value\n * @param contentType the content type of the response\n * @returns a new RenderResult instance\n */ static fromStatic(value, contentType) {\n return new RenderResult(value, {\n metadata: {},\n contentType\n });\n }\n constructor(response, { contentType, waitUntil, metadata }){\n this.response = response;\n this.contentType = contentType;\n this.metadata = metadata;\n this.waitUntil = waitUntil;\n }\n assignMetadata(metadata) {\n Object.assign(this.metadata, metadata);\n }\n /**\n * Returns true if the response is null. It can be null if the response was\n * not found or was already sent.\n */ get isNull() {\n return this.response === null;\n }\n /**\n * Returns false if the response is a string. It can be a string if the page\n * was prerendered. If it's not, then it was generated dynamically.\n */ get isDynamic() {\n return typeof this.response !== 'string';\n }\n toUnchunkedString(stream = false) {\n if (this.response === null) {\n // If the response is null, return an empty string. This behavior is\n // intentional as we're now providing the `RenderResult.EMPTY` value.\n return '';\n }\n if (typeof this.response !== 'string') {\n if (!stream) {\n throw new InvariantError('dynamic responses cannot be unchunked. This is a bug in Next.js');\n }\n return streamToString(this.readable);\n }\n return this.response;\n }\n /**\n * Returns a readable stream of the response.\n */ get readable() {\n if (this.response === null) {\n // If the response is null, return an empty stream. This behavior is\n // intentional as we're now providing the `RenderResult.EMPTY` value.\n return new ReadableStream({\n start (controller) {\n controller.close();\n }\n });\n }\n if (typeof this.response === 'string') {\n return streamFromString(this.response);\n }\n if (Buffer.isBuffer(this.response)) {\n return streamFromBuffer(this.response);\n }\n // If the response is an array of streams, then chain them together.\n if (Array.isArray(this.response)) {\n return chainStreams(...this.response);\n }\n if (isNodeReadable(this.response)) {\n if (process.env.NEXT_RUNTIME === 'edge') {\n throw new InvariantError('Node.js Readable cannot be converted to a web stream in the edge runtime');\n } else {\n let Readable;\n if (process.env.TURBOPACK) {\n Readable = require('node:stream').Readable;\n } else {\n Readable = __non_webpack_require__('node:stream').Readable;\n }\n return Readable.toWeb(this.response);\n }\n }\n return this.response;\n }\n /**\n * Coerces the response to an array of streams. This will convert the response\n * to an array of streams if it is not already one.\n *\n * @returns An array of streams\n */ coerce() {\n if (this.response === null) {\n // If the response is null, return an empty stream. This behavior is\n // intentional as we're now providing the `RenderResult.EMPTY` value.\n return [];\n }\n if (typeof this.response === 'string') {\n return [\n streamFromString(this.response)\n ];\n } else if (Array.isArray(this.response)) {\n return this.response;\n } else if (Buffer.isBuffer(this.response)) {\n return [\n streamFromBuffer(this.response)\n ];\n } else if (isNodeReadable(this.response)) {\n if (process.env.NEXT_RUNTIME === 'edge') {\n throw new InvariantError('Node.js Readable cannot be converted to a web stream in the edge runtime');\n } else {\n let Readable;\n if (process.env.TURBOPACK) {\n Readable = require('node:stream').Readable;\n } else {\n Readable = __non_webpack_require__('node:stream').Readable;\n }\n return [\n Readable.toWeb(this.response)\n ];\n }\n } else {\n return [\n this.response\n ];\n }\n }\n /**\n * Pipes the response through a transform stream. This converts the response\n * to a single readable stream (chaining if needed) and pipes it through the\n * provided transform.\n *\n * @param transform The transform stream to pipe through\n */ pipeThrough(transform) {\n this.response = this.readable.pipeThrough(transform);\n }\n /**\n * Unshifts a new stream to the response. This will convert the response to an\n * array of streams if it is not already one and will add the new stream to\n * the start of the array. When this response is piped, all of the streams\n * will be piped one after the other.\n *\n * @param readable The new stream to unshift\n */ unshift(readable) {\n // Coerce the response to an array of streams.\n this.response = this.coerce();\n // Add the new stream to the start of the array.\n this.response.unshift(readable);\n }\n /**\n * Chains a new stream to the response. This will convert the response to an\n * array of streams if it is not already one and will add the new stream to\n * the end. When this response is piped, all of the streams will be piped\n * one after the other.\n *\n * @param readable The new stream to chain\n */ push(readable) {\n // Coerce the response to an array of streams.\n this.response = this.coerce();\n // Add the new stream to the end of the array.\n this.response.push(readable);\n }\n /**\n * Pipes the response to a writable stream. This will close/cancel the\n * writable stream if an error is encountered. If this doesn't throw, then\n * the writable stream will be closed or aborted.\n *\n * @param writable Writable stream to pipe the response to\n */ async pipeTo(writable) {\n try {\n await this.readable.pipeTo(writable, {\n // We want to close the writable stream ourselves so that we can wait\n // for the waitUntil promise to resolve before closing it. If an error\n // is encountered, we'll abort the writable stream if we swallowed the\n // error.\n preventClose: true\n });\n // If there is a waitUntil promise, wait for it to resolve before\n // closing the writable stream.\n if (this.waitUntil) await this.waitUntil;\n // Close the writable stream.\n await writable.close();\n } catch (err) {\n // If this is an abort error, we should abort the writable stream (as we\n // took ownership of it when we started piping). We don't need to re-throw\n // because we handled the error.\n if (isAbortError(err)) {\n // Abort the writable stream if an error is encountered.\n await writable.abort(err);\n return;\n }\n // We're not aborting the writer here as when this method throws it's not\n // clear as to how so the caller should assume it's their responsibility\n // to clean up the writer.\n throw err;\n }\n }\n /**\n * Pipes the response to a node response. This will close/cancel the node\n * response if an error is encountered.\n *\n * @param res\n */ async pipeToNodeResponse(res) {\n if (this.response !== null && typeof this.response !== 'string' && !Buffer.isBuffer(this.response) && !Array.isArray(this.response) && isNodeReadable(this.response)) {\n await pipeNodeReadableToNodeResponse(this.response, res, this.waitUntil, this.metadata.clientComponentLoadTracker);\n return;\n }\n await pipeToNodeResponse(this.readable, res, this.waitUntil, this.metadata.clientComponentLoadTracker);\n }\n}\n\n//# sourceMappingURL=render-result.js.map","import { normalizeLocalePath } from '../../i18n/normalize-locale-path';\nimport { removePathPrefix } from './remove-path-prefix';\nimport { pathHasPrefix } from './path-has-prefix';\nexport function getNextPathnameInfo(pathname, options) {\n const { basePath, i18n, trailingSlash } = options.nextConfig ?? {};\n const info = {\n pathname,\n trailingSlash: pathname !== '/' ? pathname.endsWith('/') : trailingSlash\n };\n if (basePath && pathHasPrefix(info.pathname, basePath)) {\n info.pathname = removePathPrefix(info.pathname, basePath);\n info.basePath = basePath;\n }\n let pathnameNoDataPrefix = info.pathname;\n if (info.pathname.startsWith('/_next/data/') && info.pathname.endsWith('.json')) {\n const paths = info.pathname.replace(/^\\/_next\\/data\\//, '').replace(/\\.json$/, '').split('/');\n const buildId = paths[0];\n info.buildId = buildId;\n pathnameNoDataPrefix = paths[1] !== 'index' ? `/${paths.slice(1).join('/')}` : '/';\n // update pathname with normalized if enabled although\n // we use normalized to populate locale info still\n if (options.parseData === true) {\n info.pathname = pathnameNoDataPrefix;\n }\n }\n // If provided, use the locale route normalizer to detect the locale instead\n // of the function below.\n if (i18n) {\n let result = options.i18nProvider ? options.i18nProvider.analyze(info.pathname) : normalizeLocalePath(info.pathname, i18n.locales);\n info.locale = result.detectedLocale;\n info.pathname = result.pathname ?? info.pathname;\n if (!result.detectedLocale && info.buildId) {\n result = options.i18nProvider ? options.i18nProvider.analyze(pathnameNoDataPrefix) : normalizeLocalePath(pathnameNoDataPrefix, i18n.locales);\n if (result.detectedLocale) {\n info.locale = result.detectedLocale;\n }\n }\n }\n return info;\n}\n\n//# sourceMappingURL=get-next-pathname-info.js.map","/**\n * For a given page path, this function ensures that there is a leading slash.\n * If there is not a leading slash, one is added, otherwise it is noop.\n */ export function ensureLeadingSlash(path) {\n return path.startsWith('/') ? path : `/${path}`;\n}\n\n//# sourceMappingURL=ensure-leading-slash.js.map","/**\n * Parse cookies from the `headers` of request\n * @param req request object\n */ export function getCookieParser(headers) {\n return function parseCookie() {\n const { cookie } = headers;\n if (!cookie) {\n return {};\n }\n const { parse: parseCookieFn } = require('next/dist/compiled/cookie');\n return parseCookieFn(Array.isArray(cookie) ? cookie.join('; ') : cookie);\n };\n}\n\n//# sourceMappingURL=get-cookie-parser.js.map","/**\n * Normalizers combines many normalizers into a single normalizer interface that\n * will normalize the inputted pathname with each normalizer in order.\n */ export class Normalizers {\n constructor(normalizers = []){\n this.normalizers = normalizers;\n }\n push(normalizer) {\n this.normalizers.push(normalizer);\n }\n normalize(pathname) {\n return this.normalizers.reduce((normalized, normalizer)=>normalizer.normalize(normalized), pathname);\n }\n}\n\n//# sourceMappingURL=normalizers.js.map","import { detectDomainLocale } from '../../shared/lib/i18n/detect-domain-locale';\nimport { formatNextPathnameInfo } from '../../shared/lib/router/utils/format-next-pathname-info';\nimport { getHostname } from '../../shared/lib/get-hostname';\nimport { getNextPathnameInfo } from '../../shared/lib/router/utils/get-next-pathname-info';\nconst REGEX_LOCALHOST_HOSTNAME = /^(?:127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|\\[::1\\]|localhost)$/;\nfunction parseURL(url, base) {\n const parsed = new URL(String(url), base && String(base));\n if (REGEX_LOCALHOST_HOSTNAME.test(parsed.hostname)) {\n parsed.hostname = 'localhost';\n }\n return parsed;\n}\nconst Internal = Symbol('NextURLInternal');\nexport class NextURL {\n constructor(input, baseOrOpts, opts){\n let base;\n let options;\n if (typeof baseOrOpts === 'object' && 'pathname' in baseOrOpts || typeof baseOrOpts === 'string') {\n base = baseOrOpts;\n options = opts || {};\n } else {\n options = opts || baseOrOpts || {};\n }\n this[Internal] = {\n url: parseURL(input, base ?? options.base),\n options: options,\n basePath: ''\n };\n this.analyze();\n }\n analyze() {\n var _this_Internal_options_nextConfig_i18n, _this_Internal_options_nextConfig, _this_Internal_domainLocale, _this_Internal_options_nextConfig_i18n1, _this_Internal_options_nextConfig1;\n const info = getNextPathnameInfo(this[Internal].url.pathname, {\n nextConfig: this[Internal].options.nextConfig,\n parseData: !process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE,\n i18nProvider: this[Internal].options.i18nProvider\n });\n const hostname = getHostname(this[Internal].url, this[Internal].options.headers);\n this[Internal].domainLocale = this[Internal].options.i18nProvider ? this[Internal].options.i18nProvider.detectDomainLocale(hostname) : detectDomainLocale((_this_Internal_options_nextConfig = this[Internal].options.nextConfig) == null ? void 0 : (_this_Internal_options_nextConfig_i18n = _this_Internal_options_nextConfig.i18n) == null ? void 0 : _this_Internal_options_nextConfig_i18n.domains, hostname);\n const defaultLocale = ((_this_Internal_domainLocale = this[Internal].domainLocale) == null ? void 0 : _this_Internal_domainLocale.defaultLocale) || ((_this_Internal_options_nextConfig1 = this[Internal].options.nextConfig) == null ? void 0 : (_this_Internal_options_nextConfig_i18n1 = _this_Internal_options_nextConfig1.i18n) == null ? void 0 : _this_Internal_options_nextConfig_i18n1.defaultLocale);\n this[Internal].url.pathname = info.pathname;\n this[Internal].defaultLocale = defaultLocale;\n this[Internal].basePath = info.basePath ?? '';\n this[Internal].buildId = info.buildId;\n this[Internal].locale = info.locale ?? defaultLocale;\n this[Internal].trailingSlash = info.trailingSlash;\n }\n formatPathname() {\n return formatNextPathnameInfo({\n basePath: this[Internal].basePath,\n buildId: this[Internal].buildId,\n defaultLocale: !this[Internal].options.forceLocale ? this[Internal].defaultLocale : undefined,\n locale: this[Internal].locale,\n pathname: this[Internal].url.pathname,\n trailingSlash: this[Internal].trailingSlash\n });\n }\n formatSearch() {\n return this[Internal].url.search;\n }\n get buildId() {\n return this[Internal].buildId;\n }\n set buildId(buildId) {\n this[Internal].buildId = buildId;\n }\n get locale() {\n return this[Internal].locale ?? '';\n }\n set locale(locale) {\n var _this_Internal_options_nextConfig_i18n, _this_Internal_options_nextConfig;\n if (!this[Internal].locale || !((_this_Internal_options_nextConfig = this[Internal].options.nextConfig) == null ? void 0 : (_this_Internal_options_nextConfig_i18n = _this_Internal_options_nextConfig.i18n) == null ? void 0 : _this_Internal_options_nextConfig_i18n.locales.includes(locale))) {\n throw new TypeError(`The NextURL configuration includes no locale \"${locale}\"`);\n }\n this[Internal].locale = locale;\n }\n get defaultLocale() {\n return this[Internal].defaultLocale;\n }\n get domainLocale() {\n return this[Internal].domainLocale;\n }\n get searchParams() {\n return this[Internal].url.searchParams;\n }\n get host() {\n return this[Internal].url.host;\n }\n set host(value) {\n this[Internal].url.host = value;\n }\n get hostname() {\n return this[Internal].url.hostname;\n }\n set hostname(value) {\n this[Internal].url.hostname = value;\n }\n get port() {\n return this[Internal].url.port;\n }\n set port(value) {\n this[Internal].url.port = value;\n }\n get protocol() {\n return this[Internal].url.protocol;\n }\n set protocol(value) {\n this[Internal].url.protocol = value;\n }\n get href() {\n const pathname = this.formatPathname();\n const search = this.formatSearch();\n return `${this.protocol}//${this.host}${pathname}${search}${this.hash}`;\n }\n set href(url) {\n this[Internal].url = parseURL(url);\n this.analyze();\n }\n get origin() {\n return this[Internal].url.origin;\n }\n get pathname() {\n return this[Internal].url.pathname;\n }\n set pathname(value) {\n this[Internal].url.pathname = value;\n }\n get hash() {\n return this[Internal].url.hash;\n }\n set hash(value) {\n this[Internal].url.hash = value;\n }\n get search() {\n return this[Internal].url.search;\n }\n set search(value) {\n this[Internal].url.search = value;\n }\n get password() {\n return this[Internal].url.password;\n }\n set password(value) {\n this[Internal].url.password = value;\n }\n get username() {\n return this[Internal].url.username;\n }\n set username(value) {\n this[Internal].url.username = value;\n }\n get basePath() {\n return this[Internal].basePath;\n }\n set basePath(value) {\n this[Internal].basePath = value.startsWith('/') ? value : `/${value}`;\n }\n toString() {\n return this.href;\n }\n toJSON() {\n return this.href;\n }\n [Symbol.for('edge-runtime.inspect.custom')]() {\n return {\n href: this.href,\n origin: this.origin,\n protocol: this.protocol,\n username: this.username,\n password: this.password,\n host: this.host,\n hostname: this.hostname,\n port: this.port,\n pathname: this.pathname,\n search: this.search,\n searchParams: this.searchParams,\n hash: this.hash\n };\n }\n clone() {\n return new NextURL(String(this), this[Internal].options);\n }\n}\n\n//# sourceMappingURL=next-url.js.map","import { InvariantError } from '../shared/lib/invariant-error';\nimport { createPromiseWithResolvers } from '../shared/lib/promise-with-resolvers';\nimport { EnsureStaticLevel } from './app-render/segment-config/ensure-static';\nimport { RenderStage } from './app-render/staged-rendering';\nimport { workAsyncStorage } from './app-render/work-async-storage.external';\nimport { workUnitAsyncStorage } from './app-render/work-unit-async-storage.external';\nimport { getServerReact, getClientReact } from './runtime-reacts.external';\nexport function isHangingPromiseRejectionError(err) {\n if (typeof err !== 'object' || err === null || !('digest' in err)) {\n return false;\n }\n return err.digest === HANGING_PROMISE_REJECTION;\n}\nconst HANGING_PROMISE_REJECTION = 'HANGING_PROMISE_REJECTION';\nclass HangingPromiseRejectionError extends Error {\n constructor(route, expression){\n super(`During prerendering, ${expression} rejects when the prerender is complete. Typically these errors are handled by React but if you move ${expression} to a different context by using \\`setTimeout\\`, \\`after\\`, or similar functions you may observe this error and you should handle it in that context. This occurred at route \"${route}\".`), this.route = route, this.expression = expression, this.digest = HANGING_PROMISE_REJECTION;\n }\n}\nconst CLIENT_HOOK_DYNAMIC = 'CLIENT_HOOK_DYNAMIC';\nexport class ClientHookDynamicError extends Error {\n constructor(route, expression){\n super(`Route \"${route}\": Next.js encountered URL data \\`${expression}\\` in a Client Component outside of \\`<Suspense>\\`.\\n\\n` + `This blocks prerendering because the value is only available at runtime.\\n\\n` + `Ways to fix this:\\n` + ` - [stream] Wrap the component in \\`<Suspense fallback={...}>\\` so the hook value streams in after prerendering\\n` + ` - [block] Set \\`export const instant = false\\` to allow a blocking route\\n\\n` + `Learn more: https://nextjs.org/docs/messages/blocking-prerender-client-hook`), this.digest = CLIENT_HOOK_DYNAMIC;\n }\n}\nexport function isClientHookDynamicError(err) {\n if (typeof err !== 'object' || err === null || !('digest' in err)) {\n return false;\n }\n return err.digest === CLIENT_HOOK_DYNAMIC;\n}\nconst abortListenersBySignal = new WeakMap();\n/**\n * Constructs a promise that never resolves, standing in for *dynamic* data:\n * data that is only available during a real dynamic request and hangs in\n * every kind of prerender — `io()`, `connection()`, uncached `fetch()`.\n *\n * This is primarily useful for cacheComponents where we use promise\n * resolution timing to determine which parts of a render can be included in a\n * prerender.\n *\n * Records nothing on the prerender store: the promise's holes are only ever\n * filled by a real dynamic request, so a runtime prefetch response would have\n * the same holes as the static one. If the data source would resolve during a\n * runtime prerender, use `makeRuntimeHangingPromise` instead.\n */ export function makeDynamicHangingPromise(signal, route, expression) {\n return makeHangingPromiseWithError(signal, new HangingPromiseRejectionError(route, expression));\n}\nexport function makeUntrackedHangingPromise(signal, route, expression) {\n return makeHangingPromiseWithError(signal, new HangingPromiseRejectionError(route, expression));\n}\n/**\n * Constructs a promise that never resolves, standing in for session data\n * (which a runtime shell can access).\n * Examples: cookies, headers\n *\n * Awaiting one of these during a static prerender records on the prerender\n * store that a runtime shell would produce more content than the static\n * static shell, which the segment prefetch encoding uses\n * to tell the client whether a runtime request could be skipped.\n *\n * When unsure whether data is dynamic or runtime, prefer this method — the\n * cost of over-recording is a redundant runtime prefetch request; the cost of\n * under-recording is a permanently missing one.\n *\n * For fallback-param data — data a concrete (ISR-upgraded) prerender would\n * resolve — use `makeFallbackParamsHangingPromise` instead, so the access\n * is recorded with the right effect on the static-prefetch hint.\n */ export function makeSessionDataHangingPromise(signal, route, expression, workUnitStore) {\n const promise = makeHangingPromiseWithError(signal, new HangingPromiseRejectionError(route, expression));\n return trackPromiseUsed(promise, trackSessionDataAccessed.bind(null, workUnitStore, expression));\n}\n/**\n * Constructs a promise that never resolves, standing in for URL data,\n * which can be accessed in a runtime prefetch (but not a runtime shell).\n * Examples: fallback params, searchParams\n *\n * Awaiting one of these during a static prerender records on the prerender\n * store that a runtime prefetch would produce more content than the static\n * response, which the segment prefetch encoding uses\n * to tell the client whether a runtime prefetch request could be skipped.\n *\n * When unsure whether data is dynamic or runtime, prefer this method — the\n * cost of over-recording is a redundant runtime prefetch request; the cost of\n * under-recording is a permanently missing one.\n *\n * `workUnitStore` may be null ONLY when the caller tracks the access itself.\n * Such a caller MUST call `trackURLDataAccessed` from every path that\n * observes the promise (e.g. the proxy traps for `then`/`status`),\n * against the work unit store active at access time.\n *\n * For fallback-param data — data a concrete (ISR-upgraded) prerender would\n * resolve — use `makeFallbackParamsHangingPromise` instead, so the access\n * is recorded with the right effect on the static-prefetch hint.\n */ export function makeURLDataHangingPromise(signal, route, expression, workUnitStore) {\n const promise = makeHangingPromiseWithError(signal, new HangingPromiseRejectionError(route, expression));\n if (workUnitStore === null) {\n return promise;\n }\n return trackPromiseUsed(promise, trackURLDataAccessed.bind(null, workUnitStore, expression));\n}\n/**\n * Creates a promise that stands in for a result that will either be session data\n * or URL data, but we don't know which.\n */ export function makeUnknownRuntimeDataHangingPromise(signal, route, expression, workUnitStore) {\n // We don't know if this is session or URL data, i.e. if it should affect the shell\n // or only the prefetch. Track it conservatively as affecting both.\n return makeSessionDataHangingPromise(signal, route, expression, workUnitStore);\n}\n/**\n * Constructs a promise that never resolves, standing in for data that is only\n * accessible in the prefetch, but not in the shell, e.g. `prefetch()`.\n * This usage does *not* indicate that a runtime request is needed,\n * only that the data is not available in a shell.\n *\n * @internal\n */ export function makePrefetchHangingPromise(signal, route, expression) {\n return makeUntrackedHangingPromise(signal, route, expression);\n}\n/**\n * Variant of `makeRuntimeHangingPromise` for *fallback-param* data: fallback\n * route params and values derived solely from them (`params`, `rootParams`,\n * `pathname` during a fallback prerender). Like every runtime data access,\n * awaiting it records the access on the prerender store's response-level flag,\n * but its effect on the build-time static-prefetch hint differs — on a\n * fallback-upgradeable route the access is transient (a concrete prerender\n * resolves it), so it leaves the hint intact. See `trackFallbackParamsAccessed`.\n *\n * As with `makeRuntimeHangingPromise`, `workUnitStore` may be null ONLY when\n * the caller tracks the access itself by calling `trackFallbackParamsAccessed`\n * from every path that observes the promise.\n */ export function makeFallbackParamsHangingPromise(signal, route, expression, workUnitStore) {\n const promise = makeHangingPromiseWithError(signal, new HangingPromiseRejectionError(route, expression));\n if (workUnitStore === null) {\n return promise;\n }\n return trackPromiseUsed(promise, trackFallbackParamsAccessed.bind(null, workUnitStore, expression));\n}\nexport function createPrerenderDataTracking() {\n return {\n runtimeDataAccessed: createPromiseWithResolvers(),\n shouldAttemptStaticShell: true,\n shouldAttemptStaticPrefetch: true\n };\n}\nexport function finishPrerenderDataTracking(prerenderDataTracking) {\n // If a runtime data access already resolved this promise, this is a no-op.\n prerenderDataTracking.runtimeDataAccessed.resolve(false);\n}\n/**\n * Records on a static prerender store that the render accessed a data source\n * which would have resolved in a runtime shell (or runtime prefetch).\n * No-op for all other store types.\n *\n * Prefer `makeRuntimeHangingPromise`. Use this function only when implementing\n * similar tracking and that one is not enough.\n */ function trackSessionDataAccessed(workUnitStore, expression) {\n trackRuntimeDataAccessed(workUnitStore, 1, expression);\n}\n/**\n * Records on a static prerender store that the render accessed a data source\n * which would have resolved in a runtime prefetch (but NOT in a runtime shell)\n * No-op for all other store types.\n *\n * Prefer `makeRuntimeHangingPromise`. Use this function only when implementing\n * similar tracking and that one is not enough.\n *\n * For fallback-param data, use `trackFallbackParamsAccessed` instead. When\n * unsure, this is the conservative choice.\n */ export function trackURLDataAccessed(workUnitStore, expression) {\n trackRuntimeDataAccessed(workUnitStore, 2, expression);\n}\n/**\n * Fallback-param variant of `trackRuntimeDataAccessed`, for accesses of\n * fallback route params and values derived solely from them. It records the\n * response-level flag all the same, but only clears the build-time\n * static-prefetch hint when the route is not fallback-upgradeable — on an\n * upgradeable route the access is transient, since ISR later produces a\n * concrete prerender that resolves it.\n */ export function trackFallbackParamsAccessed(workUnitStore, expression) {\n trackRuntimeDataAccessed(workUnitStore, 3, expression);\n}\nfunction trackRuntimeDataAccessed(workUnitStore, dataKind, expression) {\n switch(workUnitStore.type){\n case 'prerender':\n {\n const { prerenderDataTracking, stagedRendering } = workUnitStore;\n if (!prerenderDataTracking || !stagedRendering) {\n return;\n }\n const { currentStage } = stagedRendering;\n if (currentStage === RenderStage.Before) {\n console.error(new InvariantError('Unexpected trackRuntimeDataAccessed in the Before stage.'));\n return;\n }\n if (currentStage >= RenderStage.NavigationStatic) {\n // Ignore any accesses that happen after `navigation()` resolves.\n // The purpose of this tracking is to judge whether a runtime prefetch\n // would give us a more complete result than a static one.\n // But `navigation()` wouldn't have resolved in a runtime prefetch,\n // so e.g. `await navigation(); await cookies()` wouldn't have more content\n // in those, and we shouldn't count it.\n return;\n }\n const ensureStaticLevel = workUnitStore.ensureStaticLevel ?? EnsureStaticLevel.None;\n // NOTE: In general, we keep hints in sync with `needsRuntimeRequest`, but they\n // don't have to always match. The client re-uses hints for the entire route,\n // while `needsRuntimeRequest` can vary across individual prerendered param values\n // (e.g. if cookies are accessed depending on a param value).\n // Hints can also become outdated if a route only starts using runtime data\n // after a revalidation, so we have to expect this and be resilient to it.\n // Also see the upgradeable fallback params case below, which deliberately\n // puts them out of sync.\n switch(dataKind){\n case 1:\n {\n // Potentially deopt both the shell and the prefetch,\n // because if the shell accessed runtime data, so does the prefetch.\n // However, if we're already past the shell stage, the shell is not affected.\n // (which makes e.g. `await prefetch(); await cookies()` only affect the prefetch)\n let firstAffectedStage = null;\n if (currentStage <= RenderStage.ShellStatic && // Only track if we're not forcing the shell to be static.\n ensureStaticLevel < EnsureStaticLevel.Shell) {\n prerenderDataTracking.shouldAttemptStaticShell = false;\n firstAffectedStage ??= RenderStage.ShellStatic;\n logRuntimeDeopt == null ? void 0 : logRuntimeDeopt(expression, 'shell');\n }\n if (currentStage <= RenderStage.PrefetchStatic && // Only track if we're not forcing the prefetch to be static.\n ensureStaticLevel < EnsureStaticLevel.Prefetch) {\n prerenderDataTracking.shouldAttemptStaticPrefetch = false;\n // NOTE: if the shell is affected, don't override it.\n firstAffectedStage ??= RenderStage.PrefetchStatic;\n logRuntimeDeopt == null ? void 0 : logRuntimeDeopt(expression, 'prefetch');\n }\n if (firstAffectedStage !== null) {\n markRuntimeDataAccessWhenStageReached(prerenderDataTracking, stagedRendering, firstAffectedStage);\n }\n break;\n }\n case 3:\n {\n if (workUnitStore.isFallbackUpgradeable) {\n // An fallback-param access is transient when the route is\n // fallback-upgradeable (i.e. ISR later produces the concrete prerender a\n // static prefetch would hit) so it does not indicate the need for a runtime\n // request and thus does not affect the static hints.\n //\n // If runtime prefetches are not disallowed by `ensureStatic`, then we still\n // set `runtimeDataAccessed` (while keeping the hints static). This means that\n // if the concrete prerender isn't ready yet and we served the fallback, then\n // the client knows it can use a *runtime* prefetch for speculative links --\n // a runtime prefetch can provide the same content (or more) as the concrete\n // prerender would.\n if (ensureStaticLevel < EnsureStaticLevel.Prefetch) {\n markRuntimeDataAccessWhenStageReached(prerenderDataTracking, stagedRendering, // `params` are URL data, so they only affect the prefetch\n RenderStage.PrefetchStatic);\n logRuntimeUpgradeableFallback == null ? void 0 : logRuntimeUpgradeableFallback();\n }\n break;\n }\n // not an upgradeable fallback param access, so we treat it as URL data.\n // intentional fallthrough\n }\n case 2:\n {\n // Only deopt the prefetch, not the shell, which cannot access URL data anyway.\n if (currentStage <= RenderStage.PrefetchStatic && ensureStaticLevel < EnsureStaticLevel.Prefetch) {\n prerenderDataTracking.shouldAttemptStaticPrefetch = false;\n logRuntimeDeopt == null ? void 0 : logRuntimeDeopt(expression, 'prefetch');\n markRuntimeDataAccessWhenStageReached(prerenderDataTracking, stagedRendering, RenderStage.PrefetchStatic);\n }\n break;\n }\n }\n break;\n }\n case 'prerender-client':\n case 'prerender-legacy':\n case 'prerender-runtime':\n case 'validation-client':\n case 'request':\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n case 'build-time-generator':\n break;\n default:\n workUnitStore;\n }\n}\n/**\n * Tracks a runtime data access on the `runtimeDataAccessed` promise,\n * but with a delay until `targetStage`.\n *\n * When we encounter a URL data access like `await params`, we need to mark the\n * *prefetch* as needing runtime data, but the *shell* should remain unaffected\n * (because it cannot access params anyway).\n *\n * However, the shell and the prefetch share one `runtimeDataAccessed` promise,\n * and it needs to be accurately rewindable by the client\n * In other words, we need to make sure that it reads as `false` when rewound\n * to a shell, but as `true` in the final response (the prefetch).\n *\n * This means that if the `await params` is encountered during the shell stage, we\n * cannot resolve `runtimeDataAccessed` immediately.\n * Instead, we delay the resolution until the PrefetchStatic stage, so the promise\n * will remain unresolved when rewound to the shell stage (which reads as `false`).\n */ function markRuntimeDataAccessWhenStageReached(prerenderDataTracking, stageController, targetStage) {\n const { runtimeDataAccessed } = prerenderDataTracking;\n // NOTE: If we're already in or past the target stage, we can avoid allocating a closure,\n // because `onStage` would've executed the callback immediately anyway.\n if (stageController.currentStage >= targetStage) {\n runtimeDataAccessed.resolve(true);\n } else {\n stageController.onStage(targetStage, runtimeDataAccessed.resolve.bind(null, true));\n }\n}\nconst logRuntimeDeopt = process.env.NEXT_PRIVATE_DEBUG_RUNTIME_DATA ? (expression, kind)=>{\n const { route } = workAsyncStorage.getStore();\n console.log(`Route '${route}': deopting to a runtime ${kind} because it used ${expression}`);\n} : undefined;\nconst logRuntimeUpgradeableFallback = process.env.NEXT_PRIVATE_DEBUG_RUNTIME_DATA ? ()=>{\n const { route } = workAsyncStorage.getStore();\n console.log(`Route '${route}': marking upgradeable fallback as runtime prefetchable`);\n} : undefined;\n/**\n * Signals that we cannot recover both a runtime shell and a static (PPR) shell\n * from the same render. Use this whenever the stage of a promise varies on\n * `RequestStore.needsRuntimeShell`.\n * */ export function trackIncompatibleShellContent(workUnitStore, reason) {\n const { stagedRendering } = workUnitStore;\n if (!stagedRendering) {\n return;\n }\n // TODO(app-shells): optimize this to only consider stages that are relevant for validation.\n // We should only track incompatible content when it can affect them.\n // For now, we simply exclude everything that happens in the dynamic stage.\n // (Note that we also need to account for cache misses that move things to a\n // different stage -- those should also preemptively set `hasIncompatibleShellContent`\n // because there's a chance that a render with warm caches would set it)\n const { currentStage } = stagedRendering;\n if (currentStage === RenderStage.Dynamic || currentStage === RenderStage.Abandoned) {\n return;\n }\n if (process.env.NEXT_PRIVATE_DEBUG_VALIDATION) {\n const workStore = workAsyncStorage.getStore();\n console.log(`Route ${workStore.route}: Incompatible shell content: ${reason}`);\n }\n workUnitStore.hasIncompatibleShellContent = true;\n}\nexport function makeClientHookHangingPromise(signal, error) {\n return makeHangingPromiseWithError(signal, error);\n}\nfunction makeHangingPromiseWithError(signal, error) {\n if (signal.aborted) {\n return Promise.reject(error);\n } else {\n const hangingPromise = new Promise((_, reject)=>{\n const boundRejection = reject.bind(null, error);\n let currentListeners = abortListenersBySignal.get(signal);\n if (currentListeners) {\n currentListeners.push(boundRejection);\n } else {\n const listeners = [\n boundRejection\n ];\n abortListenersBySignal.set(signal, listeners);\n signal.addEventListener('abort', ()=>{\n for(let i = 0; i < listeners.length; i++){\n listeners[i]();\n }\n }, {\n once: true\n });\n }\n });\n // We are fine if no one actually awaits this promise. We shouldn't consider this an unhandled rejection so\n // we attach a noop catch handler here to suppress this warning. If you actually await somewhere or construct\n // your own promise out of it you'll need to ensure you handle the error when it rejects.\n hangingPromise.catch(ignoreReject);\n return hangingPromise;\n }\n}\nfunction ignoreReject() {}\n/**\n * Creates a promise that will be triggered when another promise resolves.\n * It will not emit unhandled rejections, which is important if the trigger\n * is a promise that might itself get rejected (e.g. when a prerender/render\n * are aborted due to sync IO)\n */ export function makePromiseFromTrigger(trigger, value) {\n const promise = trigger.then(()=>value);\n promise.catch(ignoreReject);\n return promise;\n}\nexport function makeDevtoolsIOAwarePromise(underlying, requestStore, stage) {\n if (requestStore.stagedRendering) {\n // We resolve each stage in a timeout, so React DevTools will pick this up as IO.\n return requestStore.stagedRendering.delayUntilStage(stage, undefined, underlying);\n }\n // in React DevTools if we resolve in a setTimeout we will observe\n // the promise resolution as something that can suspend a boundary or root.\n return new Promise((resolve)=>{\n // Must use setTimeout to be considered IO React DevTools. setImmediate will not work.\n setTimeout(()=>{\n resolve(underlying);\n }, 0);\n });\n}\n/**\n * Invokes `onUse` whenever `then()/catch()/finally()` are called on the promise\n * or when the promise is awaited. */ export function trackPromiseUsed(promise, onUse) {\n // We can instrument `.then()/.catch()/.finally()` in one go by using a Promise subclass\n // that implements a custom `.then()`, because `catch` and `finally` delegate to it.\n //\n // Alternative implementation ideas that were tried and rejected:\n //\n // 1. Patching the methods directly via `promise.then = (..args) => { ... }`:\n // doesn't work, because Node does not call the monkeypatched methods for native `await`:\n // > Native Promise [...]: The promise is directly used and awaited natively, without calling `then()`.\n // > https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await#description\n //\n // 2. Wrapping in a proxy that returns a custom `then/catch/finally`:\n // breaks async stacks in React's IO tracking (stack becomes `Promise.then`)\n return TrackedPromise.from(promise, onUse);\n}\nclass TrackedPromise extends Promise {\n #onUse;\n // We don't need derived promises to also be a TrackedPromise.\n // We only care about the first level of `.then()`.\n static get [Symbol.species]() {\n return Promise;\n }\n static from(promise, onUse) {\n // Whenever the promise we're tracking resolves/rejects, we should follow.\n const tracked = new TrackedPromise(promise.then.bind(promise));\n tracked.#onUse = onUse;\n // Hanging promises catch rejections when created. Tracked promises are generally derived\n // from promises that may hang & reject, so we need to do the same.\n // However, we have to bypass the tracking we do in `TrackedPromise.then`.\n // (we're using `then` directly, because `catch` ends up delegating `TrackedPromise.then`)\n Promise.prototype.then.call(tracked, undefined, ignoreReject);\n return tracked;\n }\n then(onFulfilled, onRejected) {\n const onUse = this.#onUse;\n if (onUse) {\n try {\n onUse();\n } catch (err) {\n // We don't want to break the method even if our tracking errored.\n console.error(err);\n }\n }\n return Promise.prototype.then.call(this, onFulfilled, onRejected);\n }\n constructor(...args){\n super(...args), this.#onUse = null;\n }\n}\nexport const RENDER_STAGES_BY_DATA_KIND = {\n sessionData: RenderStage.ShellRuntime,\n /**\n * Statically-prerenderable URL data, like static `params`.\n * It may need to be pushed to a runtime stage in a runtime prerender,\n * but it's semantically distinct from `runtimeUrlData` like `searchParams`,\n * which is always excluded from static prerenders.\n * */ staticUrlData: {\n /**\n * From that app's point of view, `prefetch()` is semantically the same as\n * `staticUrlData`, because it does not resolve in a shell but resolves in\n * a prefetch (even a static one).\n * We handle it separately to provide a specialized error in validation renders.\n */ prefetchApi: {\n static: RenderStage.PrefetchStatic_prefetchApi,\n runtime: RenderStage.PrefetchRuntime_prefetchApi\n },\n static: RenderStage.PrefetchStatic,\n runtime: RenderStage.PrefetchRuntime\n },\n /**\n * URL data that is never statically-prerenderable, like static `searchParams`.\n * */ runtimeUrlData: RenderStage.PrefetchRuntime\n};\nexport function applyOwnerStack(error) {\n if (process.env.NODE_ENV !== 'production') {\n var _getClientReact_captureOwnerStack, _getClientReact, _getServerReact_captureOwnerStack, _getServerReact;\n let ownerStack;\n const workUnitStore = workUnitAsyncStorage.getStore();\n // captureOwnerStack() returns the owner stack for the current React\n // rendering context. Inside a cache scope this only includes the inner\n // component tree. The outer owner stack (captured before entering the\n // cache boundary in use-cache-wrapper.ts) is stored on the cache store.\n // We concatenate both to get the full component tree.\n const innerOwnerStack = ((_getClientReact = getClientReact()) == null ? void 0 : (_getClientReact_captureOwnerStack = _getClientReact.captureOwnerStack) == null ? void 0 : _getClientReact_captureOwnerStack.call(_getClientReact)) ?? ((_getServerReact = getServerReact()) == null ? void 0 : (_getServerReact_captureOwnerStack = _getServerReact.captureOwnerStack) == null ? void 0 : _getServerReact_captureOwnerStack.call(_getServerReact));\n switch(workUnitStore == null ? void 0 : workUnitStore.type){\n case 'cache':\n case 'private-cache':\n ownerStack = (innerOwnerStack || '') + (workUnitStore.outerOwnerStack || '') || undefined;\n break;\n case 'unstable-cache':\n case 'request':\n case 'prerender':\n case 'prerender-legacy':\n case 'prerender-runtime':\n case 'prerender-client':\n case 'validation-client':\n case 'build-time-generator':\n case undefined:\n ownerStack = innerOwnerStack;\n break;\n default:\n workUnitStore;\n }\n if (ownerStack) {\n let stack = ownerStack;\n if (error.stack) {\n const frames = [];\n for (const frame of error.stack.split('\\n').slice(1)){\n if (frame.includes('react_stack_bottom_frame')) {\n break;\n }\n frames.push(frame);\n }\n stack = '\\n' + frames.join('\\n') + stack;\n }\n error.stack = error.name + ': ' + error.message + stack;\n }\n }\n return error;\n}\n\n//# sourceMappingURL=dynamic-rendering-utils.js.map","import { getRequestMeta } from '../../../request-meta';\nimport { fromNodeOutgoingHttpHeaders } from '../../utils';\nimport { NextRequest } from '../request';\nimport { isNodeNextRequest, isWebNextRequest } from '../../../base-http/helpers';\nexport const ResponseAbortedName = 'ResponseAborted';\nexport class ResponseAborted extends Error {\n constructor(...args){\n super(...args), this.name = ResponseAbortedName;\n }\n}\n/**\n * Creates an AbortController tied to the closing of a ServerResponse (or other\n * appropriate Writable).\n *\n * If the `close` event is fired before the `finish` event, then we'll send the\n * `abort` signal.\n */ export function createAbortController(response) {\n const controller = new AbortController();\n // If `finish` fires first, then `res.end()` has been called and the close is\n // just us finishing the stream on our side. If `close` fires first, then we\n // know the client disconnected before we finished.\n response.once('close', ()=>{\n if (response.writableFinished) return;\n controller.abort(new ResponseAborted());\n });\n return controller;\n}\n/**\n * Creates an AbortSignal tied to the closing of a ServerResponse (or other\n * appropriate Writable).\n *\n * This cannot be done with the request (IncomingMessage or Readable) because\n * the `abort` event will not fire if to data has been fully read (because that\n * will \"close\" the readable stream and nothing fires after that).\n */ export function signalFromNodeResponse(response) {\n const { errored, destroyed } = response;\n if (errored || destroyed) {\n return AbortSignal.abort(errored ?? new ResponseAborted());\n }\n const { signal } = createAbortController(response);\n return signal;\n}\nexport class NextRequestAdapter {\n static fromBaseNextRequest(request, signal) {\n if (// The type check here ensures that `req` is correctly typed, and the\n // environment variable check provides dead code elimination.\n process.env.NEXT_RUNTIME === 'edge' && isWebNextRequest(request)) {\n return NextRequestAdapter.fromWebNextRequest(request);\n } else if (// The type check here ensures that `req` is correctly typed, and the\n // environment variable check provides dead code elimination.\n process.env.NEXT_RUNTIME !== 'edge' && isNodeNextRequest(request)) {\n return NextRequestAdapter.fromNodeNextRequest(request, signal);\n } else {\n throw new Error('Invariant: Unsupported NextRequest type');\n }\n }\n static fromNodeNextRequest(request, signal) {\n // HEAD and GET requests can not have a body.\n let body = null;\n if (request.method !== 'GET' && request.method !== 'HEAD' && request.body) {\n // @ts-expect-error - this is handled by undici, when streams/web land use it instead\n body = request.body;\n }\n let url;\n if (request.url.startsWith('http')) {\n url = new URL(request.url);\n } else {\n // Grab the full URL from the request metadata.\n const base = getRequestMeta(request, 'initURL');\n if (!base || !base.startsWith('http')) {\n // Because the URL construction relies on the fact that the URL provided\n // is absolute, we need to provide a base URL. We can't use the request\n // URL because it's relative, so we use a dummy URL instead.\n url = new URL(request.url, 'http://n');\n } else {\n url = new URL(request.url, base);\n }\n }\n return new NextRequest(url, {\n method: request.method,\n headers: fromNodeOutgoingHttpHeaders(request.headers),\n duplex: 'half',\n signal,\n // geo\n // ip\n // nextConfig\n // body can not be passed if request was aborted\n // or we get a Request body was disturbed error\n ...signal.aborted ? {} : {\n body\n }\n });\n }\n static fromWebNextRequest(request) {\n // HEAD and GET requests can not have a body.\n let body = null;\n if (request.method !== 'GET' && request.method !== 'HEAD') {\n body = request.body;\n }\n return new NextRequest(request.url, {\n method: request.method,\n headers: fromNodeOutgoingHttpHeaders(request.headers),\n duplex: 'half',\n signal: request.request.signal,\n // geo\n // ip\n // nextConfig\n // body can not be passed if request was aborted\n // or we get a Request body was disturbed error\n ...request.request.signal.aborted ? {} : {\n body\n }\n });\n }\n}\n\n//# sourceMappingURL=next-request.js.map","import { removeTrailingSlash } from './remove-trailing-slash';\nimport { addPathPrefix } from './add-path-prefix';\nimport { addPathSuffix } from './add-path-suffix';\nimport { addLocale } from './add-locale';\nexport function formatNextPathnameInfo(info) {\n let pathname = addLocale(info.pathname, info.locale, info.buildId ? undefined : info.defaultLocale, info.ignorePrefix);\n if (info.buildId || !info.trailingSlash) {\n pathname = removeTrailingSlash(pathname);\n }\n if (info.buildId) {\n pathname = addPathSuffix(addPathPrefix(pathname, `/_next/data/${info.buildId}`), info.pathname === '/' ? 'index.json' : '.json');\n }\n pathname = addPathPrefix(pathname, info.basePath);\n return !info.buildId && info.trailingSlash ? !pathname.endsWith('/') ? addPathSuffix(pathname, '/') : pathname : removeTrailingSlash(pathname);\n}\n\n//# sourceMappingURL=format-next-pathname-info.js.map","import { HeadersAdapter } from '../web/spec-extension/adapters/headers';\nimport { PRERENDER_REVALIDATE_HEADER, PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER } from '../../lib/constants';\nimport { getTracer } from '../lib/trace/tracer';\nimport { NodeSpan } from '../lib/trace/constants';\nexport function wrapApiHandler(page, handler) {\n return (...args)=>{\n getTracer().setRootSpanAttribute('next.route', page);\n // Call API route method\n return getTracer().trace(NodeSpan.runHandler, {\n spanName: `executing api route (pages) ${page}`\n }, ()=>handler(...args));\n };\n}\n/**\n *\n * @param res response object\n * @param statusCode `HTTP` status code of response\n */ export function sendStatusCode(res, statusCode) {\n res.statusCode = statusCode;\n return res;\n}\n/**\n *\n * @param res response object\n * @param [statusOrUrl] `HTTP` status code of redirect\n * @param url URL of redirect\n */ export function redirect(res, statusOrUrl, url) {\n if (typeof statusOrUrl === 'string') {\n url = statusOrUrl;\n statusOrUrl = 307;\n }\n if (typeof statusOrUrl !== 'number' || typeof url !== 'string') {\n throw new Error(`Invalid redirect arguments. Please use a single argument URL, e.g. res.redirect('/destination') or use a status code and URL, e.g. res.redirect(307, '/destination').`);\n }\n res.writeHead(statusOrUrl, {\n Location: url\n });\n res.write(url);\n res.end();\n return res;\n}\nexport function checkIsOnDemandRevalidate(rawHeaders, previewProps) {\n // Headers is a plain object for Node.js, Headers object in Edge runtime\n if (typeof rawHeaders.get === 'function') {\n const headers = HeadersAdapter.from(rawHeaders);\n const previewModeId = headers.get(PRERENDER_REVALIDATE_HEADER);\n const isOnDemandRevalidate = previewModeId === previewProps.previewModeId;\n const revalidateOnlyGenerated = headers.has(PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER);\n return {\n isOnDemandRevalidate,\n revalidateOnlyGenerated\n };\n }\n const headers = rawHeaders;\n const previewModeId = headers[PRERENDER_REVALIDATE_HEADER];\n const isOnDemandRevalidate = previewModeId === previewProps.previewModeId;\n const revalidateOnlyGenerated = headers.hasOwnProperty(PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER);\n return {\n isOnDemandRevalidate,\n revalidateOnlyGenerated\n };\n}\nexport const COOKIE_NAME_PRERENDER_BYPASS = `__prerender_bypass`;\nexport const COOKIE_NAME_PRERENDER_DATA = `__next_preview_data`;\nexport const RESPONSE_LIMIT_DEFAULT = 4 * 1024 * 1024;\nexport const SYMBOL_PREVIEW_DATA = Symbol(COOKIE_NAME_PRERENDER_DATA);\nexport const SYMBOL_CLEARED_COOKIES = Symbol(COOKIE_NAME_PRERENDER_BYPASS);\nexport function clearPreviewData(res, options = {}) {\n if (SYMBOL_CLEARED_COOKIES in res) {\n return res;\n }\n const { serialize } = require('next/dist/compiled/cookie');\n const previous = res.getHeader('Set-Cookie');\n res.setHeader(`Set-Cookie`, [\n ...typeof previous === 'string' ? [\n previous\n ] : Array.isArray(previous) ? previous : [],\n serialize(COOKIE_NAME_PRERENDER_BYPASS, '', {\n // To delete a cookie, set `expires` to a date in the past:\n // https://tools.ietf.org/html/rfc6265#section-4.1.1\n // `Max-Age: 0` is not valid, thus ignored, and the cookie is persisted.\n expires: new Date(0),\n httpOnly: true,\n sameSite: process.env.NODE_ENV !== 'development' ? 'none' : 'lax',\n secure: process.env.NODE_ENV !== 'development',\n path: '/',\n ...options.path !== undefined ? {\n path: options.path\n } : undefined\n }),\n serialize(COOKIE_NAME_PRERENDER_DATA, '', {\n // To delete a cookie, set `expires` to a date in the past:\n // https://tools.ietf.org/html/rfc6265#section-4.1.1\n // `Max-Age: 0` is not valid, thus ignored, and the cookie is persisted.\n expires: new Date(0),\n httpOnly: true,\n sameSite: process.env.NODE_ENV !== 'development' ? 'none' : 'lax',\n secure: process.env.NODE_ENV !== 'development',\n path: '/',\n ...options.path !== undefined ? {\n path: options.path\n } : undefined\n })\n ]);\n Object.defineProperty(res, SYMBOL_CLEARED_COOKIES, {\n value: true,\n enumerable: false\n });\n return res;\n}\n/**\n * Custom error class\n */ export class ApiError extends Error {\n constructor(statusCode, message){\n super(message);\n this.statusCode = statusCode;\n }\n}\n/**\n * Sends error in `response`\n * @param res response object\n * @param statusCode of response\n * @param message of response\n */ export function sendError(res, statusCode, message) {\n res.statusCode = statusCode;\n res.statusMessage = message;\n res.end(message);\n}\n/**\n * Execute getter function only if its needed\n * @param LazyProps `req` and `params` for lazyProp\n * @param prop name of property\n * @param getter function to get data\n */ export function setLazyProp({ req }, prop, getter) {\n const opts = {\n configurable: true,\n enumerable: true\n };\n const optsReset = {\n ...opts,\n writable: true\n };\n Object.defineProperty(req, prop, {\n ...opts,\n get: ()=>{\n const value = getter();\n // we set the property on the object to avoid recalculating it\n Object.defineProperty(req, prop, {\n ...optsReset,\n value\n });\n return value;\n },\n set: (value)=>{\n Object.defineProperty(req, prop, {\n ...optsReset,\n value\n });\n }\n });\n}\n\n//# sourceMappingURL=index.js.map","import { NextURL } from '../next-url';\nimport { toNodeOutgoingHttpHeaders, validateURL } from '../utils';\nimport { RemovedUAError, RemovedPageError } from '../error';\nimport { RequestCookies } from './cookies';\nexport const INTERNALS = Symbol('internal request');\n/**\n * This class extends the [Web `Request` API](https://developer.mozilla.org/docs/Web/API/Request) with additional convenience methods.\n *\n * Read more: [Next.js Docs: `NextRequest`](https://nextjs.org/docs/app/api-reference/functions/next-request)\n */ export class NextRequest extends Request {\n constructor(input, init = {}){\n const url = typeof input !== 'string' && 'url' in input ? input.url : String(input);\n validateURL(url);\n // node Request instance requires duplex option when a body\n // is present or it errors, we don't handle this for\n // Request being passed in since it would have already\n // errored if this wasn't configured\n if (process.env.NEXT_RUNTIME !== 'edge') {\n if (init.body && init.duplex !== 'half') {\n init.duplex = 'half';\n }\n }\n if (input instanceof Request) super(input, init);\n else super(url, init);\n const nextUrl = new NextURL(url, {\n headers: toNodeOutgoingHttpHeaders(this.headers),\n nextConfig: init.nextConfig\n });\n this[INTERNALS] = {\n cookies: new RequestCookies(this.headers),\n nextUrl,\n url: process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE ? url : nextUrl.toString()\n };\n }\n [Symbol.for('edge-runtime.inspect.custom')]() {\n return {\n cookies: this.cookies,\n nextUrl: this.nextUrl,\n url: this.url,\n // rest of props come from Request\n bodyUsed: this.bodyUsed,\n cache: this.cache,\n credentials: this.credentials,\n destination: this.destination,\n headers: Object.fromEntries(this.headers),\n integrity: this.integrity,\n keepalive: this.keepalive,\n method: this.method,\n mode: this.mode,\n redirect: this.redirect,\n referrer: this.referrer,\n referrerPolicy: this.referrerPolicy,\n signal: this.signal\n };\n }\n get cookies() {\n return this[INTERNALS].cookies;\n }\n get nextUrl() {\n return this[INTERNALS].nextUrl;\n }\n /**\n * @deprecated\n * `page` has been deprecated in favour of `URLPattern`.\n * Read more: https://nextjs.org/docs/messages/middleware-request-page\n */ get page() {\n throw new RemovedPageError();\n }\n /**\n * @deprecated\n * `ua` has been removed in favour of \\`userAgent\\` function.\n * Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent\n */ get ua() {\n throw new RemovedUAError();\n }\n get url() {\n return this[INTERNALS].url;\n }\n}\n\n//# sourceMappingURL=request.js.map","import { CachedRouteKind, IncrementalCacheKind } from './types';\nimport RenderResult from '../render-result';\nimport { RouteKind } from '../route-kind';\nimport { HTML_CONTENT_TYPE_HEADER } from '../../lib/constants';\nexport async function fromResponseCacheEntry(cacheEntry) {\n var _cacheEntry_value, _cacheEntry_value1;\n return {\n ...cacheEntry,\n value: ((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) === CachedRouteKind.PAGES ? {\n kind: CachedRouteKind.PAGES,\n html: await cacheEntry.value.html.toUnchunkedString(true),\n pageData: cacheEntry.value.pageData,\n headers: cacheEntry.value.headers,\n status: cacheEntry.value.status\n } : ((_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind) === CachedRouteKind.APP_PAGE ? {\n kind: CachedRouteKind.APP_PAGE,\n html: await cacheEntry.value.html.toUnchunkedString(true),\n postponed: cacheEntry.value.postponed,\n rscData: cacheEntry.value.rscData,\n headers: cacheEntry.value.headers,\n status: cacheEntry.value.status,\n segmentData: cacheEntry.value.segmentData\n } : cacheEntry.value\n };\n}\nexport async function toResponseCacheEntry(response) {\n var _response_value, _response_value1;\n if (!response) return null;\n return {\n isMiss: response.isMiss,\n isStale: response.isStale,\n cacheControl: response.cacheControl,\n isFallback: response.isFallback,\n value: ((_response_value = response.value) == null ? void 0 : _response_value.kind) === CachedRouteKind.PAGES ? {\n kind: CachedRouteKind.PAGES,\n html: RenderResult.fromStatic(response.value.html, HTML_CONTENT_TYPE_HEADER),\n pageData: response.value.pageData,\n headers: response.value.headers,\n status: response.value.status\n } : ((_response_value1 = response.value) == null ? void 0 : _response_value1.kind) === CachedRouteKind.APP_PAGE ? {\n kind: CachedRouteKind.APP_PAGE,\n html: RenderResult.fromStatic(response.value.html, HTML_CONTENT_TYPE_HEADER),\n rscData: response.value.rscData,\n headers: response.value.headers,\n status: response.value.status,\n postponed: response.value.postponed,\n segmentData: response.value.segmentData\n } : response.value\n };\n}\nexport function routeKindToIncrementalCacheKind(routeKind) {\n switch(routeKind){\n case RouteKind.PAGES:\n return IncrementalCacheKind.PAGES;\n case RouteKind.APP_PAGE:\n return IncrementalCacheKind.APP_PAGE;\n case RouteKind.IMAGE:\n return IncrementalCacheKind.IMAGE;\n case RouteKind.APP_ROUTE:\n return IncrementalCacheKind.APP_ROUTE;\n case RouteKind.PAGES_API:\n // Pages Router API routes are not cached in the incremental cache.\n throw new Error(`Unexpected route kind ${routeKind}`);\n default:\n return routeKind;\n }\n}\n\n//# sourceMappingURL=utils.js.map","import { ResponseAbortedName, createAbortController } from './web/spec-extension/adapters/next-request';\nimport { createPromiseWithResolvers } from '../shared/lib/promise-with-resolvers';\nimport { getTracer } from './lib/trace/tracer';\nimport { NextNodeServerSpan } from './lib/trace/constants';\nexport function isAbortError(e) {\n return (e == null ? void 0 : e.name) === 'AbortError' || (e == null ? void 0 : e.name) === ResponseAbortedName;\n}\nconst HAS_CLIENT_COMPONENT_METRICS_ENABLED = 'performance' in globalThis && process.env.NEXT_OTEL_PERFORMANCE_PREFIX;\nfunction createWriterFromResponse(res, waitUntilForEnd, clientComponentLoadTracker) {\n let started = false;\n // Create a promise that will resolve once the response has drained. See\n // https://nodejs.org/api/stream.html#stream_event_drain\n let drained = createPromiseWithResolvers();\n function onDrain() {\n drained.resolve();\n }\n res.on('drain', onDrain);\n // If the finish event fires, it means we shouldn't block and wait for the\n // drain event.\n res.once('close', ()=>{\n res.off('drain', onDrain);\n drained.resolve();\n });\n // Create a promise that will resolve once the response has finished. See\n // https://nodejs.org/api/http.html#event-finish_1\n const finished = createPromiseWithResolvers();\n res.once('finish', ()=>{\n finished.resolve();\n });\n // Create a writable stream that will write to the response.\n return new WritableStream({\n write: async (chunk)=>{\n // You'd think we'd want to use `start` instead of placing this in `write`\n // but this ensures that we don't actually flush the headers until we've\n // started writing chunks.\n if (!started) {\n started = true;\n if (HAS_CLIENT_COMPONENT_METRICS_ENABLED) {\n const metrics = clientComponentLoadTracker == null ? void 0 : clientComponentLoadTracker.snapshot();\n if (metrics) {\n performance.measure(`${process.env.NEXT_OTEL_PERFORMANCE_PREFIX}:next-client-component-loading`, {\n start: metrics.clientComponentLoadStart,\n end: metrics.clientComponentLoadStart + metrics.clientComponentLoadTimes\n });\n }\n }\n res.flushHeaders();\n getTracer().trace(NextNodeServerSpan.startResponse, {\n spanName: 'start response'\n }, ()=>undefined);\n }\n try {\n const ok = res.write(chunk);\n // Added by the `compression` middleware, this is a function that will\n // flush the partially-compressed response to the client.\n if ('flush' in res && typeof res.flush === 'function') {\n res.flush();\n }\n // If the write returns false, it means there's some backpressure, so\n // wait until it's streamed before continuing.\n if (!ok) {\n await drained.promise;\n // Reset the drained promise so that we can wait for the next drain event.\n drained = createPromiseWithResolvers();\n }\n } catch (err) {\n res.end();\n throw new Error('failed to write chunk to response', {\n cause: err\n });\n }\n },\n abort: (err)=>{\n if (res.writableFinished) return;\n res.destroy(err);\n },\n close: async ()=>{\n // if a waitUntil promise was passed, wait for it to resolve before\n // ending the response.\n if (waitUntilForEnd) {\n await waitUntilForEnd;\n }\n if (res.writableFinished) return;\n res.end();\n return finished.promise;\n }\n });\n}\nexport async function pipeToNodeResponse(readable, res, waitUntilForEnd, clientComponentLoadTracker) {\n try {\n // If the response has already errored, then just return now.\n const { errored, destroyed } = res;\n if (errored || destroyed) return;\n // Create a new AbortController so that we can abort the readable if the\n // client disconnects.\n const controller = createAbortController(res);\n const writer = createWriterFromResponse(res, waitUntilForEnd, clientComponentLoadTracker);\n await readable.pipeTo(writer, {\n signal: controller.signal\n });\n } catch (err) {\n // If this isn't related to an abort error, re-throw it.\n if (isAbortError(err)) return;\n throw new Error('failed to pipe response', {\n cause: err\n });\n }\n}\nexport async function pipeNodeReadableToNodeResponse(readable, res, waitUntilForEnd, clientComponentLoadTracker) {\n try {\n const { errored, destroyed } = res;\n if (errored || destroyed) return;\n let started = false;\n const finished = createPromiseWithResolvers();\n // One `drain` listener for the whole response, as in\n // `createWriterFromResponse` above. It must not be `res.once('drain')` per\n // backpressured write: the `compression` middleware forwards `res.on` to\n // its zlib stream but leaves `removeListener` pointing at the response, so\n // a `once` listener is never removed from the stream it was added to. Each\n // backpressured write would leak one, and past ten Node reports the stream\n // as a probable leak via `MaxListenersExceededWarning`.\n //\n // TODO: the upstream fix for that asymmetry is\n // https://github.com/expressjs/compression/pull/153, which intercepts\n // `removeListener` so it reaches the zlib stream. It has been open since\n // 2019 and is not in upstream 1.8.1; we vendor 1.7.4. If it ever lands and\n // we upgrade, `res.off('drain', onDrain)` below would start working with\n // compression active and the caveat on the `close` handler could go away.\n let paused = false;\n const onDrain = ()=>{\n // The listener outlives the readable: `off` below cannot reach the zlib\n // stream either, so a late drain can arrive after teardown.\n if (!paused || readable.destroyed) return;\n paused = false;\n readable.resume();\n };\n res.on('drain', onDrain);\n res.once('close', ()=>{\n // Only removes the listener when compression is inactive, which is the\n // case where it was added to the response itself. Otherwise it lives on\n // the zlib stream, which is released with the response.\n res.off('drain', onDrain);\n readable.destroy();\n finished.resolve();\n });\n readable.on('data', (chunk)=>{\n if (!started) {\n started = true;\n if ('performance' in globalThis && process.env.NEXT_OTEL_PERFORMANCE_PREFIX) {\n const metrics = clientComponentLoadTracker == null ? void 0 : clientComponentLoadTracker.snapshot();\n if (metrics) {\n performance.measure(`${process.env.NEXT_OTEL_PERFORMANCE_PREFIX}:next-client-component-loading`, {\n start: metrics.clientComponentLoadStart,\n end: metrics.clientComponentLoadStart + metrics.clientComponentLoadTimes\n });\n }\n }\n res.flushHeaders();\n getTracer().trace(NextNodeServerSpan.startResponse, {\n spanName: 'start response'\n }, ()=>undefined);\n }\n const ok = res.write(chunk);\n if ('flush' in res && typeof res.flush === 'function') {\n res.flush();\n }\n if (!ok) {\n paused = true;\n readable.pause();\n }\n });\n readable.on('end', async ()=>{\n if (waitUntilForEnd) {\n await waitUntilForEnd;\n }\n if (!res.writableFinished) {\n res.end();\n }\n finished.resolve();\n });\n readable.on('error', (err)=>{\n if (isAbortError(err)) {\n finished.resolve();\n return;\n }\n res.destroy(err);\n finished.resolve();\n });\n await finished.promise;\n } catch (err) {\n if (isAbortError(err)) return;\n throw new Error('failed to pipe response', {\n cause: err\n });\n }\n}\n\n//# sourceMappingURL=pipe-readable.js.map","import { normalizeAppPath } from '../../../../shared/lib/router/utils/app-paths';\nimport { Normalizers } from '../../normalizers';\nimport { wrapNormalizerFn } from '../../wrap-normalizer-fn';\nimport { UnderscoreNormalizer } from '../../underscore-normalizer';\nexport class AppPathnameNormalizer extends Normalizers {\n constructor(){\n super([\n // The pathname to match should have the trailing `/page` and other route\n // group information stripped from it.\n wrapNormalizerFn(normalizeAppPath),\n // The page should have the `%5F` characters replaced with `_` characters.\n new UnderscoreNormalizer()\n ]);\n }\n normalize(page) {\n return super.normalize(page);\n }\n}\nexport class DevAppPathnameNormalizer extends Normalizers {\n constructor(pageNormalizer){\n super([\n // This should normalize the filename to a page.\n pageNormalizer,\n // Normalize the app page to a pathname.\n new AppPathnameNormalizer()\n ]);\n }\n normalize(filename) {\n return super.normalize(filename);\n }\n}\n\n//# sourceMappingURL=app-pathname-normalizer.js.map","/**\n * Given a path this function will find the pathname, query and hash and return\n * them. This is useful to parse full paths on the client side.\n * @param path A path to parse e.g. /foo/bar?id=1#hash\n */ export function parsePath(path) {\n const hashIndex = path.indexOf('#');\n const queryIndex = path.indexOf('?');\n const hasQuery = queryIndex > -1 && (hashIndex < 0 || queryIndex < hashIndex);\n if (hasQuery || hashIndex > -1) {\n return {\n pathname: path.substring(0, hasQuery ? queryIndex : hashIndex),\n query: hasQuery ? path.substring(queryIndex, hashIndex > -1 ? hashIndex : undefined) : '',\n hash: hashIndex > -1 ? path.slice(hashIndex) : ''\n };\n }\n return {\n pathname: path,\n query: '',\n hash: ''\n };\n}\n\n//# sourceMappingURL=parse-path.js.map","import { parsePath } from './parse-path';\n/**\n * Adds the provided prefix to the given path. It first ensures that the path\n * is indeed starting with a slash.\n */ export function addPathPrefix(path, prefix) {\n if (!path.startsWith('/') || !prefix) {\n return path;\n }\n const { pathname, query, hash } = parsePath(path);\n return `${prefix}${pathname}${query}${hash}`;\n}\n\n//# sourceMappingURL=add-path-prefix.js.map","import { createPromiseWithResolvers } from '../shared/lib/promise-with-resolvers';\n/**\n * A wrapper for a function that will only allow one call to the function to\n * execute at a time.\n */ export class Batcher {\n constructor(cacheKeyFn, /**\n * A function that will be called to schedule the wrapped function to be\n * executed. This defaults to a function that will execute the function\n * immediately.\n */ schedulerFn = (fn)=>fn()){\n this.cacheKeyFn = cacheKeyFn;\n this.schedulerFn = schedulerFn;\n this.pending = new Map();\n }\n static create(options) {\n return new Batcher(options == null ? void 0 : options.cacheKeyFn, options == null ? void 0 : options.schedulerFn);\n }\n /**\n * Wraps a function in a promise that will be resolved or rejected only once\n * for a given key. This will allow multiple calls to the function to be\n * made, but only one will be executed at a time. The result of the first\n * call will be returned to all callers.\n *\n * @param key the key to use for the cache\n * @param fn the function to wrap\n * @returns a promise that resolves to the result of the function\n */ async batch(key, fn) {\n const cacheKey = this.cacheKeyFn ? await this.cacheKeyFn(key) : key;\n if (cacheKey === null) {\n return fn({\n resolve: (value)=>Promise.resolve(value),\n key\n });\n }\n const pending = this.pending.get(cacheKey);\n if (pending) return pending;\n const { promise, resolve, reject } = createPromiseWithResolvers();\n this.pending.set(cacheKey, promise);\n this.schedulerFn(async ()=>{\n try {\n const result = await fn({\n resolve,\n key\n });\n // Resolving a promise multiple times is a no-op, so we can safely\n // resolve all pending promises with the same result.\n resolve(result);\n } catch (err) {\n reject(err);\n } finally{\n this.pending.delete(cacheKey);\n }\n });\n return promise;\n }\n}\n\n//# sourceMappingURL=batcher.js.map","/**\n * Based on https://github.com/facebook/react/blob/d4e78c42a94be027b4dc7ed2659a5fddfbf9bd4e/packages/react/src/ReactFetch.js\n */ import * as React from 'react';\nimport { cloneResponse } from './clone-response';\nimport { InvariantError } from '../../shared/lib/invariant-error';\nconst simpleCacheKey = '[\"GET\",[],null,\"follow\",null,null,null,null]' // generateCacheKey(new Request('https://blank'));\n;\n// Headers that should not affect deduplication\n// traceparent and tracestate are used for distributed tracing and should not affect cache keys\nconst headersToExcludeInCacheKey = new Set([\n 'traceparent',\n 'tracestate'\n]);\nfunction generateCacheKey(request) {\n // We pick the fields that goes into the key used to dedupe requests.\n // We don't include the `cache` field, because we end up using whatever\n // caching resulted from the first request.\n // Notably we currently don't consider non-standard (or future) options.\n // This might not be safe. TODO: warn for non-standard extensions differing.\n // IF YOU CHANGE THIS UPDATE THE simpleCacheKey ABOVE.\n const filteredHeaders = Array.from(request.headers.entries()).filter(([key])=>!headersToExcludeInCacheKey.has(key.toLowerCase()));\n return JSON.stringify([\n request.method,\n filteredHeaders,\n request.mode,\n request.redirect,\n request.credentials,\n request.referrer,\n request.referrerPolicy,\n request.integrity\n ]);\n}\nexport function createDedupeFetch(originalFetch) {\n const getCacheEntries = React.cache(// eslint-disable-next-line @typescript-eslint/no-unused-vars -- url is the cache key\n (url)=>[]);\n return function dedupeFetch(resource, options) {\n if (options && options.signal) {\n // If we're passed a signal, then we assume that\n // someone else controls the lifetime of this object and opts out of\n // caching. It's effectively the opt-out mechanism.\n // Ideally we should be able to check this on the Request but\n // it always gets initialized with its own signal so we don't\n // know if it's supposed to override - unless we also override the\n // Request constructor.\n return originalFetch(resource, options);\n }\n // Normalize the Request\n let url;\n let cacheKey;\n if (typeof resource === 'string' && !options) {\n // Fast path.\n cacheKey = simpleCacheKey;\n url = resource;\n } else {\n // Normalize the request.\n // if resource is not a string or a URL (its an instance of Request)\n // then do not instantiate a new Request but instead\n // reuse the request as to not disturb the body in the event it's a ReadableStream.\n const request = typeof resource === 'string' || resource instanceof URL ? new Request(resource, options) : resource;\n if (request.method !== 'GET' && request.method !== 'HEAD' || request.keepalive) {\n // We currently don't dedupe requests that might have side-effects. Those\n // have to be explicitly cached. We assume that the request doesn't have a\n // body if it's GET or HEAD.\n // keepalive gets treated the same as if you passed a custom cache signal.\n return originalFetch(resource, options);\n }\n cacheKey = generateCacheKey(request);\n url = request.url;\n }\n const cacheEntries = getCacheEntries(url);\n for(let i = 0, j = cacheEntries.length; i < j; i += 1){\n const [key, promise] = cacheEntries[i];\n if (key === cacheKey) {\n return promise.then(()=>{\n const response = cacheEntries[i][2];\n if (!response) throw new InvariantError('No cached response');\n // We're cloning the response using this utility because there exists\n // a bug in the undici library around response cloning. See the\n // following pull request for more details:\n // https://github.com/vercel/next.js/pull/73274\n const [cloned1, cloned2] = cloneResponse(response);\n cacheEntries[i][2] = cloned2;\n return cloned1;\n });\n }\n }\n // We pass the original arguments here in case normalizing the Request\n // doesn't include all the options in this environment.\n const promise = originalFetch(resource, options);\n const entry = [\n cacheKey,\n promise,\n null\n ];\n cacheEntries.push(entry);\n return promise.then((response)=>{\n // We're cloning the response using this utility because there exists\n // a bug in the undici library around response cloning. See the\n // following pull request for more details:\n // https://github.com/vercel/next.js/pull/73274\n const [cloned1, cloned2] = cloneResponse(response);\n entry[2] = cloned2;\n return cloned1;\n });\n };\n}\n\n//# sourceMappingURL=dedupe-fetch.js.map","import { normalizePagePath } from '../../shared/lib/page-path/normalize-page-path';\nimport { normalizeLocalePath } from '../../shared/lib/i18n/normalize-locale-path';\nimport { InvariantError } from '../../shared/lib/invariant-error';\nimport { AppPathnameNormalizer } from '../normalizers/built/app/app-pathname-normalizer';\nimport { RouteKind } from '../route-kind';\nexport const ROUTE_CACHE_DIRECTORY = 'route-cache';\nconst appPathnameNormalizer = new AppPathnameNormalizer();\n/** Convert a runtime route definition to the identity used by response caches. */ export function getResponseCacheOwner(definition) {\n return {\n kind: definition.kind,\n // Pages module names can include a trailing /index in Turbopack. Their\n // pathname matches the manifest's source in both bundlers. App modules\n // retain groups and parallel slots in their cache identity.\n sourceRoute: definition.kind === RouteKind.PAGES ? definition.pathname : definition.page\n };\n}\n/**\n * Prerender metadata already identifies its source route. Compare that source\n * with the selected module before using its metadata, including negative\n * entries and partially specialized fallback shells. Cache storage continues\n * to use the full module identity, including groups and parallel slots.\n */ export function isRouteCacheOwner(pathname, owner, prerender, locales) {\n if (!prerender) {\n return false;\n }\n // Pages have JSON data routes, App Pages have RSC data routes, and App\n // Route Handlers have no separate data route.\n const kind = prerender.dataRoute === null ? RouteKind.APP_ROUTE : prerender.dataRoute.endsWith('.json') ? RouteKind.PAGES : prerender.dataRoute.endsWith('.rsc') ? RouteKind.APP_PAGE : undefined;\n if (kind !== owner.kind) {\n return false;\n }\n const source = 'srcRoute' in prerender ? prerender.srcRoute : prerender.fallbackSourceRoute;\n const prerenderOwner = source ?? (kind === RouteKind.PAGES ? normalizeLocalePath(pathname, locales).pathname : pathname);\n return prerenderOwner === (kind === RouteKind.PAGES ? owner.sourceRoute : appPathnameNormalizer.normalize(owner.sourceRoute));\n}\n/**\n * Response keys are opaque to cache handlers. Hash the source route into one\n * fixed-length directory, preserving App groups and slots without expanding\n * Unicode names or repeating the source directory hierarchy on disk. The\n * pathname stays readable and is normalized exactly once before namespacing.\n */ export function getRouteCacheKey(pathname, owner) {\n if (!owner) {\n throw new InvariantError('Response cache requires a source route');\n }\n const { sourceRoute } = owner;\n let source;\n if (process.env.NEXT_RUNTIME === 'edge') {\n const sha256 = require('next/dist/compiled/hash.js/sha256');\n source = sha256().update(new TextEncoder().encode(sourceRoute)).digest('hex');\n } else {\n const { createHash } = require('crypto');\n source = createHash('sha256').update(sourceRoute).digest('hex');\n }\n return `/${ROUTE_CACHE_DIRECTORY}/${owner.kind}/${source}/$${normalizePagePath(pathname)}`;\n}\n\n//# sourceMappingURL=route-cache-key.js.map","import { parsePath } from './parse-path';\n/**\n * Similarly to `addPathPrefix`, this function adds a suffix at the end on the\n * provided path. It also works only for paths ensuring the argument starts\n * with a slash.\n */ export function addPathSuffix(path, suffix) {\n if (!path.startsWith('/') || !suffix) {\n return path;\n }\n const { pathname, query, hash } = parsePath(path);\n return `${pathname}${suffix}${query}${hash}`;\n}\n\n//# sourceMappingURL=add-path-suffix.js.map","/**\n * Schedules a function to be called on the next tick after the other promises\n * have been resolved.\n *\n * @param cb the function to schedule\n */ export const scheduleOnNextTick = (cb)=>{\n // We use Promise.resolve().then() here so that the operation is scheduled at\n // the end of the promise job queue, we then add it to the next process tick\n // to ensure it's evaluated afterwards.\n //\n // This was inspired by the implementation of the DataLoader interface: https://github.com/graphql/dataloader/blob/d336bd15282664e0be4b4a657cb796f09bafbc6b/src/index.js#L213-L255\n //\n Promise.resolve().then(()=>{\n if (process.env.NEXT_RUNTIME === 'edge') {\n setTimeout(cb, 0);\n } else {\n process.nextTick(cb);\n }\n });\n};\n/**\n * Schedules a function to be called using `setImmediate` or `setTimeout` if\n * `setImmediate` is not available (like in the Edge runtime).\n *\n * @param cb the function to schedule\n */ export const scheduleImmediate = (cb)=>{\n if (process.env.NEXT_RUNTIME === 'edge') {\n setTimeout(cb, 0);\n } else {\n setImmediate(cb);\n }\n};\n/**\n * returns a promise than resolves in a future task. There is no guarantee that the task it resolves in\n * will be the next task but if you await it you can at least be sure that the current task is over and\n * most usefully that the entire microtask queue of the current task has been emptied.\n */ export function atLeastOneTask() {\n return new Promise((resolve)=>scheduleImmediate(resolve));\n}\n/**\n * This utility function is extracted to make it easier to find places where we are doing\n * specific timing tricks to try to schedule work after React has rendered. This is especially\n * important at the moment because Next.js uses the edge builds of React which use setTimeout to\n * schedule work when you might expect that something like setImmediate would do the trick.\n *\n * Long term we should switch to the node versions of React rendering when possible and then\n * update this to use setImmediate rather than setTimeout\n */ export function waitAtLeastOneReactRenderTask() {\n if (process.env.NEXT_RUNTIME === 'edge') {\n return new Promise((r)=>setTimeout(r, 0));\n } else {\n return new Promise((r)=>setImmediate(r));\n }\n}\n\n//# sourceMappingURL=scheduler.js.map","/**\n * Takes an object with a hostname property (like a parsed URL) and some\n * headers that may contain Host and returns the preferred hostname.\n * @param parsed An object containing a hostname property.\n * @param headers A dictionary with headers containing a `host`.\n */ export function getHostname(parsed, headers) {\n // Get the hostname from the headers if it exists, otherwise use the parsed\n // hostname.\n let hostname;\n if (headers?.host && !Array.isArray(headers.host)) {\n hostname = headers.host.toString().split(':', 1)[0];\n } else if (parsed.hostname) {\n hostname = parsed.hostname;\n } else return;\n return hostname.toLowerCase();\n}\n\n//# sourceMappingURL=get-hostname.js.map","/**\n * Check to see if a value is Thenable.\n *\n * @param promise the maybe-thenable value\n * @returns true if the value is thenable\n */ export function isThenable(promise) {\n return promise !== null && typeof promise === 'object' && 'then' in promise && typeof promise.then === 'function';\n}\n\n//# sourceMappingURL=is-thenable.js.map","import { addPathPrefix } from './add-path-prefix';\nimport { pathHasPrefix } from './path-has-prefix';\n/**\n * For a given path and a locale, if the locale is given, it will prefix the\n * locale. The path shouldn't be an API path. If a default locale is given the\n * prefix will be omitted if the locale is already the default locale.\n */ export function addLocale(path, locale, defaultLocale, ignorePrefix) {\n // If no locale was given or the locale is the default locale, we don't need\n // to prefix the path.\n if (!locale || locale === defaultLocale) return path;\n const lower = path.toLowerCase();\n // If the path is an API path or the path already has the locale prefix, we\n // don't need to prefix the path.\n if (!ignorePrefix) {\n if (pathHasPrefix(lower, '/api')) return path;\n if (pathHasPrefix(lower, `/${locale.toLowerCase()}`)) return path;\n }\n // Add the locale prefix to the path.\n return addPathPrefix(path, `/${locale}`);\n}\n\n//# sourceMappingURL=add-locale.js.map","import { IncrementalCacheKind } from './types';\nimport { InvariantError } from '../../shared/lib/invariant-error';\nimport { Batcher } from '../../lib/batcher';\nimport { LRUCache } from '../lib/lru-cache';\nimport { warnOnce } from '../../build/output/log';\nimport { scheduleOnNextTick } from '../../lib/scheduler';\nimport { fromResponseCacheEntry, routeKindToIncrementalCacheKind, toResponseCacheEntry } from './utils';\n/**\n * Parses an environment variable as a positive integer, returning the fallback\n * if the value is missing, not a number, or not positive.\n */ function parsePositiveInt(envValue, fallback) {\n if (!envValue) return fallback;\n const parsed = parseInt(envValue, 10);\n return Number.isFinite(parsed) && parsed > 0 ? parsed : fallback;\n}\n/**\n * Default TTL (in milliseconds) for minimal mode response cache entries.\n * Used for cache hit validation as a fallback for providers that don't\n * send the x-invocation-id header yet.\n *\n * 10 seconds chosen because:\n * - Long enough to dedupe rapid successive requests (e.g., page + data)\n * - Short enough to not serve stale data across unrelated requests\n *\n * Can be configured via `NEXT_PRIVATE_RESPONSE_CACHE_TTL` environment variable.\n */ const DEFAULT_TTL_MS = parsePositiveInt(process.env.NEXT_PRIVATE_RESPONSE_CACHE_TTL, 10000);\n/**\n * Default maximum number of entries in the response cache.\n * Can be configured via `NEXT_PRIVATE_RESPONSE_CACHE_MAX_SIZE` environment variable.\n */ const DEFAULT_MAX_SIZE = parsePositiveInt(process.env.NEXT_PRIVATE_RESPONSE_CACHE_MAX_SIZE, 150);\n/**\n * Separator used in compound cache keys to join pathname and invocationID.\n * Using null byte (\\0) since it cannot appear in valid URL paths or UUIDs.\n */ const KEY_SEPARATOR = '\\0';\n/**\n * Sentinel value used for TTL-based cache entries (when invocationID is undefined).\n * Chosen to be a clearly reserved marker for internal cache keys.\n */ const TTL_SENTINEL = '__ttl_sentinel__';\n/**\n * Creates a compound cache key from pathname and invocationID.\n */ function createCacheKey(pathname, invocationID) {\n return `${pathname}${KEY_SEPARATOR}${invocationID ?? TTL_SENTINEL}`;\n}\n/**\n * Extracts the invocationID from a compound cache key.\n * Returns undefined if the key used TTL_SENTINEL.\n */ function extractInvocationID(compoundKey) {\n const separatorIndex = compoundKey.lastIndexOf(KEY_SEPARATOR);\n if (separatorIndex === -1) return undefined;\n const invocationID = compoundKey.slice(separatorIndex + 1);\n return invocationID === TTL_SENTINEL ? undefined : invocationID;\n}\nexport * from './types';\nexport default class ResponseCache {\n constructor({ minimalMode, route, maxSize = DEFAULT_MAX_SIZE, ttl = DEFAULT_TTL_MS }){\n // The get and revalidate batchers share pending renders across invocation\n // IDs, including failures. Invocation IDs scope reuse of completed results in\n // the LRU below.\n this.getBatcher = Batcher.create({\n // Ensure on-demand revalidate doesn't block normal requests, it should be\n // safe to run an on-demand revalidate for the same key as a normal request.\n cacheKeyFn: ({ key, isOnDemandRevalidate })=>`${key}-${isOnDemandRevalidate ? '1' : '0'}`,\n // We wait to do any async work until after we've added our promise to\n // `pendingResponses` to ensure that any any other calls will reuse the\n // same promise until we've fully finished our work.\n schedulerFn: scheduleOnNextTick\n });\n this.revalidateBatcher = Batcher.create({\n // We wait to do any async work until after we've added our promise to\n // `pendingResponses` to ensure that any any other calls will reuse the\n // same promise until we've fully finished our work.\n schedulerFn: scheduleOnNextTick\n });\n /**\n * Set of invocation IDs that have had cache entries evicted.\n * Used to detect when the cache size may be too small.\n * Bounded to prevent memory growth.\n */ this.evictedInvocationIDs = new Set();\n if (!route) {\n throw new InvariantError('Response cache requires a source route');\n }\n this.route = route;\n this.minimal_mode = minimalMode;\n this.maxSize = maxSize;\n this.ttl = ttl;\n // Create the LRU cache with eviction tracking\n this.cache = new LRUCache(maxSize, undefined, (compoundKey)=>{\n const invocationID = extractInvocationID(compoundKey);\n if (invocationID) {\n // Bound to 100 entries to prevent unbounded memory growth.\n // FIFO eviction is acceptable here because:\n // 1. Invocations are short-lived (single request lifecycle), so older\n // invocations are unlikely to still be active after 100 newer ones\n // 2. This warning mechanism is best-effort for developer guidance—\n // missing occasional eviction warnings doesn't affect correctness\n // 3. If a long-running invocation is somehow evicted and then has\n // another cache entry evicted, it will simply be re-added\n if (this.evictedInvocationIDs.size >= 100) {\n const first = this.evictedInvocationIDs.values().next().value;\n if (first) this.evictedInvocationIDs.delete(first);\n }\n this.evictedInvocationIDs.add(invocationID);\n }\n });\n }\n /**\n * Gets the response cache entry for the given key.\n *\n * @param key - The key to get the response cache entry for.\n * @param responseGenerator - The response generator to use to generate the response cache entry.\n * @param context - The context for the get request.\n * @returns The response cache entry.\n */ async get(key, responseGenerator, context) {\n // If there is no key for the cache, we can't possibly look this up in the\n // cache so just return the result of the response generator.\n if (!key) {\n return responseGenerator({\n hasResolved: false,\n previousCacheEntry: null\n });\n }\n // Check minimal mode cache before doing any other work.\n if (this.minimal_mode) {\n const cacheKey = createCacheKey(key, context.invocationID);\n const cachedItem = this.cache.get(cacheKey);\n if (cachedItem) {\n // With invocationID: exact match found - always a hit\n // With TTL mode: must check expiration\n if (context.invocationID !== undefined) {\n return cachedItem.entry !== null && 'error' in cachedItem.entry ? cachedItem.entry : toResponseCacheEntry(cachedItem.entry);\n }\n // TTL entries can be reused by unrelated requests. Exclude failures so\n // those requests can retry instead of receiving a cached error.\n const now = Date.now();\n if ((cachedItem.entry === null || !('error' in cachedItem.entry)) && cachedItem.expiresAt > now) {\n return toResponseCacheEntry(cachedItem.entry);\n }\n // TTL expired - clean up\n this.cache.remove(cacheKey);\n }\n // Warn if this invocation had entries evicted - indicates cache may be too small.\n if (context.invocationID && this.evictedInvocationIDs.has(context.invocationID)) {\n warnOnce(`Response cache entry was evicted for invocation ${context.invocationID}. ` + `Consider increasing NEXT_PRIVATE_RESPONSE_CACHE_MAX_SIZE (current: ${this.maxSize}).`);\n }\n }\n const { incrementalCache, isOnDemandRevalidate = false, isFallback = false, isRoutePPREnabled = false, isPrefetch = false, waitUntil, invocationID } = context;\n const response = await this.getBatcher.batch({\n key,\n isOnDemandRevalidate\n }, ({ resolve })=>{\n const promise = this.handleGet(key, responseGenerator, {\n incrementalCache,\n isOnDemandRevalidate,\n isFallback,\n isRoutePPREnabled,\n isPrefetch,\n invocationID\n }, resolve);\n // We need to ensure background revalidates are passed to waitUntil.\n if (waitUntil) waitUntil(promise);\n return promise;\n });\n // In minimal mode, each caller with an invocation ID stores the shared\n // failure under its own ID for reuse by related requests. Callers without\n // an invocation ID receive the failure but do not store it in the LRU.\n if (this.minimal_mode && response && ('error' in response ? invocationID !== undefined : response.cacheControl)) {\n const cacheKey = createCacheKey(key, invocationID);\n this.cache.set(cacheKey, {\n entry: response,\n expiresAt: Date.now() + this.ttl\n });\n }\n return response !== null && 'error' in response ? response : toResponseCacheEntry(response);\n }\n /**\n * Handles the get request for the response cache.\n *\n * @param key - The key to get the response cache entry for.\n * @param responseGenerator - The response generator to use to generate the response cache entry.\n * @param context - The context for the get request.\n * @param resolve - The resolve function to use to resolve the response cache entry.\n * @returns The response cache entry.\n */ async handleGet(key, responseGenerator, context, resolve) {\n let previousIncrementalCacheEntry = null;\n let resolved = false;\n try {\n // Get the previous cache entry if not in minimal mode\n previousIncrementalCacheEntry = !this.minimal_mode ? await context.incrementalCache.get(key, this.getCacheContext(context.isRoutePPREnabled, context.isFallback)) : null;\n // `isStale === -1` signals that the entry is past its `expire` (either\n // via an expired tag or, with `cacheLife({ expire })`, past the route's\n // expire time in the prerender manifest). In that case we must NOT\n // early-resolve with the stale value — instead we fall through to a\n // blocking revalidation so the response returned to the user is fresh.\n if (previousIncrementalCacheEntry && !context.isOnDemandRevalidate && previousIncrementalCacheEntry.isStale !== -1) {\n resolve(previousIncrementalCacheEntry);\n resolved = true;\n if (!previousIncrementalCacheEntry.isStale || context.isPrefetch) {\n // The cached value is still valid, so we don't need to update it yet.\n return previousIncrementalCacheEntry;\n }\n }\n // Revalidate the cache entry.\n //\n // A prefetch request that missed must run its own response generator\n // rather than joining an in-flight revalidation through the batcher. A\n // background revalidation may be regenerating the concrete (non-fallback)\n // entry for this route — e.g. an ISR fallback-shell upgrade scheduled by\n // an earlier prefetch sub-request. Joining it would serve that concrete\n // result to the prefetch instead of the fallback shell, and which segment\n // wins would depend purely on request timing. Running the generator\n // directly lets every prefetch segment take the same fallback-shell path,\n // independent of any concurrent background upgrade.\n const incrementalResponseCacheEntry = context.isPrefetch && previousIncrementalCacheEntry === null ? await this.handleRevalidate(key, context.incrementalCache, context.isRoutePPREnabled, context.isFallback, responseGenerator, previousIncrementalCacheEntry, resolved) : await this.revalidate(key, context.incrementalCache, context.isRoutePPREnabled, context.isFallback, responseGenerator, previousIncrementalCacheEntry, resolved);\n if (incrementalResponseCacheEntry !== null && 'error' in incrementalResponseCacheEntry && resolved) {\n // The caller already received the stale entry. Report the background\n // failure here, as the catch below does for a thrown error.\n console.error(incrementalResponseCacheEntry.error);\n return null;\n }\n // Handle null response\n if (!incrementalResponseCacheEntry) {\n // Remove the cache item if it was set so we don't use it again.\n if (this.minimal_mode) {\n const cacheKey = createCacheKey(key, context.invocationID);\n this.cache.remove(cacheKey);\n }\n return null;\n }\n // Resolve for on-demand revalidation or if not already resolved\n if (context.isOnDemandRevalidate && !resolved) {\n return incrementalResponseCacheEntry;\n }\n return incrementalResponseCacheEntry;\n } catch (err) {\n // If we've already resolved the cache entry, we can't reject as we\n // already resolved the cache entry so log the error here.\n if (resolved) {\n console.error(err);\n return null;\n }\n throw err;\n }\n }\n /**\n * Revalidates the cache entry for the given key.\n *\n * @param key - The key to revalidate the cache entry for.\n * @param incrementalCache - The incremental cache to use to revalidate the cache entry.\n * @param isRoutePPREnabled - Whether the route is PPR enabled.\n * @param isFallback - Whether the route is a fallback.\n * @param responseGenerator - The response generator to use to generate the response cache entry.\n * @param previousIncrementalCacheEntry - The previous cache entry to use to revalidate the cache entry.\n * @param hasResolved - Whether the response has been resolved.\n * @param waitUntil - Optional function to register background work.\n * @param invocationID - The invocation ID for cache key scoping.\n * @returns The revalidated cache entry.\n */ async revalidate(key, incrementalCache, isRoutePPREnabled, isFallback, responseGenerator, previousIncrementalCacheEntry, hasResolved, waitUntil) {\n return this.revalidateBatcher.batch(key, ()=>{\n const promise = this.handleRevalidate(key, incrementalCache, isRoutePPREnabled, isFallback, responseGenerator, previousIncrementalCacheEntry, hasResolved);\n // We need to ensure background revalidates are passed to waitUntil.\n if (waitUntil) waitUntil(promise);\n return promise;\n });\n }\n async handleRevalidate(key, incrementalCache, isRoutePPREnabled, isFallback, responseGenerator, previousIncrementalCacheEntry, hasResolved) {\n let failure;\n try {\n // Generate the response cache entry using the response generator.\n const responseCacheEntry = await responseGenerator({\n hasResolved,\n previousCacheEntry: previousIncrementalCacheEntry,\n isRevalidating: true\n });\n if (!responseCacheEntry) {\n return null;\n }\n if ('error' in responseCacheEntry) {\n failure = responseCacheEntry;\n } else {\n // Convert the response cache entry to an incremental response cache entry.\n const incrementalResponseCacheEntry = await fromResponseCacheEntry({\n ...responseCacheEntry,\n isMiss: !previousIncrementalCacheEntry\n });\n // We want to persist the result only if it has a cache control value\n // defined. The minimal mode LRU write is handled in get() so that every\n // caller, including batched invocations, populates the cache.\n if (incrementalResponseCacheEntry.cacheControl && !this.minimal_mode) {\n await incrementalCache.set(key, incrementalResponseCacheEntry.value, {\n ...this.getCacheContext(isRoutePPREnabled, isFallback),\n cacheControl: incrementalResponseCacheEntry.cacheControl\n });\n }\n return incrementalResponseCacheEntry;\n }\n } catch (err) {\n await this.retainPreviousCacheEntry(key, incrementalCache, isRoutePPREnabled, isFallback, previousIncrementalCacheEntry);\n throw err;\n }\n await this.retainPreviousCacheEntry(key, incrementalCache, isRoutePPREnabled, isFallback, previousIncrementalCacheEntry);\n return failure;\n }\n // Retain the previous successful value and delay retries after revalidation\n // fails.\n async retainPreviousCacheEntry(key, incrementalCache, isRoutePPREnabled, isFallback, previousIncrementalCacheEntry) {\n if (previousIncrementalCacheEntry == null ? void 0 : previousIncrementalCacheEntry.cacheControl) {\n const revalidate = Math.min(Math.max(previousIncrementalCacheEntry.cacheControl.revalidate || 3, 3), 30);\n const expire = previousIncrementalCacheEntry.cacheControl.expire === undefined ? undefined : Math.max(revalidate + 3, previousIncrementalCacheEntry.cacheControl.expire);\n await incrementalCache.set(key, previousIncrementalCacheEntry.value, {\n ...this.getCacheContext(isRoutePPREnabled, isFallback),\n cacheControl: {\n revalidate: revalidate,\n expire: expire\n }\n });\n }\n }\n getCacheContext(isRoutePPREnabled, isFallback) {\n if (this.route === 'image') {\n return {\n kind: IncrementalCacheKind.IMAGE,\n isFallback: false\n };\n }\n const kind = routeKindToIncrementalCacheKind(this.route.kind);\n if (kind === IncrementalCacheKind.IMAGE) {\n throw new InvariantError('Images must use the image response cache');\n }\n return {\n route: this.route,\n kind,\n isRoutePPREnabled,\n isFallback\n };\n }\n}\n\n//# sourceMappingURL=index.js.map","/**\n * Removes the trailing slash for a given route or page path. Examples:\n * - `/foo/bar/` -> `/foo/bar`\n * - `/foo/bar` -> `/foo/bar`\n *\n * Uses charCodeAt (47 === '/') instead of regex to avoid the overhead of\n * compiling and executing a RegExp on every call (~3-5x faster).\n */ export function removeTrailingSlash(route) {\n return route.charCodeAt(route.length - 1) === 47 && route.length > 1 ? route.slice(0, -1) : route;\n}\n\n//# sourceMappingURL=remove-trailing-slash.js.map","import { parsePath } from './parse-path';\n/**\n * Checks if a given path starts with a given prefix. It ensures it matches\n * exactly without containing extra chars. e.g. prefix /docs should replace\n * for /docs, /docs/, /docs/a but not /docsss\n * @param path The path to check.\n * @param prefix The prefix to check against.\n */ export function pathHasPrefix(path, prefix) {\n if (typeof path !== 'string') {\n return false;\n }\n const { pathname } = parsePath(path);\n return pathname === prefix || pathname.startsWith(prefix + '/');\n}\n\n//# sourceMappingURL=path-has-prefix.js.map","import { InvariantError } from '../../shared/lib/invariant-error';\nimport { normalizeAppPath } from '../../shared/lib/router/utils/app-paths';\nimport { pathHasPrefix } from '../../shared/lib/router/utils/path-has-prefix';\nimport { removePathPrefix } from '../../shared/lib/router/utils/remove-path-prefix';\nimport { mightBeServerReferenceId } from '../../shared/lib/server-reference-info';\nimport { wellKnownProperties } from '../../shared/lib/utils/reflect-utils';\nimport { workAsyncStorage } from './work-async-storage.external';\nimport { workUnitAsyncStorage } from './work-unit-async-storage.external';\nexport function getActionNotFoundError(actionId) {\n return new Error(`Failed to find Server Action${actionId ? ` \"${actionId}\"` : ''}. This request might be from an older or newer deployment.\\nRead more: https://nextjs.org/docs/messages/failed-to-find-server-action`);\n}\nexport function getInvalidServerReferenceIdError(id) {\n // `id` is arbitrary client-provided input. Unlike the not-found case, it has\n // not passed the length gate and can reach this error via a malformed server\n // reference in an action payload, so it may be of any length and contain\n // control characters. `JSON.stringify` escapes newlines and quotes so it\n // can't forge log lines, and truncating overly long ids prevents log\n // flooding. Ids at or below the cap are logged in full so that we only add an\n // ellipsis to ids that are meaningfully longer than the truncated length.\n const encoded = JSON.stringify(id.length > MAX_LOGGED_SERVER_REFERENCE_ID_LENGTH ? id.slice(0, TRUNCATED_SERVER_REFERENCE_ID_LENGTH) + '…' : id);\n return new Error(`The Server Reference ID did not match the expected format. Received ${encoded}.\\nRead more: https://nextjs.org/docs/messages/failed-to-find-server-action`);\n}\n// Ids at or below the cap are logged in full. Longer ids are truncated to the\n// shorter length and marked with an ellipsis, so the cap leaves headroom over\n// the truncated length rather than ellipsizing ids that are barely too long.\nconst MAX_LOGGED_SERVER_REFERENCE_ID_LENGTH = 100;\nconst TRUNCATED_SERVER_REFERENCE_ID_LENGTH = 90;\n// This is a global singleton that is, among other things, also used to\n// encode/decode bound args of server function closures. This can't be using a\n// AsyncLocalStorage as it might happen at the module level.\nconst MANIFESTS_SINGLETON = Symbol.for('next.server.manifests');\nconst globalThisWithManifests = globalThis;\nfunction isUseCacheStore(workUnitStore) {\n if (!workUnitStore) {\n return false;\n }\n switch(workUnitStore.type){\n case 'cache':\n case 'private-cache':\n return true;\n case 'request':\n case 'unstable-cache':\n case 'prerender':\n case 'prerender-client':\n case 'prerender-legacy':\n case 'prerender-runtime':\n case 'validation-client':\n case 'build-time-generator':\n return false;\n default:\n return workUnitStore;\n }\n}\nfunction createProxiedClientReferenceManifest(clientReferenceManifestsPerRoute) {\n const createMappingProxy = (prop)=>{\n return new Proxy({}, {\n get (_, id) {\n const workStore = workAsyncStorage.getStore();\n if (workStore) {\n var _clientReferenceManifestsPerRoute_get;\n const currentManifest = (_clientReferenceManifestsPerRoute_get = clientReferenceManifestsPerRoute.get(workStore.route)) == null ? void 0 : _clientReferenceManifestsPerRoute_get.clientReferenceManifest;\n if (currentManifest == null ? void 0 : currentManifest[prop][id]) {\n if (workStore.durableUseCacheEntries && prop === 'clientModules') {\n const workUnitStore = workUnitAsyncStorage.getStore();\n if (isUseCacheStore(workUnitStore)) {\n // This creates a mapping so that a given client references with name\n // `app/foo/client.tsx` is serialized as\n // ```\n // { id: `app/foo/client.tsx`, name: `*`, chunks: [\"stub\"], async: false }\n // ```\n // instead of the actual\n // ```\n // { id: 19132, name: `*`, chunks: [\"/_next/static/chunks/...\"], async: true }\n // ```\n //\n // This means that not the unstable client module id is used for the cache entry,\n // but the stable client reference name. The stable client reference name is\n // resolved against the current manifest via rscModuleMappingForUseCache when the\n // entry is read.\n const clientReferenceManifestEntry = currentManifest.clientModules[id];\n return {\n // Return `id` instead of `clientReferenceManifestEntry.id` here.\n id,\n name: clientReferenceManifestEntry.name,\n // Set a sentinel value just in case this does ends up being read at some point\n // in the future, then at least we'll get \"Failed to load chunk stub (404)\"\n // instead of \"Failed to load module 1234\".\n chunks: [\n 'stub'\n ],\n async: false\n };\n }\n }\n return currentManifest[prop][id];\n }\n // In development, we also check all other manifests to see if the\n // module exists there. This is to support a scenario where React's\n // I/O tracking (dev-only) creates a connection from one page to\n // another through an emitted async I/O node that references client\n // components from the other page, e.g. in owner props.\n // TODO: Maybe we need to add a `debugBundlerConfig` option to React\n // to avoid this workaround. The current workaround has the\n // disadvantage that one might accidentally or intentionally share\n // client references across pages (e.g. by storing them in a global\n // variable), which would then only be caught in production.\n if (process.env.NODE_ENV !== 'production') {\n for (const [route, { page, clientReferenceManifest }] of clientReferenceManifestsPerRoute){\n if (route === workStore.route) {\n continue;\n }\n const entry = clientReferenceManifest[prop][id];\n if (entry !== undefined) {\n if (process.env.__NEXT_DEV_SERVER) {\n // The dev validation worker rebuilds this registry in its\n // own thread, seeded with only the route it validates, so\n // it has to be told which other manifests it needs.\n workStore.additionalClientReferenceManifestPages ??= new Set();\n workStore.additionalClientReferenceManifestPages.add(page);\n }\n return entry;\n }\n }\n }\n } else {\n // If there's no work store defined, we can assume that a client\n // reference manifest is needed during module evaluation, e.g. to\n // create a server function using a higher-order function. This\n // might also use client components which need to be serialized by\n // Flight, and therefore client references need to be resolvable. In\n // that case we search all page manifests to find the module.\n for (const { clientReferenceManifest } of clientReferenceManifestsPerRoute.values()){\n const entry = clientReferenceManifest[prop][id];\n if (entry !== undefined) {\n return entry;\n }\n }\n }\n return undefined;\n }\n });\n };\n const mappingProxies = new Map();\n const proxiedClientReferenceManifest = new Proxy({}, {\n get (_, prop) {\n const workStore = workAsyncStorage.getStore();\n switch(prop){\n case 'moduleLoading':\n case 'entryCSSFiles':\n case 'entryJSFiles':\n {\n if (!workStore) {\n throw new InvariantError(`Cannot access \"${prop}\" without a work store.`);\n }\n const registeredManifest = clientReferenceManifestsPerRoute.get(workStore.route);\n if (!registeredManifest) {\n throw new InvariantError(`The client reference manifest for route \"${workStore.route}\" does not exist.`);\n }\n return registeredManifest.clientReferenceManifest[prop];\n }\n case 'clientModules':\n case 'rscModuleMapping':\n case 'edgeRscModuleMapping':\n case 'ssrModuleMapping':\n case 'edgeSSRModuleMapping':\n {\n let proxy = mappingProxies.get(prop);\n if (!proxy) {\n proxy = createMappingProxy(prop);\n mappingProxies.set(prop, proxy);\n }\n return proxy;\n }\n default:\n {\n throw new InvariantError(`This is a proxied client reference manifest. The property \"${String(prop)}\" is not handled.`);\n }\n }\n }\n });\n // Performs the inverse of the clientModules isUseCacheStore(workUnitStore) special case above:\n //\n // For cache functions, don't do the usual rscModuleMapping lookup by module ID, but instead look\n // up by the stable client reference name. This is because cache entries must not depend on\n // build-local module IDs or chunks. So we need a second layer of indirection here to do client\n // reference name -> client module id -> rsc module mapping lookup.\n //\n // This one is created separately (not inside proxiedClientReferenceManifest.rscModuleMapping) as\n // we don't necessarily are inside a workUnitStore when we need to access this mapping (as opposed\n // to the clientModules mapping, which always has the ALS set).\n const rscModuleMappingForUseCache = new Proxy({}, {\n get (_, key) {\n const workStore = workAsyncStorage.getStore();\n if (workStore && workStore.durableUseCacheEntries) {\n var _clientReferenceManifestsPerRoute_get;\n const currentManifest = (_clientReferenceManifestsPerRoute_get = clientReferenceManifestsPerRoute.get(workStore.route)) == null ? void 0 : _clientReferenceManifestsPerRoute_get.clientReferenceManifest;\n const clientReferenceName = key;\n const clientReferenceManifestEntry = currentManifest == null ? void 0 : currentManifest.clientModules[clientReferenceName];\n if (clientReferenceManifestEntry === undefined) {\n return undefined;\n }\n const clientModuleId = clientReferenceManifestEntry.id;\n return currentManifest == null ? void 0 : currentManifest.rscModuleMapping[clientModuleId];\n } else {\n return proxiedClientReferenceManifest.rscModuleMapping[key];\n }\n }\n });\n return {\n proxiedClientReferenceManifest,\n rscModuleMappingForUseCache\n };\n}\n/**\n * This function creates a Flight-acceptable server module map proxy from our\n * Server Reference Manifest similar to our client module map. This is because\n * our manifest contains a lot of internal Next.js data that are relevant to the\n * runtime, workers, etc. that React doesn't need to know.\n */ function createServerModuleMap() {\n return new Proxy(Object.create(null), {\n get: (target, id, receiver)=>{\n var _getServerActionsManifest__id, _getServerActionsManifest_;\n // React's debug serialization can probe the module map like a plain object.\n // These probes are not server reference lookups.\n if (typeof id !== 'string') {\n return Reflect.get(target, id, receiver);\n }\n if (wellKnownProperties.has(id)) {\n return Reflect.get(target, id, receiver);\n }\n if (!mightBeServerReferenceId(id)) {\n throw getInvalidServerReferenceIdError(id);\n }\n const workers = (_getServerActionsManifest_ = getServerActionsManifest()[process.env.NEXT_RUNTIME === 'edge' ? 'edge' : 'node']) == null ? void 0 : (_getServerActionsManifest__id = _getServerActionsManifest_[id]) == null ? void 0 : _getServerActionsManifest__id.workers;\n if (!workers) {\n throw getActionNotFoundError(id);\n }\n const workStore = workAsyncStorage.getStore();\n let workerEntry;\n if (workStore) {\n workerEntry = workers[normalizeWorkerPageName(workStore.page)];\n } else {\n // If there's no work store defined, we can assume that a server\n // module map is needed during module evaluation, e.g. to create a\n // server action using a higher-order function. Therefore it should be\n // safe to return any entry from the manifest that matches the action\n // ID. They all refer to the same module ID, which must also exist in\n // the current page bundle. TODO: This is currently not guaranteed in\n // Turbopack, and needs to be fixed.\n workerEntry = Object.values(workers).at(0);\n }\n if (!workerEntry) {\n throw getActionNotFoundError(id);\n }\n const { moduleId, async, durability } = workerEntry;\n return {\n id: moduleId,\n name: id,\n chunks: [],\n async,\n durability\n };\n }\n });\n}\n/**\n * The flight entry loader keys actions by bundlePath. bundlePath corresponds\n * with the relative path (including 'app') to the page entrypoint.\n */ export function normalizeWorkerPageName(pageName) {\n if (pathHasPrefix(pageName, 'app')) {\n return pageName;\n }\n return 'app' + pageName;\n}\n/**\n * Converts a bundlePath (relative path to the entrypoint) to a routable page\n * name.\n */ function denormalizeWorkerPageName(bundlePath) {\n return normalizeAppPath(removePathPrefix(bundlePath, 'app'));\n}\n/**\n * Checks if the requested action has a worker for the current page.\n * If not, it returns the first worker that has a handler for the action.\n */ export function selectWorkerForForwarding(actionId, pageName) {\n var _serverActionsManifest__actionId;\n const serverActionsManifest = getServerActionsManifest();\n const workers = (_serverActionsManifest__actionId = serverActionsManifest[process.env.NEXT_RUNTIME === 'edge' ? 'edge' : 'node'][actionId]) == null ? void 0 : _serverActionsManifest__actionId.workers;\n // There are no workers to handle this action, nothing to forward to.\n if (!workers) {\n return;\n }\n // If there is an entry for the current page, we don't need to forward.\n if (workers[normalizeWorkerPageName(pageName)]) {\n return;\n }\n // Otherwise, grab the first worker that has a handler for this action id.\n return denormalizeWorkerPageName(Object.keys(workers)[0]);\n}\nexport function setManifestsSingleton({ page, clientReferenceManifest, serverActionsManifest: rawServerActionsManifest }) {\n const existingSingleton = globalThisWithManifests[MANIFESTS_SINGLETON];\n const route = normalizeAppPath(page);\n const serverActionsManifest = {\n encryptionKey: rawServerActionsManifest.encryptionKey,\n // Use null-prototypes for the action objects to prevent prototype pollution\n // from affecting action ID lookups.\n node: Object.assign(Object.create(null), rawServerActionsManifest.node),\n edge: Object.assign(Object.create(null), rawServerActionsManifest.edge)\n };\n if (existingSingleton) {\n existingSingleton.clientReferenceManifestsPerRoute.set(route, {\n page,\n clientReferenceManifest\n });\n existingSingleton.serverActionsManifest = serverActionsManifest;\n } else {\n const clientReferenceManifestsPerRoute = new Map([\n [\n route,\n {\n page,\n clientReferenceManifest\n }\n ]\n ]);\n const { proxiedClientReferenceManifest, rscModuleMappingForUseCache } = createProxiedClientReferenceManifest(clientReferenceManifestsPerRoute);\n globalThisWithManifests[MANIFESTS_SINGLETON] = {\n clientReferenceManifestsPerRoute,\n proxiedClientReferenceManifest,\n rscModuleMappingForUseCache,\n serverActionsManifest,\n serverModuleMap: createServerModuleMap()\n };\n }\n}\nfunction getManifestsSingleton() {\n const manifestSingleton = globalThisWithManifests[MANIFESTS_SINGLETON];\n if (!manifestSingleton) {\n throw new InvariantError('The manifests singleton was not initialized.');\n }\n return manifestSingleton;\n}\n/**\n * Returns the usual client_reference_manifest.json.\n *\n * In dev, it also looks up references of other pages (due to overlapping processing on\n * navigations).\n *\n * Inside a use-cache workUnitStore, clientModules instead map to a stable dummy value (see comments\n * above).\n */ export function getClientReferenceManifest() {\n return getManifestsSingleton().proxiedClientReferenceManifest;\n}\n/**\n * A mapping of client reference names to the RSC module id. (So a double lookup of clientModules ->\n * rscModuleMapping)\n */ export function getRscModuleMappingForUseCache() {\n return getManifestsSingleton().rscModuleMappingForUseCache;\n}\nexport function getServerActionsManifest() {\n return getManifestsSingleton().serverActionsManifest;\n}\nexport function getServerModuleMap() {\n return getManifestsSingleton().serverModuleMap;\n}\n\n//# sourceMappingURL=manifests-singleton.js.map","import { pathHasPrefix } from './path-has-prefix';\n/**\n * Given a path and a prefix it will remove the prefix when it exists in the\n * given path. It ensures it matches exactly without containing extra chars\n * and if the prefix is not there it will be noop.\n *\n * @param path The path to remove the prefix from.\n * @param prefix The prefix to be removed.\n */ export function removePathPrefix(path, prefix) {\n // If the path doesn't start with the prefix we can return it as is. This\n // protects us from situations where the prefix is a substring of the path\n // prefix such as:\n //\n // For prefix: /blog\n //\n // /blog -> true\n // /blog/ -> true\n // /blog/1 -> true\n // /blogging -> false\n // /blogging/ -> false\n // /blogging/1 -> false\n if (!pathHasPrefix(path, prefix)) {\n return path;\n }\n // Remove the prefix from the path via slicing.\n const withoutPrefix = path.slice(prefix.length);\n // If the path without the prefix starts with a `/` we can return it as is.\n if (withoutPrefix.startsWith('/')) {\n return withoutPrefix;\n }\n // If the path without the prefix doesn't start with a `/` we need to add it\n // back to the path to make sure it's a valid path.\n return `/${withoutPrefix}`;\n}\n\n//# sourceMappingURL=remove-path-prefix.js.map","import { getTracer } from '../lib/trace/tracer';\nimport { AppRenderSpan } from '../lib/trace/constants';\nimport { createPromiseWithResolvers } from '../../shared/lib/promise-with-resolvers';\nimport { scheduleImmediate, atLeastOneTask, waitAtLeastOneReactRenderTask } from '../../lib/scheduler';\nimport { ENCODED_TAGS } from './encoded-tags';\nimport { indexOfUint8Array, isEquivalentUint8Arrays, removeFromUint8Array } from './uint8array-helpers';\nimport { MISSING_ROOT_TAGS_ERROR } from '../../shared/lib/errors/constants';\nimport { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_ROUTER_SEGMENT_PREFETCH_HEADER, NEXT_RSC_UNION_QUERY } from '../../client/components/app-router-headers';\nimport { computeCacheBustingSearchParam } from '../../shared/lib/router/utils/cache-busting-search-param';\nfunction voidCatch() {\n// this catcher is designed to be used with pipeTo where we expect the underlying\n// pipe implementation to forward errors but we don't want the pipeTo promise to reject\n// and be unhandled\n}\n// We can share the same encoder instance everywhere\n// Notably we cannot do the same for TextDecoder because it is stateful\n// when handling streaming data\nconst encoder = new TextEncoder();\nexport function chainStreams(...streams) {\n // If we have no streams, return an empty stream. This behavior is\n // intentional as we're now providing the `RenderResult.EMPTY` value.\n if (streams.length === 0) {\n return new ReadableStream({\n start (controller) {\n controller.close();\n }\n });\n }\n // If we only have 1 stream we fast path it by returning just this stream\n if (streams.length === 1) {\n return streams[0];\n }\n const { readable, writable } = new TransformStream();\n // We always initiate pipeTo immediately. We know we have at least 2 streams\n // so we need to avoid closing the writable when this one finishes.\n let promise = streams[0].pipeTo(writable, {\n preventClose: true\n });\n let i = 1;\n for(; i < streams.length - 1; i++){\n const nextStream = streams[i];\n promise = promise.then(()=>nextStream.pipeTo(writable, {\n preventClose: true\n }));\n }\n // We can omit the length check because we halted before the last stream and there\n // is at least two streams so the lastStream here will always be defined\n const lastStream = streams[i];\n promise = promise.then(()=>lastStream.pipeTo(writable));\n // Catch any errors from the streams and ignore them, they will be handled\n // by whatever is consuming the readable stream.\n promise.catch(voidCatch);\n return readable;\n}\nexport function streamFromString(str) {\n return new ReadableStream({\n start (controller) {\n controller.enqueue(encoder.encode(str));\n controller.close();\n }\n });\n}\n/**\n * Creates a stream that delivers `chunk` and then closes.\n *\n * The stream is a default stream, and it has to stay one. A byte stream (`type:\n * 'bytes'`) transfers the buffer of each chunk that it receives, which detaches\n * `chunk`. A caller that keeps `chunk` to serve more than one read, such as an\n * in-memory cache handler, loses the data on the first read.\n *\n * Every reader receives the same `chunk` instance. A reader that modifies it\n * changes what later readers see.\n */ export function streamFromBuffer(chunk) {\n return new ReadableStream({\n start (controller) {\n controller.enqueue(chunk);\n controller.close();\n }\n });\n}\nasync function streamToChunks(stream) {\n const reader = stream.getReader();\n const chunks = [];\n while(true){\n const { done, value } = await reader.read();\n if (done) {\n break;\n }\n chunks.push(value);\n }\n return chunks;\n}\nfunction concatUint8Arrays(chunks) {\n const totalLength = chunks.reduce((sum, chunk)=>sum + chunk.length, 0);\n const result = new Uint8Array(totalLength);\n let offset = 0;\n for (const chunk of chunks){\n result.set(chunk, offset);\n offset += chunk.length;\n }\n return result;\n}\nexport async function webstreamToUint8Array(stream) {\n return concatUint8Arrays(await streamToChunks(stream));\n}\nfunction webToReadable(stream) {\n if (process.env.NEXT_RUNTIME === 'edge') {\n throw new Error('webToReadable cannot be used in the edge runtime');\n } else {\n let Readable;\n if (process.env.TURBOPACK) {\n Readable = require('node:stream').Readable;\n } else if (process.env.__NEXT_BUNDLER === 'Webpack' || process.env.__NEXT_BUNDLER === 'Rspack') {\n Readable = __non_webpack_require__('node:stream').Readable;\n } else {\n Readable = require('node:stream').Readable;\n }\n if (stream instanceof Readable) {\n return stream;\n }\n return Readable.fromWeb(stream);\n }\n}\nexport async function nodestreamToUint8Array(stream) {\n const chunks = [];\n for await (const chunk of webToReadable(stream)){\n chunks.push(typeof chunk === 'string' ? Buffer.from(chunk) : chunk);\n }\n return Buffer.concat(chunks);\n}\nexport async function streamToUint8Array(stream) {\n if (process.env.NEXT_RUNTIME === 'edge') {\n // Edge runtime always uses web streams\n return webstreamToUint8Array(stream);\n } else {\n let Readable;\n if (process.env.TURBOPACK) {\n Readable = require('node:stream').Readable;\n } else if (process.env.__NEXT_BUNDLER === 'Webpack' || process.env.__NEXT_BUNDLER === 'Rspack') {\n Readable = __non_webpack_require__('node:stream').Readable;\n } else {\n Readable = require('node:stream').Readable;\n }\n if (stream instanceof Readable) {\n return nodestreamToUint8Array(stream);\n }\n return webstreamToUint8Array(stream);\n }\n}\nexport async function streamToBuffer(stream) {\n return Buffer.concat(await streamToChunks(stream));\n}\nexport async function streamToString(stream, signal) {\n const decoder = new TextDecoder('utf-8', {\n fatal: true\n });\n let string = '';\n for await (const chunk of stream){\n if (signal == null ? void 0 : signal.aborted) {\n return string;\n }\n string += decoder.decode(chunk, {\n stream: true\n });\n }\n string += decoder.decode();\n return string;\n}\nexport function createBufferedTransformStream(options = {}) {\n const { maxBufferByteLength = Infinity } = options;\n let bufferedChunks = [];\n let bufferByteLength = 0;\n let pending;\n const flush = (controller)=>{\n try {\n if (bufferedChunks.length === 0) {\n return;\n }\n const chunk = new Uint8Array(bufferByteLength);\n let copiedBytes = 0;\n for(let i = 0; i < bufferedChunks.length; i++){\n const bufferedChunk = bufferedChunks[i];\n chunk.set(bufferedChunk, copiedBytes);\n copiedBytes += bufferedChunk.byteLength;\n }\n // We just wrote all the buffered chunks so we need to reset the bufferedChunks array\n // and our bufferByteLength to prepare for the next round of buffered chunks\n bufferedChunks.length = 0;\n bufferByteLength = 0;\n controller.enqueue(chunk);\n } catch {\n // If an error occurs while enqueuing, it can't be due to this\n // transformer. It's most likely caused by the controller having been\n // errored (for example, if the stream was cancelled).\n }\n };\n const scheduleFlush = (controller)=>{\n if (pending) {\n return;\n }\n const detached = createPromiseWithResolvers();\n pending = detached;\n scheduleImmediate(()=>{\n try {\n flush(controller);\n } finally{\n pending = undefined;\n detached.resolve();\n }\n });\n };\n return new TransformStream({\n transform (chunk, controller) {\n // Combine the previous buffer with the new chunk.\n bufferedChunks.push(chunk);\n bufferByteLength += chunk.byteLength;\n if (bufferByteLength >= maxBufferByteLength) {\n flush(controller);\n } else {\n scheduleFlush(controller);\n }\n },\n flush () {\n return pending == null ? void 0 : pending.promise;\n }\n });\n}\n// TODO this is currently unused but once we add proper output:export support, it needs to be\n// revisited. See https://github.com/vercel/next.js/pull/89478 for more details\n//\n// function createPrefetchCommentStream(\n// isBuildTimePrerendering: boolean,\n// buildId: string\n// ): TransformStream<Uint8Array, Uint8Array> {\n// // Insert an extra comment at the beginning of the HTML document. This must\n// // come after the DOCTYPE, which is inserted by React.\n// //\n// // The first chunk sent by React will contain the doctype. After that, we can\n// // pass through the rest of the chunks as-is.\n// let didTransformFirstChunk = false\n// return new TransformStream({\n// transform(chunk, controller) {\n// if (isBuildTimePrerendering && !didTransformFirstChunk) {\n// didTransformFirstChunk = true\n// const decoder = new TextDecoder('utf-8', { fatal: true })\n// const chunkStr = decoder.decode(chunk, {\n// stream: true,\n// })\n// const updatedChunkStr = insertBuildIdComment(chunkStr, buildId)\n// controller.enqueue(encoder.encode(updatedChunkStr))\n// return\n// }\n// controller.enqueue(chunk)\n// },\n// })\n// }\nexport function renderToInitialFizzStream({ ReactDOMServer, element, streamOptions }) {\n return getTracer().trace(AppRenderSpan.renderToReadableStream, async ()=>ReactDOMServer.renderToReadableStream(element, streamOptions));\n}\nexport function createMetadataTransformStream(insert) {\n let chunkIndex = -1;\n let isMarkRemoved = false;\n return new TransformStream({\n async transform (chunk, controller) {\n let iconMarkIndex = -1;\n let closedHeadIndex = -1;\n chunkIndex++;\n if (isMarkRemoved) {\n controller.enqueue(chunk);\n return;\n }\n let iconMarkLength = 0;\n // Only search for the closed head tag once\n if (iconMarkIndex === -1) {\n iconMarkIndex = indexOfUint8Array(chunk, ENCODED_TAGS.META.ICON_MARK);\n if (iconMarkIndex === -1) {\n controller.enqueue(chunk);\n return;\n } else {\n // When we found the `<meta name=\"«nxt-icon»\"` tag prefix, we will remove it from the chunk.\n // Its close tag could either be `/>` or `>`, checking the next char to ensure we cover both cases.\n iconMarkLength = ENCODED_TAGS.META.ICON_MARK.length;\n // Check if next char is /, this is for xml mode.\n if (chunk[iconMarkIndex + iconMarkLength] === 47) {\n iconMarkLength += 2;\n } else {\n // The last char is `>`\n iconMarkLength++;\n }\n }\n }\n // Check if icon mark is inside <head> tag in the first chunk.\n if (chunkIndex === 0) {\n closedHeadIndex = indexOfUint8Array(chunk, ENCODED_TAGS.CLOSED.HEAD);\n if (iconMarkIndex !== -1) {\n // The mark icon is located in the 1st chunk before the head tag.\n // We do not need to insert the script tag in this case because it's in the head.\n // Just remove the icon mark from the chunk.\n if (iconMarkIndex < closedHeadIndex) {\n const replaced = new Uint8Array(chunk.length - iconMarkLength);\n // Remove the icon mark from the chunk.\n replaced.set(chunk.subarray(0, iconMarkIndex));\n replaced.set(chunk.subarray(iconMarkIndex + iconMarkLength), iconMarkIndex);\n chunk = replaced;\n } else {\n // The icon mark is after the head tag, replace and insert the script tag at that position.\n const insertion = await insert();\n const encodedInsertion = encoder.encode(insertion);\n const insertionLength = encodedInsertion.length;\n const replaced = new Uint8Array(chunk.length - iconMarkLength + insertionLength);\n replaced.set(chunk.subarray(0, iconMarkIndex));\n replaced.set(encodedInsertion, iconMarkIndex);\n replaced.set(chunk.subarray(iconMarkIndex + iconMarkLength), iconMarkIndex + insertionLength);\n chunk = replaced;\n }\n isMarkRemoved = true;\n }\n // If there's no icon mark located, it will be handled later when if present in the following chunks.\n } else {\n // When it's appeared in the following chunks, we'll need to\n // remove the mark and then insert the script tag at that position.\n const insertion = await insert();\n const encodedInsertion = encoder.encode(insertion);\n const insertionLength = encodedInsertion.length;\n // Replace the icon mark with the hoist script or empty string.\n const replaced = new Uint8Array(chunk.length - iconMarkLength + insertionLength);\n // Set the first part of the chunk, before the icon mark.\n replaced.set(chunk.subarray(0, iconMarkIndex));\n // Set the insertion after the icon mark.\n replaced.set(encodedInsertion, iconMarkIndex);\n // Set the rest of the chunk after the icon mark.\n replaced.set(chunk.subarray(iconMarkIndex + iconMarkLength), iconMarkIndex + insertionLength);\n chunk = replaced;\n isMarkRemoved = true;\n }\n controller.enqueue(chunk);\n }\n });\n}\nexport function createHeadInsertionTransformStream(insert) {\n let inserted = false;\n // We need to track if this transform saw any bytes because if it didn't\n // we won't want to insert any server HTML at all\n let hasBytes = false;\n return new TransformStream({\n async transform (chunk, controller) {\n hasBytes = true;\n const insertion = await insert();\n if (inserted) {\n if (insertion) {\n const encodedInsertion = encoder.encode(insertion);\n controller.enqueue(encodedInsertion);\n }\n controller.enqueue(chunk);\n } else {\n // TODO (@Ethan-Arrowood): Replace the generic `indexOfUint8Array` method with something finely tuned for the subset of things actually being checked for.\n const index = indexOfUint8Array(chunk, ENCODED_TAGS.CLOSED.HEAD);\n // In fully static rendering or non PPR rendering cases:\n // `/head>` will always be found in the chunk in first chunk rendering.\n if (index !== -1) {\n if (insertion) {\n const encodedInsertion = encoder.encode(insertion);\n // Get the total count of the bytes in the chunk and the insertion\n // e.g.\n // chunk = <head><meta charset=\"utf-8\"></head>\n // insertion = <script>...</script>\n // output = <head><meta charset=\"utf-8\"> [ <script>...</script> ] </head>\n const insertedHeadContent = new Uint8Array(chunk.length + encodedInsertion.length);\n // Append the first part of the chunk, before the head tag\n insertedHeadContent.set(chunk.slice(0, index));\n // Append the server inserted content\n insertedHeadContent.set(encodedInsertion, index);\n // Append the rest of the chunk\n insertedHeadContent.set(chunk.slice(index), index + encodedInsertion.length);\n controller.enqueue(insertedHeadContent);\n } else {\n controller.enqueue(chunk);\n }\n inserted = true;\n } else {\n // This will happens in PPR rendering during next start, when the page is partially rendered.\n // When the page resumes, the head tag will be found in the middle of the chunk.\n // Where we just need to append the insertion and chunk to the current stream.\n // e.g.\n // PPR-static: <head>...</head><body> [ resume content ] </body>\n // PPR-resume: [ insertion ] [ rest content ]\n if (insertion) {\n controller.enqueue(encoder.encode(insertion));\n }\n controller.enqueue(chunk);\n inserted = true;\n }\n }\n },\n async flush (controller) {\n // Check before closing if there's anything remaining to insert.\n if (hasBytes) {\n const insertion = await insert();\n if (insertion) {\n controller.enqueue(encoder.encode(insertion));\n }\n }\n }\n });\n}\nasync function createClientResumeScriptInsertionTransformStream() {\n const segmentPath = '/_full';\n const cacheBustingHeader = await computeCacheBustingSearchParam('1', '/_full', undefined, undefined // headers[NEXT_URL]\n );\n const searchStr = `${NEXT_RSC_UNION_QUERY}=${cacheBustingHeader}`;\n const NEXT_CLIENT_RESUME_SCRIPT = `<script>__NEXT_CLIENT_RESUME=fetch(location.pathname+'?${searchStr}',{credentials:'same-origin',headers:{'${RSC_HEADER}': '1','${NEXT_ROUTER_PREFETCH_HEADER}': '1','${NEXT_ROUTER_SEGMENT_PREFETCH_HEADER}': '${segmentPath}'}})</script>`;\n let didAlreadyInsert = false;\n return new TransformStream({\n transform (chunk, controller) {\n if (didAlreadyInsert) {\n // Already inserted the script into the head. Pass through.\n controller.enqueue(chunk);\n return;\n }\n // TODO (@Ethan-Arrowood): Replace the generic `indexOfUint8Array` method with something finely tuned for the subset of things actually being checked for.\n const headClosingTagIndex = indexOfUint8Array(chunk, ENCODED_TAGS.CLOSED.HEAD);\n if (headClosingTagIndex === -1) {\n // In fully static rendering or non PPR rendering cases:\n // `/head>` will always be found in the chunk in first chunk rendering.\n controller.enqueue(chunk);\n return;\n }\n const encodedInsertion = encoder.encode(NEXT_CLIENT_RESUME_SCRIPT);\n // Get the total count of the bytes in the chunk and the insertion\n // e.g.\n // chunk = <head><meta charset=\"utf-8\"></head>\n // insertion = <script>...</script>\n // output = <head><meta charset=\"utf-8\"> [ <script>...</script> ] </head>\n const insertedHeadContent = new Uint8Array(chunk.length + encodedInsertion.length);\n // Append the first part of the chunk, before the head tag\n insertedHeadContent.set(chunk.slice(0, headClosingTagIndex));\n // Append the server inserted content\n insertedHeadContent.set(encodedInsertion, headClosingTagIndex);\n // Append the rest of the chunk\n insertedHeadContent.set(chunk.slice(headClosingTagIndex), headClosingTagIndex + encodedInsertion.length);\n controller.enqueue(insertedHeadContent);\n didAlreadyInsert = true;\n }\n });\n}\n// Suffix after main body content - scripts before </body>,\n// but wait for the major chunks to be enqueued.\nexport function createDeferredSuffixStream(suffix) {\n let flushed = false;\n let pending;\n const flush = (controller)=>{\n const detached = createPromiseWithResolvers();\n pending = detached;\n scheduleImmediate(()=>{\n try {\n controller.enqueue(encoder.encode(suffix));\n } catch {\n // If an error occurs while enqueuing it can't be due to this\n // transformers fault. It's likely due to the controller being\n // errored due to the stream being cancelled.\n } finally{\n pending = undefined;\n detached.resolve();\n }\n });\n };\n return new TransformStream({\n transform (chunk, controller) {\n controller.enqueue(chunk);\n // If we've already flushed, we're done.\n if (flushed) return;\n // Schedule the flush to happen.\n flushed = true;\n flush(controller);\n },\n flush (controller) {\n if (pending) return pending.promise;\n if (flushed) return;\n // Flush now.\n controller.enqueue(encoder.encode(suffix));\n }\n });\n}\nexport function createFlightDataInjectionTransformStream(stream, delayDataUntilFirstHtmlChunk) {\n let htmlStreamFinished = false;\n let pull = null;\n let donePulling = false;\n function startOrContinuePulling(controller) {\n if (!pull) {\n pull = startPulling(controller);\n }\n return pull;\n }\n async function startPulling(controller) {\n const reader = stream.getReader();\n if (delayDataUntilFirstHtmlChunk) {\n // NOTE: streaming flush\n // We are buffering here for the inlined data stream because the\n // \"shell\" stream might be chunkenized again by the underlying stream\n // implementation, e.g. with a specific high-water mark. To ensure it's\n // the safe timing to pipe the data stream, this extra tick is\n // necessary.\n // We don't start reading until we've left the current Task to ensure\n // that it's inserted after flushing the shell. Note that this implementation\n // might get stale if impl details of Fizz change in the future.\n await atLeastOneTask();\n }\n try {\n while(true){\n const { done, value } = await reader.read();\n if (done) {\n donePulling = true;\n return;\n }\n // We want to prioritize HTML over RSC data.\n // The SSR render is based on the same RSC stream, so when we get a new RSC chunk,\n // we're likely to produce an HTML chunk as well, so give it a chance to flush first.\n if (!delayDataUntilFirstHtmlChunk && !htmlStreamFinished) {\n await atLeastOneTask();\n }\n controller.enqueue(value);\n }\n } catch (err) {\n controller.error(err);\n }\n }\n return new TransformStream({\n start (controller) {\n if (!delayDataUntilFirstHtmlChunk) {\n startOrContinuePulling(controller);\n }\n },\n transform (chunk, controller) {\n controller.enqueue(chunk);\n // Start the streaming if it hasn't already been started yet.\n if (delayDataUntilFirstHtmlChunk) {\n startOrContinuePulling(controller);\n }\n },\n flush (controller) {\n htmlStreamFinished = true;\n if (donePulling) {\n return;\n }\n return startOrContinuePulling(controller);\n }\n });\n}\nexport const CLOSE_TAG = '</body></html>';\n/**\n * This transform stream moves the suffix to the end of the stream, so results\n * like `</body></html><script>...</script>` will be transformed to\n * `<script>...</script></body></html>`.\n */ export function createMoveSuffixStream() {\n let foundSuffix = false;\n return new TransformStream({\n transform (chunk, controller) {\n if (foundSuffix) {\n return controller.enqueue(chunk);\n }\n const index = indexOfUint8Array(chunk, ENCODED_TAGS.CLOSED.BODY_AND_HTML);\n if (index > -1) {\n foundSuffix = true;\n // If the whole chunk is the suffix, then don't write anything, it will\n // be written in the flush.\n if (chunk.length === ENCODED_TAGS.CLOSED.BODY_AND_HTML.length) {\n return;\n }\n // Write out the part before the suffix.\n const before = chunk.slice(0, index);\n controller.enqueue(before);\n // In the case where the suffix is in the middle of the chunk, we need\n // to split the chunk into two parts.\n if (chunk.length > ENCODED_TAGS.CLOSED.BODY_AND_HTML.length + index) {\n // Write out the part after the suffix.\n const after = chunk.slice(index + ENCODED_TAGS.CLOSED.BODY_AND_HTML.length);\n controller.enqueue(after);\n }\n } else {\n controller.enqueue(chunk);\n }\n },\n flush (controller) {\n // Even if we didn't find the suffix, the HTML is not valid if we don't\n // add it, so insert it at the end.\n controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML);\n }\n });\n}\nfunction createStripDocumentClosingTagsTransform() {\n return new TransformStream({\n transform (chunk, controller) {\n // We rely on the assumption that chunks will never break across a code unit.\n // This is reasonable because we currently concat all of React's output from a single\n // flush into one chunk before streaming it forward which means the chunk will represent\n // a single coherent utf-8 string. This is not safe to use if we change our streaming to no\n // longer do this large buffered chunk\n if (isEquivalentUint8Arrays(chunk, ENCODED_TAGS.CLOSED.BODY_AND_HTML) || isEquivalentUint8Arrays(chunk, ENCODED_TAGS.CLOSED.BODY) || isEquivalentUint8Arrays(chunk, ENCODED_TAGS.CLOSED.HTML)) {\n // the entire chunk is the closing tags; return without enqueueing anything.\n return;\n }\n // We assume these tags will go at together at the end of the document and that\n // they won't appear anywhere else in the document. This is not really a safe assumption\n // but until we revamp our streaming infra this is a performant way to string the tags\n chunk = removeFromUint8Array(chunk, ENCODED_TAGS.CLOSED.BODY);\n chunk = removeFromUint8Array(chunk, ENCODED_TAGS.CLOSED.HTML);\n controller.enqueue(chunk);\n }\n });\n}\nexport function createHtmlDataDplIdTransformStream(dplId) {\n let didTransform = false;\n return new TransformStream({\n transform (chunk, controller) {\n if (didTransform) {\n controller.enqueue(chunk);\n return;\n }\n const htmlTagIndex = indexOfUint8Array(chunk, ENCODED_TAGS.OPENING.HTML);\n if (htmlTagIndex === -1) {\n controller.enqueue(chunk);\n return;\n }\n // Insert the data-dpl-id attribute right after \"<html \"\n const insertionPoint = htmlTagIndex + ENCODED_TAGS.OPENING.HTML.length;\n const attribute = ` data-dpl-id=\"${dplId}\"`;\n const encodedAttribute = encoder.encode(attribute);\n const modifiedChunk = new Uint8Array(chunk.length + encodedAttribute.length);\n // Copy everything before the insertion point\n modifiedChunk.set(chunk.subarray(0, insertionPoint));\n // Insert the attribute\n modifiedChunk.set(encodedAttribute, insertionPoint);\n // Copy everything after\n modifiedChunk.set(chunk.subarray(insertionPoint), insertionPoint + encodedAttribute.length);\n controller.enqueue(modifiedChunk);\n didTransform = true;\n }\n });\n}\n/*\n * Checks if the root layout is missing the html or body tags\n * and if so, it will inject a script tag to throw an error in the browser, showing the user\n * the error message in the error overlay.\n */ export function createRootLayoutValidatorStream() {\n let foundHtml = false;\n let foundBody = false;\n return new TransformStream({\n async transform (chunk, controller) {\n // Peek into the streamed chunk to see if the tags are present.\n if (!foundHtml && indexOfUint8Array(chunk, ENCODED_TAGS.OPENING.HTML) > -1) {\n foundHtml = true;\n }\n if (!foundBody && indexOfUint8Array(chunk, ENCODED_TAGS.OPENING.BODY) > -1) {\n foundBody = true;\n }\n controller.enqueue(chunk);\n },\n flush (controller) {\n const missingTags = [];\n if (!foundHtml) missingTags.push('html');\n if (!foundBody) missingTags.push('body');\n if (!missingTags.length) return;\n controller.enqueue(encoder.encode(`<html id=\"__next_error__\">\n <template\n data-next-error-message=\"Missing ${missingTags.map((c)=>`<${c}>`).join(missingTags.length > 1 ? ' and ' : '')} tags in the root layout.\\nRead more at https://nextjs.org/docs/messages/missing-root-layout-tags\"\n data-next-error-digest=\"${MISSING_ROOT_TAGS_ERROR}\"\n data-next-error-stack=\"\"\n ></template>\n `));\n }\n });\n}\nexport function chainTransformers(readable, transformers) {\n let stream = readable;\n for (const transformer of transformers){\n if (!transformer) continue;\n stream = stream.pipeThrough(transformer);\n }\n return stream;\n}\nexport async function continueFizzStream(renderStream, { suffix, inlinedDataStream, waitForAllReady, deploymentId, getServerInsertedHTML, getServerInsertedMetadata, validateRootLayout }) {\n // Suffix itself might contain close tags at the end, so we need to split it.\n const suffixUnclosed = suffix ? suffix.split(CLOSE_TAG, 1)[0] : null;\n if (waitForAllReady) {\n // Wait for all Suspense boundaries to resolve before continuing.\n await renderStream.allReady;\n } else {\n // Otherwise, we want to make sure Fizz is done with all microtasky work\n // before we start pulling the stream and cause a flush.\n await waitAtLeastOneReactRenderTask();\n }\n return chainTransformers(renderStream, [\n // Buffer everything to avoid flushing too frequently\n createBufferedTransformStream(),\n // Insert data-dpl-id attribute on the html tag\n deploymentId ? createHtmlDataDplIdTransformStream(deploymentId) : null,\n // Transform metadata\n createMetadataTransformStream(getServerInsertedMetadata),\n // Insert suffix content\n suffixUnclosed != null && suffixUnclosed.length > 0 ? createDeferredSuffixStream(suffixUnclosed) : null,\n // Insert the inlined data (Flight data, form state, etc.) stream into the HTML\n inlinedDataStream ? createFlightDataInjectionTransformStream(inlinedDataStream, true) : null,\n // Validate the root layout for missing html or body tags\n validateRootLayout ? createRootLayoutValidatorStream() : null,\n // Close tags should always be deferred to the end\n createMoveSuffixStream(),\n // Special head insertions\n // TODO-APP: Insert server side html to end of head in app layout rendering, to avoid\n // hydration errors. Remove this once it's ready to be handled by react itself.\n createHeadInsertionTransformStream(getServerInsertedHTML)\n ]);\n}\nexport async function continueDynamicPrerender(prerenderStream, { getServerInsertedHTML, getServerInsertedMetadata, deploymentId }) {\n return chainTransformers(prerenderStream, [\n // Buffer everything to avoid flushing too frequently\n createBufferedTransformStream(),\n createStripDocumentClosingTagsTransform(),\n // Insert data-dpl-id attribute on the html tag\n deploymentId ? createHtmlDataDplIdTransformStream(deploymentId) : null,\n // Insert generated tags to head\n createHeadInsertionTransformStream(getServerInsertedHTML),\n // Transform metadata\n createMetadataTransformStream(getServerInsertedMetadata)\n ]);\n}\nexport async function continueStaticPrerender(prerenderStream, { inlinedDataStream, getServerInsertedHTML, getServerInsertedMetadata, deploymentId }) {\n return chainTransformers(prerenderStream, [\n // Buffer everything to avoid flushing too frequently\n createBufferedTransformStream(),\n // Add build id comment to start of the HTML document (in export mode)\n // Insert data-dpl-id attribute on the html tag\n deploymentId ? createHtmlDataDplIdTransformStream(deploymentId) : null,\n // Insert generated tags to head\n createHeadInsertionTransformStream(getServerInsertedHTML),\n // Transform metadata\n createMetadataTransformStream(getServerInsertedMetadata),\n // Insert the inlined data (Flight data, form state, etc.) stream into the HTML\n createFlightDataInjectionTransformStream(inlinedDataStream, true),\n // Close tags should always be deferred to the end\n createMoveSuffixStream()\n ]);\n}\nexport async function continueStaticFallbackPrerender(prerenderStream, { inlinedDataStream, getServerInsertedHTML, getServerInsertedMetadata, deploymentId }) {\n // Same as `continueStaticPrerender`, but also inserts an additional script\n // to instruct the client to start fetching the hydration data as early\n // as possible.\n return chainTransformers(prerenderStream, [\n // Buffer everything to avoid flushing too frequently\n createBufferedTransformStream(),\n // Insert data-dpl-id attribute on the html tag\n deploymentId ? createHtmlDataDplIdTransformStream(deploymentId) : null,\n // Insert generated tags to head\n createHeadInsertionTransformStream(getServerInsertedHTML),\n // Insert the client resume script into the head\n await createClientResumeScriptInsertionTransformStream(),\n // Transform metadata\n createMetadataTransformStream(getServerInsertedMetadata),\n // Insert the inlined data (Flight data, form state, etc.) stream into the HTML\n createFlightDataInjectionTransformStream(inlinedDataStream, true),\n // Close tags should always be deferred to the end\n createMoveSuffixStream()\n ]);\n}\nexport async function continueDynamicHTMLResume(renderStream, { delayDataUntilFirstHtmlChunk, inlinedDataStream, getServerInsertedHTML, getServerInsertedMetadata, deploymentId }) {\n return chainTransformers(renderStream, [\n // Buffer everything to avoid flushing too frequently\n createBufferedTransformStream(),\n // Insert data-dpl-id attribute on the html tag\n deploymentId ? createHtmlDataDplIdTransformStream(deploymentId) : null,\n // Insert generated tags to head\n createHeadInsertionTransformStream(getServerInsertedHTML),\n // Transform metadata\n createMetadataTransformStream(getServerInsertedMetadata),\n // Insert the inlined data (Flight data, form state, etc.) stream into the HTML\n createFlightDataInjectionTransformStream(inlinedDataStream, delayDataUntilFirstHtmlChunk),\n // Close tags should always be deferred to the end\n createMoveSuffixStream()\n ]);\n}\nexport function createDocumentClosingStream() {\n return streamFromString(CLOSE_TAG);\n}\n// ---------------------------------------------------------------------------\n// Runtime prefetch transform (Web streams)\n// ---------------------------------------------------------------------------\n/**\n * Web TransformStream that replaces the runtime prefetch sentinel in an RSC\n * payload stream: `[<sentinel>]` -> `[<isPartial>,<staleTime>]`.\n *\n * This is the web equivalent of createRuntimePrefetchNodeTransform\n * in node-stream-helpers.ts.\n */ export function createRuntimePrefetchTransformStream(sentinel, isPartial, staleTime) {\n const enc = new TextEncoder();\n // Search for: [<sentinel>]\n // Replace with: [<isPartial>,<staleTime>]\n const search = enc.encode(`[${sentinel}]`);\n const first = search[0];\n const replace = enc.encode(`[${isPartial},${staleTime}]`);\n const searchLen = search.length;\n let currentChunk = null;\n let found = false;\n function processChunk(controller, nextChunk) {\n if (found) {\n if (nextChunk) {\n controller.enqueue(nextChunk);\n }\n return;\n }\n if (currentChunk) {\n // We can't search past the index that can contain a full match\n let exclusiveUpperBound = currentChunk.length - (searchLen - 1);\n if (nextChunk) {\n // If we have any overflow bytes we can search up to the chunk's final byte\n exclusiveUpperBound += Math.min(nextChunk.length, searchLen - 1);\n }\n if (exclusiveUpperBound < 1) {\n // we can't match the current chunk.\n controller.enqueue(currentChunk);\n currentChunk = nextChunk // advance so we don't process this chunk again\n ;\n return;\n }\n let currentIndex = currentChunk.indexOf(first);\n // check the current candidate match if it is within the bounds of our search space for the currentChunk\n candidateLoop: while(-1 < currentIndex && currentIndex < exclusiveUpperBound){\n // We already know index 0 matches because we used indexOf to find the candidateIndex so we start at index 1\n let matchIndex = 1;\n while(matchIndex < searchLen){\n const candidateIndex = currentIndex + matchIndex;\n const candidateValue = candidateIndex < currentChunk.length ? currentChunk[candidateIndex] : nextChunk[candidateIndex - currentChunk.length];\n if (candidateValue !== search[matchIndex]) {\n // No match, reset and continue the search from the next position\n currentIndex = currentChunk.indexOf(first, currentIndex + 1);\n continue candidateLoop;\n }\n matchIndex++;\n }\n // We found a complete match. currentIndex is our starting point to replace the value.\n found = true;\n // enqueue everything up to the match\n controller.enqueue(currentChunk.subarray(0, currentIndex));\n // enqueue the replacement value\n controller.enqueue(replace);\n // If there are bytes in the currentChunk after the match enqueue them\n if (currentIndex + searchLen < currentChunk.length) {\n controller.enqueue(currentChunk.slice(currentIndex + searchLen));\n }\n // If we have a next chunk we enqueue it now\n if (nextChunk) {\n // if replacement spills over to the next chunk we first exclude the replaced bytes\n const overflowBytes = currentIndex + searchLen - currentChunk.length;\n const truncatedChunk = overflowBytes > 0 ? nextChunk.subarray(overflowBytes) : nextChunk;\n controller.enqueue(truncatedChunk);\n }\n // We are now in found mode and don't need to track currentChunk anymore\n currentChunk = null;\n return;\n }\n // No match found in this chunk, emit it and wait for the next one\n controller.enqueue(currentChunk);\n }\n // Advance to the next chunk\n currentChunk = nextChunk;\n }\n return new TransformStream({\n transform (chunk, controller) {\n processChunk(controller, chunk);\n },\n flush (controller) {\n processChunk(controller, null);\n }\n });\n}\n\n//# sourceMappingURL=node-web-streams-helper.js.map","import { isNodeNextResponse } from './base-http/helpers';\nimport { pipeToNodeResponse } from './pipe-readable';\nimport { splitCookiesString } from './web/utils';\n/**\n * Sends the response on the underlying next response object.\n *\n * @param req the underlying request object\n * @param res the underlying response object\n * @param response the response to send\n */ export async function sendResponse(req, res, response, waitUntil) {\n if (// The type check here ensures that `req` is correctly typed, and the\n // environment variable check provides dead code elimination.\n process.env.NEXT_RUNTIME !== 'edge' && isNodeNextResponse(res)) {\n var // Copy over the response headers.\n _response_headers;\n // Copy over the response status.\n res.statusCode = response.status;\n res.statusMessage = response.statusText;\n // TODO: this is not spec-compliant behavior and we should not restrict\n // headers that are allowed to appear many times.\n //\n // See:\n // https://github.com/vercel/next.js/pull/70127\n const headersWithMultipleValuesAllowed = [\n // can add more headers to this list if needed\n 'set-cookie',\n 'www-authenticate',\n 'proxy-authenticate',\n 'vary'\n ];\n (_response_headers = response.headers) == null ? void 0 : _response_headers.forEach((value, name)=>{\n // `x-middleware-set-cookie` is an internal header not needed for the response\n if (name.toLowerCase() === 'x-middleware-set-cookie') {\n return;\n }\n // The append handling is special cased for `set-cookie`.\n if (name.toLowerCase() === 'set-cookie') {\n // TODO: (wyattjoh) replace with native response iteration when we can upgrade undici\n for (const cookie of splitCookiesString(value)){\n res.appendHeader(name, cookie);\n }\n } else {\n // only append the header if it is either not present in the outbound response\n // or if the header supports multiple values\n const isHeaderPresent = typeof res.getHeader(name) !== 'undefined';\n if (headersWithMultipleValuesAllowed.includes(name.toLowerCase()) || !isHeaderPresent) {\n res.appendHeader(name, value);\n }\n }\n });\n /**\n * The response can't be directly piped to the underlying response. The\n * following is duplicated from the edge runtime handler.\n *\n * See packages/next/server/next-server.ts\n */ const { originalResponse } = res;\n // A response body must not be sent for HEAD requests. See https://httpwg.org/specs/rfc9110.html#HEAD\n if (response.body && req.method !== 'HEAD') {\n await pipeToNodeResponse(response.body, originalResponse, waitUntil);\n } else {\n originalResponse.end();\n }\n }\n}\n\n//# sourceMappingURL=send-response.js.map","import { NEXT_INTERCEPTION_MARKER_PREFIX, NEXT_QUERY_PARAM_PREFIX } from '../../lib/constants';\n/**\n * Converts a Node.js IncomingHttpHeaders object to a Headers object. Any\n * headers with multiple values will be joined with a comma and space. Any\n * headers that have an undefined value will be ignored and others will be\n * coerced to strings.\n *\n * @param nodeHeaders the headers object to convert\n * @returns the converted headers object\n */ export function fromNodeOutgoingHttpHeaders(nodeHeaders) {\n const headers = new Headers();\n for (let [key, value] of Object.entries(nodeHeaders)){\n const values = Array.isArray(value) ? value : [\n value\n ];\n for (let v of values){\n if (typeof v === 'undefined') continue;\n if (typeof v === 'number') {\n v = v.toString();\n }\n headers.append(key, v);\n }\n }\n return headers;\n}\n/*\n Set-Cookie header field-values are sometimes comma joined in one string. This splits them without choking on commas\n that are within a single set-cookie field-value, such as in the Expires portion.\n This is uncommon, but explicitly allowed - see https://tools.ietf.org/html/rfc2616#section-4.2\n Node.js does this for every header *except* set-cookie - see https://github.com/nodejs/node/blob/d5e363b77ebaf1caf67cd7528224b651c86815c1/lib/_http_incoming.js#L128\n React Native's fetch does this for *every* header, including set-cookie.\n \n Based on: https://github.com/google/j2objc/commit/16820fdbc8f76ca0c33472810ce0cb03d20efe25\n Credits to: https://github.com/tomball for original and https://github.com/chrusart for JavaScript implementation\n*/ export function splitCookiesString(cookiesString) {\n var cookiesStrings = [];\n var pos = 0;\n var start;\n var ch;\n var lastComma;\n var nextStart;\n var cookiesSeparatorFound;\n function skipWhitespace() {\n while(pos < cookiesString.length && /\\s/.test(cookiesString.charAt(pos))){\n pos += 1;\n }\n return pos < cookiesString.length;\n }\n function notSpecialChar() {\n ch = cookiesString.charAt(pos);\n return ch !== '=' && ch !== ';' && ch !== ',';\n }\n while(pos < cookiesString.length){\n start = pos;\n cookiesSeparatorFound = false;\n while(skipWhitespace()){\n ch = cookiesString.charAt(pos);\n if (ch === ',') {\n // ',' is a cookie separator if we have later first '=', not ';' or ','\n lastComma = pos;\n pos += 1;\n skipWhitespace();\n nextStart = pos;\n while(pos < cookiesString.length && notSpecialChar()){\n pos += 1;\n }\n // currently special character\n if (pos < cookiesString.length && cookiesString.charAt(pos) === '=') {\n // we found cookies separator\n cookiesSeparatorFound = true;\n // pos is inside the next cookie, so back up and return it.\n pos = nextStart;\n cookiesStrings.push(cookiesString.substring(start, lastComma));\n start = pos;\n } else {\n // in param ',' or param separator ';',\n // we continue from that comma\n pos = lastComma + 1;\n }\n } else {\n pos += 1;\n }\n }\n if (!cookiesSeparatorFound || pos >= cookiesString.length) {\n cookiesStrings.push(cookiesString.substring(start, cookiesString.length));\n }\n }\n return cookiesStrings;\n}\n/**\n * Converts a Headers object to a Node.js OutgoingHttpHeaders object. This is\n * required to support the set-cookie header, which may have multiple values.\n *\n * @param headers the headers object to convert\n * @returns the converted headers object\n */ export function toNodeOutgoingHttpHeaders(headers) {\n const nodeHeaders = {};\n const cookies = [];\n if (headers) {\n for (const [key, value] of headers.entries()){\n if (key.toLowerCase() === 'set-cookie') {\n // We may have gotten a comma joined string of cookies, or multiple\n // set-cookie headers. We need to merge them into one header array\n // to represent all the cookies.\n cookies.push(...splitCookiesString(value));\n nodeHeaders[key] = cookies.length === 1 ? cookies[0] : cookies;\n } else {\n nodeHeaders[key] = value;\n }\n }\n }\n return nodeHeaders;\n}\n/**\n * Validate the correctness of a user-provided URL.\n */ export function validateURL(url) {\n try {\n return String(new URL(String(url)));\n } catch (error) {\n throw new Error(`URL is malformed \"${String(url)}\". Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls`, {\n cause: error\n });\n }\n}\n/**\n * Normalizes `nxtP` and `nxtI` query param values to remove the prefix.\n * This function does not mutate the input key.\n */ export function normalizeNextQueryParam(key) {\n const prefixes = [\n NEXT_QUERY_PARAM_PREFIX,\n NEXT_INTERCEPTION_MARKER_PREFIX\n ];\n for (const prefix of prefixes){\n if (key !== prefix && key.startsWith(prefix)) {\n return key.substring(prefix.length);\n }\n }\n return null;\n}\n\n//# sourceMappingURL=utils.js.map","/**\n * This file provides some helpers that should be used in conjunction with\n * explicit environment checks. When combined with the environment checks, it\n * will ensure that the correct typings are used as well as enable code\n * elimination.\n */ /**\n * Type guard to determine if a request is a WebNextRequest. This does not\n * actually check the type of the request, but rather the runtime environment.\n * It's expected that when the runtime environment is the edge runtime, that any\n * base request is a WebNextRequest.\n */ export const isWebNextRequest = (req)=>process.env.NEXT_RUNTIME === 'edge';\n/**\n * Type guard to determine if a response is a WebNextResponse. This does not\n * actually check the type of the response, but rather the runtime environment.\n * It's expected that when the runtime environment is the edge runtime, that any\n * base response is a WebNextResponse.\n */ export const isWebNextResponse = (res)=>process.env.NEXT_RUNTIME === 'edge';\n/**\n * Type guard to determine if a request is a NodeNextRequest. This does not\n * actually check the type of the request, but rather the runtime environment.\n * It's expected that when the runtime environment is the node runtime, that any\n * base request is a NodeNextRequest.\n */ export const isNodeNextRequest = (req)=>process.env.NEXT_RUNTIME !== 'edge';\n/**\n * Type guard to determine if a response is a NodeNextResponse. This does not\n * actually check the type of the response, but rather the runtime environment.\n * It's expected that when the runtime environment is the node runtime, that any\n * base response is a NodeNextResponse.\n */ export const isNodeNextResponse = (res)=>process.env.NEXT_RUNTIME !== 'edge';\n\n//# sourceMappingURL=helpers.js.map","import { ensureLeadingSlash } from './ensure-leading-slash';\nimport { isDynamicRoute } from '../router/utils';\nimport { NormalizeError } from '../utils';\n/**\n * Takes a page and transforms it into its file counterpart ensuring that the\n * output is normalized. Note this function is not idempotent because a page\n * `/index` can be referencing `/index/index.js` and `/index/index` could be\n * referencing `/index/index/index.js`. Examples:\n * - `/` -> `/index`\n * - `/index/foo` -> `/index/index/foo`\n * - `/index` -> `/index/index`\n */ export function normalizePagePath(page) {\n const normalized = /^\\/index(\\/|$)/.test(page) && !isDynamicRoute(page) ? `/index${page}` : page === '/' ? '/index' : ensureLeadingSlash(page);\n if (process.env.NEXT_RUNTIME !== 'edge') {\n const { posix } = require('path');\n const resolvedPage = posix.normalize(normalized);\n if (resolvedPage !== normalized) {\n throw new NormalizeError(`Requested and resolved page mismatch: ${normalized} ${resolvedPage}`);\n }\n }\n return normalized;\n}\n\n//# sourceMappingURL=normalize-page-path.js.map","import { AppRenderSpan, NextNodeServerSpan } from './trace/constants';\nimport { isRequestInsightsEnabled, recordRequestInsightFetch } from './trace/request-insights';\nimport { getRequestInsightsIdentity } from './trace/request-insights-identity';\nimport { getTracer, SpanKind } from './trace/tracer';\nimport { CACHE_ONE_YEAR_SECONDS, INFINITE_CACHE, NEXT_CACHE_TAG_MAX_ITEMS, NEXT_CACHE_TAG_MAX_LENGTH } from '../../lib/constants';\nimport { markCurrentScopeAsDynamic } from '../app-render/dynamic-rendering';\nimport { makeDynamicHangingPromise } from '../dynamic-rendering-utils';\nimport { createDedupeFetch } from './dedupe-fetch';\nimport { getCacheSignal, willConsumerServerCache } from '../app-render/work-unit-async-storage.external';\nimport { CachedRouteKind, IncrementalCacheKind } from '../response-cache';\nimport { cloneResponse } from './clone-response';\nimport { RenderStage } from '../app-render/staged-rendering';\nimport { encodeHeaderSafe } from './encode-header-safe';\nconst isEdgeRuntime = process.env.NEXT_RUNTIME === 'edge';\n/**\n * Whether fetch cache configuration needs to be processed for the current work\n * unit before an origin fetch. Static prerender stores use it for dynamic\n * access tracking. Cache scopes apply it to their own cache policy, regardless\n * of which outer work unit created them. Development staged renders additionally\n * coordinate dynamic fetches with the dynamic render stage.\n */ function shouldProcessFetchConfigForWorkUnit(workUnitStore) {\n if (!workUnitStore) {\n return false;\n }\n switch(workUnitStore.type){\n case 'prerender':\n case 'prerender-client':\n case 'prerender-legacy':\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n return true;\n case 'request':\n return Boolean(process.env.NODE_ENV === 'development' && process.env.__NEXT_CACHE_COMPONENTS && workUnitStore.stagedRendering);\n case 'prerender-runtime':\n case 'validation-client':\n case 'build-time-generator':\n return false;\n default:\n return workUnitStore;\n }\n}\nexport const NEXT_PATCH_SYMBOL = Symbol.for('next-patch');\nfunction isFetchPatched() {\n return globalThis[NEXT_PATCH_SYMBOL] === true;\n}\nexport function validateRevalidate(revalidateVal, route) {\n try {\n let normalizedRevalidate = undefined;\n if (revalidateVal === false || revalidateVal === Infinity) {\n // Unlike Infinity, INFINITE_CACHE survives JSON serialization (e.g. in\n // the fetch cache).\n normalizedRevalidate = INFINITE_CACHE;\n } else if (typeof revalidateVal === 'number' && !isNaN(revalidateVal) && revalidateVal > -1) {\n normalizedRevalidate = revalidateVal;\n } else if (typeof revalidateVal !== 'undefined') {\n throw new Error(`Invalid revalidate value \"${revalidateVal}\" on \"${route}\", must be a non-negative number or false`);\n }\n return normalizedRevalidate;\n } catch (err) {\n // handle client component error from attempting to check revalidate value\n if (err instanceof Error && err.message.includes('Invalid revalidate')) {\n throw err;\n }\n return undefined;\n }\n}\nexport function validateTags(tags, description) {\n const validTags = [];\n const invalidTags = [];\n for(let i = 0; i < tags.length; i++){\n const tag = tags[i];\n if (typeof tag !== 'string') {\n invalidTags.push({\n tag,\n reason: 'invalid type, must be a string'\n });\n } else if (tag.length > NEXT_CACHE_TAG_MAX_LENGTH) {\n invalidTags.push({\n tag,\n reason: `exceeded max length of ${NEXT_CACHE_TAG_MAX_LENGTH}`\n });\n } else {\n // Encode so a non-ASCII tag can be safely serialized into the\n // `x-next-cache-tags` HTTP header without tripping Node's header\n // validation. Length is checked on the raw input above.\n validTags.push(encodeHeaderSafe(tag));\n }\n if (validTags.length > NEXT_CACHE_TAG_MAX_ITEMS) {\n console.warn(`Warning: exceeded max tag count for ${description}, dropped tags:`, tags.slice(i).join(', '));\n break;\n }\n }\n if (invalidTags.length > 0) {\n console.warn(`Warning: invalid tags passed to ${description}: `);\n for (const { tag, reason } of invalidTags){\n console.log(`tag: \"${tag}\" ${reason}`);\n }\n }\n return validTags;\n}\nfunction trackFetchMetric(workStore, span, ctx) {\n const metric = {\n ...ctx,\n end: performance.timeOrigin + performance.now(),\n idx: workStore.nextFetchId || 0\n };\n span == null ? void 0 : span.setAttributes({\n 'http.status_code': metric.status,\n 'next.fetch.idx': metric.idx,\n 'next.fetch.cache_status': metric.cacheStatus,\n 'next.fetch.cache_reason': metric.cacheReason\n });\n if (isRequestInsightsEnabled()) {\n const requestInsightsIdentity = getRequestInsightsIdentity();\n const requestInsightsRequestId = (requestInsightsIdentity == null ? void 0 : requestInsightsIdentity.requestId) ?? workStore.requestId;\n if (requestInsightsRequestId) {\n recordRequestInsightFetch({\n requestId: requestInsightsRequestId,\n kind: requestInsightsIdentity == null ? void 0 : requestInsightsIdentity.kind,\n htmlRequestId: (requestInsightsIdentity == null ? void 0 : requestInsightsIdentity.htmlRequestId) ?? workStore.htmlRequestId,\n route: workStore.route\n }, {\n url: metric.url,\n method: metric.method,\n statusCode: metric.status,\n startTime: metric.start,\n durationMs: metric.end - metric.start,\n cacheStatus: metric.cacheStatus,\n cacheReason: metric.cacheReason,\n index: metric.idx\n });\n }\n }\n if (!workStore.shouldTrackFetchMetrics) {\n return;\n }\n workStore.fetchMetrics ??= [];\n workStore.fetchMetrics.push(metric);\n}\nasync function createCachedPrerenderResponse(res, cacheKey, incrementalCacheContext, incrementalCache, revalidate, handleUnlock) {\n // We are prerendering at build time or revalidate time with cacheComponents so we\n // need to buffer the response so we can guarantee it can be read in a\n // microtask.\n const bodyBuffer = await res.arrayBuffer();\n const fetchedData = {\n headers: Object.fromEntries(res.headers.entries()),\n body: Buffer.from(bodyBuffer).toString('base64'),\n status: res.status,\n url: res.url\n };\n // We can skip setting the serverComponentsHmrCache because we aren't in dev\n // mode.\n if (incrementalCacheContext) {\n await incrementalCache.set(cacheKey, {\n kind: CachedRouteKind.FETCH,\n data: fetchedData,\n revalidate\n }, incrementalCacheContext);\n }\n await handleUnlock();\n // We return a new Response to the caller.\n return new Response(bodyBuffer, {\n headers: res.headers,\n status: res.status,\n statusText: res.statusText\n });\n}\nasync function createCachedDynamicResponse(workStore, res, cacheKey, incrementalCacheContext, incrementalCache, serverComponentsHmrCache, revalidate, input, handleUnlock, signal) {\n // We're cloning the response using this utility because there exists a bug in\n // the undici library around response cloning. See the following pull request\n // for more details: https://github.com/vercel/next.js/pull/73274\n const [cloned1, cloned2] = cloneResponse(res);\n // We are dynamically rendering including dev mode. We want to return the\n // response to the caller as soon as possible because it might stream over a\n // very long time.\n const cacheSetPromise = cloned1.arrayBuffer().then(async (arrayBuffer)=>{\n const bodyBuffer = Buffer.from(arrayBuffer);\n const fetchedData = {\n headers: Object.fromEntries(cloned1.headers.entries()),\n body: bodyBuffer.toString('base64'),\n status: cloned1.status,\n url: cloned1.url\n };\n serverComponentsHmrCache == null ? void 0 : serverComponentsHmrCache.set(cacheKey, fetchedData);\n if (incrementalCacheContext) {\n await incrementalCache.set(cacheKey, {\n kind: CachedRouteKind.FETCH,\n data: fetchedData,\n revalidate\n }, incrementalCacheContext);\n }\n }).catch((error)=>{\n // Don't warn if the request was aborted intentionally.\n if (!(signal == null ? void 0 : signal.aborted)) {\n console.warn(`Failed to set fetch cache`, input, error);\n }\n }).finally(handleUnlock);\n const pendingRevalidateKey = `cache-set-${cacheKey}`;\n const pendingRevalidates = workStore.pendingRevalidates ??= {};\n let pendingRevalidatePromise = Promise.resolve();\n if (pendingRevalidateKey in pendingRevalidates) {\n // There is already a pending revalidate entry that we need to await to\n // avoid race conditions.\n pendingRevalidatePromise = pendingRevalidates[pendingRevalidateKey];\n }\n pendingRevalidates[pendingRevalidateKey] = pendingRevalidatePromise.then(()=>cacheSetPromise).finally(()=>{\n // If the pending revalidate is not present in the store, then we have\n // nothing to delete.\n if (!(pendingRevalidates == null ? void 0 : pendingRevalidates[pendingRevalidateKey])) {\n return;\n }\n delete pendingRevalidates[pendingRevalidateKey];\n });\n return cloned2;\n}\nexport function createPatchedFetcher(originFetch, { workAsyncStorage, workUnitAsyncStorage }) {\n // Create the patched fetch function.\n const patched = async function fetch(input, init) {\n var _init_method, _init_next;\n let url;\n try {\n url = new URL(input instanceof Request ? input.url : input);\n url.username = '';\n url.password = '';\n } catch {\n // Error caused by malformed URL should be handled by native fetch\n url = undefined;\n }\n const fetchUrl = (url == null ? void 0 : url.href) ?? '';\n const method = (init == null ? void 0 : (_init_method = init.method) == null ? void 0 : _init_method.toUpperCase()) || 'GET';\n // Do create a new span trace for internal fetches in the\n // non-verbose mode.\n const isInternal = (init == null ? void 0 : (_init_next = init.next) == null ? void 0 : _init_next.internal) === true;\n const hideSpan = process.env.NEXT_OTEL_FETCH_DISABLED === '1';\n // We don't track fetch metrics for internal fetches\n // so it's not critical that we have a start time, as it won't be recorded.\n // This is to workaround a flaky issue where performance APIs might\n // not be available and will require follow-up investigation.\n const fetchStart = isInternal ? undefined : performance.timeOrigin + performance.now();\n const workStore = workAsyncStorage.getStore();\n const workUnitStore = workUnitAsyncStorage.getStore();\n let cacheSignal = workUnitStore ? getCacheSignal(workUnitStore) : null;\n if (cacheSignal) {\n cacheSignal.beginRead();\n }\n const result = getTracer().trace(isInternal ? NextNodeServerSpan.internalFetch : AppRenderSpan.fetch, {\n hideSpan,\n kind: SpanKind.CLIENT,\n spanName: [\n 'fetch',\n method,\n fetchUrl\n ].filter(Boolean).join(' '),\n attributes: {\n 'http.url': fetchUrl,\n 'http.method': method,\n 'net.peer.name': url == null ? void 0 : url.hostname,\n 'net.peer.port': (url == null ? void 0 : url.port) || undefined\n }\n }, async (span)=>{\n var _getRequestMeta;\n // If this is an internal fetch, we should not do any special treatment.\n if (isInternal) {\n return originFetch(input, init);\n }\n // If the workStore is not available, we can't do any\n // special treatment of fetch, therefore fallback to the original\n // fetch implementation.\n if (!workStore) {\n return originFetch(input, init);\n }\n // We should also fallback to the original fetch implementation if we\n // are in draft mode, it does not constitute a static generation.\n if (workStore.isDraftMode) {\n return originFetch(input, init);\n }\n const isRequestInput = input && typeof input === 'object' && typeof input.method === 'string';\n // With `fetch(new Request(url), init)`, native fetch lets `init`\n // override the base Request. Merge them into a single effective Request\n // so cacheability, the cache key, and the upstream request all describe\n // the same thing.\n if (isRequestInput && init) {\n // `next` (revalidate/tags) is Next-specific and dropped by\n // `new Request`, so keep it on `init` and move the rest onto input.\n const { next, ...overrides } = init;\n input = new Request(input, overrides);\n init = next ? {\n next\n } : undefined;\n }\n const getRequestMeta = (field)=>{\n // If request input is present but init is not, retrieve from input first.\n const value = init == null ? void 0 : init[field];\n return value || (isRequestInput ? input[field] : null);\n };\n let finalRevalidate = undefined;\n const getNextField = (field)=>{\n var _init_next, _init_next1, _input_next;\n return typeof (init == null ? void 0 : (_init_next = init.next) == null ? void 0 : _init_next[field]) !== 'undefined' ? init == null ? void 0 : (_init_next1 = init.next) == null ? void 0 : _init_next1[field] : isRequestInput ? (_input_next = input.next) == null ? void 0 : _input_next[field] : undefined;\n };\n // RequestInit doesn't keep extra fields e.g. next so it's\n // only available if init is used separate\n const originalFetchRevalidate = getNextField('revalidate');\n let currentFetchRevalidate = originalFetchRevalidate;\n const tags = validateTags(getNextField('tags') || [], `fetch ${input.toString()}`);\n let revalidateStore;\n if (workUnitStore) {\n switch(workUnitStore.type){\n case 'prerender':\n case 'prerender-runtime':\n // TODO: Stop accumulating tags in client prerender. (fallthrough)\n case 'prerender-client':\n case 'validation-client':\n case 'prerender-legacy':\n case 'cache':\n case 'private-cache':\n revalidateStore = workUnitStore;\n break;\n case 'request':\n case 'unstable-cache':\n case 'build-time-generator':\n break;\n default:\n workUnitStore;\n }\n }\n if (revalidateStore) {\n if (Array.isArray(tags)) {\n // Collect tags onto parent caches or parent prerenders.\n const collectedTags = revalidateStore.tags ?? (revalidateStore.tags = []);\n for (const tag of tags){\n if (!collectedTags.includes(tag)) {\n collectedTags.push(tag);\n }\n }\n }\n }\n const implicitTags = workUnitStore == null ? void 0 : workUnitStore.implicitTags;\n let pageFetchCacheMode = workStore.fetchCache;\n if (workUnitStore) {\n switch(workUnitStore.type){\n case 'unstable-cache':\n // Inside unstable-cache we treat it the same as force-no-store on\n // the page.\n pageFetchCacheMode = 'force-no-store';\n break;\n case 'prerender':\n case 'prerender-client':\n case 'validation-client':\n case 'prerender-runtime':\n case 'prerender-legacy':\n case 'request':\n case 'cache':\n case 'private-cache':\n case 'build-time-generator':\n break;\n default:\n workUnitStore;\n }\n }\n const isUsingNoStore = !!workStore.isUnstableNoStore;\n let currentFetchCacheConfig = getRequestMeta('cache');\n let cacheReason = '';\n let cacheWarning;\n if (typeof currentFetchCacheConfig === 'string' && typeof currentFetchRevalidate !== 'undefined') {\n // If the revalidate value conflicts with the cache value, we should warn the user and unset the conflicting values.\n const isConflictingRevalidate = // revalidate: 0 and cache: force-cache\n currentFetchCacheConfig === 'force-cache' && currentFetchRevalidate === 0 || // revalidate: >0 or revalidate: false and cache: no-store\n currentFetchCacheConfig === 'no-store' && (currentFetchRevalidate > 0 || currentFetchRevalidate === false);\n if (isConflictingRevalidate) {\n cacheWarning = `Specified \"cache: ${currentFetchCacheConfig}\" and \"revalidate: ${currentFetchRevalidate}\", only one should be specified.`;\n currentFetchCacheConfig = undefined;\n currentFetchRevalidate = undefined;\n }\n }\n const hasExplicitFetchCacheOptOut = // fetch config itself signals not to cache\n currentFetchCacheConfig === 'no-cache' || currentFetchCacheConfig === 'no-store' || // the fetch isn't explicitly caching and the segment level cache config signals not to cache\n // note: `pageFetchCacheMode` is also set by being in an unstable_cache context.\n pageFetchCacheMode === 'force-no-store' || pageFetchCacheMode === 'only-no-store';\n // If no explicit fetch cache mode is set, but dynamic = `force-dynamic` is set,\n // we shouldn't consider caching the fetch. This is because the `dynamic` cache\n // is considered a \"top-level\" cache mode, whereas something like `fetchCache` is more\n // fine-grained. Top-level modes are responsible for setting reasonable defaults for the\n // other configurations.\n const noFetchConfigAndForceDynamic = !pageFetchCacheMode && !currentFetchCacheConfig && !currentFetchRevalidate && workStore.forceDynamic;\n if (// force-cache was specified without a revalidate value. We set the revalidate value to false\n // which will signal the cache to not revalidate\n currentFetchCacheConfig === 'force-cache' && typeof currentFetchRevalidate === 'undefined') {\n currentFetchRevalidate = false;\n } else if (hasExplicitFetchCacheOptOut || noFetchConfigAndForceDynamic) {\n currentFetchRevalidate = 0;\n }\n if (currentFetchCacheConfig === 'no-cache' || currentFetchCacheConfig === 'no-store') {\n cacheReason = `cache: ${currentFetchCacheConfig}`;\n }\n finalRevalidate = validateRevalidate(currentFetchRevalidate, workStore.route);\n const _headers = getRequestMeta('headers');\n const initHeaders = typeof (_headers == null ? void 0 : _headers.get) === 'function' ? _headers : new Headers(_headers || {});\n const hasUnCacheableHeader = initHeaders.get('authorization') || initHeaders.get('cookie');\n const isUnCacheableMethod = ![\n 'get',\n 'head'\n ].includes(((_getRequestMeta = getRequestMeta('method')) == null ? void 0 : _getRequestMeta.toLowerCase()) || 'get');\n /**\n * We automatically disable fetch caching under the following conditions:\n * - Fetch cache configs are not set. Specifically:\n * - A page fetch cache mode is not set (export const fetchCache=...)\n * - A fetch cache mode is not set in the fetch call (fetch(url, { cache: ... }))\n * or the fetch cache mode is set to 'default'\n * - A fetch revalidate value is not set in the fetch call (fetch(url, { revalidate: ... }))\n * - OR the fetch comes after a configuration that triggered dynamic rendering (e.g., reading cookies())\n * and the fetch was considered uncacheable (e.g., POST method or has authorization headers)\n */ const hasNoExplicitCacheConfig = // eslint-disable-next-line eqeqeq\n pageFetchCacheMode == undefined && // eslint-disable-next-line eqeqeq\n (currentFetchCacheConfig == undefined || // when considering whether to opt into the default \"no-cache\" fetch semantics,\n // a \"default\" cache config should be treated the same as no cache config\n currentFetchCacheConfig === 'default') && // eslint-disable-next-line eqeqeq\n currentFetchRevalidate == undefined;\n let autoNoCache = Boolean((hasUnCacheableHeader || isUnCacheableMethod) && (revalidateStore == null ? void 0 : revalidateStore.revalidate) === 0);\n let isImplicitBuildTimeCache = false;\n if (!autoNoCache && hasNoExplicitCacheConfig) {\n // We don't enable automatic no-cache behavior during build-time\n // prerendering so that we can still leverage the fetch cache between\n // export workers.\n if (workStore.isBuildTimePrerendering) {\n isImplicitBuildTimeCache = true;\n } else {\n autoNoCache = true;\n }\n }\n // If we have no cache config, and we're in Dynamic I/O prerendering,\n // it'll be a dynamic call. We don't have to issue that dynamic call.\n if (hasNoExplicitCacheConfig && workUnitStore !== undefined) {\n switch(workUnitStore.type){\n case 'prerender':\n case 'prerender-runtime':\n // While we don't want to do caching in the client scope we know the\n // fetch will be dynamic for cacheComponents so we may as well avoid the\n // call here. (fallthrough)\n case 'prerender-client':\n if (cacheSignal) {\n cacheSignal.endRead();\n cacheSignal = null;\n }\n return makeDynamicHangingPromise(workUnitStore.renderSignal, workStore.route, 'fetch()');\n case 'validation-client':\n break;\n case 'request':\n if (process.env.NODE_ENV === 'development' && workUnitStore.stagedRendering) {\n if (cacheSignal) {\n cacheSignal.endRead();\n cacheSignal = null;\n }\n await workUnitStore.stagedRendering.waitForStage(RenderStage.Dynamic);\n }\n break;\n case 'prerender-legacy':\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n case 'build-time-generator':\n break;\n default:\n workUnitStore;\n }\n }\n switch(pageFetchCacheMode){\n case 'force-no-store':\n {\n cacheReason = 'fetchCache = force-no-store';\n break;\n }\n case 'only-no-store':\n {\n if (currentFetchCacheConfig === 'force-cache' || typeof finalRevalidate !== 'undefined' && finalRevalidate > 0) {\n throw new Error(`cache: 'force-cache' used on fetch for ${fetchUrl} with 'export const fetchCache = 'only-no-store'`);\n }\n cacheReason = 'fetchCache = only-no-store';\n break;\n }\n case 'only-cache':\n {\n if (currentFetchCacheConfig === 'no-store') {\n throw new Error(`cache: 'no-store' used on fetch for ${fetchUrl} with 'export const fetchCache = 'only-cache'`);\n }\n break;\n }\n case 'force-cache':\n {\n if (typeof currentFetchRevalidate === 'undefined' || currentFetchRevalidate === 0) {\n cacheReason = 'fetchCache = force-cache';\n finalRevalidate = INFINITE_CACHE;\n }\n break;\n }\n case 'default-cache':\n case 'default-no-store':\n case 'auto':\n case undefined:\n break;\n default:\n pageFetchCacheMode;\n }\n if (typeof finalRevalidate === 'undefined') {\n if (pageFetchCacheMode === 'default-cache' && !isUsingNoStore) {\n finalRevalidate = INFINITE_CACHE;\n cacheReason = 'fetchCache = default-cache';\n } else if (pageFetchCacheMode === 'default-no-store') {\n finalRevalidate = 0;\n cacheReason = 'fetchCache = default-no-store';\n } else if (isUsingNoStore) {\n finalRevalidate = 0;\n cacheReason = 'noStore call';\n } else if (autoNoCache) {\n finalRevalidate = 0;\n cacheReason = 'auto no cache';\n } else {\n // TODO: should we consider this case an invariant?\n cacheReason = 'auto cache';\n finalRevalidate = revalidateStore ? revalidateStore.revalidate : INFINITE_CACHE;\n }\n } else if (!cacheReason) {\n cacheReason = `revalidate: ${finalRevalidate}`;\n }\n if (// when force static is configured we don't bail from\n // `revalidate: 0` values\n !(workStore.forceStatic && finalRevalidate === 0) && // we don't consider autoNoCache to switch to dynamic for ISR\n !autoNoCache && // If the revalidate value isn't currently set or the value is less\n // than the current revalidate value, we should update the revalidate\n // value.\n revalidateStore && finalRevalidate < revalidateStore.revalidate) {\n // If we were setting the revalidate value to 0, we should try to\n // postpone instead first.\n if (finalRevalidate === 0) {\n if (workUnitStore) {\n switch(workUnitStore.type){\n case 'prerender':\n case 'prerender-client':\n case 'prerender-runtime':\n // If we're in an instant validation, a dynamic fetch won't\n // have time to resolve during the validation prerender anyway,\n // so we leave it hanging. This can cause false negatives in shared parents,\n // but we accept that for now, because client data fetching is non-idiomatic.\n // eslint-disable-next-line no-fallthrough\n case 'validation-client':\n if (cacheSignal) {\n cacheSignal.endRead();\n cacheSignal = null;\n }\n return makeDynamicHangingPromise(workUnitStore.renderSignal, workStore.route, 'fetch()');\n case 'request':\n if (process.env.NODE_ENV === 'development' && workUnitStore.stagedRendering) {\n if (cacheSignal) {\n cacheSignal.endRead();\n cacheSignal = null;\n }\n await workUnitStore.stagedRendering.waitForStage(RenderStage.Dynamic);\n }\n break;\n case 'prerender-legacy':\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n case 'build-time-generator':\n break;\n default:\n workUnitStore;\n }\n }\n markCurrentScopeAsDynamic(workStore, workUnitStore, `revalidate: 0 fetch ${input} ${workStore.route}`);\n }\n // We only want to set the revalidate store's revalidate time if it\n // was explicitly set for the fetch call, i.e.\n // originalFetchRevalidate.\n if (revalidateStore && originalFetchRevalidate === finalRevalidate) {\n revalidateStore.revalidate = finalRevalidate;\n }\n }\n const isCacheableRevalidate = typeof finalRevalidate === 'number' && finalRevalidate > 0;\n let cacheKey;\n const { incrementalCache } = workStore;\n let isHmrRefresh = false;\n let serverComponentsHmrCache;\n if (workUnitStore) {\n switch(workUnitStore.type){\n case 'request':\n case 'cache':\n case 'private-cache':\n isHmrRefresh = workUnitStore.isHmrRefresh ?? false;\n serverComponentsHmrCache = workUnitStore.serverComponentsHmrCache;\n break;\n case 'prerender':\n case 'prerender-client':\n case 'validation-client':\n case 'prerender-runtime':\n case 'prerender-legacy':\n case 'unstable-cache':\n case 'build-time-generator':\n break;\n default:\n workUnitStore;\n }\n }\n if (incrementalCache && (isCacheableRevalidate || serverComponentsHmrCache)) {\n try {\n cacheKey = await incrementalCache.generateCacheKey(fetchUrl, isRequestInput ? input : init);\n } catch (cause) {\n console.error(`Failed to generate cache key for`, input, cause);\n }\n }\n const fetchIdx = workStore.nextFetchId ?? 1;\n workStore.nextFetchId = fetchIdx + 1;\n let handleUnlock = ()=>{};\n const doOriginalFetch = async (isStale, cacheReasonOverride)=>{\n const requestInputFields = [\n 'cache',\n 'credentials',\n 'headers',\n 'integrity',\n 'keepalive',\n 'method',\n 'mode',\n 'redirect',\n 'referrer',\n 'referrerPolicy',\n 'window',\n 'duplex',\n // don't pass through signal when revalidating\n ...isStale ? [] : [\n 'signal'\n ]\n ];\n if (isRequestInput) {\n const reqInput = input;\n const reqOptions = {\n body: reqInput._ogBody || reqInput.body\n };\n for (const field of requestInputFields){\n // @ts-expect-error custom fields\n reqOptions[field] = reqInput[field];\n }\n input = new Request(reqInput.url, reqOptions);\n } else if (init) {\n const { _ogBody, body, signal, ...otherInput } = init;\n init = {\n ...otherInput,\n body: _ogBody || body,\n signal: isStale ? undefined : signal\n };\n }\n // add metadata to init without editing the original\n const clonedInit = {\n ...init,\n next: {\n ...init == null ? void 0 : init.next,\n fetchType: 'origin',\n fetchIdx\n }\n };\n return originFetch(input, clonedInit).then(async (res)=>{\n if (!isStale && fetchStart) {\n trackFetchMetric(workStore, span, {\n start: fetchStart,\n url: fetchUrl,\n cacheReason: cacheReasonOverride || cacheReason,\n cacheStatus: finalRevalidate === 0 || cacheReasonOverride ? 'skip' : 'miss',\n cacheWarning,\n status: res.status,\n method: clonedInit.method || 'GET'\n });\n }\n if (res.status === 200 && incrementalCache && cacheKey && (isCacheableRevalidate || serverComponentsHmrCache)) {\n const normalizedRevalidate = finalRevalidate >= INFINITE_CACHE ? CACHE_ONE_YEAR_SECONDS : finalRevalidate;\n const incrementalCacheConfig = isCacheableRevalidate ? {\n fetchCache: true,\n fetchUrl,\n fetchIdx,\n tags,\n isImplicitBuildTimeCache\n } : undefined;\n switch(workUnitStore == null ? void 0 : workUnitStore.type){\n case 'prerender':\n case 'prerender-client':\n case 'validation-client':\n case 'prerender-runtime':\n return createCachedPrerenderResponse(res, cacheKey, incrementalCacheConfig, incrementalCache, normalizedRevalidate, handleUnlock);\n case 'request':\n if (process.env.NODE_ENV === 'development' && workUnitStore.stagedRendering && workUnitStore.cacheSignal && isCacheableRevalidate) {\n // We're filling caches for a staged render with an\n // explicit cache config, so we need to wait for the\n // response to finish instead of streaming. For HMR-only\n // caching (no explicit revalidate), we fall through to\n // createCachedDynamicResponse which handles streaming\n // and abort gracefully.\n return createCachedPrerenderResponse(res, cacheKey, incrementalCacheConfig, incrementalCache, normalizedRevalidate, handleUnlock);\n }\n // fallthrough\n case 'prerender-legacy':\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n case 'build-time-generator':\n case undefined:\n return createCachedDynamicResponse(workStore, res, cacheKey, incrementalCacheConfig, incrementalCache, serverComponentsHmrCache, normalizedRevalidate, input, handleUnlock, getRequestMeta('signal'));\n default:\n workUnitStore;\n }\n }\n // we had response that we determined shouldn't be cached so we return it\n // and don't cache it. This also needs to unlock the cache lock we acquired.\n await handleUnlock();\n return res;\n }).catch((error)=>{\n handleUnlock();\n throw error;\n });\n };\n let cacheReasonOverride;\n let isForegroundRevalidate = false;\n let isHmrRefreshCache = false;\n if (cacheKey && incrementalCache) {\n let cachedFetchData;\n if (isHmrRefresh && serverComponentsHmrCache) {\n cachedFetchData = serverComponentsHmrCache.get(cacheKey);\n isHmrRefreshCache = true;\n }\n if (isCacheableRevalidate && !cachedFetchData) {\n handleUnlock = await incrementalCache.lock(cacheKey);\n const entry = workStore.isOnDemandRevalidate ? null : await incrementalCache.get(cacheKey, {\n kind: IncrementalCacheKind.FETCH,\n revalidate: finalRevalidate,\n fetchUrl,\n fetchIdx,\n tags,\n softTags: implicitTags == null ? void 0 : implicitTags.tags\n });\n if (hasNoExplicitCacheConfig && workUnitStore) {\n switch(workUnitStore.type){\n case 'prerender':\n case 'prerender-client':\n case 'validation-client':\n case 'prerender-runtime':\n // We sometimes use the cache to dedupe fetches that do not\n // specify a cache configuration. In these cases we want to\n // make sure we still exclude them from prerenders if\n // cacheComponents is on so we introduce an artificial task boundary\n // here.\n await getTimeoutBoundary();\n break;\n case 'request':\n if (process.env.NODE_ENV === 'development' && workUnitStore.stagedRendering) {\n await workUnitStore.stagedRendering.waitForStage(RenderStage.Dynamic);\n }\n break;\n case 'prerender-legacy':\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n case 'build-time-generator':\n break;\n default:\n workUnitStore;\n }\n }\n if (entry) {\n await handleUnlock();\n } else {\n // in dev, incremental cache response will be null in case the browser adds `cache-control: no-cache` in the request headers\n // TODO: it seems like we also hit this after revalidates in dev?\n cacheReasonOverride = 'cache-control: no-cache (hard refresh)';\n }\n if ((entry == null ? void 0 : entry.value) && entry.value.kind === CachedRouteKind.FETCH) {\n // If the consumer will persist this result in a server cache,\n // wait for fresh data so it doesn't persist a stale value.\n if (willConsumerServerCache(workUnitStore) && entry.isStale) {\n isForegroundRevalidate = true;\n } else {\n if (entry.isStale) {\n workStore.pendingRevalidates ??= {};\n if (!workStore.pendingRevalidates[cacheKey]) {\n const pendingRevalidate = doOriginalFetch(true).then(async (response)=>({\n body: await response.arrayBuffer(),\n headers: response.headers,\n status: response.status,\n statusText: response.statusText\n })).finally(()=>{\n workStore.pendingRevalidates ??= {};\n delete workStore.pendingRevalidates[cacheKey || ''];\n });\n // Attach the empty catch here so we don't get a \"unhandled\n // promise rejection\" warning.\n pendingRevalidate.catch(console.error);\n workStore.pendingRevalidates[cacheKey] = pendingRevalidate;\n }\n }\n cachedFetchData = entry.value.data;\n }\n }\n }\n if (cachedFetchData) {\n if (fetchStart) {\n trackFetchMetric(workStore, span, {\n start: fetchStart,\n url: fetchUrl,\n cacheReason,\n cacheStatus: isHmrRefreshCache ? 'hmr' : 'hit',\n cacheWarning,\n status: cachedFetchData.status || 200,\n method: (init == null ? void 0 : init.method) || 'GET'\n });\n }\n const response = new Response(Buffer.from(cachedFetchData.body, 'base64'), {\n headers: cachedFetchData.headers,\n status: cachedFetchData.status\n });\n Object.defineProperty(response, 'url', {\n value: cachedFetchData.url\n });\n return response;\n }\n }\n if (init && typeof init === 'object' && shouldProcessFetchConfigForWorkUnit(workUnitStore)) {\n const { cache } = init;\n // Delete `cache` property as Cloudflare Workers will throw an error\n if (isEdgeRuntime) delete init.cache;\n if (cache === 'no-store') {\n // If enabled, we should bail out of static generation.\n if (workUnitStore) {\n switch(workUnitStore.type){\n case 'prerender':\n case 'prerender-client':\n case 'prerender-runtime':\n case 'validation-client':\n if (cacheSignal) {\n cacheSignal.endRead();\n cacheSignal = null;\n }\n return makeDynamicHangingPromise(workUnitStore.renderSignal, workStore.route, 'fetch()');\n case 'request':\n if (process.env.NODE_ENV === 'development' && workUnitStore.stagedRendering) {\n if (cacheSignal) {\n cacheSignal.endRead();\n cacheSignal = null;\n }\n await workUnitStore.stagedRendering.waitForStage(RenderStage.Dynamic);\n }\n break;\n case 'prerender-legacy':\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n case 'build-time-generator':\n break;\n default:\n workUnitStore;\n }\n }\n markCurrentScopeAsDynamic(workStore, workUnitStore, `no-store fetch ${input} ${workStore.route}`);\n }\n const hasNextConfig = 'next' in init;\n const { next = {} } = init;\n if (typeof next.revalidate === 'number' && revalidateStore && next.revalidate < revalidateStore.revalidate) {\n if (next.revalidate === 0) {\n // If enabled, we should bail out of static generation.\n if (workUnitStore) {\n switch(workUnitStore.type){\n case 'prerender':\n case 'prerender-client':\n case 'prerender-runtime':\n case 'validation-client':\n return makeDynamicHangingPromise(workUnitStore.renderSignal, workStore.route, 'fetch()');\n case 'request':\n if (process.env.NODE_ENV === 'development' && workUnitStore.stagedRendering) {\n await workUnitStore.stagedRendering.waitForStage(RenderStage.Dynamic);\n }\n break;\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n case 'prerender-legacy':\n case 'build-time-generator':\n break;\n default:\n workUnitStore;\n }\n }\n markCurrentScopeAsDynamic(workStore, workUnitStore, `revalidate: 0 fetch ${input} ${workStore.route}`);\n }\n if (!workStore.forceStatic || next.revalidate !== 0) {\n revalidateStore.revalidate = next.revalidate;\n }\n }\n if (hasNextConfig) delete init.next;\n }\n // if we are revalidating the whole page via time or on-demand and\n // the fetch cache entry is stale we should still de-dupe the\n // origin hit if it's a cache-able entry\n if (cacheKey && isForegroundRevalidate) {\n const pendingRevalidateKey = cacheKey;\n workStore.pendingRevalidates ??= {};\n let pendingRevalidate = workStore.pendingRevalidates[pendingRevalidateKey];\n if (pendingRevalidate) {\n const revalidatedResult = await pendingRevalidate;\n return new Response(revalidatedResult.body, {\n headers: revalidatedResult.headers,\n status: revalidatedResult.status,\n statusText: revalidatedResult.statusText\n });\n }\n // We used to just resolve the Response and clone it however for\n // static generation with cacheComponents we need the response to be able to\n // be resolved in a microtask and cloning the response will never have\n // a body that can resolve in a microtask in node (as observed through\n // experimentation) So instead we await the body and then when it is\n // available we construct manually cloned Response objects with the\n // body as an ArrayBuffer. This will be resolvable in a microtask\n // making it compatible with cacheComponents.\n const pendingResponse = doOriginalFetch(true, cacheReasonOverride)// We're cloning the response using this utility because there\n // exists a bug in the undici library around response cloning.\n // See the following pull request for more details:\n // https://github.com/vercel/next.js/pull/73274\n .then(cloneResponse);\n pendingRevalidate = pendingResponse.then(async (responses)=>{\n const response = responses[0];\n return {\n body: await response.arrayBuffer(),\n headers: response.headers,\n status: response.status,\n statusText: response.statusText\n };\n }).finally(()=>{\n var _workStore_pendingRevalidates;\n // If the pending revalidate is not present in the store, then\n // we have nothing to delete.\n if (!((_workStore_pendingRevalidates = workStore.pendingRevalidates) == null ? void 0 : _workStore_pendingRevalidates[pendingRevalidateKey])) {\n return;\n }\n delete workStore.pendingRevalidates[pendingRevalidateKey];\n });\n // Attach the empty catch here so we don't get a \"unhandled promise\n // rejection\" warning\n pendingRevalidate.catch(()=>{});\n workStore.pendingRevalidates[pendingRevalidateKey] = pendingRevalidate;\n return pendingResponse.then((responses)=>responses[1]);\n } else {\n return doOriginalFetch(false, cacheReasonOverride);\n }\n });\n if (cacheSignal) {\n try {\n return await result;\n } finally{\n if (cacheSignal) {\n cacheSignal.endRead();\n }\n }\n }\n return result;\n };\n // Attach the necessary properties to the patched fetch function.\n // We don't use this to determine if the fetch function has been patched,\n // but for external consumers to determine if the fetch function has been\n // patched.\n patched.__nextPatched = true;\n patched.__nextGetStaticStore = ()=>workAsyncStorage;\n patched._nextOriginalFetch = originFetch;\n globalThis[NEXT_PATCH_SYMBOL] = true;\n // Assign the function name also as a name property, so that it's preserved\n // even when mangling is enabled.\n Object.defineProperty(patched, 'name', {\n value: 'fetch',\n writable: false\n });\n return patched;\n}\n// we patch fetch to collect cache information used for\n// determining if a page is static or not\nexport function patchFetch(options) {\n // If we've already patched fetch, we should not patch it again.\n if (isFetchPatched()) return;\n // Grab the original fetch function. We'll attach this so we can use it in\n // the patched fetch function.\n const original = createDedupeFetch(globalThis.fetch);\n // Set the global fetch to the patched fetch.\n globalThis.fetch = createPatchedFetcher(original, options);\n}\nlet currentTimeoutBoundary = null;\nfunction getTimeoutBoundary() {\n if (!currentTimeoutBoundary) {\n currentTimeoutBoundary = new Promise((r)=>{\n setTimeout(()=>{\n currentTimeoutBoundary = null;\n r();\n }, 0);\n });\n }\n return currentTimeoutBoundary;\n}\n\n//# sourceMappingURL=patch-fetch.js.map","import { ensureLeadingSlash } from '../../page-path/ensure-leading-slash';\nimport { isGroupSegment } from '../../segment';\n/**\n * Normalizes an app route so it represents the actual request path. Essentially\n * performing the following transformations:\n *\n * - `/(dashboard)/user/[id]/page` to `/user/[id]`\n * - `/(dashboard)/account/page` to `/account`\n * - `/user/[id]/page` to `/user/[id]`\n * - `/account/page` to `/account`\n * - `/page` to `/`\n * - `/(dashboard)/user/[id]/route` to `/user/[id]`\n * - `/(dashboard)/account/route` to `/account`\n * - `/user/[id]/route` to `/user/[id]`\n * - `/account/route` to `/account`\n * - `/route` to `/`\n * - `/` to `/`\n *\n * @param route the app route to normalize\n * @returns the normalized pathname\n */ export function normalizeAppPath(route) {\n return ensureLeadingSlash(route.split('/').reduce((pathname, segment, index, segments)=>{\n // Empty segments are ignored.\n if (!segment) {\n return pathname;\n }\n // Groups are ignored.\n if (isGroupSegment(segment)) {\n return pathname;\n }\n // Parallel segments are ignored.\n if (segment[0] === '@') {\n return pathname;\n }\n // The last segment (if it's a leaf) should be ignored.\n if ((segment === 'page' || segment === 'route') && index === segments.length - 1) {\n return pathname;\n }\n return `${pathname}/${segment}`;\n }, ''));\n}\n/**\n * Comparator for sorting app paths so that parallel slot paths (containing\n * `/@`) come before the children/root page path. This keeps the direct\n * children/root page last so it can be selected as the canonical entry.\n *\n * Without this, route group prefixes like `(group)` (char code 0x28) sort\n * before `@` (0x40), causing the children page to sort first instead of last\n * and leading to a manifest mismatch / 404 in webpack dev mode.\n */ export function compareAppPaths(a, b) {\n const aHasSlot = a.includes('/@');\n const bHasSlot = b.includes('/@');\n if (aHasSlot && !bHasSlot) return -1;\n if (!aHasSlot && bHasSlot) return 1;\n return a.localeCompare(b);\n}\nfunction normalizeAppPageEntryPathname(appPath) {\n // Webpack app entries preserve escaped underscore segments as `%5F`, while\n // normalized request pathnames expose the decoded `_` segment.\n return normalizeAppPath(appPath).replace(/%5F/g, '_');\n}\n/**\n * Selects the app path that owns the compiled entry for a normalized route.\n * Catch-all normalization can add app paths from other routes, so only direct\n * paths are candidates. Among those, compareAppPaths deterministically prefers\n * the children/root page, or a stable slot when the route only has slots.\n */ export function selectAppPageEntry(pathname, appPaths, normalizePathname = normalizeAppPageEntryPathname) {\n let entry;\n for (const appPath of appPaths){\n if (normalizePathname(appPath) !== pathname) continue;\n if (entry === undefined || compareAppPaths(entry, appPath) < 0) {\n entry = appPath;\n }\n }\n if (entry === undefined) {\n throw new Error(`Invariant: no direct app page entry found for ${pathname}`);\n }\n return entry;\n}\n/**\n * Strips the `.rsc` extension if it's in the pathname.\n * Since this function is used on full urls it checks `?` for searchParams handling.\n */ export function normalizeRscURL(url) {\n return url.replace(/\\.rsc($|\\?)/, // $1 ensures `?` is preserved\n '$1');\n}\n\n//# sourceMappingURL=app-paths.js.map","export const METADATA_BOUNDARY_NAME = '__next_metadata_boundary__'\nexport const VIEWPORT_BOUNDARY_NAME = '__next_viewport_boundary__'\nexport const OUTLET_BOUNDARY_NAME = '__next_outlet_boundary__'\nexport const ROOT_LAYOUT_BOUNDARY_NAME = '__next_root_layout_boundary__'\n","export type ScheduledFn<T = void> = () => T | PromiseLike<T>\nexport type SchedulerFn<T = void> = (cb: ScheduledFn<T>) => void\n\n/**\n * Schedules a function to be called on the next tick after the other promises\n * have been resolved.\n *\n * @param cb the function to schedule\n */\nexport const scheduleOnNextTick = (cb: ScheduledFn<void>) => {\n // We use Promise.resolve().then() here so that the operation is scheduled at\n // the end of the promise job queue, we then add it to the next process tick\n // to ensure it's evaluated afterwards.\n //\n // This was inspired by the implementation of the DataLoader interface: https://github.com/graphql/dataloader/blob/d336bd15282664e0be4b4a657cb796f09bafbc6b/src/index.js#L213-L255\n //\n Promise.resolve().then(() => {\n if (process.env.NEXT_RUNTIME === 'edge') {\n setTimeout(cb, 0)\n } else {\n process.nextTick(cb)\n }\n })\n}\n\n/**\n * Schedules a function to be called using `setImmediate` or `setTimeout` if\n * `setImmediate` is not available (like in the Edge runtime).\n *\n * @param cb the function to schedule\n */\nexport const scheduleImmediate = (cb: ScheduledFn<void>): void => {\n if (process.env.NEXT_RUNTIME === 'edge') {\n setTimeout(cb, 0)\n } else {\n setImmediate(cb)\n }\n}\n\n/**\n * returns a promise than resolves in a future task. There is no guarantee that the task it resolves in\n * will be the next task but if you await it you can at least be sure that the current task is over and\n * most usefully that the entire microtask queue of the current task has been emptied.\n */\nexport function atLeastOneTask() {\n return new Promise<void>((resolve) => scheduleImmediate(resolve))\n}\n\n/**\n * This utility function is extracted to make it easier to find places where we are doing\n * specific timing tricks to try to schedule work after React has rendered. This is especially\n * important at the moment because Next.js uses the edge builds of React which use setTimeout to\n * schedule work when you might expect that something like setImmediate would do the trick.\n *\n * Long term we should switch to the node versions of React rendering when possible and then\n * update this to use setImmediate rather than setTimeout\n */\nexport function waitAtLeastOneReactRenderTask(): Promise<void> {\n if (process.env.NEXT_RUNTIME === 'edge') {\n return new Promise((r) => setTimeout(r, 0))\n } else {\n return new Promise((r) => setImmediate(r))\n }\n}\n","export function createRuntimeBodyError(route: string): Error {\n return new Error(\n `Route \"${route}\": Next.js encountered runtime data during prerendering.\\n\\n` +\n `\\`cookies()\\`, \\`headers()\\`, \\`params\\`, or \\`searchParams\\` accessed outside of \\`<Suspense>\\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience.\\n\\n` +\n `Ways to fix this:\\n` +\n ` - [stream] Provide a placeholder with \\`<Suspense fallback={...}>\\` around the data access\\n` +\n ` - [block] Set \\`export const instant = false\\` to allow a blocking route\\n\\n` +\n `Learn more: https://nextjs.org/docs/messages/blocking-prerender-runtime`\n )\n}\n\nexport function createDynamicBodyError(route: string): Error {\n return new Error(\n `Route \"${route}\": Next.js encountered uncached data during prerendering.\\n\\n` +\n `\\`fetch(...)\\` or \\`connection()\\` accessed outside of \\`<Suspense>\\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience.\\n\\n` +\n `Ways to fix this:\\n` +\n ` - [stream] Provide a placeholder with \\`<Suspense fallback={...}>\\` around the data access\\n` +\n ` - [cache] Cache the data access with \\`\"use cache\"\\` (does not apply to \\`connection()\\`)\\n` +\n ` - [block] Set \\`export const instant = false\\` to allow a blocking route\\n\\n` +\n `Learn more: https://nextjs.org/docs/messages/blocking-prerender-dynamic`\n )\n}\n\nexport function createRuntimeBodyErrorInNavigation(route: string): Error {\n return new Error(\n `Route \"${route}\": Next.js encountered runtime data during prerendering or a navigation.\\n\\n` +\n `\\`cookies()\\`, \\`headers()\\`, \\`params\\`, or \\`searchParams\\` accessed outside of \\`<Suspense>\\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience.\\n\\n` +\n `Ways to fix this:\\n` +\n ` - [stream] Provide a placeholder with \\`<Suspense fallback={...}>\\` around the data access\\n` +\n ` - [block] Set \\`export const instant = false\\` to allow a blocking route\\n\\n` +\n `Learn more: https://nextjs.org/docs/messages/blocking-prerender-runtime`\n )\n}\n\nexport function createLinkBodyErrorInNavigation(route: string): Error {\n return new Error(\n `Route \"${route}\": Next.js encountered URL data during prerendering or a navigation.\\n\\n` +\n `\\`params\\` or \\`searchParams\\` accessed outside of \\`<Suspense>\\` may prevent the navigation from being instant, leading to a slower user experience.\\n\\n` +\n `Ways to fix this:\\n` +\n ` - [stream] Provide a placeholder with \\`<Suspense fallback={...}>\\` around the data access\\n` +\n ` - [block] Set \\`export const instant = false\\` to allow a blocking route\\n\\n` +\n `Learn more: https://nextjs.org/docs/messages/instant-shell-url-data`\n )\n}\n\nexport function createNavigationBodyErrorInNavigation(route: string): Error {\n return new Error(\n `Route \"${route}\": Next.js encountered \\`navigation()\\` during prerendering or a navigation.\\n\\n` +\n `\\`navigation()\\` called outside of \\`<Suspense>\\` may prevent the navigation from being instant, leading to a slower user experience.\\n\\n` +\n `Ways to fix this:\\n` +\n ` - [stream] Provide a placeholder with \\`<Suspense fallback={...}>\\` around the component that calls \\`navigation()\\`\\n` +\n ` - [block] Set \\`export const instant = false\\` to allow a blocking route\\n\\n` +\n `Learn more: https://nextjs.org/docs/messages/instant-navigation-stage`\n )\n}\n\nexport function createPrefetchBodyErrorInNavigation(route: string): Error {\n return new Error(\n `Route \"${route}\": Next.js encountered \\`prefetch()\\` during prerendering or a navigation.\\n\\n` +\n `\\`prefetch()\\` called outside of \\`<Suspense>\\` may prevent the navigation from being instant, leading to a slower user experience.\\n\\n` +\n `Ways to fix this:\\n` +\n ` - [stream] Provide a placeholder with \\`<Suspense fallback={...}>\\` around the component that calls \\`prefetch()\\`\\n` +\n ` - [block] Set \\`export const instant = false\\` to allow a blocking route\\n\\n` +\n `Learn more: https://nextjs.org/docs/messages/instant-navigation-stage`\n )\n}\n\nexport function createDynamicBodyErrorInNavigation(route: string): Error {\n return new Error(\n `Route \"${route}\": Next.js encountered uncached data during prerendering or a navigation.\\n\\n` +\n `\\`fetch(...)\\` or \\`connection()\\` accessed outside of \\`<Suspense>\\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience.\\n\\n` +\n `Ways to fix this:\\n` +\n ` - [stream] Provide a placeholder with \\`<Suspense fallback={...}>\\` around the data access\\n` +\n ` - [cache] Cache the data access with \\`\"use cache\"\\` (does not apply to \\`connection()\\`)\\n` +\n ` - [block] Set \\`export const instant = false\\` to allow a blocking route\\n\\n` +\n `Learn more: https://nextjs.org/docs/messages/blocking-prerender-dynamic`\n )\n}\n\n/**\n * NOTE: Prefer `createRuntimeBodyError` or `createDynamicBodyError`.\n * Only use this in situations like build-time static validation, where\n * we can't pinpoint a more specific reason.\n */\nexport function createDynamicOrRuntimeBodyError(route: string): Error {\n return new Error(\n `Route \"${route}\": Next.js encountered uncached or runtime data during prerendering.\\n\\n` +\n `\\`fetch(...)\\`, \\`cookies()\\`, \\`headers()\\`, \\`params\\`, \\`searchParams\\`, or \\`connection()\\` accessed outside of \\`<Suspense>\\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience.\\n\\n` +\n `Ways to fix this:\\n` +\n ` - [stream] Provide a placeholder with \\`<Suspense fallback={...}>\\` around the data access\\n` +\n ` - [cache] For uncached data (\\`fetch\\`, database calls): cache the access with \\`\"use cache\"\\` (does not apply to \\`connection()\\`)\\n` +\n ` - [block] Set \\`export const instant = false\\` to allow a blocking route\\n\\n` +\n `Learn more: https://nextjs.org/docs/messages/blocking-prerender-dynamic`\n )\n}\n\nexport function createLinkMetadataError(route: string): Error {\n return new Error(\n `Route \"${route}\": Next.js encountered URL data in \\`generateMetadata()\\`.\\n\\n` +\n `This route's metadata is blocked, but the rest of its content can be prefetched. \\`params\\` or \\`searchParams\\` accessed in \\`generateMetadata()\\` prevent it from being prefetched.\\n\\n` +\n `Ways to fix this:\\n` +\n ` - [static] Use a static metadata export instead of \\`generateMetadata()\\`\\n` +\n ` - [dynamic] Render a marker component that calls \\`await connection()\\` inside \\`<Suspense>\\` on the page\\n\\n` +\n `Learn more: https://nextjs.org/docs/messages/blocking-prerender-metadata-runtime`\n )\n}\n\nexport function createRuntimeMetadataError(route: string): Error {\n return new Error(\n `Route \"${route}\": Next.js encountered runtime data in \\`generateMetadata()\\`.\\n\\n` +\n `This route's metadata is blocked, but the rest of its content can be prerendered. \\`cookies()\\`, \\`headers()\\`, \\`params\\`, or \\`searchParams\\` accessed in \\`generateMetadata()\\` cause it to run dynamically.\\n\\n` +\n `Ways to fix this:\\n` +\n ` - [static] Use a static metadata export instead of \\`generateMetadata()\\`\\n` +\n ` - [dynamic] Render a marker component that calls \\`await connection()\\` inside \\`<Suspense>\\` on the page\\n\\n` +\n `Learn more: https://nextjs.org/docs/messages/blocking-prerender-metadata-runtime`\n )\n}\n\nexport function createNavigationMetadataError(route: string): Error {\n return new Error(\n `Route \"${route}\": Next.js encountered \\`navigation()\\` in \\`generateMetadata()\\`.\\n\\n` +\n `Metadata can already stream without blocking the route's UI, so delaying it until navigation may be unintentional.\\n\\n` +\n `Ways to fix this:\\n` +\n ` - [remove] Remove \\`navigation()\\` from \\`generateMetadata()\\`\\n` +\n ` - [mark] Render a marker component that calls \\`await navigation()\\` inside \\`<Suspense>\\` on the page\\n\\n` +\n `Learn more: https://nextjs.org/docs/messages/instant-navigation-stage-metadata`\n )\n}\n\nexport function createPrefetchMetadataError(route: string): Error {\n return new Error(\n `Route \"${route}\": Next.js encountered \\`prefetch()\\` in \\`generateMetadata()\\`.\\n\\n` +\n `Metadata can already stream without blocking the route's UI, so delaying it until a per-link prefetch or navigation may be unintentional.\\n\\n` +\n `Ways to fix this:\\n` +\n ` - [remove] Remove \\`prefetch()\\` from \\`generateMetadata()\\`\\n` +\n ` - [mark] Render a marker component that calls \\`await prefetch()\\` inside \\`<Suspense>\\` on the page\\n\\n` +\n `Learn more: https://nextjs.org/docs/messages/instant-navigation-stage-metadata`\n )\n}\n\nexport function createDynamicMetadataError(route: string): Error {\n return new Error(\n `Route \"${route}\": Next.js encountered uncached data in \\`generateMetadata()\\`.\\n\\n` +\n `This route's metadata is blocked, but the rest of its content can be prerendered. \\`fetch(...)\\` or \\`connection()\\` accessed in \\`generateMetadata()\\` cause it to run dynamically.\\n\\n` +\n `Ways to fix this:\\n` +\n ` - [cache] Cache the metadata with \\`\"use cache\"\\` in \\`generateMetadata()\\` (does not apply to \\`connection()\\`)\\n` +\n ` - [dynamic] Render a marker component that calls \\`await connection()\\` inside \\`<Suspense>\\` on the page\\n\\n` +\n `Learn more: https://nextjs.org/docs/messages/blocking-prerender-metadata-dynamic`\n )\n}\n\nexport function createLinkViewportError(route: string): Error {\n return new Error(\n `Route \"${route}\": Next.js encountered URL data in \\`generateViewport()\\`.\\n\\n` +\n `\\`params\\` or \\`searchParams\\` in \\`generateViewport()\\` prevents the page from being prerendered, leading to a slower user experience.\\n\\n` +\n `Ways to fix this:\\n` +\n ` - [static] Use a static viewport export instead of \\`generateViewport()\\`\\n` +\n ` - [block] Set \\`export const instant = false\\` to allow a blocking route\\n\\n` +\n `Learn more: https://nextjs.org/docs/messages/blocking-prerender-viewport-runtime`\n )\n}\n\nexport function createRuntimeViewportError(route: string): Error {\n return new Error(\n `Route \"${route}\": Next.js encountered runtime data in \\`generateViewport()\\`.\\n\\n` +\n `\\`cookies()\\`, \\`headers()\\`, \\`params\\`, or \\`searchParams\\` in \\`generateViewport()\\` prevents the page from being prerendered, leading to a slower user experience.\\n\\n` +\n `Ways to fix this:\\n` +\n ` - [static] Use a static viewport export instead of \\`generateViewport()\\`\\n` +\n ` - [block] Set \\`export const instant = false\\` to allow a blocking route\\n\\n` +\n `Learn more: https://nextjs.org/docs/messages/blocking-prerender-viewport-runtime`\n )\n}\n\nexport function createNavigationViewportError(route: string): Error {\n return new Error(\n `Route \"${route}\": Next.js encountered \\`navigation()\\` in \\`generateViewport()\\`.\\n\\n` +\n `This prevents Next.js from creating the App Shell, leading to a slower user experience.\\n\\n` +\n `Ways to fix this:\\n` +\n ` - [remove] Remove \\`navigation()\\` from \\`generateViewport()\\`\\n` +\n ` - [ignore] Set \\`export const instant = false\\` to disable validation for this segment\\n\\n` +\n `Learn more: https://nextjs.org/docs/messages/instant-navigation-stage-viewport`\n )\n}\n\nexport function createPrefetchViewportError(route: string): Error {\n return new Error(\n `Route \"${route}\": Next.js encountered \\`prefetch()\\` in \\`generateViewport()\\`.\\n\\n` +\n `This prevents Next.js from creating the App Shell, leading to a slower user experience.\\n\\n` +\n `Ways to fix this:\\n` +\n ` - [remove] Remove \\`prefetch()\\` from \\`generateViewport()\\`\\n` +\n ` - [ignore] Set \\`export const instant = false\\` to disable validation for this segment\\n\\n` +\n `Learn more: https://nextjs.org/docs/messages/instant-navigation-stage-viewport`\n )\n}\n\nexport function createDynamicViewportError(route: string): Error {\n return new Error(\n `Route \"${route}\": Next.js encountered uncached data in \\`generateViewport()\\`.\\n\\n` +\n `\\`fetch(...)\\` or \\`connection()\\` in \\`generateViewport()\\` prevents the page from being prerendered, leading to a slower user experience.\\n\\n` +\n `Ways to fix this:\\n` +\n ` - [cache] Cache the viewport data with \\`\"use cache\"\\` in \\`generateViewport()\\` (does not apply to \\`connection()\\`)\\n` +\n ` - [block] Set \\`export const instant = false\\` to allow a blocking route\\n\\n` +\n `Learn more: https://nextjs.org/docs/messages/blocking-prerender-viewport-dynamic`\n )\n}\n\n/**\n * NOTE: Prefer `createRuntimeViewportError` or `createDynamicViewportError`.\n * Only use this in situations like build-time static validation, where\n * we can't pinpoint a more specific reason.\n */\nexport function createDynamicOrRuntimeViewportError(route: string): Error {\n return new Error(\n `Route \"${route}\": Next.js encountered uncached or runtime data in \\`generateViewport()\\`.\\n\\n` +\n `This prevents the page from being prerendered, leading to a slower user experience. Unlike metadata, viewport cannot be streamed behind \\`<Suspense>\\` because it affects the initial page load.\\n\\n` +\n `Ways to fix this:\\n` +\n ` - [static] Use a static viewport export instead of \\`generateViewport()\\`\\n` +\n ` - [cache] For uncached data (\\`fetch\\`, database calls): cache the viewport with \\`\"use cache\"\\` in \\`generateViewport()\\` (does not apply to \\`connection()\\`)\\n` +\n ` - [block] Set \\`export const instant = false\\` to allow a blocking route\\n\\n` +\n `Learn more: https://nextjs.org/docs/messages/blocking-prerender-viewport-runtime`\n )\n}\n\n/**\n * NOTE: Prefer `createRuntimeMetadataError` or `createDynamicMetadataError`.\n * Only use this in situations like build-time static validation, where\n * we can't pinpoint a more specific reason.\n */\nexport function createDynamicOrRuntimeMetadataError(route: string): Error {\n return new Error(\n `Route \"${route}\": Next.js encountered uncached or runtime data in \\`generateMetadata()\\`.\\n\\n` +\n `This route's metadata is blocked, but the rest of its content can be prerendered.\\n\\n` +\n `Ways to fix this:\\n` +\n ` - [static] Use a static metadata export instead of \\`generateMetadata()\\`\\n` +\n ` - [cache] Cache the metadata with \\`\"use cache\"\\` in \\`generateMetadata()\\` (does not apply to \\`connection()\\`)\\n` +\n ` - [dynamic] Render a marker component that calls \\`await connection()\\` inside \\`<Suspense>\\` on the page\\n\\n` +\n `Learn more: https://nextjs.org/docs/messages/blocking-prerender-metadata-runtime`\n )\n}\n\n//====================================================\n// Static routes (with `ensureStatic = \"navigation\"`)\n//====================================================\n\nexport function createRuntimeBodyErrorInStaticRoute(route: string): Error {\n return new Error(\n `Route \"${route}\": Next.js encountered runtime data on a route that must be fully static.\\n\\n` +\n `This route is configured to be fully static, but runtime data from \\`cookies()\\`, \\`headers()\\`, \\`params\\`, \\`searchParams\\`, or a short-lived cache requires rendering at request time.\\n\\n` +\n `Ways to fix this:\\n` +\n ` - [remove] Remove the data access\\n` +\n ` - [client] Read the data on the client\\n\\n` +\n `Learn more: https://nextjs.org/docs/messages/static-route-runtime`\n )\n}\n\nexport function createDynamicBodyErrorInStaticRoute(route: string): Error {\n return new Error(\n `Route \"${route}\": Next.js encountered uncached data on a route that must be fully static.\\n\\n` +\n `This route is configured to be fully static, but an uncached \\`fetch(...)\\`, database call, or \\`connection()\\` requires rendering at request time.\\n\\n` +\n `Ways to fix this:\\n` +\n ` - [cache] Cache the data access with \\`\"use cache\"\\` (does not apply to \\`connection()\\`)\\n` +\n ` - [remove] Remove the data access\\n` +\n ` - [client] Read the data on the client\\n\\n` +\n `Learn more: https://nextjs.org/docs/messages/static-route-dynamic`\n )\n}\n\nexport function createNonPrerenderableBodyErrorInStaticRoute(\n route: string\n): Error {\n return new Error(\n `Route \"${route}\": Next.js encountered uncached or runtime data on a route that must be fully static.\\n\\n` +\n `This route is configured to be fully static, but some data requires rendering at request time.\\n\\n` +\n `Ways to fix this:\\n` +\n ` - [cache] For uncached data (\\`fetch\\`, database calls): cache the access with \\`\"use cache\"\\` (does not apply to \\`connection()\\`)\\n` +\n ` - [remove] Remove the data access\\n` +\n ` - [client] Read the data on the client\\n\\n` +\n `Learn more: https://nextjs.org/docs/messages/static-route-dynamic`\n )\n}\n\nexport function createRuntimeMetadataErrorInStaticRoute(route: string): Error {\n return new Error(\n `Route \"${route}\": Next.js encountered runtime data in \\`generateMetadata()\\` on a route that must be fully static.\\n\\n` +\n `This route is configured to be fully static, but runtime data from \\`cookies()\\`, \\`headers()\\`, \\`params\\`, \\`searchParams\\`, or a short-lived cache requires rendering at request time.\\n\\n` +\n `Ways to fix this:\\n` +\n ` - [static] Replace the dynamic data used by \\`generateMetadata()\\` with static data\\n\\n` +\n `Learn more: https://nextjs.org/docs/messages/static-metadata-runtime`\n )\n}\n\nexport function createDynamicMetadataErrorInStaticRoute(route: string): Error {\n return new Error(\n `Route \"${route}\": Next.js encountered uncached data in \\`generateMetadata()\\` on a route that must be fully static.\\n\\n` +\n `This route is configured to be fully static, but an uncached \\`fetch(...)\\`, database call, or \\`connection()\\` requires rendering at request time.\\n\\n` +\n `Ways to fix this:\\n` +\n ` - [cache] Cache the data used by \\`generateMetadata()\\` with \\`\"use cache\"\\` (does not apply to \\`connection()\\`)\\n` +\n ` - [static] Replace the dynamic data used by \\`generateMetadata()\\` with static data\\n\\n` +\n `Learn more: https://nextjs.org/docs/messages/static-metadata-dynamic`\n )\n}\n\nexport function createNonPrerenderableMetadataErrorInStaticRoute(\n route: string\n): Error {\n return new Error(\n `Route \"${route}\": Next.js encountered uncached or runtime data in \\`generateMetadata()\\` on a route that must be fully static.\\n\\n` +\n `This route is configured to be fully static, but some data requires rendering at request time.\\n\\n` +\n `Ways to fix this:\\n` +\n ` - [cache] For uncached data: cache the data used by \\`generateMetadata()\\` with \\`\"use cache\"\\` (does not apply to \\`connection()\\`)\\n` +\n ` - [static] Replace the dynamic data used by \\`generateMetadata()\\` with static data\\n\\n` +\n `Learn more: https://nextjs.org/docs/messages/static-metadata-dynamic`\n )\n}\n\nexport function createRuntimeViewportErrorInStaticRoute(route: string): Error {\n return new Error(\n `Route \"${route}\": Next.js encountered runtime data in \\`generateViewport()\\` on a route that must be fully static.\\n\\n` +\n `This route is configured to be fully static, but runtime data from \\`cookies()\\`, \\`headers()\\`, \\`params\\`, \\`searchParams\\`, or a short-lived cache requires rendering at request time.\\n\\n` +\n `Ways to fix this:\\n` +\n ` - [static] Replace the dynamic data used by \\`generateViewport()\\` with static data\\n\\n` +\n `Learn more: https://nextjs.org/docs/messages/static-viewport-runtime`\n )\n}\n\nexport function createDynamicViewportErrorInStaticRoute(route: string): Error {\n return new Error(\n `Route \"${route}\": Next.js encountered uncached data in \\`generateViewport()\\` on a route that must be fully static.\\n\\n` +\n `This route is configured to be fully static, but an uncached \\`fetch(...)\\`, database call, or \\`connection()\\` requires rendering at request time.\\n\\n` +\n `Ways to fix this:\\n` +\n ` - [cache] Cache the data used by \\`generateViewport()\\` with \\`\"use cache\"\\` (does not apply to \\`connection()\\`)\\n` +\n ` - [static] Replace the dynamic data used by \\`generateViewport()\\` with static data\\n\\n` +\n `Learn more: https://nextjs.org/docs/messages/static-viewport-dynamic`\n )\n}\n\nexport function createNonPrerenderableViewportErrorInStaticRoute(\n route: string\n): Error {\n return new Error(\n `Route \"${route}\": Next.js encountered uncached or runtime data in \\`generateViewport()\\` on a route that must be fully static.\\n\\n` +\n `This route is configured to be fully static, but some data requires rendering at request time.\\n\\n` +\n `Ways to fix this:\\n` +\n ` - [cache] For uncached data: cache the data used by \\`generateViewport()\\` with \\`\"use cache\"\\` (does not apply to \\`connection()\\`)\\n` +\n ` - [static] Replace the dynamic data used by \\`generateViewport()\\` with static data\\n\\n` +\n `Learn more: https://nextjs.org/docs/messages/static-viewport-dynamic`\n )\n}\n\nexport function logBuildDebugHint(route: string): void {\n if (process.env.NODE_ENV !== 'development') {\n console.error(\n `To get a more detailed stack trace and pinpoint the issue, try one of the following:\\n` +\n ` - Start the app in development mode by running \\`next dev\\`, then open \"${route}\" in your browser to investigate the error.\\n` +\n ` - Rerun the production build with \\`next build --debug-prerender\\` to generate better stack traces.`\n )\n } else if (!process.env.__NEXT_DEV_SERVER) {\n console.error(\n `To debug the issue, start the app in development mode by running \\`next dev\\`, then open \"${route}\" in your browser to investigate the error.`\n )\n }\n}\n","/**\n * The functions provided by this module are used to communicate certain properties\n * about the currently running code so that Next.js can make decisions on how to handle\n * the current execution in different rendering modes such as pre-rendering, resuming, and SSR.\n *\n * Today Next.js treats all code as potentially static. Certain APIs may only make sense when dynamically rendering.\n * Traditionally this meant deopting the entire render to dynamic however with PPR we can now deopt parts\n * of a React tree as dynamic while still keeping other parts static. There are really two different kinds of\n * Dynamic indications.\n *\n * The first is simply an intention to be dynamic. unstable_noStore is an example of this where\n * the currently executing code simply declares that the current scope is dynamic but if you use it\n * inside unstable_cache it can still be cached. This type of indication can be removed if we ever\n * make the default dynamic to begin with because the only way you would ever be static is inside\n * a cache scope which this indication does not affect.\n *\n * The second is an indication that a dynamic data source was read. This is a stronger form of dynamic\n * because it means that it is inappropriate to cache this at all. using a dynamic data source inside\n * unstable_cache should error. If you want to use some dynamic data inside unstable_cache you should\n * read that data outside the cache and pass it in as an argument to the cached function.\n */\n\nimport type { WorkStore } from './work-async-storage.external'\nimport type {\n RequestStore,\n WorkUnitStore,\n PrerenderStoreLegacy,\n PrerenderStoreModern,\n ValidationStoreClient,\n PrerenderStoreModernServer,\n} from './work-unit-async-storage.external'\n\n// Once postpone is in stable we should switch to importing the postpone export directly\nimport React from 'react'\n\nimport { DynamicServerError } from '../../client/components/hooks-server-context'\nimport { StaticGenBailoutError } from '../../client/components/static-generation-bailout'\nimport { getStagedRenderingController } from './work-unit-async-storage.external'\nimport { isClientHookDynamicError } from '../dynamic-rendering-utils'\nimport {\n METADATA_BOUNDARY_NAME,\n VIEWPORT_BOUNDARY_NAME,\n OUTLET_BOUNDARY_NAME,\n ROOT_LAYOUT_BOUNDARY_NAME,\n} from '../../lib/framework/boundary-constants'\nimport { scheduleOnNextTick } from '../../lib/scheduler'\nimport {\n createRuntimeBodyError,\n createDynamicBodyError,\n createRuntimeBodyErrorInNavigation,\n createNavigationBodyErrorInNavigation,\n createPrefetchBodyErrorInNavigation,\n createDynamicBodyErrorInNavigation,\n createDynamicOrRuntimeBodyError,\n createRuntimeMetadataError,\n createDynamicMetadataError,\n createRuntimeViewportError,\n createNavigationViewportError,\n createPrefetchViewportError,\n createDynamicViewportError,\n createDynamicOrRuntimeViewportError,\n createDynamicOrRuntimeMetadataError,\n logBuildDebugHint,\n createLinkBodyErrorInNavigation,\n createLinkMetadataError,\n createLinkViewportError,\n createNavigationMetadataError,\n createPrefetchMetadataError,\n createNonPrerenderableMetadataErrorInStaticRoute,\n createNonPrerenderableViewportErrorInStaticRoute,\n createNonPrerenderableBodyErrorInStaticRoute,\n createRuntimeBodyErrorInStaticRoute,\n createDynamicBodyErrorInStaticRoute,\n createRuntimeMetadataErrorInStaticRoute,\n createDynamicMetadataErrorInStaticRoute,\n createRuntimeViewportErrorInStaticRoute,\n createDynamicViewportErrorInStaticRoute,\n} from './blocking-route-messages'\nimport { InvariantError } from '../../shared/lib/invariant-error'\nimport {\n INSTANT_VALIDATION_BOUNDARY_NAME,\n INSTANT_SLOT_MARKER_PREFIX,\n INSTANT_SLOT_MARKER_SUFFIX,\n} from './instant-validation/boundary-constants'\nimport {\n type ValidationBoundaryTracking,\n allRequiredBoundariesRendered,\n} from './instant-validation/boundary-tracking'\nimport type { InstantValidationSampleTracking } from './instant-validation/instant-samples'\nimport { createUnrenderedSegmentError } from '../../shared/lib/instant-messages'\nimport { getReactBrowserBailoutReason } from '../../shared/lib/lazy-dynamic/react-browser-bailout'\n\nexport type DynamicAccess = {\n /**\n * If debugging, this will contain the stack trace of where the dynamic access\n * occurred. This is used to provide more information to the user about why\n * their page is being rendered dynamically.\n */\n stack?: string\n\n /**\n * The expression that was accessed dynamically.\n */\n expression: string\n}\n\n// Stores dynamic reasons used during an RSC render.\nexport type DynamicTrackingState = {\n /**\n * When true, stack information will also be tracked during dynamic access.\n */\n readonly isDebugDynamicAccesses: boolean | undefined\n\n /**\n * The dynamic accesses that occurred during the render.\n */\n readonly dynamicAccesses: Array<DynamicAccess>\n\n syncDynamicErrorWithStack: null | Error\n syncDynamicErrorWithStackPostMicrotask: boolean\n}\n\n// Stores dynamic reasons used during an SSR render.\nexport type DynamicValidationState = {\n hasSuspenseAboveBody: boolean\n hasDynamicMetadata: boolean\n dynamicMetadata: null | Error\n hasDynamicViewport: boolean\n hasAllowedDynamic: boolean\n dynamicErrors: Array<Error>\n}\n\nexport function createDynamicTrackingState(\n isDebugDynamicAccesses: boolean | undefined\n): DynamicTrackingState {\n return {\n isDebugDynamicAccesses,\n dynamicAccesses: [],\n syncDynamicErrorWithStack: null,\n syncDynamicErrorWithStackPostMicrotask: false,\n }\n}\n\nexport function createDynamicValidationState(): DynamicValidationState {\n return {\n hasSuspenseAboveBody: false,\n hasDynamicMetadata: false,\n dynamicMetadata: null,\n hasDynamicViewport: false,\n hasAllowedDynamic: false,\n dynamicErrors: [],\n }\n}\n\nfunction getPendingClientSyncDynamicError(\n clientDynamic: DynamicTrackingState\n): null | Error {\n return clientDynamic.syncDynamicErrorWithStackPostMicrotask\n ? null\n : clientDynamic.syncDynamicErrorWithStack\n}\n\nexport function getFirstDynamicReason(\n trackingState: DynamicTrackingState\n): undefined | string {\n return trackingState.dynamicAccesses[0]?.expression\n}\n\n/**\n * This function communicates that the current scope should be treated as dynamic.\n *\n * In most cases this function is a no-op but if called during\n * a PPR prerender it will postpone the current sub-tree and calling\n * it during a normal prerender will cause the entire prerender to abort\n */\nexport function markCurrentScopeAsDynamic(\n store: WorkStore,\n workUnitStore: undefined | Exclude<WorkUnitStore, PrerenderStoreModern>,\n expression: string\n): void {\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'cache':\n case 'unstable-cache':\n // Inside cache scopes, marking a scope as dynamic has no effect,\n // because the outer cache scope creates a cache boundary. This is\n // subtly different from reading a dynamic data source, which is\n // forbidden inside a cache scope.\n return\n case 'private-cache':\n // A private cache scope is already dynamic by definition.\n return\n case 'prerender-legacy':\n case 'request':\n case 'build-time-generator':\n break\n default:\n workUnitStore satisfies never\n }\n }\n\n // If we're forcing dynamic rendering or we're forcing static rendering, we\n // don't need to do anything here because the entire page is already dynamic\n // or it's static and it should not throw or postpone here.\n if (store.forceDynamic || store.forceStatic) return\n\n if (store.dynamicShouldError) {\n throw new StaticGenBailoutError(\n `Route ${store.route} with \\`dynamic = \"error\"\\` couldn't be rendered statically because it used \\`${expression}\\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`\n )\n }\n\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'prerender-legacy':\n workUnitStore.revalidate = 0\n\n // We aren't prerendering, but we are generating a static page. We need\n // to bail out of static generation.\n const err = new DynamicServerError(\n `Route ${store.route} couldn't be rendered statically because it used ${expression}. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`\n )\n store.dynamicUsageDescription = expression\n store.dynamicUsageStack = err.stack\n\n throw err\n case 'request':\n markRequestStoreAsDynamic(workUnitStore)\n break\n case 'build-time-generator':\n break\n default:\n workUnitStore satisfies never\n }\n }\n}\n\n/**\n * This function is meant to be used when prerendering without cacheComponents or PPR.\n * When called during a build it will cause Next.js to consider the route as dynamic.\n *\n * @internal\n */\nexport function throwToInterruptStaticGeneration(\n expression: string,\n store: WorkStore,\n prerenderStore: PrerenderStoreLegacy\n): never {\n // We aren't prerendering but we are generating a static page. We need to bail out of static generation\n const err = new DynamicServerError(\n `Route ${store.route} couldn't be rendered statically because it used \\`${expression}\\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`\n )\n\n prerenderStore.revalidate = 0\n\n store.dynamicUsageDescription = expression\n store.dynamicUsageStack = err.stack\n\n throw err\n}\n\n/**\n * This function should be used to track whether something dynamic happened even when\n * we are in a dynamic render. This is useful for Dev where all renders are dynamic but\n * we still track whether dynamic APIs were accessed for helpful messaging\n *\n * @internal\n */\nexport function trackDynamicDataInDynamicRender(workUnitStore: WorkUnitStore) {\n switch (workUnitStore.type) {\n case 'cache':\n case 'unstable-cache':\n // Inside cache scopes, marking a scope as dynamic has no effect,\n // because the outer cache scope creates a cache boundary. This is\n // subtly different from reading a dynamic data source, which is\n // forbidden inside a cache scope.\n return\n case 'private-cache':\n // A private cache scope is already dynamic by definition.\n return\n case 'prerender':\n case 'prerender-runtime':\n case 'prerender-legacy':\n case 'prerender-client':\n case 'validation-client':\n case 'build-time-generator':\n break\n case 'request':\n markRequestStoreAsDynamic(workUnitStore)\n break\n default:\n workUnitStore satisfies never\n }\n}\n\nfunction markRequestStoreAsDynamic(requestStore: RequestStore): void {\n if (process.env.__NEXT_DEV_SERVER && requestStore.phase === 'render') {\n requestStore.usedDynamic = true\n }\n}\n\nfunction abortOnSynchronousDynamicDataAccess(\n route: string,\n expression: string,\n prerenderStore: PrerenderStoreModern\n): void {\n const reason = `Route ${route} needs to bail out of prerendering at this point because it used ${expression}.`\n\n const error = createPrerenderInterruptedError(reason)\n\n prerenderStore.controller.abort(error)\n\n const dynamicTracking = prerenderStore.dynamicTracking\n if (dynamicTracking) {\n dynamicTracking.dynamicAccesses.push({\n // When we aren't debugging, we don't need to create another error for the\n // stack trace.\n stack: dynamicTracking.isDebugDynamicAccesses\n ? new Error().stack\n : undefined,\n expression,\n })\n }\n}\n\nexport function abortOnSynchronousPlatformIOAccess(\n route: string,\n expression: string,\n errorWithStack: Error,\n prerenderStore: PrerenderStoreModern\n): void {\n const dynamicTracking = prerenderStore.dynamicTracking\n\n if (dynamicTracking && dynamicTracking.syncDynamicErrorWithStack === null) {\n dynamicTracking.syncDynamicErrorWithStack = errorWithStack\n // React completes the task that is currently rendering before scheduled\n // abort cleanup. Client tracking can attribute the sync IO only during\n // that current task; server tracking keeps the error regardless.\n queueMicrotask(() => {\n dynamicTracking.syncDynamicErrorWithStackPostMicrotask = true\n })\n }\n\n abortOnSynchronousDynamicDataAccess(route, expression, prerenderStore)\n}\n\n/**\n * use this function when prerendering with cacheComponents. If we are doing a\n * prospective prerender we don't actually abort because we want to discover\n * all caches for the shell. If this is the actual prerender we do abort.\n *\n * This function accepts a prerenderStore but the caller should ensure we're\n * actually running in cacheComponents mode.\n *\n * @internal\n */\nexport function abortAndThrowOnSynchronousRequestDataAccess(\n route: string,\n expression: string,\n errorWithStack: Error,\n prerenderStore: PrerenderStoreModern\n): never {\n const prerenderSignal = prerenderStore.controller.signal\n if (prerenderSignal.aborted === false) {\n // TODO it would be better to move this aborted check into the callsite so we can avoid making\n // the error object when it isn't relevant to the aborting of the prerender however\n // since we need the throw semantics regardless of whether we abort it is easier to land\n // this way. See how this was handled with `abortOnSynchronousPlatformIOAccess` for a closer\n // to ideal implementation\n abortOnSynchronousDynamicDataAccess(route, expression, prerenderStore)\n // Preserve the exact server-side dynamic access for final validation after\n // interrupting this render.\n const dynamicTracking = prerenderStore.dynamicTracking\n if (dynamicTracking) {\n if (dynamicTracking.syncDynamicErrorWithStack === null) {\n dynamicTracking.syncDynamicErrorWithStack = errorWithStack\n }\n }\n }\n throw createPrerenderInterruptedError(\n `Route ${route} needs to bail out of prerendering at this point because it used ${expression}.`\n )\n}\n\nconst NEXT_PRERENDER_INTERRUPTED = 'NEXT_PRERENDER_INTERRUPTED'\n\nfunction createPrerenderInterruptedError(message: string): Error {\n const error = new Error(message)\n ;(error as any).digest = NEXT_PRERENDER_INTERRUPTED\n return error\n}\n\ntype DigestError = Error & {\n digest: string\n}\n\nexport function isPrerenderInterruptedError(\n error: unknown\n): error is DigestError {\n return (\n typeof error === 'object' &&\n error !== null &&\n (error as any).digest === NEXT_PRERENDER_INTERRUPTED &&\n 'name' in error &&\n 'message' in error &&\n error instanceof Error\n )\n}\n\nexport function accessedDynamicData(\n dynamicAccesses: Array<DynamicAccess>\n): boolean {\n return dynamicAccesses.length > 0\n}\n\nexport function consumeDynamicAccess(\n serverDynamic: DynamicTrackingState,\n clientDynamic: DynamicTrackingState\n): DynamicTrackingState['dynamicAccesses'] {\n // We mutate because we only call this once we are no longer writing\n // to the dynamicTrackingState and it's more efficient than creating a new\n // array.\n serverDynamic.dynamicAccesses.push(...clientDynamic.dynamicAccesses)\n return serverDynamic.dynamicAccesses\n}\n\nexport function formatDynamicAPIAccesses(\n dynamicAccesses: Array<DynamicAccess>\n): string[] {\n return dynamicAccesses\n .filter(\n (access): access is Required<DynamicAccess> =>\n typeof access.stack === 'string' && access.stack.length > 0\n )\n .map(({ expression, stack }) => {\n stack = stack\n .split('\\n')\n // Remove the \"Error: \" prefix from the first line of the stack trace as\n // well as the first 4 lines of the stack trace which is the distance\n // from the user code and the `new Error().stack` call.\n .slice(4)\n .filter((line) => {\n // Exclude Next.js internals from the stack trace.\n if (line.includes('node_modules/next/')) {\n return false\n }\n\n // Exclude anonymous functions from the stack trace.\n if (line.includes(' (<anonymous>)')) {\n return false\n }\n\n // Exclude Node.js internals from the stack trace.\n if (line.includes(' (node:')) {\n return false\n }\n\n return true\n })\n .join('\\n')\n return `Dynamic API Usage Debug - ${expression}:\\n${stack}`\n })\n}\n\n/**\n * In a prerender, we may end up with hanging Promises as inputs due them\n * stalling on connection() or because they're loading dynamic data. In that\n * case we need to abort the encoding of arguments since they'll never complete.\n */\nexport function createHangingInputAbortSignal(\n workUnitStore: PrerenderStoreModernServer\n): AbortSignal\nexport function createHangingInputAbortSignal(\n workUnitStore: WorkUnitStore\n): AbortSignal | undefined\nexport function createHangingInputAbortSignal(\n workUnitStore: WorkUnitStore\n): AbortSignal | undefined {\n switch (workUnitStore.type) {\n case 'prerender':\n case 'prerender-runtime':\n const controller = new AbortController()\n\n if (workUnitStore.cacheSignal) {\n // If we have a cacheSignal it means we're in a prospective render. If\n // the input we're waiting on is coming from another cache, we do want\n // to wait for it so that we can resolve this cache entry too.\n workUnitStore.cacheSignal.inputReady().then(() => {\n controller.abort()\n })\n } else {\n // Otherwise we're in the final render and we should already have all\n // our caches filled.\n // If the prerender uses stages, we have wait until the final stage.\n // if an input didn't resolve at that point, then we can assume it never will.\n //\n // We might still be waiting on some microtasks so we\n // wait one tick before giving up. When we give up, we still want to\n // render the content of this cache as deeply as we can so that we can\n // suspend as deeply as possible in the tree or not at all if we don't\n // end up waiting for the input.\n\n const stagedRendering = getStagedRenderingController(workUnitStore)\n if (stagedRendering && stagedRendering.finalStage !== null) {\n stagedRendering\n .waitForStage(stagedRendering.finalStage)\n .then(() => scheduleOnNextTick(() => controller.abort()), noop)\n } else {\n scheduleOnNextTick(() => controller.abort())\n }\n }\n\n return controller.signal\n case 'prerender-client':\n case 'validation-client':\n case 'prerender-legacy':\n case 'request':\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n case 'build-time-generator':\n return undefined\n default:\n workUnitStore satisfies never\n }\n}\n\nfunction noop() {}\n\nexport function annotateDynamicAccess(\n expression: string,\n prerenderStore: PrerenderStoreModern | ValidationStoreClient\n) {\n const dynamicTracking = prerenderStore.dynamicTracking\n if (dynamicTracking) {\n dynamicTracking.dynamicAccesses.push({\n stack: dynamicTracking.isDebugDynamicAccesses\n ? new Error().stack\n : undefined,\n expression,\n })\n }\n}\n\nconst hasSuspenseRegex = /\\n\\s+at Suspense \\(<anonymous>\\)/\n\n// Common implicit body tags that React will treat as body when placed directly in html\nconst bodyAndImplicitTags =\n 'body|div|main|section|article|aside|header|footer|nav|form|p|span|h1|h2|h3|h4|h5|h6'\n\n// Detects when RootLayoutBoundary (our framework marker component) appears\n// after Suspense in the component stack, indicating the root layout is wrapped\n// within a Suspense boundary. Ensures no body/html/implicit-body components are in between.\n//\n// Example matches:\n// at Suspense (<anonymous>)\n// at __next_root_layout_boundary__ (<anonymous>)\n//\n// Or with other components in between (but not body/html/implicit-body):\n// at Suspense (<anonymous>)\n// at SomeComponent (<anonymous>)\n// at __next_root_layout_boundary__ (<anonymous>)\nconst hasSuspenseBeforeRootLayoutWithoutBodyOrImplicitBodyRegex = new RegExp(\n `\\\\n\\\\s+at Suspense \\\\(<anonymous>\\\\)(?:(?!\\\\n\\\\s+at (?:${bodyAndImplicitTags}) \\\\(<anonymous>\\\\))[\\\\s\\\\S])*?\\\\n\\\\s+at ${ROOT_LAYOUT_BOUNDARY_NAME} \\\\([^\\\\n]*\\\\)`\n)\n\nconst hasMetadataRegex = new RegExp(\n `\\\\n\\\\s+at ${METADATA_BOUNDARY_NAME}[\\\\n\\\\s]`\n)\nconst hasViewportRegex = new RegExp(\n `\\\\n\\\\s+at ${VIEWPORT_BOUNDARY_NAME}[\\\\n\\\\s]`\n)\nconst hasOutletRegex = new RegExp(`\\\\n\\\\s+at ${OUTLET_BOUNDARY_NAME}[\\\\n\\\\s]`)\n\nconst hasInstantValidationBoundaryRegex = new RegExp(\n `\\\\n\\\\s+at ${INSTANT_VALIDATION_BOUNDARY_NAME}[\\\\n\\\\s]`\n)\nconst slotMarkerRegex = new RegExp(\n `\\\\n\\\\s+at ${INSTANT_SLOT_MARKER_PREFIX}(\\\\d+)${INSTANT_SLOT_MARKER_SUFFIX}[\\\\n\\\\s]`\n)\n\n/** Look up the config factory for the slot this error belongs to.\n * Checks the component stack for a slot marker (__next_instant_slot_N__)\n * and returns the config at that index. Falls back to index 0 (root\n * config) when no slot marker is found or the slot has no config. */\nfunction resolveInstantStack(\n componentStack: string,\n dynamicValidation: InstantValidationState\n): (() => Error) | null {\n const { slotStacks } = dynamicValidation\n if (slotStacks.length > 1) {\n const match = slotMarkerRegex.exec(componentStack)\n if (match) {\n // Slot markers are 0-indexed in the component name but\n // slotStacks is 1-indexed (index 0 is the root config).\n const slotIndex = parseInt(match[1], 10) + 1\n const slotStack = slotStacks[slotIndex]\n if (slotStack != null) {\n return slotStack\n }\n }\n }\n // Fall back to root config (index 0)\n return slotStacks[0] ?? null\n}\n\n/**\n * Inspects the component stack of an outlet boundary to discover whether the\n * user placed a Suspense boundary above the document body, and records the\n * opt-in on `dynamicValidation.hasSuspenseAboveBody` if so.\n *\n * The outlet itself isn't a meaningful source of dynamic — it only resolves\n * when metadata/viewport are dynamic, which we track via their own boundaries.\n * However, the outlet renders alongside the page content, so its stack passes\n * through the user's layout chain (typically reaching into `<body>` via the\n * root layout). That makes the outlet stack our best opportunity to spot a\n * Suspense boundary above the body, even when no real body content is dynamic.\n * Without this, a route whose only dynamic source is `generateViewport()` would\n * miss the Suspense-above-body opt-in, because the viewport's stack lives in\n * the head and never sees the user's root layout.\n *\n * We deliberately only set `hasSuspenseAboveBody`, not `hasAllowedDynamic`. The\n * latter tracks whether the body has dynamic content that's been wrapped in\n * Suspense (i.e., the page is partially dynamic). The outlet rendering tells us\n * about the structural opt-in for an empty shell, not about the body being\n * partially dynamic. The distinction matters because dynamic metadata is only\n * acceptable when the page is partially dynamic (via real body holes), and we\n * don't want this outlet-based detection to mask that case.\n */\nfunction trackOutletSuspenseAboveBody(\n componentStack: string,\n dynamicValidation: DynamicValidationState\n): void {\n if (\n hasSuspenseBeforeRootLayoutWithoutBodyOrImplicitBodyRegex.test(\n componentStack\n )\n ) {\n dynamicValidation.hasSuspenseAboveBody = true\n }\n}\n\nexport function trackDynamicAccessInStaticRoute(\n dynamicReason: unknown,\n workStore: WorkStore,\n componentStack: string,\n dynamicValidation: DynamicValidationState,\n clientDynamic: DynamicTrackingState,\n isServerPartial: boolean,\n kind: StaticValidationHoleKind\n) {\n const syncDynamicError = getPendingClientSyncDynamicError(clientDynamic)\n\n if (hasOutletRegex.test(componentStack)) {\n trackOutletSuspenseAboveBody(componentStack, dynamicValidation)\n return\n }\n if (hasMetadataRegex.test(componentStack)) {\n dynamicValidation.dynamicErrors.push(\n addErrorContext(\n createMetadataErrorInStaticRoute(kind, workStore.route),\n componentStack,\n null\n )\n )\n return\n }\n if (hasViewportRegex.test(componentStack)) {\n dynamicValidation.dynamicErrors.push(\n addErrorContext(\n createViewportErrorInStaticRoute(kind, workStore.route),\n componentStack,\n null\n )\n )\n return\n }\n\n let hasSuspense = false\n if (\n hasSuspenseBeforeRootLayoutWithoutBodyOrImplicitBodyRegex.test(\n componentStack\n )\n ) {\n // this error had a Suspense boundary above it, and it's above the body as well.\n dynamicValidation.hasSuspenseAboveBody = true\n hasSuspense = true\n } else if (hasSuspenseRegex.test(componentStack)) {\n // this error had a Suspense boundary above it.\n hasSuspense = true\n }\n\n if (hasSuspense) {\n if (!isServerPartial) {\n // If we don't have holes caused by server data, then any holes must be caused\n // by client-only code, which is allowed.\n dynamicValidation.hasAllowedDynamic = true\n return\n }\n\n // We have holes that may be caused by server data.\n if (syncDynamicError || isClientHookDynamicError(dynamicReason)) {\n // We know this hole wasn't caused by server data, so it's allowed\n // (because it's wrapped in a Suspense)\n dynamicValidation.hasAllowedDynamic = true\n return\n }\n\n // Any remaining hole may be caused by a server hole.\n // These are not allowed even with Suspense.\n // (NOTE: this may misreport valid client dynamic holes as server holes)\n dynamicValidation.dynamicErrors.push(\n addErrorContext(\n createBodyErrorInStaticRoute(kind, workStore.route),\n componentStack,\n null\n )\n )\n return\n }\n\n if (syncDynamicError) {\n dynamicValidation.dynamicErrors.push(syncDynamicError)\n return\n }\n\n if (isClientHookDynamicError(dynamicReason)) {\n dynamicValidation.dynamicErrors.push(\n addErrorContext(dynamicReason, componentStack, null)\n )\n return\n }\n\n const error = addErrorContext(\n isServerPartial\n ? // This hole may be caused by server data.\n // (NOTE: this may misreport client dynamic holes as server holes)\n createBodyErrorInStaticRoute(kind, workStore.route)\n : // TODO(ensure-static): this could be something client-specific because we know\n // that server data is complete\n createBodyError(kind, workStore.route),\n componentStack,\n null\n )\n dynamicValidation.dynamicErrors.push(error)\n}\n\nexport function trackAllowedDynamicAccess(\n dynamicReason: unknown,\n workStore: WorkStore,\n componentStack: string,\n dynamicValidation: DynamicValidationState,\n clientDynamic: DynamicTrackingState\n) {\n const dynamicHoleKind = DynamicHoleKind.RuntimeOrDynamic\n\n const syncDynamicError = getPendingClientSyncDynamicError(clientDynamic)\n\n if (hasOutletRegex.test(componentStack)) {\n trackOutletSuspenseAboveBody(componentStack, dynamicValidation)\n return\n } else if (hasMetadataRegex.test(componentStack)) {\n dynamicValidation.hasDynamicMetadata = true\n return\n } else if (hasViewportRegex.test(componentStack)) {\n dynamicValidation.hasDynamicViewport = true\n return\n } else if (\n hasSuspenseBeforeRootLayoutWithoutBodyOrImplicitBodyRegex.test(\n componentStack\n )\n ) {\n // For Suspense within body, the prelude wouldn't be empty so it wouldn't violate the empty static shells rule.\n // But if you have Suspense above body, the prelude is empty but we allow that because having Suspense\n // is an explicit signal from the user that they acknowledge the empty shell and want dynamic rendering.\n dynamicValidation.hasAllowedDynamic = true\n dynamicValidation.hasSuspenseAboveBody = true\n return\n } else if (hasSuspenseRegex.test(componentStack)) {\n // this error had a Suspense boundary above it so we don't need to report it as a source\n // of disallowed\n dynamicValidation.hasAllowedDynamic = true\n return\n } else if (syncDynamicError) {\n dynamicValidation.dynamicErrors.push(syncDynamicError)\n return\n }\n\n if (isClientHookDynamicError(dynamicReason)) {\n dynamicValidation.dynamicErrors.push(\n addErrorContext(dynamicReason, componentStack, null)\n )\n return\n }\n\n const error = addErrorContext(\n createBodyError(dynamicHoleKind, workStore.route),\n componentStack,\n null\n )\n dynamicValidation.dynamicErrors.push(error)\n return\n}\n\nexport enum DynamicHoleKind {\n /** We know that this hole is caused by runtime data. */\n Runtime = 1,\n /** We know that this hole is caused by link data. */\n Link = 2,\n /** We know that this hole is caused by navigation(). */\n Navigation = 3,\n /** We know that this hole is caused by prefetch(). */\n Prefetch = 4,\n /** We know that this hole is caused by dynamic data. */\n Dynamic = 5,\n /** We know that this hole is caused by runtime or dynamic data, but don't know which. */\n RuntimeOrDynamic = 6,\n}\n\n// In Instant Validation we can always discriminate between runtime and dynamic.\nexport type InstantValidationHoleKind = Exclude<\n DynamicHoleKind,\n DynamicHoleKind.RuntimeOrDynamic\n>\n\nexport type StaticValidationHoleKind =\n // During dev-time static validation we can discriminate runtime and dynamic.\n | DynamicHoleKind.Runtime\n | DynamicHoleKind.Dynamic\n // During build-time static validation we can't discriminate runtime and dynamic.\n | DynamicHoleKind.RuntimeOrDynamic\n\n/** Stores dynamic reasons used during an SSR render in instant validation. */\nexport type InstantValidationState = {\n hasDynamicMetadata: boolean\n hasAllowedClientDynamicAboveBoundary: boolean\n dynamicMetadata: null | Error\n hasDynamicViewport: boolean\n hasAllowedDynamic: boolean\n dynamicErrors: Array<Error>\n validationPreventingErrors: Array<Error>\n thrownErrorsOutsideBoundary: Array<unknown>\n /** Per-slot config factories. Index 0 is the root config (fallback).\n * Indices 1+ correspond to slot marker components in the tree. */\n slotStacks: Array<(() => Error) | null>\n}\n\nexport function createInstantValidationState(\n slotStacks: Array<(() => Error) | null>\n): InstantValidationState {\n return {\n hasDynamicMetadata: false,\n hasAllowedClientDynamicAboveBoundary: false,\n dynamicMetadata: null,\n hasDynamicViewport: false,\n hasAllowedDynamic: false,\n dynamicErrors: [],\n validationPreventingErrors: [],\n thrownErrorsOutsideBoundary: [],\n slotStacks,\n }\n}\n\nexport function trackDynamicHoleInNavigation(\n dynamicReason: unknown,\n workStore: WorkStore,\n componentStack: string,\n dynamicValidation: InstantValidationState,\n clientDynamic: DynamicTrackingState,\n kind: InstantValidationHoleKind,\n boundaryState: ValidationBoundaryTracking\n) {\n const syncDynamicError = getPendingClientSyncDynamicError(clientDynamic)\n\n if (hasOutletRegex.test(componentStack)) {\n // We don't need to track that this is dynamic. It is only so when something else is also dynamic.\n return\n }\n // Resolve the config stack for this specific error. If the error\n // is inside a slot marker, use that slot's config. Otherwise fall\n // back to the default.\n const effectiveCreateInstantStack = resolveInstantStack(\n componentStack,\n dynamicValidation\n )\n\n if (hasMetadataRegex.test(componentStack)) {\n const error = addErrorContext(\n createMetadataError(kind, workStore.route),\n componentStack,\n effectiveCreateInstantStack\n )\n dynamicValidation.dynamicMetadata = error\n return\n }\n if (hasViewportRegex.test(componentStack)) {\n const error = addErrorContext(\n createViewportError(kind, workStore.route),\n componentStack,\n effectiveCreateInstantStack\n )\n dynamicValidation.dynamicErrors.push(error)\n return\n }\n\n const boundaryLocation =\n hasInstantValidationBoundaryRegex.exec(componentStack)\n if (!boundaryLocation) {\n // We don't see the validation boundary in the component stack,\n // so this hole must be coming from a shared parent.\n // Shared parents are fully resolved and don't have RSC holes,\n // but they can still suspend in a client component during SSR.\n\n // If we managed to render all the validation boundaries, that means\n // that the client holes aren't blocking validation and we can disregard them.\n // Note that we don't even care whether they have suspense or not.\n if (allRequiredBoundariesRendered(boundaryState)) {\n dynamicValidation.hasAllowedClientDynamicAboveBoundary = true\n dynamicValidation.hasAllowedDynamic = true // Holes outside the boundary contribute to allowing dynamic metadata\n return\n } else {\n // TODO(instant-validation) TODO(NAR-787)\n // If shared parents blocked us from validating, we should only log\n // the errors from the innermost (segments), i.e. omit layouts whose\n // slots managed to render (because clearly they didn't block validation)\n const message = `Route \"${workStore.route}\": Could not validate \\`instant\\` because a Client Component in a parent segment prevented the page from rendering.`\n const error = addErrorContext(\n new Error(message),\n componentStack,\n effectiveCreateInstantStack\n )\n dynamicValidation.validationPreventingErrors.push(error)\n return\n }\n } else {\n // The hole originates inside the validation boundary.\n //\n // Check if we have a Suspense above the hole, but below the validation boundary.\n // If we do, then this dynamic usage wouldn't block a navigation to this subtree.\n // Conversely, if the nearest suspense is above the validation boundary, then this subtree would block.\n //\n // Note that in the component stack, children come before parents.\n //\n // Valid:\n // ...\n // at Suspense\n // ...\n // at __next_prefetch_validation_boundary__\n //\n // Invalid:\n // ...\n // at __next_prefetch_validation_boundary__\n // ...\n // at Suspense\n //\n const suspenseLocation = hasSuspenseRegex.exec(componentStack)\n if (suspenseLocation) {\n if (suspenseLocation.index < boundaryLocation.index) {\n dynamicValidation.hasAllowedDynamic = true\n return\n } else {\n // invalid - fallthrough\n }\n }\n }\n\n if (syncDynamicError) {\n if (\n effectiveCreateInstantStack !== null &&\n syncDynamicError.cause === undefined\n ) {\n syncDynamicError.cause = effectiveCreateInstantStack()\n }\n dynamicValidation.dynamicErrors.push(syncDynamicError)\n return\n }\n\n if (isClientHookDynamicError(dynamicReason)) {\n dynamicValidation.dynamicErrors.push(\n addErrorContext(\n dynamicReason,\n componentStack,\n effectiveCreateInstantStack\n )\n )\n return\n }\n\n const error = addErrorContext(\n createBodyErrorInNavigation(kind, workStore.route),\n componentStack,\n effectiveCreateInstantStack\n )\n dynamicValidation.dynamicErrors.push(error)\n return\n}\n\nfunction createBodyError(kind: StaticValidationHoleKind, route: string): Error {\n switch (kind) {\n case DynamicHoleKind.Runtime:\n return createRuntimeBodyError(route)\n case DynamicHoleKind.Dynamic:\n return createDynamicBodyError(route)\n case DynamicHoleKind.RuntimeOrDynamic:\n return createDynamicOrRuntimeBodyError(route)\n }\n}\n\nfunction createBodyErrorInNavigation(\n kind: InstantValidationHoleKind,\n route: string\n): Error {\n switch (kind) {\n case DynamicHoleKind.Runtime:\n return createRuntimeBodyErrorInNavigation(route)\n case DynamicHoleKind.Link:\n return createLinkBodyErrorInNavigation(route)\n case DynamicHoleKind.Navigation:\n return createNavigationBodyErrorInNavigation(route)\n case DynamicHoleKind.Prefetch:\n return createPrefetchBodyErrorInNavigation(route)\n case DynamicHoleKind.Dynamic:\n return createDynamicBodyErrorInNavigation(route)\n }\n}\n\nfunction createMetadataError(kind: DynamicHoleKind, route: string): Error {\n switch (kind) {\n case DynamicHoleKind.Runtime:\n return createRuntimeMetadataError(route)\n case DynamicHoleKind.Link:\n return createLinkMetadataError(route)\n case DynamicHoleKind.Navigation:\n return createNavigationMetadataError(route)\n case DynamicHoleKind.Prefetch:\n return createPrefetchMetadataError(route)\n case DynamicHoleKind.Dynamic:\n return createDynamicMetadataError(route)\n case DynamicHoleKind.RuntimeOrDynamic:\n return createDynamicOrRuntimeMetadataError(route)\n }\n}\n\nfunction createViewportError(kind: DynamicHoleKind, route: string): Error {\n switch (kind) {\n case DynamicHoleKind.Runtime:\n return createRuntimeViewportError(route)\n case DynamicHoleKind.Link:\n return createLinkViewportError(route)\n case DynamicHoleKind.Navigation:\n return createNavigationViewportError(route)\n case DynamicHoleKind.Prefetch:\n return createPrefetchViewportError(route)\n case DynamicHoleKind.Dynamic:\n return createDynamicViewportError(route)\n case DynamicHoleKind.RuntimeOrDynamic:\n return createDynamicOrRuntimeViewportError(route)\n }\n}\n\nfunction createBodyErrorInStaticRoute(\n kind: StaticValidationHoleKind,\n route: string\n): Error {\n switch (kind) {\n case DynamicHoleKind.Runtime:\n return createRuntimeBodyErrorInStaticRoute(route)\n case DynamicHoleKind.Dynamic:\n return createDynamicBodyErrorInStaticRoute(route)\n case DynamicHoleKind.RuntimeOrDynamic:\n return createNonPrerenderableBodyErrorInStaticRoute(route)\n }\n}\n\nfunction createMetadataErrorInStaticRoute(\n kind: StaticValidationHoleKind,\n route: string\n) {\n switch (kind) {\n case DynamicHoleKind.Runtime:\n return createRuntimeMetadataErrorInStaticRoute(route)\n case DynamicHoleKind.Dynamic:\n return createDynamicMetadataErrorInStaticRoute(route)\n case DynamicHoleKind.RuntimeOrDynamic:\n return createNonPrerenderableMetadataErrorInStaticRoute(route)\n }\n}\n\nfunction createViewportErrorInStaticRoute(\n kind: StaticValidationHoleKind,\n route: string\n) {\n switch (kind) {\n case DynamicHoleKind.Runtime:\n return createRuntimeViewportErrorInStaticRoute(route)\n case DynamicHoleKind.Dynamic:\n return createDynamicViewportErrorInStaticRoute(route)\n case DynamicHoleKind.RuntimeOrDynamic:\n return createNonPrerenderableViewportErrorInStaticRoute(route)\n }\n}\n\nexport function trackThrownErrorInNavigation(\n workStore: WorkStore,\n dynamicValidation: InstantValidationState,\n thrownValue: unknown,\n componentStack: string,\n reactBrowserBailout: boolean\n) {\n const boundaryLocation =\n hasInstantValidationBoundaryRegex.exec(componentStack)\n if (!boundaryLocation) {\n // There's no validation boundary on the component stack.\n // This error may have blocked a boundary from rendering.\n\n // Wrap the error to provide component context.\n // This helps for errors from node_modules which would otherwise\n // have no useful stack information due to ignore-listing,\n // e.g. next/dynamic with `ssr: false`.\n if (reactBrowserBailout) {\n // React preserves Next's branded bailout reason as the error cause.\n // Replace the internal wrapper before storing the user-facing diagnostic.\n const browserBailoutReason = getReactBrowserBailoutReason(thrownValue)\n if (browserBailoutReason !== undefined) {\n const browserBailoutError = thrownValue as Error\n browserBailoutError.cause = browserBailoutReason\n }\n }\n\n const error = addErrorContext(\n new Error(\n 'An error occurred while attempting to validate instant UI. This error may be preventing the validation from completing.',\n { cause: thrownValue }\n ),\n componentStack,\n null\n )\n dynamicValidation.thrownErrorsOutsideBoundary.push(error)\n } else {\n // There's validation boundary on the component stack,\n // so we know this error didn't block a validation boundary from rendering.\n // However, this error might be hiding be hiding dynamic content that would\n // cause validation to fail.\n const suspenseLocation = hasSuspenseRegex.exec(componentStack)\n if (suspenseLocation) {\n if (suspenseLocation.index < boundaryLocation.index) {\n // There's a Suspense below the validation boundary but above this error's location.\n // This subtree can't fail instant validation because any potential\n // dynamic holes would be guarded by the Suspense anyway,\n // so we can allow this.\n return\n } else {\n // invalid - fallthrough\n }\n }\n if (reactBrowserBailout) {\n // React preserves Next's branded bailout reason as the error cause.\n // Replace the internal wrapper before storing the user-facing diagnostic.\n const browserBailoutReason = getReactBrowserBailoutReason(thrownValue)\n if (browserBailoutReason !== undefined) {\n const browserBailoutError = thrownValue as Error\n browserBailoutError.cause = browserBailoutReason\n }\n }\n\n const message = `Route \"${workStore.route}\": Could not validate \\`instant\\` because an error prevented the target segment from rendering.`\n const error = addErrorContext(\n new Error(message, { cause: thrownValue }),\n componentStack,\n null // TODO(instant-validation-build): conflicting use of cause\n )\n dynamicValidation.validationPreventingErrors.push(error)\n }\n}\n\nexport function trackDynamicHoleInStaticShell(\n dynamicReason: unknown,\n workStore: WorkStore,\n componentStack: string,\n dynamicValidation: DynamicValidationState,\n clientDynamic: DynamicTrackingState,\n kind: DynamicHoleKind.Runtime | DynamicHoleKind.Dynamic\n) {\n const syncDynamicError = getPendingClientSyncDynamicError(clientDynamic)\n\n if (hasOutletRegex.test(componentStack)) {\n trackOutletSuspenseAboveBody(componentStack, dynamicValidation)\n return\n } else if (hasMetadataRegex.test(componentStack)) {\n const error = addErrorContext(\n createMetadataError(kind, workStore.route),\n componentStack,\n null\n )\n dynamicValidation.dynamicMetadata = error\n return\n } else if (hasViewportRegex.test(componentStack)) {\n const error = addErrorContext(\n createViewportError(kind, workStore.route),\n componentStack,\n null\n )\n dynamicValidation.dynamicErrors.push(error)\n return\n } else if (\n hasSuspenseBeforeRootLayoutWithoutBodyOrImplicitBodyRegex.test(\n componentStack\n )\n ) {\n // For Suspense within body, the prelude wouldn't be empty so it wouldn't violate the empty static shells rule.\n // But if you have Suspense above body, the prelude is empty but we allow that because having Suspense\n // is an explicit signal from the user that they acknowledge the empty shell and want dynamic rendering.\n dynamicValidation.hasAllowedDynamic = true\n dynamicValidation.hasSuspenseAboveBody = true\n return\n } else if (hasSuspenseRegex.test(componentStack)) {\n // this error had a Suspense boundary above it so we don't need to report it as a source\n // of disallowed\n dynamicValidation.hasAllowedDynamic = true\n return\n } else if (syncDynamicError) {\n dynamicValidation.dynamicErrors.push(syncDynamicError)\n return\n }\n\n if (isClientHookDynamicError(dynamicReason)) {\n dynamicValidation.dynamicErrors.push(\n addErrorContext(dynamicReason, componentStack, null)\n )\n return\n }\n\n const error = addErrorContext(\n kind === DynamicHoleKind.Runtime\n ? createRuntimeBodyError(workStore.route)\n : createDynamicBodyError(workStore.route),\n componentStack,\n null\n )\n dynamicValidation.dynamicErrors.push(error)\n return\n}\n\n/**\n * In dev mode, we prefer using the owner stack, otherwise the provided\n * component stack is used.\n */\nfunction addErrorContext(\n error: Error,\n componentStack: string,\n createInstantStack: (() => Error) | null\n) {\n const ownerStack =\n process.env.NODE_ENV !== 'production' && React.captureOwnerStack\n ? React.captureOwnerStack()\n : null\n\n if (createInstantStack !== null) {\n error.cause = createInstantStack()\n }\n // TODO go back to owner stack here if available. This is temporarily using componentStack to get the right\n //\n error.stack =\n error.name + ': ' + error.message + (ownerStack || componentStack)\n return error\n}\n\nexport enum PreludeState {\n Full = 0,\n Empty = 1,\n Errored = 2,\n}\n\nexport function logDisallowedDynamicError(\n workStore: WorkStore,\n error: Error\n): void {\n console.error(error)\n logBuildDebugHint(workStore.route)\n}\n\nexport function throwIfSyncIOUsed(\n workStore: WorkStore,\n serverDynamic: DynamicTrackingState\n) {\n if (serverDynamic.syncDynamicErrorWithStack) {\n logDisallowedDynamicError(\n workStore,\n serverDynamic.syncDynamicErrorWithStack\n )\n throw new StaticGenBailoutError()\n }\n}\n\nexport function throwIfDisallowedDynamic(\n workStore: WorkStore,\n prelude: PreludeState,\n dynamicValidation: DynamicValidationState,\n serverDynamic: DynamicTrackingState,\n allowEmptyStaticShell: boolean\n): void {\n const dynamicHoleKind = DynamicHoleKind.RuntimeOrDynamic\n\n throwIfSyncIOUsed(workStore, serverDynamic)\n\n // The dynamic metadata error is a mistake-detection signal. It fires when the\n // rest of the shell is otherwise fully static apart from metadata, suggesting\n // the dynamic data access in `generateMetadata` was probably unintentional.\n // That condition is independent of whether the user or build phase accepted\n // an empty shell, so we surface it before any opt-in bypass.\n if (\n prelude === PreludeState.Full &&\n dynamicValidation.hasAllowedDynamic === false &&\n dynamicValidation.hasDynamicMetadata\n ) {\n console.error(createMetadataError(dynamicHoleKind, workStore.route).message)\n throw new StaticGenBailoutError()\n }\n\n // Either flag expresses \"this shell is allowed to be empty/blocking\":\n // - `allowEmptyStaticShell` covers `instant = false` (user opt-in)\n // and the build-phase fallback-shell case.\n // - `hasSuspenseAboveBody` is the structural opt-in inside the user's root\n // layout.\n // Treat them as synonyms for the purpose of bypassing shell-failure errors.\n if (allowEmptyStaticShell || dynamicValidation.hasSuspenseAboveBody) {\n return\n }\n\n if (prelude !== PreludeState.Full) {\n // We didn't have any sync bailouts but there may be user code which\n // blocked the root. We would have captured these during the prerender\n // and can log them here and then terminate the build/validating render\n const dynamicErrors = dynamicValidation.dynamicErrors\n if (dynamicErrors.length > 0) {\n for (let i = 0; i < dynamicErrors.length; i++) {\n logDisallowedDynamicError(workStore, dynamicErrors[i])\n }\n\n throw new StaticGenBailoutError()\n }\n\n // If we got this far then the only other thing that could be blocking\n // the root is dynamic Viewport. If this is dynamic then\n // you need to opt into that by adding a Suspense boundary above the body\n // to indicate your are ok with fully dynamic rendering.\n if (dynamicValidation.hasDynamicViewport) {\n console.error(\n createViewportError(dynamicHoleKind, workStore.route).message\n )\n throw new StaticGenBailoutError()\n }\n\n if (prelude === PreludeState.Empty) {\n // If we ever get this far then we messed up the tracking of invalid dynamic.\n // We still adhere to the constraint that you must produce a shell but invite the\n // user to report this as a bug in Next.js.\n console.error(\n `Route \"${workStore.route}\" did not produce a static shell and Next.js was unable to determine a reason. This is a bug in Next.js.`\n )\n throw new StaticGenBailoutError()\n }\n }\n}\n\nexport function throwIfDisallowedDynamicInStaticRoute(\n workStore: WorkStore,\n prelude: PreludeState,\n dynamicValidation: DynamicValidationState,\n serverDynamic: DynamicTrackingState,\n isFallbackShell: boolean,\n allowEmptyStaticShell: boolean,\n isServerPartial: boolean\n): void {\n const reasons = getDisallowedReasonsInStaticRoute(\n workStore,\n prelude,\n dynamicValidation,\n serverDynamic,\n isFallbackShell,\n allowEmptyStaticShell,\n isServerPartial\n )\n if (reasons.length > 0) {\n for (const reason of reasons) {\n logDisallowedDynamicError(workStore, reason)\n }\n throw new StaticGenBailoutError()\n }\n}\n\nexport function getDisallowedReasonsInStaticRoute(\n workStore: WorkStore,\n prelude: PreludeState,\n dynamicValidation: DynamicValidationState,\n serverDynamic: DynamicTrackingState | null,\n isFallbackShell: boolean,\n allowEmptyStaticShell: boolean,\n isServerPartial: boolean\n): Error[] {\n if (serverDynamic && serverDynamic.syncDynamicErrorWithStack) {\n return [serverDynamic.syncDynamicErrorWithStack]\n }\n\n // We do a fallback shell prerender, but it's not meant to be validated --\n // we just need it to create the relevant prerender outputs.\n if (isFallbackShell) {\n return []\n }\n\n // Suspense-above-body and `instant = false` bypass reporting\n // that the shell is blocked. However, if we have non-prerenderable server\n // data, we still have to error, regardless of those two.\n if (\n !isServerPartial &&\n (allowEmptyStaticShell || dynamicValidation.hasSuspenseAboveBody)\n ) {\n return []\n }\n\n const { dynamicErrors } = dynamicValidation\n if (dynamicErrors.length > 0) {\n return dynamicErrors\n }\n\n // Dynamic data may have been passed into a client component without calling `use()`,\n // in which case we wouldn't see it during the prerender, but still need to error.\n // Fall back to a generic error message.\n if (isServerPartial) {\n return [\n new Error(\n `Route \"${workStore.route}\": Next.js encountered data that is not available during a static prerender, but is unable to provide a location.`\n ),\n ]\n }\n\n if (prelude === PreludeState.Empty || prelude === PreludeState.Errored) {\n // We've somehow ended up with an empty prelude but no dynamic errors.\n // We must've messed up the tracking somehow.\n return [\n new InvariantError(\n `Route \"${workStore.route}\" did not produce a static shell and Next.js was unable to determine a reason.`\n ),\n ]\n }\n return []\n}\n\nexport function getStaticShellDisallowedDynamicReasons(\n workStore: WorkStore,\n prelude: PreludeState,\n dynamicValidation: DynamicValidationState,\n allowEmptyStaticShell: boolean\n): Array<Error> {\n // The dynamic metadata error is a mistake-detection signal. It fires when the\n // rest of the shell is otherwise fully static apart from metadata, suggesting\n // the dynamic data access in `generateMetadata` was probably unintentional.\n // That condition is independent of whether the user or build phase accepted\n // an empty shell, so we surface it before any opt-in bypass.\n if (\n prelude === PreludeState.Full &&\n dynamicValidation.hasAllowedDynamic === false &&\n dynamicValidation.dynamicErrors.length === 0 &&\n dynamicValidation.dynamicMetadata\n ) {\n return [dynamicValidation.dynamicMetadata]\n }\n\n // Either flag expresses \"this shell is allowed to be empty/blocking\":\n // - `allowEmptyStaticShell` covers `instant = false` (user opt-in)\n // and the build-phase fallback-shell case.\n // - `hasSuspenseAboveBody` is the structural opt-in inside the user's root\n // layout.\n // Treat them as synonyms for the purpose of bypassing shell-failure errors.\n if (allowEmptyStaticShell || dynamicValidation.hasSuspenseAboveBody) {\n return []\n }\n\n if (prelude !== PreludeState.Full) {\n // We didn't have any sync bailouts but there may be user code which\n // blocked the root. We would have captured these during the prerender\n // and can log them here and then terminate the build/validating render\n const dynamicErrors = dynamicValidation.dynamicErrors\n if (dynamicErrors.length > 0) {\n return dynamicErrors\n }\n\n if (prelude === PreludeState.Empty) {\n // If we ever get this far then we messed up the tracking of invalid dynamic.\n // We still adhere to the constraint that you must produce a shell but invite the\n // user to report this as a bug in Next.js.\n return [\n new InvariantError(\n `Route \"${workStore.route}\" did not produce a static shell and Next.js was unable to determine a reason.`\n ),\n ]\n }\n }\n // We had a non-empty prelude and there are no dynamic holes\n return []\n}\n\n/**\n * `errors` are validation failures that should be surfaced immediately.\n * `deferredFallback` carries a missing-boundary explanation that the caller\n * should hold back until *every* validation depth has been tried — a missing\n * boundary often just means a parent layout intentionally omitted a slot, and\n * a different depth's validation may surface a more meaningful error.\n */\nexport type NavigationValidationResult =\n // instances that block instant navigation\n | Array<Error>\n // validation was blocked with zero or more reasons\n | Error\n | AggregateError\n\nexport function getNavigationDisallowedDynamicReasons(\n workStore: WorkStore,\n prelude: PreludeState,\n dynamicValidation: InstantValidationState,\n validationSampleTracking: InstantValidationSampleTracking | null,\n boundaryState: ValidationBoundaryTracking,\n devRenderDidError: boolean\n): NavigationValidationResult {\n // If we have errors related to missing samples, those should take precedence over everything else.\n if (validationSampleTracking) {\n const { missingSampleErrors } = validationSampleTracking\n if (missingSampleErrors.length > 0) {\n return missingSampleErrors\n }\n }\n\n const { validationPreventingErrors } = dynamicValidation\n if (validationPreventingErrors.length > 0) {\n if (process.env.__NEXT_DEV_SERVER && devRenderDidError) {\n // The dev render already surfaced server errors to the user.\n // The same errors likely caused validation to be inconclusive,\n // so reporting them again as validation failures would be noisy.\n return []\n }\n return validationPreventingErrors\n }\n\n // NOTE: We don't care about Suspense above body here,\n // we're only concerned with the validation boundary\n if (prelude !== PreludeState.Full) {\n const dynamicErrors = dynamicValidation.dynamicErrors\n if (dynamicErrors.length > 0) {\n return dynamicErrors\n }\n\n if (\n prelude === PreludeState.Empty &&\n !dynamicValidation.hasAllowedClientDynamicAboveBoundary &&\n allRequiredBoundariesRendered(boundaryState)\n ) {\n // If we ever get this far then we messed up the tracking of invalid\n // dynamic. (When boundaries are missing the deferred fallback below\n // will surface a more useful error.)\n return new InvariantError(\n `Route \"${workStore.route}\" failed to render during instant validation and Next.js was unable to determine a reason.`\n )\n }\n } else {\n const dynamicErrors = dynamicValidation.dynamicErrors\n if (dynamicErrors.length > 0) {\n return dynamicErrors\n }\n\n if (\n dynamicValidation.hasAllowedDynamic === false &&\n dynamicValidation.dynamicMetadata\n ) {\n return [dynamicValidation.dynamicMetadata]\n }\n }\n\n // Missing boundaries on their own aren't a strong signal — a parent\n // layout may legitimately omit a slot. Defer this so the caller can\n // try shallower validation depths first; if every depth comes up\n // empty we still want to surface this so the user is made aware that\n // validation didn't complete. When we add a markers API, the\n // marker-based variant of this check can become strict again.\n if (!allRequiredBoundariesRendered(boundaryState)) {\n const { thrownErrorsOutsideBoundary } = dynamicValidation\n const rootInstantStack = dynamicValidation.slotStacks[0]\n if (thrownErrorsOutsideBoundary.length === 0) {\n const missingFiles: string[] = []\n for (const [id, filePaths] of boundaryState.requiredIds) {\n if (!boundaryState.renderedIds.has(id)) {\n for (const filePath of filePaths) {\n let normalized = filePath\n .replace(/^\\[project\\][\\\\/]?/, '')\n .replace(process.cwd() + '/', '')\n .replace(process.cwd() + '\\\\', '')\n missingFiles.push(normalized)\n }\n }\n }\n missingFiles.sort()\n return createUnrenderedSegmentError(workStore.route, missingFiles)\n } else if (process.env.__NEXT_DEV_SERVER && devRenderDidError) {\n // Errors outside the boundary likely blocked it from rendering,\n // but they're already being reported to the user via the dev\n // render. Suppress the validation failure to avoid noise.\n return []\n } else if (thrownErrorsOutsideBoundary.length === 1) {\n const message = `Route \"${workStore.route}\": Could not validate \\`instant\\` because the target segment was prevented from rendering, likely due to the following error.`\n const error = rootInstantStack !== null ? rootInstantStack() : new Error()\n error.name = 'Error'\n error.message = message\n return new AggregateError([\n error,\n thrownErrorsOutsideBoundary[0] as Error,\n ])\n } else {\n const message = `Route \"${workStore.route}\": Could not validate \\`instant\\` because the target segment was prevented from rendering, likely due to one of the following errors.`\n const error = rootInstantStack !== null ? rootInstantStack() : new Error()\n error.name = 'Error'\n error.message = message\n return new AggregateError([\n error,\n ...(thrownErrorsOutsideBoundary as Error[]),\n ])\n }\n }\n\n // We had a non-empty prelude and there are no dynamic holes\n return []\n}\n","export const INSTANT_VALIDATION_BOUNDARY_NAME =\n '__next_instant_validation_boundary__'\n\nexport const INSTANT_SLOT_MARKER_PREFIX = '__next_instant_slot_'\nexport const INSTANT_SLOT_MARKER_SUFFIX = '__'\n","export type ValidationBoundaryTracking = {\n /**\n * Map from boundary id (the SegmentPath where a validation boundary is\n * placed) to the file paths of modules inside that boundary's subtree.\n * When the boundary spans multiple parallel slots, each slot contributes\n * its own first-found module path so all unrendered segments can be\n * reported together.\n */\n requiredIds: Map<string, string[]>\n renderedIds: Set<string>\n}\n\nexport function createValidationBoundaryTracking(\n /** Pass if the render is expected to render the same IDs as a previous one. */\n matchPrevious?: ValidationBoundaryTracking\n): ValidationBoundaryTracking {\n return {\n requiredIds: matchPrevious ? new Map(matchPrevious.requiredIds) : new Map(),\n renderedIds: new Set(),\n }\n}\n\nexport function allRequiredBoundariesRendered(\n state: ValidationBoundaryTracking\n): boolean {\n for (const id of state.requiredIds.keys()) {\n if (!state.renderedIds.has(id)) {\n return false\n }\n }\n return true\n}\n","import type {\n AppSegmentConfig,\n EnsureStatic,\n} from '../../../build/segment-config/app/app-segment-config'\nimport { parseLoaderTree } from '../../../shared/lib/router/utils/parse-loader-tree'\nimport {\n getLayoutOrPageModule,\n type LoaderTree,\n} from '../../lib/app-dir-module'\n\n/**\n * The outcome of resolving a route's `ensureStatic` config.\n * The ordering is intentional -- higher values indicate a\n * more constrained route that forces more request kinds to be static.\n *\n * A constraint also implies all its predecessors:\n * - `Prefetch` implies `Shell`, i.e. if prefetches are static, so are shells.\n * - `Navigation` implies `Prefetch` and `Shell`, i.e. if the whole page is static,\n * then so are its shells and prefetches.\n *\n * Note that this flattens `\"auto\"` and `false` into `None`.\n * This is because rendering code does not need to distinguish them --\n * both indicate that the route follows normal Partial Prefetching semantics\n * and does not force anything to be static.\n * However, it is only correct to collapse them into one *after* resolving the\n * config for the entire route, because they have different interactions with\n * configs from other segments on the same route.\n */\nexport enum EnsureStaticLevel {\n /** The route follows standard Partial Prefetching semantics. */\n None = 0,\n /** The route requires that app shells must be statically prerendered. */\n Shell = 1,\n /** The route requires that app shells and prefetches must be statically prerendered. */\n Prefetch = 2,\n /** The route requires that app shells, prefetches, and the whole page must be statically prerendered. */\n Navigation = 3,\n}\n\nfunction getEnsureStaticLevel(ensureStatic: EnsureStatic) {\n switch (ensureStatic) {\n case 'auto':\n case false: {\n return EnsureStaticLevel.None\n }\n case 'shell': {\n return EnsureStaticLevel.Shell\n }\n case 'prefetch': {\n return EnsureStaticLevel.Prefetch\n }\n case 'navigation': {\n return EnsureStaticLevel.Navigation\n }\n }\n}\n\nexport async function resolveEnsureStaticLevel(\n tree: LoaderTree,\n partialPrefetching: boolean\n): Promise<EnsureStaticLevel> {\n return getEnsureStaticLevel(\n await resolveEnsureStaticConfig(tree, partialPrefetching)\n )\n}\n\nexport async function resolveEnsureStaticConfig(\n tree: LoaderTree,\n partialPrefetching: boolean\n): Promise<Exclude<EnsureStatic, false>> {\n let { config, filePath } = await resolveEnsureStaticConfigImpl(tree)\n\n if (!partialPrefetching) {\n // If Partial Prefetching is not enabled for this route, we only support\n // a subset of `ensureStatic` values.\n // (We error in `getAppPageStaticInfo` if `ensureStatic` is used without enabling\n // Cache Components, so we don't have to assert that here)\n switch (config) {\n case 'auto': {\n // Default to the equivalent of Cache Components prefetching behavior.\n config = 'prefetch'\n break\n }\n case false:\n case 'shell': {\n // Not meaningful in Cache Components without Partial Prefetching\n const originalConfig = config\n config = 'prefetch'\n console.warn(\n `${formatEnsureStaticExport(originalConfig)} has no effect unless the route is using Partial Prefetching.` +\n `\\n (from: ${filePath})`\n )\n break\n }\n case 'prefetch':\n // Equivalent to regular Cache Components behavior, so we allow it\n // without warning to avoid noise when doing gradual opt-in\n break\n case 'navigation':\n // Meaningful in Cache Components, even without Partial Prefetching\n break\n default:\n config satisfies never\n }\n }\n\n if (config === false) {\n // `false` and \"auto\" are equivalent once resolved.\n return 'auto'\n } else {\n return config\n }\n}\n\ntype EnsureStaticWithSource = {\n config: EnsureStatic\n filePath: string | null\n}\n\nasync function resolveEnsureStaticConfigImpl(\n tree: LoaderTree\n): Promise<EnsureStaticWithSource> {\n const { mod: layoutOrPageMod, filePath } = await getLayoutOrPageModule(tree)\n\n const config = getEnsureStaticConfigForModule(layoutOrPageMod)\n\n const parentResult: EnsureStaticWithSource = {\n config,\n filePath: filePath ?? null,\n }\n\n // Walk the slots if any and validate that they don't have incompatible configs\n // with each other. If compatible, pick the most constrained value from the slots.\n let slotsResult: EnsureStaticWithSource | null = null\n let slotResultKey: string | null = null\n const { parallelRoutes } = parseLoaderTree(tree)\n for (const parallelRouteKey in parallelRoutes) {\n const parallelRoute = parallelRoutes[parallelRouteKey]\n const childResult = await resolveEnsureStaticConfigImpl(parallelRoute)\n if (!slotsResult) {\n slotsResult = childResult\n slotResultKey = parallelRouteKey\n } else {\n // Check if the child is compatible with the current result for the slots.\n switch (compareEnsureStatic(childResult.config, slotsResult.config)) {\n case Comparison.Compatible: {\n // 'auto' is compatible with anything, but if the current result is 'auto' and the new one isn't,\n // we want to use the more specific result.\n if (slotsResult.config === 'auto' && childResult.config !== 'auto') {\n slotsResult = childResult\n slotResultKey = parallelRouteKey\n }\n break\n }\n case Comparison.Incompatible:\n case Comparison.LessConstrained:\n case Comparison.MoreConstrained: {\n throw new Error(\n `Parallel slots cannot have incompatible \\`ensureStatic\\`.` +\n `\\n ${formatParallelSlot(slotResultKey!)}: ` +\n `\\n ${formatEnsureStaticExport(slotsResult.config)}` +\n `\\n (from: ${slotsResult.filePath})` +\n `\\n` +\n `\\n ${formatParallelSlot(parallelRouteKey)}: ` +\n `\\n ${formatEnsureStaticExport(childResult.config)}` +\n `\\n (from: ${childResult.filePath})` +\n `\\n` +\n `\\n Possible fixes:` +\n `\\n - Remove one of the \\`ensureStatic\\` exports` +\n `\\n - Change one of the \\`ensureStatic\\` exports to match the other`\n )\n }\n }\n }\n }\n\n // Child segments can override the config from the parent with a more constrained value,\n // but they cannot have a less constrained value.\n if (!slotsResult) {\n return parentResult\n } else {\n const comparison = compareEnsureStatic(\n slotsResult.config,\n parentResult.config\n )\n switch (comparison) {\n case Comparison.Compatible: {\n // 'auto' is compatible with anything, but if the parent result is 'auto' and the slots one isn't,\n // we want to use the more constrained result.\n if (parentResult.config === 'auto' && slotsResult.config !== 'auto') {\n return slotsResult\n } else {\n return parentResult\n }\n }\n case Comparison.MoreConstrained: {\n return slotsResult\n }\n case Comparison.LessConstrained:\n case Comparison.Incompatible: {\n throw new Error(\n (comparison === Comparison.LessConstrained\n ? `A child segment cannot override a parent segment with a less-constrained \\`ensureStatic\\`.`\n : `A child segment cannot override a parent segment with an incompatible \\`ensureStatic\\`.`) +\n `\\n Parent has: ` +\n `\\n ${formatEnsureStaticExport(parentResult.config)}` +\n `\\n (from: ${parentResult.filePath})` +\n `\\n Child has: ` +\n `\\n ${formatEnsureStaticExport(slotsResult.config)}` +\n `\\n (from: ${slotsResult.filePath})` +\n `\\n` +\n `\\n Possible fixes:` +\n `\\n - Remove one of the \\`ensureStatic\\` exports` +\n `\\n - Change one of the \\`ensureStatic\\` exports to match the other`\n )\n }\n }\n }\n}\n\nfunction formatParallelSlot(slot: string) {\n return slot === 'children' ? slot : `@${slot}`\n}\n\nfunction formatEnsureStaticExport(config: EnsureStatic) {\n return `export const ensureStatic = ${JSON.stringify(config)}`\n}\n\nenum Comparison {\n LessConstrained = 1,\n Compatible = 2,\n MoreConstrained = 3,\n Incompatible = 4,\n}\n\nconst ENSURE_STATIC_ORDER: Exclude<EnsureStatic, 'auto' | false>[] = [\n 'shell',\n 'prefetch',\n 'navigation',\n]\n\nfunction compareEnsureStatic(\n left: EnsureStatic,\n right: EnsureStatic\n): Comparison {\n // 'auto' is compatible with everything.\n if (left === 'auto' || right === 'auto') {\n return Comparison.Compatible\n }\n\n // `false` is compatible with false.\n if (left === false && right === false) {\n return Comparison.Compatible\n }\n // If only one of the values is `false` (we know it's not both), it's incompatible.\n if (left === false || right === false) {\n return Comparison.Incompatible\n }\n\n const leftSort = ENSURE_STATIC_ORDER.indexOf(left)\n const rightSort = ENSURE_STATIC_ORDER.indexOf(right)\n return leftSort < rightSort\n ? Comparison.LessConstrained\n : leftSort === rightSort\n ? Comparison.Compatible\n : Comparison.MoreConstrained\n}\n\nfunction getEnsureStaticConfigForModule(\n mod: Record<string, any> | undefined\n): EnsureStatic {\n return (mod ? (mod as AppSegmentConfig).ensureStatic : undefined) ?? 'auto'\n}\n","import { InvariantError } from '../../shared/lib/invariant-error'\nimport { createPromiseWithResolvers } from '../../shared/lib/promise-with-resolvers'\n\nexport enum RenderStage {\n Before = 1,\n //\n ShellStatic = 10,\n /** Discrimination-only stage: `prefetch()` in validation renders (static) */\n PrefetchStatic_prefetchApi = 11,\n PrefetchStatic = 12,\n NavigationStatic = 13,\n Static = 14,\n //\n ShellRuntime = 20,\n /** Discrimination-only stage: `prefetch()` in validation renders (runtime) */\n PrefetchRuntime_prefetchApi = 21,\n PrefetchRuntime = 22,\n NavigationRuntime = 23,\n //\n Dynamic = 30,\n Abandoned = 40,\n}\n\nexport type AdvanceableRenderStage = Exclude<\n RenderStage,\n RenderStage.Before | RenderStage.Abandoned\n>\n\nexport const RENDER_STAGE_ADVANCE_ORDER: AdvanceableRenderStage[] = [\n RenderStage.ShellStatic,\n RenderStage.PrefetchStatic_prefetchApi,\n RenderStage.PrefetchStatic,\n RenderStage.NavigationStatic,\n RenderStage.Static,\n //\n RenderStage.ShellRuntime,\n RenderStage.PrefetchRuntime_prefetchApi,\n RenderStage.PrefetchRuntime,\n RenderStage.NavigationRuntime,\n //\n RenderStage.Dynamic,\n]\n\nexport function getNextStage(\n stage: Exclude<AdvanceableRenderStage, RenderStage.Dynamic>\n) {\n return RENDER_STAGE_ADVANCE_ORDER[\n RENDER_STAGE_ADVANCE_ORDER.indexOf(stage) + 1\n ]\n}\n\nexport function isAdvanceableRenderStage(\n stage: RenderStage\n): stage is AdvanceableRenderStage {\n return RenderStage.Before < stage && stage <= RenderStage.Dynamic\n}\n\nexport enum SyncIOMode {\n /** Sync IO does not error in any stage. */\n Untracked = 1,\n /** Before `partialPrefetching`: Sync IO errors in static stages, and is allowed otherwise. */\n AllowedInRuntimeOrDynamic = 2,\n /** After `partialPrefetching`: Sync IO errors in all stages other than dynamic. */\n AllowedInDynamic = 3,\n}\n\nexport class StagedRenderingController {\n private abortSignal: AbortSignal | null\n private abandonController: AbortController | null\n private syncIOMode: SyncIOMode\n public readonly finalStage: AdvanceableRenderStage | null\n\n currentStage: RenderStage = RenderStage.Before\n\n syncInterruptReason: Error | null = null\n\n triggers: Record<AdvanceableRenderStage, StageTrigger> =\n createAdvanceableStageTriggers()\n\n constructor({\n abortSignal,\n abandonController,\n syncIO,\n finalStage,\n }: {\n abortSignal: AbortSignal | null\n abandonController: AbortController | null\n syncIO: SyncIOMode\n finalStage: AdvanceableRenderStage | null\n }) {\n this.abortSignal = abortSignal\n this.abandonController = abandonController\n this.syncIOMode = syncIO\n this.finalStage = finalStage\n\n if (abortSignal) {\n abortSignal.addEventListener(\n 'abort',\n () => {\n // Reject all stage promises that haven't already been resolved.\n // `cancelStageTrigger` is a noop if the trigger already resolved.\n const { reason } = abortSignal\n for (const trigger of Object.values(this.triggers)) {\n cancelStageTrigger(trigger, reason)\n }\n },\n { once: true }\n )\n }\n\n if (abandonController) {\n abandonController.signal.addEventListener(\n 'abort',\n () => {\n this.abandonRender()\n },\n { once: true }\n )\n }\n }\n\n /**\n * Schedules a callback that will execute synchronously when the controller is advanced\n * to `stage` or past it, before any promises for that stage are resolved.\n * If the controller is already past `stage`, the callback is executed immediately.\n * */\n onStage(stage: AdvanceableRenderStage, callback: () => void) {\n addSyncTriggerListener(this.triggers[stage], callback)\n }\n\n shouldTrackSyncInterrupt(): boolean {\n const { syncIOMode, currentStage } = this\n switch (syncIOMode) {\n case SyncIOMode.Untracked: {\n return false\n }\n case SyncIOMode.AllowedInRuntimeOrDynamic: {\n // Legacy: track Sync IO only in static stages.\n // Do not track it before the render, or in runtime/dynamic stages.\n return (\n currentStage > RenderStage.Before &&\n currentStage <= RenderStage.Static\n )\n }\n case SyncIOMode.AllowedInDynamic: {\n // Track sync IO in all cacheable stages.\n // This means all stages except:\n // - before the render\n // - in the dynamic stage\n return (\n currentStage > RenderStage.Before &&\n currentStage < RenderStage.Dynamic\n )\n }\n }\n }\n\n /** Note: only call this if `shouldTrackSyncInterrupt()` returned true */\n syncInterruptCurrentStageWithReason(reason: Error) {\n const { currentStage } = this\n if (\n currentStage === RenderStage.Before ||\n currentStage === RenderStage.Dynamic ||\n currentStage === RenderStage.Abandoned\n ) {\n // Not interruptible. Defensive noop.\n return\n }\n\n // If Sync IO occurs during an abandonable render, we trigger the abandon.\n // The abandon listener will call abandonRender which advances through\n // stages to let caches fill before marking as Abandoned.\n if (this.abandonController) {\n this.abandonController.abort()\n return\n }\n\n if (this.abortSignal) {\n // If this is an abortable render, we capture the interruption reason and stop advancing.\n // We don't release any more promises.\n // The caller is expected to abort the signal.\n this.syncInterruptReason = reason\n this.currentStage = RenderStage.Abandoned\n return\n }\n\n // If we're in a non-abandonable & non-abortable render,\n // we need to advance to the Dynamic stage and capture the interruption reason.\n // (in dev, this will be the restarted render)\n this.syncInterruptReason = reason\n this.advanceStage(RenderStage.Dynamic)\n }\n\n getSyncInterruptReason() {\n return this.syncInterruptReason\n }\n\n getStageEndTime(stage: Exclude<AdvanceableRenderStage, RenderStage.Dynamic>) {\n return this.triggers[getNextStage(stage)].triggeredAt ?? Infinity\n }\n\n private abandonRender() {\n // In staged rendering, only the initial render is abandonable.\n // We can abandon the initial render if\n // 1. We notice a cache miss, and need to wait for caches to fill\n // 2. A sync IO error occurs, and the render should be interrupted\n // (this might be a lazy intitialization of a module,\n // so we still want to restart in this case and see if it still occurs)\n // In either case, we'll be doing another render after this one,\n // so we only want to unblock the next stage, not Dynamic, because\n // unblocking the dynamic stage would likely lead to wasted (uncached) IO.\n\n const { currentStage } = this\n\n if (currentStage === RenderStage.Before) {\n throw new InvariantError(\n \"A render that hasn't started yet cannot be abandoned\"\n )\n }\n if (\n currentStage === RenderStage.Dynamic ||\n currentStage === RenderStage.Abandoned\n ) {\n // We shouldn't ever trigger an abandon in these. Defensive noop.\n return\n }\n\n // Resolve all stages after the current one, up to runtime (excluding dynamic)\n const nextStageIx = RENDER_STAGE_ADVANCE_ORDER.indexOf(currentStage) + 1\n const dynamicStageIx = RENDER_STAGE_ADVANCE_ORDER.indexOf(\n RenderStage.Dynamic\n )\n for (let i = nextStageIx; i < dynamicStageIx; i++) {\n this.resolveStage(RENDER_STAGE_ADVANCE_ORDER[i])\n }\n\n this.currentStage = RenderStage.Abandoned\n }\n\n advanceStage(targetStage: AdvanceableRenderStage) {\n if (this.finalStage !== null && targetStage > this.finalStage) {\n throw new InvariantError(\n `Attempted to advance to stage ${RenderStage[targetStage]} but the render is limited to ${RenderStage[this.finalStage]}`\n )\n }\n const { currentStage } = this\n\n if (\n currentStage === RenderStage.Dynamic ||\n currentStage === RenderStage.Abandoned\n ) {\n // Terminal stages, nowhere left to advance.\n return\n }\n\n // If we're already at the target stage or beyond, do nothing.\n if (targetStage <= currentStage) {\n return\n }\n\n this.currentStage = targetStage\n\n // Resolve all stages between the current stage and the target.\n const nextStageIx =\n currentStage === RenderStage.Before\n ? 0\n : RENDER_STAGE_ADVANCE_ORDER.indexOf(currentStage) + 1\n const targetStageIx = RENDER_STAGE_ADVANCE_ORDER.indexOf(targetStage)\n for (let i = nextStageIx; i <= targetStageIx; i++) {\n this.resolveStage(RENDER_STAGE_ADVANCE_ORDER[i])\n }\n }\n\n private resolveStage(stage: AdvanceableRenderStage) {\n fireStageTrigger(this.triggers[stage])\n }\n\n private getStagePromise(stage: AdvanceableRenderStage): Promise<void> {\n return this.triggers[stage].promise\n }\n\n waitForStage(stage: AdvanceableRenderStage) {\n return this.getStagePromise(stage)\n }\n\n delayUntilStage<T>(\n stage: AdvanceableRenderStage,\n displayName: string | undefined,\n resolvedValue: T\n ): Promise<T> {\n const stagePromise = this.getStagePromise(stage)\n\n const promise =\n process.env.NODE_ENV === 'development'\n ? makeDevtoolsIOPromiseFromIOTrigger(\n stagePromise,\n displayName,\n resolvedValue\n )\n : stagePromise.then(() => resolvedValue)\n\n // Analogously to `makeDynamicHangingPromise`, we might reject this promise if the signal is invoked.\n // (e.g. in the case where we don't want want the render to proceed to the dynamic stage and abort it).\n // We shouldn't consider this an unhandled rejection, so we attach a noop catch handler here to suppress this warning.\n if (this.abortSignal) {\n promise.catch(ignoreReject)\n }\n return promise\n }\n}\n\nfunction createAdvanceableStageTriggers(): Record<\n AdvanceableRenderStage,\n StageTrigger\n> {\n const triggers: Partial<Record<AdvanceableRenderStage, StageTrigger>> = {}\n for (const stage of RENDER_STAGE_ADVANCE_ORDER) {\n triggers[stage] = createStageTrigger()\n }\n return triggers as Record<AdvanceableRenderStage, StageTrigger>\n}\n\nfunction ignoreReject() {}\n\n// TODO(restart-on-cache-miss): the layering of `delayUntilStage`,\n// `makeDevtoolsIOPromiseFromIOTrigger` and and `makeDevtoolsIOAwarePromise`\n// is confusing, we should clean it up.\nfunction makeDevtoolsIOPromiseFromIOTrigger<T>(\n ioTrigger: Promise<any>,\n displayName: string | undefined,\n resolvedValue: T\n): Promise<T> {\n // If we create a `new Promise` and give it a displayName\n // (with no userspace code above us in the stack)\n // React Devtools will use it as the IO cause when determining \"suspended by\".\n // In particular, it should shadow any inner IO that resolved/rejected the promise\n // (in case of staged rendering, this will be the `setTimeout` that triggers the relevant stage)\n const promise = new Promise<T>((resolve, reject) => {\n ioTrigger.then(resolve.bind(null, resolvedValue), reject)\n })\n if (displayName !== undefined) {\n // @ts-expect-error\n promise.displayName = displayName\n }\n return promise\n}\n\ntype StageTrigger = {\n state: 'pending' | 'triggered' | 'cancelled'\n triggeredAt: number | null\n promise: Promise<void>\n _listeners: Array<() => void>\n _resolvePromise: () => void\n _rejectPromise: (reason: unknown) => void\n}\n\nfunction addSyncTriggerListener(trigger: StageTrigger, listener: () => void) {\n if (trigger.state === 'pending') {\n trigger._listeners.push(listener)\n } else {\n listener()\n }\n}\n\nfunction createStageTrigger(): StageTrigger {\n const { promise, resolve, reject } = createPromiseWithResolvers<void>()\n return {\n state: 'pending',\n triggeredAt: null,\n promise,\n _listeners: [],\n _resolvePromise: resolve,\n _rejectPromise: reject,\n }\n}\n\nfunction fireStageTrigger(trigger: StageTrigger) {\n if (trigger.state !== 'pending') {\n return\n }\n trigger.state = 'triggered'\n trigger.triggeredAt = performance.now() + performance.timeOrigin\n try {\n const { _listeners: listeners } = trigger\n for (let i = 0; i < listeners.length; i++) {\n listeners[i]()\n }\n listeners.length = 0\n } finally {\n trigger._resolvePromise()\n }\n}\n\nfunction cancelStageTrigger(trigger: StageTrigger, reason: unknown) {\n if (trigger.state !== 'pending') {\n return\n }\n trigger.state = 'cancelled'\n // we didn't trigger, so don't save `triggeredAt`.\n\n // We're not gonna fire the listeners, we may as well free them.\n trigger._listeners.length = 0\n\n // Suppress unhandled rejection warnings for promises that no one is awaiting.\n trigger.promise.catch(ignoreReject)\n trigger._rejectPromise(reason)\n}\n","import * as React from 'react'\n\nconst errorRef: { current: null | Error } = { current: null }\n\n// React.cache is currently only available in canary/experimental React channels.\nconst cache =\n typeof React.cache === 'function'\n ? React.cache\n : (fn: (key: unknown) => void) => fn\n\n// When Cache Components is enabled, we record these as errors so that they\n// are captured by the dev overlay as it's more critical to fix these\n// when enabled.\nconst logErrorOrWarn = process.env.__NEXT_CACHE_COMPONENTS\n ? console.error\n : console.warn\n\n// We don't want to dedupe across requests.\n// The developer might've just attempted to fix the warning so we should warn again if it still happens.\nconst flushCurrentErrorIfNew = cache(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars -- cache key\n (key: unknown) => {\n try {\n logErrorOrWarn(errorRef.current)\n } finally {\n errorRef.current = null\n }\n }\n)\n\n/**\n * Creates a function that logs an error message that is deduped by the userland\n * callsite.\n * This requires no indirection between the call of this function and the userland\n * callsite i.e. there's only a single library frame above this.\n * Do not use on the Client where sourcemaps and ignore listing might be enabled.\n * Only use that for warnings need a fix independent of the callstack.\n *\n * @param getMessage\n * @returns\n */\nexport function createDedupedByCallsiteServerErrorLoggerDev<Args extends any[]>(\n getMessage: (...args: Args) => Error\n) {\n return function logDedupedError(...args: Args) {\n const message = getMessage(...args)\n\n if (process.env.NODE_ENV !== 'production') {\n const callStackFrames = new Error().stack?.split('\\n')\n if (callStackFrames === undefined || callStackFrames.length < 4) {\n logErrorOrWarn(message)\n } else {\n // Error:\n // logDedupedError\n // asyncApiBeingAccessedSynchronously\n // <userland callsite>\n // TODO: This breaks if sourcemaps with ignore lists are enabled.\n const key = callStackFrames[4]\n errorRef.current = message\n flushCurrentErrorIfNew(key)\n }\n } else {\n logErrorOrWarn(message)\n }\n }\n}\n","import { InvariantError } from '../shared/lib/invariant-error'\nimport { createPromiseWithResolvers } from '../shared/lib/promise-with-resolvers'\nimport { EnsureStaticLevel } from './app-render/segment-config/ensure-static'\nimport {\n RenderStage,\n type StagedRenderingController,\n type AdvanceableRenderStage,\n} from './app-render/staged-rendering'\nimport { workAsyncStorage } from './app-render/work-async-storage.external'\nimport type {\n RequestStore,\n WorkUnitStore,\n} from './app-render/work-unit-async-storage.external'\nimport { workUnitAsyncStorage } from './app-render/work-unit-async-storage.external'\nimport { getServerReact, getClientReact } from './runtime-reacts.external'\n\nexport function isHangingPromiseRejectionError(\n err: unknown\n): err is HangingPromiseRejectionError {\n if (typeof err !== 'object' || err === null || !('digest' in err)) {\n return false\n }\n\n return err.digest === HANGING_PROMISE_REJECTION\n}\n\nconst HANGING_PROMISE_REJECTION = 'HANGING_PROMISE_REJECTION'\n\nclass HangingPromiseRejectionError extends Error {\n public readonly digest = HANGING_PROMISE_REJECTION\n\n constructor(\n public readonly route: string,\n public readonly expression: string\n ) {\n super(\n `During prerendering, ${expression} rejects when the prerender is complete. Typically these errors are handled by React but if you move ${expression} to a different context by using \\`setTimeout\\`, \\`after\\`, or similar functions you may observe this error and you should handle it in that context. This occurred at route \"${route}\".`\n )\n }\n}\n\nconst CLIENT_HOOK_DYNAMIC = 'CLIENT_HOOK_DYNAMIC'\n\nexport class ClientHookDynamicError extends Error {\n public readonly digest = CLIENT_HOOK_DYNAMIC\n\n constructor(route: string, expression: string) {\n super(\n `Route \"${route}\": Next.js encountered URL data \\`${expression}\\` in a Client Component outside of \\`<Suspense>\\`.\\n\\n` +\n `This blocks prerendering because the value is only available at runtime.\\n\\n` +\n `Ways to fix this:\\n` +\n ` - [stream] Wrap the component in \\`<Suspense fallback={...}>\\` so the hook value streams in after prerendering\\n` +\n ` - [block] Set \\`export const instant = false\\` to allow a blocking route\\n\\n` +\n `Learn more: https://nextjs.org/docs/messages/blocking-prerender-client-hook`\n )\n }\n}\n\nexport function isClientHookDynamicError(\n err: unknown\n): err is ClientHookDynamicError {\n if (typeof err !== 'object' || err === null || !('digest' in err)) {\n return false\n }\n\n return err.digest === CLIENT_HOOK_DYNAMIC\n}\n\ntype AbortListeners = Array<() => void>\nconst abortListenersBySignal = new WeakMap<AbortSignal, AbortListeners>()\n\n/**\n * Constructs a promise that never resolves, standing in for *dynamic* data:\n * data that is only available during a real dynamic request and hangs in\n * every kind of prerender — `io()`, `connection()`, uncached `fetch()`.\n *\n * This is primarily useful for cacheComponents where we use promise\n * resolution timing to determine which parts of a render can be included in a\n * prerender.\n *\n * Records nothing on the prerender store: the promise's holes are only ever\n * filled by a real dynamic request, so a runtime prefetch response would have\n * the same holes as the static one. If the data source would resolve during a\n * runtime prerender, use `makeRuntimeHangingPromise` instead.\n */\nexport function makeDynamicHangingPromise<T>(\n signal: AbortSignal,\n route: string,\n expression: string\n): Promise<T> {\n return makeHangingPromiseWithError(\n signal,\n new HangingPromiseRejectionError(route, expression)\n )\n}\n\nexport function makeUntrackedHangingPromise<T>(\n signal: AbortSignal,\n route: string,\n expression: string\n): Promise<T> {\n return makeHangingPromiseWithError(\n signal,\n new HangingPromiseRejectionError(route, expression)\n )\n}\n\n/**\n * Constructs a promise that never resolves, standing in for session data\n * (which a runtime shell can access).\n * Examples: cookies, headers\n *\n * Awaiting one of these during a static prerender records on the prerender\n * store that a runtime shell would produce more content than the static\n * static shell, which the segment prefetch encoding uses\n * to tell the client whether a runtime request could be skipped.\n *\n * When unsure whether data is dynamic or runtime, prefer this method — the\n * cost of over-recording is a redundant runtime prefetch request; the cost of\n * under-recording is a permanently missing one.\n *\n * For fallback-param data — data a concrete (ISR-upgraded) prerender would\n * resolve — use `makeFallbackParamsHangingPromise` instead, so the access\n * is recorded with the right effect on the static-prefetch hint.\n */\nexport function makeSessionDataHangingPromise<T>(\n signal: AbortSignal,\n route: string,\n expression: string,\n workUnitStore: WorkUnitStore\n): Promise<T> {\n const promise = makeHangingPromiseWithError<T>(\n signal,\n new HangingPromiseRejectionError(route, expression)\n )\n return trackPromiseUsed(\n promise,\n trackSessionDataAccessed.bind(null, workUnitStore, expression)\n )\n}\n\n/**\n * Constructs a promise that never resolves, standing in for URL data,\n * which can be accessed in a runtime prefetch (but not a runtime shell).\n * Examples: fallback params, searchParams\n *\n * Awaiting one of these during a static prerender records on the prerender\n * store that a runtime prefetch would produce more content than the static\n * response, which the segment prefetch encoding uses\n * to tell the client whether a runtime prefetch request could be skipped.\n *\n * When unsure whether data is dynamic or runtime, prefer this method — the\n * cost of over-recording is a redundant runtime prefetch request; the cost of\n * under-recording is a permanently missing one.\n *\n * `workUnitStore` may be null ONLY when the caller tracks the access itself.\n * Such a caller MUST call `trackURLDataAccessed` from every path that\n * observes the promise (e.g. the proxy traps for `then`/`status`),\n * against the work unit store active at access time.\n *\n * For fallback-param data — data a concrete (ISR-upgraded) prerender would\n * resolve — use `makeFallbackParamsHangingPromise` instead, so the access\n * is recorded with the right effect on the static-prefetch hint.\n */\nexport function makeURLDataHangingPromise<T>(\n signal: AbortSignal,\n route: string,\n expression: string,\n workUnitStore: WorkUnitStore | null\n): Promise<T> {\n const promise = makeHangingPromiseWithError<T>(\n signal,\n new HangingPromiseRejectionError(route, expression)\n )\n if (workUnitStore === null) {\n return promise\n }\n return trackPromiseUsed(\n promise,\n trackURLDataAccessed.bind(null, workUnitStore, expression)\n )\n}\n\n/**\n * Creates a promise that stands in for a result that will either be session data\n * or URL data, but we don't know which.\n */\nexport function makeUnknownRuntimeDataHangingPromise<T>(\n signal: AbortSignal,\n route: string,\n expression: string,\n workUnitStore: WorkUnitStore\n): Promise<T> {\n // We don't know if this is session or URL data, i.e. if it should affect the shell\n // or only the prefetch. Track it conservatively as affecting both.\n return makeSessionDataHangingPromise(signal, route, expression, workUnitStore)\n}\n\n/**\n * Constructs a promise that never resolves, standing in for data that is only\n * accessible in the prefetch, but not in the shell, e.g. `prefetch()`.\n * This usage does *not* indicate that a runtime request is needed,\n * only that the data is not available in a shell.\n *\n * @internal\n */\nexport function makePrefetchHangingPromise<T>(\n signal: AbortSignal,\n route: string,\n expression: string\n): Promise<T> {\n return makeUntrackedHangingPromise(signal, route, expression)\n}\n\n/**\n * Variant of `makeRuntimeHangingPromise` for *fallback-param* data: fallback\n * route params and values derived solely from them (`params`, `rootParams`,\n * `pathname` during a fallback prerender). Like every runtime data access,\n * awaiting it records the access on the prerender store's response-level flag,\n * but its effect on the build-time static-prefetch hint differs — on a\n * fallback-upgradeable route the access is transient (a concrete prerender\n * resolves it), so it leaves the hint intact. See `trackFallbackParamsAccessed`.\n *\n * As with `makeRuntimeHangingPromise`, `workUnitStore` may be null ONLY when\n * the caller tracks the access itself by calling `trackFallbackParamsAccessed`\n * from every path that observes the promise.\n */\nexport function makeFallbackParamsHangingPromise<T>(\n signal: AbortSignal,\n route: string,\n expression: string,\n workUnitStore: WorkUnitStore | null\n): Promise<T> {\n const promise = makeHangingPromiseWithError<T>(\n signal,\n new HangingPromiseRejectionError(route, expression)\n )\n if (workUnitStore === null) {\n return promise\n }\n return trackPromiseUsed(\n promise,\n trackFallbackParamsAccessed.bind(null, workUnitStore, expression)\n )\n}\n\nexport type PrerenderDataTracking = {\n /**\n * Records when the render has accessed a request data source\n * that hangs during a static prerender but would resolve during a runtime\n * prerender — cookies, headers, fallback params, searchParams, and cache\n * entries excluded only from static prerenders.\n *\n * The client uses this promise as the actual source of truth for whether a segment\n * needs a runtime request. Prefetch hints can become stale after a revalidation,\n * so if a hint says a static request should be enough but `runtimeDataAccessed`\n * resolves to `true`, a follow-up runtime request will be issued.\n * This applies to both shells and prefetches.\n *\n * The promise is embedded in the RSC payload (`InitialRSCPayload['u']`),\n * and is meant to be rewindable. This means that the shell might not have\n * any runtime data accesses, even when the prefetch does.\n * (this has some subtleties; see `markRuntimeDataAccessWhenStageReached`\n * for more)\n *\n * After the prerender, the promise is consumed by `collectSegmentData` and each\n * static prefetch will contain it (`PrefetchFlightResponse['u']`).\n * However, all the segments for a route will use the same promise (because we're\n * only tracking this on the page level) so if one segment needs runtime data, then\n * all segments will be marked as such.\n * However, on the client `isPartial` takes precedence over `runtimeDataAccessed`,\n * so complete segments will not end up being deopted.\n */\n readonly runtimeDataAccessed: PromiseWithResolvers<boolean>\n\n /** Corresponds to `PrefetchHint.ShouldAttemptStaticShell`. */\n shouldAttemptStaticShell: boolean\n /** Corresponds to `PrefetchHint.ShouldAttemptStaticPrefetch`. */\n shouldAttemptStaticPrefetch: boolean\n}\n\nexport function createPrerenderDataTracking(): PrerenderDataTracking {\n return {\n runtimeDataAccessed: createPromiseWithResolvers(),\n shouldAttemptStaticShell: true,\n shouldAttemptStaticPrefetch: true,\n }\n}\n\nexport function finishPrerenderDataTracking(\n prerenderDataTracking: PrerenderDataTracking\n) {\n // If a runtime data access already resolved this promise, this is a no-op.\n prerenderDataTracking.runtimeDataAccessed.resolve(false)\n}\n\n/**\n * Records on a static prerender store that the render accessed a data source\n * which would have resolved in a runtime shell (or runtime prefetch).\n * No-op for all other store types.\n *\n * Prefer `makeRuntimeHangingPromise`. Use this function only when implementing\n * similar tracking and that one is not enough.\n */\nfunction trackSessionDataAccessed(\n workUnitStore: WorkUnitStore,\n expression: string\n): void {\n trackRuntimeDataAccessed(\n workUnitStore,\n PrerenderDataKind.SessionData,\n expression\n )\n}\n\n/**\n * Records on a static prerender store that the render accessed a data source\n * which would have resolved in a runtime prefetch (but NOT in a runtime shell)\n * No-op for all other store types.\n *\n * Prefer `makeRuntimeHangingPromise`. Use this function only when implementing\n * similar tracking and that one is not enough.\n *\n * For fallback-param data, use `trackFallbackParamsAccessed` instead. When\n * unsure, this is the conservative choice.\n */\nexport function trackURLDataAccessed(\n workUnitStore: WorkUnitStore,\n expression: string\n): void {\n trackRuntimeDataAccessed(workUnitStore, PrerenderDataKind.UrlData, expression)\n}\n\n/**\n * Fallback-param variant of `trackRuntimeDataAccessed`, for accesses of\n * fallback route params and values derived solely from them. It records the\n * response-level flag all the same, but only clears the build-time\n * static-prefetch hint when the route is not fallback-upgradeable — on an\n * upgradeable route the access is transient, since ISR later produces a\n * concrete prerender that resolves it.\n */\nexport function trackFallbackParamsAccessed(\n workUnitStore: WorkUnitStore,\n expression: string\n): void {\n trackRuntimeDataAccessed(\n workUnitStore,\n PrerenderDataKind.FallbackParams,\n expression\n )\n}\n\nconst enum PrerenderDataKind {\n SessionData = 1,\n UrlData = 2,\n FallbackParams = 3,\n}\n\nfunction trackRuntimeDataAccessed(\n workUnitStore: WorkUnitStore,\n dataKind: PrerenderDataKind,\n expression: string\n): void {\n switch (workUnitStore.type) {\n case 'prerender': {\n const { prerenderDataTracking, stagedRendering } = workUnitStore\n if (!prerenderDataTracking || !stagedRendering) {\n return\n }\n const { currentStage } = stagedRendering\n if (currentStage === RenderStage.Before) {\n console.error(\n new InvariantError(\n 'Unexpected trackRuntimeDataAccessed in the Before stage.'\n )\n )\n return\n }\n if (currentStage >= RenderStage.NavigationStatic) {\n // Ignore any accesses that happen after `navigation()` resolves.\n // The purpose of this tracking is to judge whether a runtime prefetch\n // would give us a more complete result than a static one.\n // But `navigation()` wouldn't have resolved in a runtime prefetch,\n // so e.g. `await navigation(); await cookies()` wouldn't have more content\n // in those, and we shouldn't count it.\n return\n }\n\n const ensureStaticLevel =\n workUnitStore.ensureStaticLevel ?? EnsureStaticLevel.None\n\n // NOTE: In general, we keep hints in sync with `needsRuntimeRequest`, but they\n // don't have to always match. The client re-uses hints for the entire route,\n // while `needsRuntimeRequest` can vary across individual prerendered param values\n // (e.g. if cookies are accessed depending on a param value).\n // Hints can also become outdated if a route only starts using runtime data\n // after a revalidation, so we have to expect this and be resilient to it.\n // Also see the upgradeable fallback params case below, which deliberately\n // puts them out of sync.\n\n switch (dataKind) {\n case PrerenderDataKind.SessionData: {\n // Potentially deopt both the shell and the prefetch,\n // because if the shell accessed runtime data, so does the prefetch.\n // However, if we're already past the shell stage, the shell is not affected.\n // (which makes e.g. `await prefetch(); await cookies()` only affect the prefetch)\n let firstAffectedStage:\n | RenderStage.ShellStatic\n | RenderStage.PrefetchStatic\n | null = null\n\n if (\n currentStage <= RenderStage.ShellStatic &&\n // Only track if we're not forcing the shell to be static.\n ensureStaticLevel < EnsureStaticLevel.Shell\n ) {\n prerenderDataTracking.shouldAttemptStaticShell = false\n firstAffectedStage ??= RenderStage.ShellStatic\n logRuntimeDeopt?.(expression, 'shell')\n }\n\n if (\n currentStage <= RenderStage.PrefetchStatic &&\n // Only track if we're not forcing the prefetch to be static.\n ensureStaticLevel < EnsureStaticLevel.Prefetch\n ) {\n prerenderDataTracking.shouldAttemptStaticPrefetch = false\n // NOTE: if the shell is affected, don't override it.\n firstAffectedStage ??= RenderStage.PrefetchStatic\n logRuntimeDeopt?.(expression, 'prefetch')\n }\n\n if (firstAffectedStage !== null) {\n markRuntimeDataAccessWhenStageReached(\n prerenderDataTracking,\n stagedRendering,\n firstAffectedStage\n )\n }\n break\n }\n case PrerenderDataKind.FallbackParams: {\n if (workUnitStore.isFallbackUpgradeable) {\n // An fallback-param access is transient when the route is\n // fallback-upgradeable (i.e. ISR later produces the concrete prerender a\n // static prefetch would hit) so it does not indicate the need for a runtime\n // request and thus does not affect the static hints.\n //\n // If runtime prefetches are not disallowed by `ensureStatic`, then we still\n // set `runtimeDataAccessed` (while keeping the hints static). This means that\n // if the concrete prerender isn't ready yet and we served the fallback, then\n // the client knows it can use a *runtime* prefetch for speculative links --\n // a runtime prefetch can provide the same content (or more) as the concrete\n // prerender would.\n if (ensureStaticLevel < EnsureStaticLevel.Prefetch) {\n markRuntimeDataAccessWhenStageReached(\n prerenderDataTracking,\n stagedRendering,\n // `params` are URL data, so they only affect the prefetch\n RenderStage.PrefetchStatic\n )\n logRuntimeUpgradeableFallback?.()\n }\n break\n }\n // not an upgradeable fallback param access, so we treat it as URL data.\n // intentional fallthrough\n }\n case PrerenderDataKind.UrlData: {\n // Only deopt the prefetch, not the shell, which cannot access URL data anyway.\n if (\n currentStage <= RenderStage.PrefetchStatic &&\n ensureStaticLevel < EnsureStaticLevel.Prefetch\n ) {\n prerenderDataTracking.shouldAttemptStaticPrefetch = false\n logRuntimeDeopt?.(expression, 'prefetch')\n\n markRuntimeDataAccessWhenStageReached(\n prerenderDataTracking,\n stagedRendering,\n RenderStage.PrefetchStatic\n )\n }\n break\n }\n }\n\n break\n }\n case 'prerender-client':\n case 'prerender-legacy':\n case 'prerender-runtime':\n case 'validation-client':\n case 'request':\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n case 'build-time-generator':\n // Only the modern server prerender tracks this; see the field docs on\n // PrerenderStoreModernServer.\n break\n default:\n workUnitStore satisfies never\n }\n}\n\n/**\n * Tracks a runtime data access on the `runtimeDataAccessed` promise,\n * but with a delay until `targetStage`.\n *\n * When we encounter a URL data access like `await params`, we need to mark the\n * *prefetch* as needing runtime data, but the *shell* should remain unaffected\n * (because it cannot access params anyway).\n *\n * However, the shell and the prefetch share one `runtimeDataAccessed` promise,\n * and it needs to be accurately rewindable by the client\n * In other words, we need to make sure that it reads as `false` when rewound\n * to a shell, but as `true` in the final response (the prefetch).\n *\n * This means that if the `await params` is encountered during the shell stage, we\n * cannot resolve `runtimeDataAccessed` immediately.\n * Instead, we delay the resolution until the PrefetchStatic stage, so the promise\n * will remain unresolved when rewound to the shell stage (which reads as `false`).\n */\nfunction markRuntimeDataAccessWhenStageReached(\n prerenderDataTracking: PrerenderDataTracking,\n stageController: StagedRenderingController,\n targetStage: AdvanceableRenderStage\n) {\n const { runtimeDataAccessed } = prerenderDataTracking\n // NOTE: If we're already in or past the target stage, we can avoid allocating a closure,\n // because `onStage` would've executed the callback immediately anyway.\n if (stageController.currentStage >= targetStage) {\n runtimeDataAccessed.resolve(true)\n } else {\n stageController.onStage(\n targetStage,\n runtimeDataAccessed.resolve.bind(null, true)\n )\n }\n}\n\nconst logRuntimeDeopt = process.env.NEXT_PRIVATE_DEBUG_RUNTIME_DATA\n ? (expression: string, kind: 'shell' | 'prefetch') => {\n const { route } = workAsyncStorage.getStore()!\n console.log(\n `Route '${route}': deopting to a runtime ${kind} because it used ${expression}`\n )\n }\n : undefined\n\nconst logRuntimeUpgradeableFallback = process.env\n .NEXT_PRIVATE_DEBUG_RUNTIME_DATA\n ? () => {\n const { route } = workAsyncStorage.getStore()!\n console.log(\n `Route '${route}': marking upgradeable fallback as runtime prefetchable`\n )\n }\n : undefined\n\n/**\n * Signals that we cannot recover both a runtime shell and a static (PPR) shell\n * from the same render. Use this whenever the stage of a promise varies on\n * `RequestStore.needsRuntimeShell`.\n * */\nexport function trackIncompatibleShellContent(\n workUnitStore: RequestStore,\n reason: string\n) {\n const { stagedRendering } = workUnitStore\n if (!stagedRendering) {\n return\n }\n\n // TODO(app-shells): optimize this to only consider stages that are relevant for validation.\n // We should only track incompatible content when it can affect them.\n // For now, we simply exclude everything that happens in the dynamic stage.\n // (Note that we also need to account for cache misses that move things to a\n // different stage -- those should also preemptively set `hasIncompatibleShellContent`\n // because there's a chance that a render with warm caches would set it)\n const { currentStage } = stagedRendering\n if (\n currentStage === RenderStage.Dynamic ||\n currentStage === RenderStage.Abandoned\n ) {\n return\n }\n if (process.env.NEXT_PRIVATE_DEBUG_VALIDATION) {\n const workStore = workAsyncStorage.getStore()!\n console.log(\n `Route ${workStore.route}: Incompatible shell content: ${reason}`\n )\n }\n workUnitStore.hasIncompatibleShellContent = true\n}\n\nexport function makeClientHookHangingPromise<T>(\n signal: AbortSignal,\n error: ClientHookDynamicError\n): Promise<T> {\n return makeHangingPromiseWithError(signal, error)\n}\n\nfunction makeHangingPromiseWithError<T>(\n signal: AbortSignal,\n error: Error\n): Promise<T> {\n if (signal.aborted) {\n return Promise.reject(error)\n } else {\n const hangingPromise = new Promise<T>((_, reject) => {\n const boundRejection = reject.bind(null, error)\n let currentListeners = abortListenersBySignal.get(signal)\n if (currentListeners) {\n currentListeners.push(boundRejection)\n } else {\n const listeners = [boundRejection]\n abortListenersBySignal.set(signal, listeners)\n signal.addEventListener(\n 'abort',\n () => {\n for (let i = 0; i < listeners.length; i++) {\n listeners[i]()\n }\n },\n { once: true }\n )\n }\n })\n // We are fine if no one actually awaits this promise. We shouldn't consider this an unhandled rejection so\n // we attach a noop catch handler here to suppress this warning. If you actually await somewhere or construct\n // your own promise out of it you'll need to ensure you handle the error when it rejects.\n hangingPromise.catch(ignoreReject)\n return hangingPromise\n }\n}\n\nfunction ignoreReject() {}\n\n/**\n * Creates a promise that will be triggered when another promise resolves.\n * It will not emit unhandled rejections, which is important if the trigger\n * is a promise that might itself get rejected (e.g. when a prerender/render\n * are aborted due to sync IO)\n */\nexport function makePromiseFromTrigger<T>(\n trigger: Promise<any>,\n value: T\n): Promise<T> {\n const promise = trigger.then(() => value)\n promise.catch(ignoreReject)\n return promise\n}\n\nexport function makeDevtoolsIOAwarePromise<T>(\n underlying: T,\n requestStore: RequestStore,\n stage: AdvanceableRenderStage\n): Promise<T> {\n if (requestStore.stagedRendering) {\n // We resolve each stage in a timeout, so React DevTools will pick this up as IO.\n return requestStore.stagedRendering.delayUntilStage(\n stage,\n undefined,\n underlying\n )\n }\n // in React DevTools if we resolve in a setTimeout we will observe\n // the promise resolution as something that can suspend a boundary or root.\n return new Promise<T>((resolve) => {\n // Must use setTimeout to be considered IO React DevTools. setImmediate will not work.\n setTimeout(() => {\n resolve(underlying)\n }, 0)\n })\n}\n\n/**\n * Invokes `onUse` whenever `then()/catch()/finally()` are called on the promise\n * or when the promise is awaited. */\nexport function trackPromiseUsed<T>(\n promise: Promise<T>,\n onUse: () => void\n): Promise<T> {\n // We can instrument `.then()/.catch()/.finally()` in one go by using a Promise subclass\n // that implements a custom `.then()`, because `catch` and `finally` delegate to it.\n //\n // Alternative implementation ideas that were tried and rejected:\n //\n // 1. Patching the methods directly via `promise.then = (..args) => { ... }`:\n // doesn't work, because Node does not call the monkeypatched methods for native `await`:\n // > Native Promise [...]: The promise is directly used and awaited natively, without calling `then()`.\n // > https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await#description\n //\n // 2. Wrapping in a proxy that returns a custom `then/catch/finally`:\n // breaks async stacks in React's IO tracking (stack becomes `Promise.then`)\n return TrackedPromise.from<T>(promise, onUse)\n}\n\nclass TrackedPromise<T> extends Promise<T> {\n #onUse: (() => void) | null = null\n\n // We don't need derived promises to also be a TrackedPromise.\n // We only care about the first level of `.then()`.\n static get [Symbol.species]() {\n return Promise\n }\n\n static from<T>(promise: Promise<T>, onUse: () => void): TrackedPromise<T> {\n // Whenever the promise we're tracking resolves/rejects, we should follow.\n const tracked = new TrackedPromise<T>(promise.then.bind(promise))\n\n tracked.#onUse = onUse\n\n // Hanging promises catch rejections when created. Tracked promises are generally derived\n // from promises that may hang & reject, so we need to do the same.\n // However, we have to bypass the tracking we do in `TrackedPromise.then`.\n // (we're using `then` directly, because `catch` ends up delegating `TrackedPromise.then`)\n Promise.prototype.then.call(tracked, undefined, ignoreReject)\n\n return tracked\n }\n\n then<TResult1, TResult2>(\n onFulfilled?: (value: T) => TResult1 | PromiseLike<TResult1>,\n onRejected?: (reason: unknown) => TResult2 | PromiseLike<TResult2>\n ): Promise<TResult1 | TResult2> {\n const onUse = this.#onUse\n if (onUse) {\n try {\n onUse()\n } catch (err) {\n // We don't want to break the method even if our tracking errored.\n console.error(err)\n }\n }\n\n return Promise.prototype.then.call(\n this,\n onFulfilled,\n onRejected\n ) as Promise<TResult1 | TResult2>\n }\n}\n\nexport const RENDER_STAGES_BY_DATA_KIND = {\n sessionData: RenderStage.ShellRuntime as const,\n /**\n * Statically-prerenderable URL data, like static `params`.\n * It may need to be pushed to a runtime stage in a runtime prerender,\n * but it's semantically distinct from `runtimeUrlData` like `searchParams`,\n * which is always excluded from static prerenders.\n * */\n staticUrlData: {\n /**\n * From that app's point of view, `prefetch()` is semantically the same as\n * `staticUrlData`, because it does not resolve in a shell but resolves in\n * a prefetch (even a static one).\n * We handle it separately to provide a specialized error in validation renders.\n */\n prefetchApi: {\n static: RenderStage.PrefetchStatic_prefetchApi as const,\n runtime: RenderStage.PrefetchRuntime_prefetchApi as const,\n },\n static: RenderStage.PrefetchStatic as const,\n runtime: RenderStage.PrefetchRuntime as const,\n },\n /**\n * URL data that is never statically-prerenderable, like static `searchParams`.\n * */\n runtimeUrlData: RenderStage.PrefetchRuntime as const,\n}\n\nexport function applyOwnerStack(error: Error): Error {\n if (process.env.NODE_ENV !== 'production') {\n let ownerStack: string | undefined | null\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n // captureOwnerStack() returns the owner stack for the current React\n // rendering context. Inside a cache scope this only includes the inner\n // component tree. The outer owner stack (captured before entering the\n // cache boundary in use-cache-wrapper.ts) is stored on the cache store.\n // We concatenate both to get the full component tree.\n const innerOwnerStack =\n getClientReact()?.captureOwnerStack?.() ??\n getServerReact()?.captureOwnerStack?.()\n\n switch (workUnitStore?.type) {\n case 'cache':\n case 'private-cache':\n ownerStack =\n (innerOwnerStack || '') + (workUnitStore.outerOwnerStack || '') ||\n undefined\n break\n case 'unstable-cache':\n case 'request':\n case 'prerender':\n case 'prerender-legacy':\n case 'prerender-runtime':\n case 'prerender-client':\n case 'validation-client':\n case 'build-time-generator':\n case undefined:\n ownerStack = innerOwnerStack\n break\n default:\n workUnitStore satisfies never\n }\n\n if (ownerStack) {\n let stack = ownerStack\n\n if (error.stack) {\n const frames: string[] = []\n\n for (const frame of error.stack.split('\\n').slice(1)) {\n if (frame.includes('react_stack_bottom_frame')) {\n break\n }\n\n frames.push(frame)\n }\n\n stack = '\\n' + frames.join('\\n') + stack\n }\n\n error.stack = error.name + ': ' + error.message + stack\n }\n }\n\n return error\n}\n","import type { AppDirModules } from '../../build/webpack/loaders/next-app-loader'\nimport { DEFAULT_SEGMENT_KEY } from '../../shared/lib/segment'\n\n/**\n * LoaderTree is generated in next-app-loader.\n */\nexport type LoaderTree = [\n segment: string,\n parallelRoutes: { [parallelRouterKey: string]: LoaderTree },\n modules: AppDirModules,\n /**\n * At build time, for each dynamic segment, we compute the list of static\n * sibling segments that exist at the same URL path level. This is used by\n * the client router to determine if a prefetch can be reused.\n *\n * For example, given the following file structure:\n * /app/(group1)/products/sale/page.tsx -> /products/sale\n * /app/(group2)/products/[id]/page.tsx -> /products/[id]\n *\n * The [id] segment would have staticSiblings: ['sale']\n *\n * This accounts for route groups, which may place sibling routes in\n * different parts of the file system tree but at the same URL level.\n *\n * A value of `null` means the static siblings are unknown (e.g., in webpack\n * dev mode where routes are compiled on-demand).\n */\n staticSiblings: readonly string[] | null,\n]\n\nexport async function getLayoutOrPageModule(loaderTree: LoaderTree) {\n const { layout, page, defaultPage } = loaderTree[2]\n const isLayout = typeof layout !== 'undefined'\n const isPage = typeof page !== 'undefined'\n const isDefaultPage =\n typeof defaultPage !== 'undefined' && loaderTree[0] === DEFAULT_SEGMENT_KEY\n\n let mod = undefined\n let modType: 'layout' | 'page' | undefined = undefined\n let filePath = undefined\n\n if (isLayout) {\n mod = await layout[0]()\n modType = 'layout'\n filePath = layout[1]\n } else if (isPage) {\n mod = await page[0]()\n modType = 'page'\n filePath = page[1]\n } else if (isDefaultPage) {\n mod = await defaultPage[0]()\n modType = 'page'\n filePath = defaultPage[1]\n }\n\n return { mod, modType, filePath }\n}\n\nexport async function getComponentTypeModule(\n loaderTree: LoaderTree,\n moduleType: 'layout' | 'not-found' | 'forbidden' | 'unauthorized'\n) {\n const { [moduleType]: module } = loaderTree[2]\n if (typeof module !== 'undefined') {\n return await module[0]()\n }\n return undefined\n}\n","import {\n type ReadonlyRequestCookies,\n areCookiesMutableInCurrentPhase,\n RequestCookiesAdapter,\n} from '../web/spec-extension/adapters/request-cookies'\nimport { RequestCookies } from '../web/spec-extension/cookies'\nimport {\n workAsyncStorage,\n type WorkStore,\n} from '../app-render/work-async-storage.external'\nimport {\n throwForMissingRequestStore,\n workUnitAsyncStorage,\n type PrerenderStoreModern,\n type RequestStore,\n} from '../app-render/work-unit-async-storage.external'\nimport {\n throwToInterruptStaticGeneration,\n trackDynamicDataInDynamicRender,\n} from '../app-render/dynamic-rendering'\nimport { StaticGenBailoutError } from '../../client/components/static-generation-bailout'\nimport {\n makeDevtoolsIOAwarePromise,\n makeSessionDataHangingPromise,\n RENDER_STAGES_BY_DATA_KIND,\n} from '../dynamic-rendering-utils'\nimport { createDedupedByCallsiteServerErrorLoggerDev } from '../create-deduped-by-callsite-server-error-logger'\nimport { isRequestApiAllowedInCurrentPhase } from './utils'\nimport { applyOwnerStack } from '../dynamic-rendering-utils'\nimport { InvariantError } from '../../shared/lib/invariant-error'\nimport {\n createCookiesInUseCacheError,\n createCookiesInUnstableCacheError,\n} from '../use-cache/use-cache-messages'\n\nexport function cookies(): Promise<ReadonlyRequestCookies> {\n const callingExpression = 'cookies'\n const workStore = workAsyncStorage.getStore()\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n if (workStore) {\n if (workUnitStore && !isRequestApiAllowedInCurrentPhase(workUnitStore)) {\n throw new Error(\n `Route ${workStore.route} used \\`cookies()\\` inside \\`after()\\` while rendering. This is not supported. If you need this data inside an \\`after()\\` callback, use \\`cookies()\\` outside of the callback. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`\n )\n }\n\n if (workStore.forceStatic) {\n // When using forceStatic we override all other logic and always just return an empty\n // cookies object without tracking\n const underlyingCookies = createEmptyCookies()\n return makeUntrackedCookies(underlyingCookies)\n }\n\n if (workStore.dynamicShouldError) {\n throw new StaticGenBailoutError(\n `Route ${workStore.route} with \\`dynamic = \"error\"\\` couldn't be rendered statically because it used \\`cookies()\\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`\n )\n }\n\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'cache':\n const error = createCookiesInUseCacheError(workStore.route)\n Error.captureStackTrace(error, cookies)\n applyOwnerStack(error)\n workStore.invalidDynamicUsageError ??= error\n throw error\n case 'unstable-cache':\n throw createCookiesInUnstableCacheError(workStore.route)\n case 'build-time-generator':\n throw new Error(\n `Route ${workStore.route} used \\`cookies()\\` inside \\`${workUnitStore.functionName}\\`. This is not supported because \\`${workUnitStore.functionName}\\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`\n )\n case 'prerender':\n return makeHangingCookies(workStore, workUnitStore)\n case 'prerender-client':\n case 'validation-client':\n const exportName = '`cookies`'\n throw new InvariantError(\n `${exportName} must not be used within a Client Component. Next.js should be preventing ${exportName} from being included in Client Components statically, but did not in this case.`\n )\n case 'prerender-legacy':\n // We track dynamic access here so we don't need to wrap the cookies\n // in individual property access tracking.\n return throwToInterruptStaticGeneration(\n callingExpression,\n workStore,\n workUnitStore\n )\n case 'prerender-runtime': {\n const { stagedRendering } = workUnitStore\n if (stagedRendering) {\n return stagedRendering.delayUntilStage(\n RENDER_STAGES_BY_DATA_KIND.sessionData,\n 'cookies',\n workUnitStore.cookies\n )\n } else {\n return makeUntrackedCookies(workUnitStore.cookies)\n }\n }\n case 'private-cache':\n // Private caches are delayed until the runtime stage in use-cache-wrapper,\n // so we don't need an additional delay here.\n return makeUntrackedCookies(workUnitStore.cookies)\n case 'request':\n trackDynamicDataInDynamicRender(workUnitStore)\n\n let underlyingCookies: ReadonlyRequestCookies\n\n if (areCookiesMutableInCurrentPhase(workUnitStore)) {\n // We can't conditionally return different types here based on the context.\n // To avoid confusion, we always return the readonly type here.\n underlyingCookies =\n workUnitStore.userspaceMutableCookies as unknown as ReadonlyRequestCookies\n } else {\n underlyingCookies = workUnitStore.cookies\n }\n\n if (process.env.NODE_ENV === 'development') {\n // Semantically we only need the dev tracking when running in `next dev`\n // but since you would never use next dev with production NODE_ENV we use this\n // as a proxy so we can statically exclude this code from production builds.\n return makeUntrackedCookiesWithDevWarnings(\n workUnitStore,\n underlyingCookies,\n workStore?.route\n )\n } else if (workUnitStore.asyncApiPromises) {\n if (underlyingCookies === workUnitStore.mutableCookies) {\n return workUnitStore.asyncApiPromises.mutableCookies\n } else {\n return workUnitStore.asyncApiPromises.cookies\n }\n } else {\n return makeUntrackedCookies(underlyingCookies)\n }\n default:\n workUnitStore satisfies never\n }\n }\n }\n\n // If we end up here, there was no work store or work unit store present.\n throwForMissingRequestStore(callingExpression)\n}\n\nfunction createEmptyCookies(): ReadonlyRequestCookies {\n return RequestCookiesAdapter.seal(new RequestCookies(new Headers({})))\n}\n\ninterface CacheLifetime {}\nconst CachedCookies = new WeakMap<\n CacheLifetime,\n Promise<ReadonlyRequestCookies>\n>()\n\nfunction makeHangingCookies(\n workStore: WorkStore,\n prerenderStore: PrerenderStoreModern\n): Promise<ReadonlyRequestCookies> {\n const cachedPromise = CachedCookies.get(prerenderStore)\n if (cachedPromise) {\n return cachedPromise\n }\n\n const promise = makeSessionDataHangingPromise<ReadonlyRequestCookies>(\n prerenderStore.renderSignal,\n workStore.route,\n '`cookies()`',\n prerenderStore\n )\n CachedCookies.set(prerenderStore, promise)\n\n return promise\n}\n\nfunction makeUntrackedCookies(\n underlyingCookies: ReadonlyRequestCookies\n): Promise<ReadonlyRequestCookies> {\n const cachedCookies = CachedCookies.get(underlyingCookies)\n if (cachedCookies) {\n return cachedCookies\n }\n\n const promise = Promise.resolve(underlyingCookies)\n CachedCookies.set(underlyingCookies, promise)\n\n return promise\n}\n\nfunction makeUntrackedCookiesWithDevWarnings(\n requestStore: RequestStore,\n underlyingCookies: ReadonlyRequestCookies,\n route?: string\n): Promise<ReadonlyRequestCookies> {\n if (requestStore.asyncApiPromises) {\n let promise: Promise<ReadonlyRequestCookies>\n if (underlyingCookies === requestStore.mutableCookies) {\n promise = requestStore.asyncApiPromises.mutableCookies\n } else if (underlyingCookies === requestStore.cookies) {\n promise = requestStore.asyncApiPromises.cookies\n } else {\n throw new InvariantError(\n 'Received an underlying cookies object that does not match either `cookies` or `mutableCookies`'\n )\n }\n return instrumentCookiesPromiseWithDevWarnings(promise, route)\n }\n\n const cachedCookies = CachedCookies.get(underlyingCookies)\n if (cachedCookies) {\n return cachedCookies\n }\n\n const promise = makeDevtoolsIOAwarePromise(\n underlyingCookies,\n requestStore,\n RENDER_STAGES_BY_DATA_KIND.sessionData\n )\n\n const proxiedPromise = instrumentCookiesPromiseWithDevWarnings(promise, route)\n\n CachedCookies.set(underlyingCookies, proxiedPromise)\n\n return proxiedPromise\n}\n\nconst warnForSyncAccess = createDedupedByCallsiteServerErrorLoggerDev(\n createCookiesAccessError\n)\n\nfunction instrumentCookiesPromiseWithDevWarnings(\n promise: Promise<ReadonlyRequestCookies>,\n route: string | undefined\n) {\n Object.defineProperties(promise, {\n [Symbol.iterator]: replaceableWarningDescriptorForSymbolIterator(\n promise,\n route\n ),\n size: replaceableWarningDescriptor(promise, 'size', route),\n get: replaceableWarningDescriptor(promise, 'get', route),\n getAll: replaceableWarningDescriptor(promise, 'getAll', route),\n has: replaceableWarningDescriptor(promise, 'has', route),\n set: replaceableWarningDescriptor(promise, 'set', route),\n delete: replaceableWarningDescriptor(promise, 'delete', route),\n clear: replaceableWarningDescriptor(promise, 'clear', route),\n toString: replaceableWarningDescriptor(promise, 'toString', route),\n })\n return promise\n}\n\nfunction replaceableWarningDescriptor(\n target: unknown,\n prop: string,\n route: string | undefined\n) {\n return {\n enumerable: false,\n get() {\n warnForSyncAccess(route, `\\`cookies().${prop}\\``)\n return undefined\n },\n set(value: unknown) {\n Object.defineProperty(target, prop, {\n value,\n writable: true,\n configurable: true,\n })\n },\n configurable: true,\n }\n}\n\nfunction replaceableWarningDescriptorForSymbolIterator(\n target: unknown,\n route: string | undefined\n) {\n return {\n enumerable: false,\n get() {\n warnForSyncAccess(route, '`...cookies()` or similar iteration')\n return undefined\n },\n set(value: unknown) {\n Object.defineProperty(target, Symbol.iterator, {\n value,\n writable: true,\n enumerable: true,\n configurable: true,\n })\n },\n configurable: true,\n }\n}\n\nfunction createCookiesAccessError(\n route: string | undefined,\n expression: string\n) {\n const prefix = route ? `Route \"${route}\" ` : 'This route '\n return new Error(\n `${prefix}used ${expression}. ` +\n `\\`cookies()\\` returns a Promise and must be unwrapped with \\`await\\` or \\`React.use()\\` before accessing its properties. ` +\n `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`\n )\n}\n","import {\n getDraftModeProviderForCacheScope,\n throwForMissingRequestStore,\n} from '../app-render/work-unit-async-storage.external'\n\nimport type { DraftModeProvider } from '../async-storage/draft-mode-provider'\n\nimport {\n workAsyncStorage,\n type WorkStore,\n} from '../app-render/work-async-storage.external'\nimport { workUnitAsyncStorage } from '../app-render/work-unit-async-storage.external'\nimport {\n abortAndThrowOnSynchronousRequestDataAccess,\n trackDynamicDataInDynamicRender,\n} from '../app-render/dynamic-rendering'\nimport { createDedupedByCallsiteServerErrorLoggerDev } from '../create-deduped-by-callsite-server-error-logger'\nimport { StaticGenBailoutError } from '../../client/components/static-generation-bailout'\nimport { DynamicServerError } from '../../client/components/hooks-server-context'\nimport { InvariantError } from '../../shared/lib/invariant-error'\nimport {\n createDraftModeMutationInUseCacheError,\n createDraftModeMutationInUnstableCacheError,\n} from '../use-cache/use-cache-messages'\nimport { ReflectAdapter } from '../web/spec-extension/adapters/reflect'\nimport {\n applyOwnerStack,\n RENDER_STAGES_BY_DATA_KIND,\n} from '../dynamic-rendering-utils'\n\nexport function draftMode(): Promise<DraftMode> {\n const callingExpression = 'draftMode'\n const workStore = workAsyncStorage.getStore()\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n if (!workStore || !workUnitStore) {\n throwForMissingRequestStore(callingExpression)\n }\n\n switch (workUnitStore.type) {\n case 'prerender-runtime': {\n // TODO(runtime-ppr): does it make sense to delay this? normally it's always microtasky\n const { stagedRendering } = workUnitStore\n if (stagedRendering) {\n return stagedRendering.delayUntilStage(\n RENDER_STAGES_BY_DATA_KIND.sessionData,\n 'draftMode',\n new DraftMode(workUnitStore.draftMode)\n )\n } else {\n return createOrGetCachedDraftMode(workUnitStore.draftMode, workStore)\n }\n }\n case 'request':\n return createOrGetCachedDraftMode(workUnitStore.draftMode, workStore)\n\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n // Inside of `\"use cache\"` or `unstable_cache`, draft mode is available if\n // the outmost work unit store is a request store (or a runtime prerender),\n // and if draft mode is enabled.\n const draftModeProvider = getDraftModeProviderForCacheScope(\n workStore,\n workUnitStore\n )\n\n if (draftModeProvider) {\n return createOrGetCachedDraftMode(draftModeProvider, workStore)\n }\n\n // Otherwise, we fall through to providing an empty draft mode.\n // eslint-disable-next-line no-fallthrough\n case 'prerender':\n case 'prerender-legacy':\n // Return empty draft mode\n return createOrGetCachedDraftMode(null, workStore)\n case 'prerender-client':\n case 'validation-client': {\n const exportName = '`draftMode`'\n throw new InvariantError(\n `${exportName} must not be used within a Client Component. Next.js should be preventing ${exportName} from being included in Client Components statically, but did not in this case.`\n )\n }\n case 'build-time-generator':\n throw new Error(\n `Route ${workStore.route} used \\`${callingExpression}()\\` inside \\`${workUnitStore.functionName}\\`. This is not supported because \\`${workUnitStore.functionName}\\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`\n )\n\n default:\n return workUnitStore satisfies never\n }\n}\n\nfunction createOrGetCachedDraftMode(\n draftModeProvider: DraftModeProvider | null,\n workStore: WorkStore | undefined\n): Promise<DraftMode> {\n const cacheKey = draftModeProvider ?? NullDraftMode\n const cachedDraftMode = CachedDraftModes.get(cacheKey)\n\n if (cachedDraftMode) {\n return cachedDraftMode\n }\n\n if (process.env.NODE_ENV === 'development' && !workStore?.isPrefetchRequest) {\n const route = workStore?.route\n return createDraftModeWithDevWarnings(draftModeProvider, route)\n } else {\n return Promise.resolve(new DraftMode(draftModeProvider))\n }\n}\n\ninterface CacheLifetime {}\nconst NullDraftMode = {}\nconst CachedDraftModes = new WeakMap<CacheLifetime, Promise<DraftMode>>()\n\nfunction createDraftModeWithDevWarnings(\n underlyingProvider: null | DraftModeProvider,\n route: undefined | string\n): Promise<DraftMode> {\n const instance = new DraftMode(underlyingProvider)\n const promise = Promise.resolve(instance)\n\n const proxiedPromise = new Proxy(promise, {\n get(target, prop, receiver) {\n switch (prop) {\n case 'isEnabled':\n warnForSyncAccess(route, `\\`draftMode().${prop}\\``)\n break\n case 'enable':\n case 'disable': {\n warnForSyncAccess(route, `\\`draftMode().${prop}()\\``)\n break\n }\n default: {\n // We only warn for well-defined properties of the draftMode object.\n }\n }\n\n return ReflectAdapter.get(target, prop, receiver)\n },\n })\n\n return proxiedPromise\n}\n\nclass DraftMode {\n /**\n * @internal - this declaration is stripped via `tsc --stripInternal`\n */\n private readonly _provider: null | DraftModeProvider\n\n constructor(provider: null | DraftModeProvider) {\n this._provider = provider\n }\n get isEnabled() {\n if (this._provider !== null) {\n return this._provider.isEnabled\n }\n return false\n }\n public enable() {\n // We have a store we want to track dynamic data access to ensure we\n // don't statically generate routes that manipulate draft mode.\n trackDynamicDraftMode('draftMode().enable()', this.enable)\n if (this._provider !== null) {\n this._provider.enable()\n }\n }\n public disable() {\n trackDynamicDraftMode('draftMode().disable()', this.disable)\n if (this._provider !== null) {\n this._provider.disable()\n }\n }\n}\nconst warnForSyncAccess = createDedupedByCallsiteServerErrorLoggerDev(\n createDraftModeAccessError\n)\n\nfunction createDraftModeAccessError(\n route: string | undefined,\n expression: string\n) {\n const prefix = route ? `Route \"${route}\" ` : 'This route '\n return new Error(\n `${prefix}used ${expression}. ` +\n `\\`draftMode()\\` returns a Promise and must be unwrapped with \\`await\\` or \\`React.use()\\` before accessing its properties. ` +\n `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`\n )\n}\n\nfunction trackDynamicDraftMode(expression: string, constructorOpt: Function) {\n const workStore = workAsyncStorage.getStore()\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n if (workStore) {\n // We have a store we want to track dynamic data access to ensure we\n // don't statically generate routes that manipulate draft mode.\n if (workUnitStore?.phase === 'after') {\n throw new Error(\n `Route ${workStore.route} used \"${expression}\" inside \\`after()\\`. The enabled status of \\`draftMode()\\` can be read inside \\`after()\\` but you cannot enable or disable \\`draftMode()\\`. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`\n )\n }\n\n if (workStore.dynamicShouldError) {\n throw new StaticGenBailoutError(\n `Route ${workStore.route} with \\`dynamic = \"error\"\\` couldn't be rendered statically because it used \\`${expression}\\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`\n )\n }\n\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'cache':\n case 'private-cache': {\n const error = createDraftModeMutationInUseCacheError(\n workStore.route,\n expression\n )\n Error.captureStackTrace(error, constructorOpt)\n applyOwnerStack(error)\n workStore.invalidDynamicUsageError ??= error\n throw error\n }\n case 'unstable-cache':\n throw createDraftModeMutationInUnstableCacheError(\n workStore.route,\n expression\n )\n\n case 'prerender':\n case 'prerender-runtime': {\n const error = new Error(\n `Route ${workStore.route} used ${expression} without first calling \\`await connection()\\`. See more info here: https://nextjs.org/docs/messages/next-prerender-sync-headers`\n )\n return abortAndThrowOnSynchronousRequestDataAccess(\n workStore.route,\n expression,\n error,\n workUnitStore\n )\n }\n case 'prerender-client':\n case 'validation-client':\n const exportName = '`draftMode`'\n throw new InvariantError(\n `${exportName} must not be used within a Client Component. Next.js should be preventing ${exportName} from being included in Client Components statically, but did not in this case.`\n )\n case 'prerender-legacy':\n workUnitStore.revalidate = 0\n\n const err = new DynamicServerError(\n `Route ${workStore.route} couldn't be rendered statically because it used \\`${expression}\\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`\n )\n workStore.dynamicUsageDescription = expression\n workStore.dynamicUsageStack = err.stack\n\n throw err\n case 'request':\n trackDynamicDataInDynamicRender(workUnitStore)\n break\n case 'build-time-generator':\n throw new Error(\n `Route ${workStore.route} used \\`${expression}\\` inside \\`${workUnitStore.functionName}\\`. This is not supported because \\`${workUnitStore.functionName}\\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`\n )\n default:\n workUnitStore satisfies never\n }\n }\n }\n}\n","import {\n HeadersAdapter,\n type ReadonlyHeaders,\n} from '../web/spec-extension/adapters/headers'\nimport {\n workAsyncStorage,\n type WorkStore,\n} from '../app-render/work-async-storage.external'\nimport {\n throwForMissingRequestStore,\n workUnitAsyncStorage,\n type PrerenderStoreModern,\n type RequestStore,\n} from '../app-render/work-unit-async-storage.external'\nimport {\n throwToInterruptStaticGeneration,\n trackDynamicDataInDynamicRender,\n} from '../app-render/dynamic-rendering'\nimport { StaticGenBailoutError } from '../../client/components/static-generation-bailout'\nimport {\n makeDevtoolsIOAwarePromise,\n makeSessionDataHangingPromise,\n RENDER_STAGES_BY_DATA_KIND,\n} from '../dynamic-rendering-utils'\nimport { createDedupedByCallsiteServerErrorLoggerDev } from '../create-deduped-by-callsite-server-error-logger'\nimport { isRequestApiAllowedInCurrentPhase } from './utils'\nimport { applyOwnerStack } from '../dynamic-rendering-utils'\nimport { InvariantError } from '../../shared/lib/invariant-error'\nimport {\n createHeadersInUseCacheError,\n createHeadersInUnstableCacheError,\n} from '../use-cache/use-cache-messages'\n\n/**\n * This function allows you to read the HTTP incoming request headers in\n * [Server Components](https://nextjs.org/docs/app/building-your-application/rendering/server-components),\n * [Server Actions](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations),\n * [Route Handlers](https://nextjs.org/docs/app/building-your-application/routing/route-handlers) and\n * [Middleware](https://nextjs.org/docs/app/building-your-application/routing/middleware).\n *\n * Read more: [Next.js Docs: `headers`](https://nextjs.org/docs/app/api-reference/functions/headers)\n */\nexport function headers(): Promise<ReadonlyHeaders> {\n const callingExpression = 'headers'\n const workStore = workAsyncStorage.getStore()\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n if (workStore) {\n if (workUnitStore && !isRequestApiAllowedInCurrentPhase(workUnitStore)) {\n throw new Error(\n `Route ${workStore.route} used \\`headers()\\` inside \\`after()\\` while rendering. This is not supported. If you need this data inside an \\`after()\\` callback, use \\`headers()\\` outside of the callback. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`\n )\n }\n\n if (workStore.forceStatic) {\n // When using forceStatic we override all other logic and always just return an empty\n // headers object without tracking\n const underlyingHeaders = HeadersAdapter.seal(new Headers({}))\n return makeUntrackedHeaders(underlyingHeaders)\n }\n\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'cache': {\n const error = createHeadersInUseCacheError(workStore.route)\n Error.captureStackTrace(error, headers)\n applyOwnerStack(error)\n workStore.invalidDynamicUsageError ??= error\n throw error\n }\n case 'unstable-cache':\n throw createHeadersInUnstableCacheError(workStore.route)\n case 'build-time-generator':\n throw new Error(\n `Route ${workStore.route} used \\`headers()\\` inside \\`${workUnitStore.functionName}\\`. This is not supported because \\`${workUnitStore.functionName}\\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`\n )\n case 'prerender':\n case 'prerender-client':\n case 'validation-client':\n case 'private-cache':\n case 'prerender-runtime':\n case 'prerender-legacy':\n case 'request':\n break\n default:\n workUnitStore satisfies never\n }\n }\n\n if (workStore.dynamicShouldError) {\n throw new StaticGenBailoutError(\n `Route ${workStore.route} with \\`dynamic = \"error\"\\` couldn't be rendered statically because it used \\`headers()\\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`\n )\n }\n\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'prerender':\n return makeHangingHeaders(workStore, workUnitStore)\n case 'prerender-client':\n case 'validation-client':\n const exportName = '`headers`'\n throw new InvariantError(\n `${exportName} must not be used within a client component. Next.js should be preventing ${exportName} from being included in client components statically, but did not in this case.`\n )\n case 'prerender-legacy':\n // Legacy Prerender\n // We are in a legacy static generation mode while prerendering\n // We track dynamic access here so we don't need to wrap the headers in\n // individual property access tracking.\n return throwToInterruptStaticGeneration(\n callingExpression,\n workStore,\n workUnitStore\n )\n case 'prerender-runtime': {\n const { stagedRendering } = workUnitStore\n if (stagedRendering) {\n return stagedRendering.delayUntilStage(\n RENDER_STAGES_BY_DATA_KIND.sessionData,\n 'headers',\n workUnitStore.headers\n )\n } else {\n return makeUntrackedHeaders(workUnitStore.headers)\n }\n }\n case 'private-cache':\n // Private caches are delayed until the runtime stage in use-cache-wrapper,\n // so we don't need an additional delay here.\n return makeUntrackedHeaders(workUnitStore.headers)\n case 'request':\n trackDynamicDataInDynamicRender(workUnitStore)\n\n if (process.env.NODE_ENV === 'development') {\n // Semantically we only need the dev tracking when running in `next dev`\n // but since you would never use next dev with production NODE_ENV we use this\n // as a proxy so we can statically exclude this code from production builds.\n return makeUntrackedHeadersWithDevWarnings(\n workUnitStore.headers,\n workStore?.route,\n workUnitStore\n )\n } else if (workUnitStore.asyncApiPromises) {\n return workUnitStore.asyncApiPromises.headers\n } else {\n return makeUntrackedHeaders(workUnitStore.headers)\n }\n break\n default:\n workUnitStore satisfies never\n }\n }\n }\n\n // If we end up here, there was no work store or work unit store present.\n throwForMissingRequestStore(callingExpression)\n}\n\ninterface CacheLifetime {}\nconst CachedHeaders = new WeakMap<CacheLifetime, Promise<ReadonlyHeaders>>()\n\nfunction makeHangingHeaders(\n workStore: WorkStore,\n prerenderStore: PrerenderStoreModern\n): Promise<ReadonlyHeaders> {\n const cachedHeaders = CachedHeaders.get(prerenderStore)\n if (cachedHeaders) {\n return cachedHeaders\n }\n\n const promise = makeSessionDataHangingPromise<ReadonlyHeaders>(\n prerenderStore.renderSignal,\n workStore.route,\n '`headers()`',\n prerenderStore\n )\n CachedHeaders.set(prerenderStore, promise)\n\n return promise\n}\n\nfunction makeUntrackedHeaders(\n underlyingHeaders: ReadonlyHeaders\n): Promise<ReadonlyHeaders> {\n const cachedHeaders = CachedHeaders.get(underlyingHeaders)\n if (cachedHeaders) {\n return cachedHeaders\n }\n\n const promise = Promise.resolve(underlyingHeaders)\n CachedHeaders.set(underlyingHeaders, promise)\n\n return promise\n}\n\nfunction makeUntrackedHeadersWithDevWarnings(\n underlyingHeaders: ReadonlyHeaders,\n route: string | undefined,\n requestStore: RequestStore\n): Promise<ReadonlyHeaders> {\n if (requestStore.asyncApiPromises) {\n return instrumentHeadersPromiseWithDevWarnings(\n requestStore.asyncApiPromises.headers,\n route\n )\n }\n\n const cachedHeaders = CachedHeaders.get(underlyingHeaders)\n if (cachedHeaders) {\n return cachedHeaders\n }\n\n const promise = makeDevtoolsIOAwarePromise(\n underlyingHeaders,\n requestStore,\n RENDER_STAGES_BY_DATA_KIND.sessionData\n )\n\n const proxiedPromise = instrumentHeadersPromiseWithDevWarnings(promise, route)\n\n CachedHeaders.set(underlyingHeaders, proxiedPromise)\n\n return proxiedPromise\n}\n\nconst warnForSyncAccess = createDedupedByCallsiteServerErrorLoggerDev(\n createHeadersAccessError\n)\n\nfunction instrumentHeadersPromiseWithDevWarnings(\n promise: Promise<ReadonlyHeaders>,\n route: string | undefined\n) {\n Object.defineProperties(promise, {\n [Symbol.iterator]: replaceableWarningDescriptorForSymbolIterator(\n promise,\n route\n ),\n append: replaceableWarningDescriptor(promise, 'append', route),\n delete: replaceableWarningDescriptor(promise, 'delete', route),\n get: replaceableWarningDescriptor(promise, 'get', route),\n has: replaceableWarningDescriptor(promise, 'has', route),\n set: replaceableWarningDescriptor(promise, 'set', route),\n getSetCookie: replaceableWarningDescriptor(promise, 'getSetCookie', route),\n forEach: replaceableWarningDescriptor(promise, 'forEach', route),\n keys: replaceableWarningDescriptor(promise, 'keys', route),\n values: replaceableWarningDescriptor(promise, 'values', route),\n entries: replaceableWarningDescriptor(promise, 'entries', route),\n })\n return promise\n}\n\nfunction replaceableWarningDescriptor(\n target: unknown,\n prop: string,\n route: string | undefined\n) {\n return {\n enumerable: false,\n get() {\n warnForSyncAccess(route, `\\`headers().${prop}\\``)\n return undefined\n },\n set(value: unknown) {\n Object.defineProperty(target, prop, {\n value,\n writable: true,\n configurable: true,\n })\n },\n configurable: true,\n }\n}\n\nfunction replaceableWarningDescriptorForSymbolIterator(\n target: unknown,\n route: string | undefined\n) {\n return {\n enumerable: false,\n get() {\n warnForSyncAccess(route, '`...headers()` or similar iteration')\n return undefined\n },\n set(value: unknown) {\n Object.defineProperty(target, Symbol.iterator, {\n value,\n writable: true,\n enumerable: true,\n configurable: true,\n })\n },\n configurable: true,\n }\n}\n\nfunction createHeadersAccessError(\n route: string | undefined,\n expression: string\n) {\n const prefix = route ? `Route \"${route}\" ` : 'This route '\n return new Error(\n `${prefix}used ${expression}. ` +\n `\\`headers()\\` returns a Promise and must be unwrapped with \\`await\\` or \\`React.use()\\` before accessing its properties. ` +\n `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`\n )\n}\n","import { StaticGenBailoutError } from '../../client/components/static-generation-bailout'\nimport { actionAsyncStorage } from '../app-render/action-async-storage.external'\nimport { afterTaskAsyncStorage } from '../app-render/after-task-async-storage.external'\nimport type { WorkStore } from '../app-render/work-async-storage.external'\nimport { createSearchParamsInUseCacheError } from '../use-cache/use-cache-messages'\nimport type { WorkUnitStore } from '../app-render/work-unit-async-storage.external'\n\nexport function throwWithStaticGenerationBailoutErrorWithDynamicError(\n route: string,\n expression: string\n): never {\n throw new StaticGenBailoutError(\n `Route ${route} with \\`dynamic = \"error\"\\` couldn't be rendered statically because it used ${expression}. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`\n )\n}\n\nexport function throwForSearchParamsAccessInUseCache(\n workStore: WorkStore,\n constructorOpt: Function\n): never {\n const error = createSearchParamsInUseCacheError(workStore.route)\n\n Error.captureStackTrace(error, constructorOpt)\n workStore.invalidDynamicUsageError ??= error\n\n throw error\n}\n\nexport function isRequestApiAllowedInCurrentPhase(\n workUnitStore: WorkUnitStore\n): boolean {\n switch (workUnitStore.phase) {\n case 'action':\n case 'render': {\n // The request is still in progress. The API may be disallowed for other reasons,\n // but not because of phase.\n return true\n }\n case 'after': {\n // The request has finished.\n\n // If we're in a Route Handler or a Server Action,\n // request APIs can be called everywhere, even in after().\n const actionStore = actionAsyncStorage.getStore()\n if (actionStore && (actionStore.isAppRoute || actionStore.isAction)) {\n return true\n }\n\n const afterTaskStore = afterTaskAsyncStorage.getStore()\n if (afterTaskStore) {\n // We're in an `after` callback. Request APIs are callable if\n // the `after()` call happened in an action phase:\n // - in a Route Handler\n // - in a Server Action's body (but not the render after)\n //\n // TODO(after): Is it even possible to have `phase === 'action'` but no `actionStore`?\n // We should revisit this setup and simplify this.\n return afterTaskStore.rootTaskSpawnPhase === 'action'\n }\n\n // Otherwise, we must be in a page, in the `after` phase.\n // We don't allow calling request APIs here because we'd miss\n // them during prerendering and wouldn't know that the page is dynamic.\n return false\n }\n }\n}\n","if (process.env.NEXT_RUNTIME === 'edge') {\n module.exports = require('next/dist/server/route-modules/app-page/module.js')\n} else {\n if (process.env.__NEXT_EXPERIMENTAL_REACT) {\n if (process.env.NODE_ENV === 'development') {\n if (process.env.TURBOPACK) {\n module.exports = require('next/dist/compiled/next-server/app-page-turbo-experimental.runtime.dev.js')\n } else {\n module.exports = require('next/dist/compiled/next-server/app-page-experimental.runtime.dev.js')\n }\n } else {\n if (process.env.TURBOPACK) {\n module.exports = require('next/dist/compiled/next-server/app-page-turbo-experimental.runtime.prod.js')\n } else {\n module.exports = require('next/dist/compiled/next-server/app-page-experimental.runtime.prod.js')\n }\n }\n } else {\n if (process.env.NODE_ENV === 'development') {\n if (process.env.TURBOPACK) {\n module.exports = require('next/dist/compiled/next-server/app-page-turbo.runtime.dev.js')\n } else {\n module.exports = require('next/dist/compiled/next-server/app-page.runtime.dev.js')\n }\n } else {\n if (process.env.TURBOPACK) {\n module.exports = require('next/dist/compiled/next-server/app-page-turbo.runtime.prod.js')\n } else {\n module.exports = require('next/dist/compiled/next-server/app-page.runtime.prod.js')\n }\n }\n }\n}\n","module.exports = (\n require('../../module.compiled') as typeof import('../../module.compiled')\n).vendored['react-rsc']!.React\n","/**\n * Centralized error factories for cached function and revalidation misuse.\n * State the scope and constraint, explain non-obvious boundaries, give the\n * immediate fix, then link to the relevant docs.\n */\n\nimport type { BuildTimeGeneratorName } from '../app-render/work-unit-async-storage.external'\n\nconst NEXT_REQUEST_IN_USE_CACHE =\n 'https://nextjs.org/docs/messages/next-request-in-use-cache'\n\nconst UNSTABLE_CACHE_API_DOCS =\n 'https://nextjs.org/docs/app/api-reference/functions/unstable_cache'\n\nconst USE_CACHE_PRIVATE_API_DOCS =\n 'https://nextjs.org/docs/app/api-reference/directives/use-cache-private'\n\nconst CACHE_TAG_OUTSIDE_USE_CACHE =\n 'https://nextjs.org/docs/messages/cache-tag-outside-use-cache'\n\nconst CACHE_LIFE_OUTSIDE_USE_CACHE =\n 'https://nextjs.org/docs/messages/cache-life-outside-use-cache'\n\nconst USE_CACHE_PRIVATE_COMPOSITION =\n 'https://nextjs.org/docs/messages/use-cache-private-composition'\n\nconst REVALIDATE_IN_USE_CACHE =\n 'https://nextjs.org/docs/messages/revalidate-in-use-cache'\n\nconst NESTED_USE_CACHE_NO_EXPLICIT_CACHELIFE =\n 'https://nextjs.org/docs/messages/nested-use-cache-no-explicit-cachelife'\n\n// Request data accessed in caches\n\nexport function createCookiesInUseCacheError(route: string): Error {\n return new Error(\n `Route \"${route}\": \\`cookies()\\` can't be read inside \\`\"use cache\"\\`. Read it outside the cached function and pass what you need as an argument.\\nLearn more: ${NEXT_REQUEST_IN_USE_CACHE}`\n )\n}\n\nexport function createCookiesInUnstableCacheError(route: string): Error {\n return new Error(\n `Route \"${route}\": \\`cookies()\\` can't be read inside \\`unstable_cache()\\`. Read it outside the cached function and pass what you need as an argument.\\nLearn more: ${UNSTABLE_CACHE_API_DOCS}`\n )\n}\n\nexport function createHeadersInUseCacheError(route: string): Error {\n return new Error(\n `Route \"${route}\": \\`headers()\\` can't be read inside \\`\"use cache\"\\`. Read it outside the cached function and pass what you need as an argument.\\nLearn more: ${NEXT_REQUEST_IN_USE_CACHE}`\n )\n}\n\nexport function createHeadersInUnstableCacheError(route: string): Error {\n return new Error(\n `Route \"${route}\": \\`headers()\\` can't be read inside \\`unstable_cache()\\`. Read it outside the cached function and pass what you need as an argument.\\nLearn more: ${UNSTABLE_CACHE_API_DOCS}`\n )\n}\n\nexport function createSearchParamsInUseCacheError(route: string): Error {\n return new Error(\n `Route \"${route}\": \\`searchParams\\` can't be read inside \\`\"use cache\"\\`. Await it outside the cached function and pass what you need as an argument.\\nLearn more: ${NEXT_REQUEST_IN_USE_CACHE}`\n )\n}\n\nexport function createConnectionInPublicUseCacheError(route: string): Error {\n return new Error(\n `Route \"${route}\": \\`connection()\\` can't be called inside \\`\"use cache\"\\` because cached functions may run during prerendering, without an incoming request. Call it outside the cached function.\\nLearn more: ${NEXT_REQUEST_IN_USE_CACHE}`\n )\n}\n\nexport function createConnectionInPrivateUseCacheError(route: string): Error {\n return new Error(\n `Route \"${route}\": \\`connection()\\` can't be called inside \\`\"use cache: private\"\\` because private cached functions may run during prefetching, without a navigation request. Call it outside the cached function.\\nLearn more: ${USE_CACHE_PRIVATE_API_DOCS}`\n )\n}\n\nexport function createConnectionInUnstableCacheError(route: string): Error {\n return new Error(\n `Route \"${route}\": \\`connection()\\` can't be called inside \\`unstable_cache()\\` because cached functions may run during prerendering, without an incoming request. Call it outside the cached function.\\nLearn more: ${UNSTABLE_CACHE_API_DOCS}`\n )\n}\n\nexport function createRouteHandlerRequestInUseCacheError(\n route: string,\n expression: string\n): Error {\n return new Error(\n `Route \"${route}\": \\`${expression}\\` can't be read inside \\`\"use cache\"\\`. Read it outside the cached function and pass what you need as an argument.\\nLearn more: ${NEXT_REQUEST_IN_USE_CACHE}`\n )\n}\n\nexport function createRouteHandlerRequestInUnstableCacheError(\n route: string,\n expression: string\n): Error {\n return new Error(\n `Route \"${route}\": \\`${expression}\\` can't be read inside \\`unstable_cache()\\`. Read it outside the cached function and pass what you need as an argument.\\nLearn more: ${UNSTABLE_CACHE_API_DOCS}`\n )\n}\n\n// Mutations inside caches and render\n\n/**\n * Used when `draftMode().enable()` or `.disable()` is called inside\n * `\"use cache\"` or `\"use cache: private\"`. Reading `draftMode()` is fine\n * inside a cached function, but toggling it is not.\n */\nexport function createDraftModeMutationInUseCacheError(\n route: string,\n expression: string\n): Error {\n return new Error(\n `Route \"${route}\": \\`${expression}\\` can't be called inside \\`\"use cache\"\\`. Draft mode can be read inside a cached function, but enabling or disabling it must happen outside.\\nLearn more: ${NEXT_REQUEST_IN_USE_CACHE}`\n )\n}\n\nexport function createDraftModeMutationInUnstableCacheError(\n route: string,\n expression: string\n): Error {\n return new Error(\n `Route \"${route}\": \\`${expression}\\` can't be called inside \\`unstable_cache()\\`. Draft mode can be read inside a cached function, but enabling or disabling it must happen outside.\\nLearn more: ${UNSTABLE_CACHE_API_DOCS}`\n )\n}\n\nexport function createRevalidateDuringRenderError(\n route: string,\n expression: string\n): Error {\n return new Error(\n `Route \"${route}\": \\`${expression}\\` can't be called during render. Call it from a Server Action or Route Handler instead.\\nLearn more: ${REVALIDATE_IN_USE_CACHE}`\n )\n}\n\nexport function createRevalidateInCachedFunctionError(\n route: string,\n expression: string\n): Error {\n return new Error(\n `Route \"${route}\": \\`${expression}\\` can't be called inside a cached function. Call it from a Server Action or Route Handler instead.\\nLearn more: ${REVALIDATE_IN_USE_CACHE}`\n )\n}\n\nexport function createRevalidateInBuildTimeGeneratorError(\n route: string,\n expression: string,\n generatorName: BuildTimeGeneratorName\n): Error {\n return new Error(\n `Route \"${route}\": \\`${expression}\\` can't be called inside \\`${generatorName}\\`. Call it from a Server Action or Route Handler instead.\\nLearn more: ${REVALIDATE_IN_USE_CACHE}`\n )\n}\n\n// Cache configuration and nesting\n\nfunction routePrefix(route: string | undefined): string {\n return route === undefined ? '' : `Route \"${route}\": `\n}\n\nexport function createCacheTagOutsideUseCacheError(\n route: string | undefined\n): Error {\n return new Error(\n `${routePrefix(route)}\\`cacheTag()\\` can only be called inside a \\`\"use cache\"\\` or \\`\"use cache: private\"\\` function.\\nLearn more: ${CACHE_TAG_OUTSIDE_USE_CACHE}`\n )\n}\n\nexport function createCacheLifeOutsideUseCacheError(\n route: string | undefined\n): Error {\n return new Error(\n `${routePrefix(route)}\\`cacheLife()\\` can only be called inside a \\`\"use cache\"\\` or \\`\"use cache: private\"\\` function.\\nLearn more: ${CACHE_LIFE_OUTSIDE_USE_CACHE}`\n )\n}\n\nexport function createNestedCacheZeroRevalidateError(\n route: string,\n cause: Error | undefined\n): Error {\n return new Error(\n `Route \"${route}\": A nested \\`\"use cache\"\\` with \\`revalidate: 0\\` is inside an outer \\`\"use cache\"\\` that has no \\`cacheLife()\\`. Add \\`cacheLife()\\` to the outer one to choose whether to prerender it with a non-zero \\`revalidate\\` or keep it dynamic with \\`revalidate: 0\\`.\\nLearn more: ${NESTED_USE_CACHE_NO_EXPLICIT_CACHELIFE}`,\n { cause }\n )\n}\n\nexport function createNestedCacheShortExpireError(\n route: string,\n cause: Error | undefined\n): Error {\n return new Error(\n `Route \"${route}\": A nested \\`\"use cache\"\\` with a short \\`expire\\` (under 5 minutes) is inside an outer \\`\"use cache\"\\` that has no \\`cacheLife()\\`. Add \\`cacheLife()\\` to the outer one to choose whether to prerender it with a longer \\`expire\\` or keep it dynamic with a short \\`expire\\`.\\nLearn more: ${NESTED_USE_CACHE_NO_EXPLICIT_CACHELIFE}`,\n { cause }\n )\n}\n\n// Private cache composition and request context\n\nexport function createUseCachePrivateInsidePublicUseCacheError(\n route: string\n): Error {\n return new Error(\n `Route \"${route}\": \\`\"use cache: private\"\\` can't be nested inside \\`\"use cache\"\\` because a shared cached function can't depend on private request data. Nest it only inside another \\`\"use cache: private\"\\`.\\nLearn more: ${USE_CACHE_PRIVATE_COMPOSITION}`\n )\n}\n\nexport function createUseCachePrivateInsideUnstableCacheError(\n route: string\n): Error {\n return new Error(\n `Route \"${route}\": \\`\"use cache: private\"\\` can't be used inside \\`unstable_cache()\\` because \\`unstable_cache()\\` uses a shared cache that can't contain private request data. Call the private cached function outside \\`unstable_cache()\\`.\\nLearn more: ${USE_CACHE_PRIVATE_COMPOSITION}`\n )\n}\n\nexport function createUseCachePrivateOutsideRequestContextError(\n route: string,\n functionName: string\n): Error {\n return new Error(\n `Route \"${route}\": \\`\"use cache: private\"\\` needs an active request, so it can't be used during \\`${functionName}\\` or other build-time contexts. Move it to a request-time component or function.\\nLearn more: ${USE_CACHE_PRIVATE_COMPOSITION}`\n )\n}\n","import type { IncomingHttpHeaders } from 'http'\n\nimport { ReflectAdapter } from './reflect'\n\n/**\n * @internal\n */\nexport class ReadonlyHeadersError extends Error {\n constructor() {\n super(\n 'Headers cannot be modified. Read more: https://nextjs.org/docs/app/api-reference/functions/headers'\n )\n }\n\n public static callable() {\n throw new ReadonlyHeadersError()\n }\n}\n\nexport type ReadonlyHeaders = Headers & {\n /** @deprecated Method unavailable on `ReadonlyHeaders`. Read more: https://nextjs.org/docs/app/api-reference/functions/headers */\n append(...args: any[]): void\n /** @deprecated Method unavailable on `ReadonlyHeaders`. Read more: https://nextjs.org/docs/app/api-reference/functions/headers */\n set(...args: any[]): void\n /** @deprecated Method unavailable on `ReadonlyHeaders`. Read more: https://nextjs.org/docs/app/api-reference/functions/headers */\n delete(...args: any[]): void\n}\n\n/**\n * The read methods that a sealed view provides itself instead of forwarding to\n * the underlying `Headers`. Deriving the type from `Headers` keeps the\n * implementations in step with the platform signatures.\n */\ntype SealedHeaderMethods = Pick<\n Headers,\n | 'get'\n | 'has'\n | 'getSetCookie'\n | 'keys'\n | 'values'\n | 'entries'\n | 'forEach'\n | typeof Symbol.iterator\n>\n\n/**\n * Builds the read methods for a sealed view that exposes all of `target`.\n */\nfunction createPassThroughMethods(\n target: Headers,\n sealed: ReadonlyHeaders\n): SealedHeaderMethods {\n return {\n get: target.get.bind(target),\n has: target.has.bind(target),\n getSetCookie: target.getSetCookie.bind(target),\n keys: target.keys.bind(target),\n values: target.values.bind(target),\n entries: target.entries.bind(target),\n [Symbol.iterator]: target[Symbol.iterator].bind(target),\n // The native method passes the unsealed target as the callback's `parent`\n // argument. That is a mutable handle on the underlying headers. Pass the\n // sealed view instead.\n forEach(callbackfn, thisArg) {\n for (const [name, value] of target.entries()) {\n callbackfn.call(thisArg, value, name, sealed)\n }\n },\n }\n}\n\n/**\n * Builds the read methods for a sealed view that omits the header names matched\n * by `isHidden`.\n */\nfunction createHidingMethods(\n target: Headers,\n sealed: ReadonlyHeaders,\n isHidden: (name: string) => boolean\n): SealedHeaderMethods {\n function* entries(): HeadersIterator<[string, string]> {\n for (const entry of target.entries()) {\n if (!isHidden(entry[0])) {\n yield entry\n }\n }\n }\n\n return {\n entries,\n [Symbol.iterator]: entries,\n get: (name) => (isHidden(name) ? null : target.get(name)),\n has: (name) => (isHidden(name) ? false : target.has(name)),\n getSetCookie: () => (isHidden('set-cookie') ? [] : target.getSetCookie()),\n *keys(): HeadersIterator<string> {\n for (const name of target.keys()) {\n if (!isHidden(name)) {\n yield name\n }\n }\n },\n *values(): HeadersIterator<string> {\n for (const [, value] of entries()) {\n yield value\n }\n },\n // The native method passes the unsealed target as the callback's `parent`\n // argument. That is a mutable handle on the underlying headers. Pass the\n // sealed view instead.\n forEach(callbackfn, thisArg) {\n for (const [name, value] of entries()) {\n callbackfn.call(thisArg, value, name, sealed)\n }\n },\n }\n}\n\nexport class HeadersAdapter extends Headers {\n private readonly headers: IncomingHttpHeaders\n\n constructor(headers: IncomingHttpHeaders) {\n // We've already overridden the methods that would be called, so we're just\n // calling the super constructor to ensure that the instanceof check works.\n super()\n\n this.headers = new Proxy(headers, {\n get(target, prop, receiver) {\n // Because this is just an object, we expect that all \"get\" operations\n // are for properties. If it's a \"get\" for a symbol, we'll just return\n // the symbol.\n if (typeof prop === 'symbol') {\n return ReflectAdapter.get(target, prop, receiver)\n }\n\n const lowercased = prop.toLowerCase()\n\n // Let's find the original casing of the key. This assumes that there is\n // no mixed case keys (e.g. \"Content-Type\" and \"content-type\") in the\n // headers object.\n const original = Object.keys(headers).find(\n (o) => o.toLowerCase() === lowercased\n )\n\n // If the original casing doesn't exist, return undefined.\n if (typeof original === 'undefined') return\n\n // If the original casing exists, return the value.\n return ReflectAdapter.get(target, original, receiver)\n },\n set(target, prop, value, receiver) {\n if (typeof prop === 'symbol') {\n return ReflectAdapter.set(target, prop, value, receiver)\n }\n\n const lowercased = prop.toLowerCase()\n\n // Let's find the original casing of the key. This assumes that there is\n // no mixed case keys (e.g. \"Content-Type\" and \"content-type\") in the\n // headers object.\n const original = Object.keys(headers).find(\n (o) => o.toLowerCase() === lowercased\n )\n\n // If the original casing doesn't exist, use the prop as the key.\n return ReflectAdapter.set(target, original ?? prop, value, receiver)\n },\n has(target, prop) {\n if (typeof prop === 'symbol') return ReflectAdapter.has(target, prop)\n\n const lowercased = prop.toLowerCase()\n\n // Let's find the original casing of the key. This assumes that there is\n // no mixed case keys (e.g. \"Content-Type\" and \"content-type\") in the\n // headers object.\n const original = Object.keys(headers).find(\n (o) => o.toLowerCase() === lowercased\n )\n\n // If the original casing doesn't exist, return false.\n if (typeof original === 'undefined') return false\n\n // If the original casing exists, return true.\n return ReflectAdapter.has(target, original)\n },\n deleteProperty(target, prop) {\n if (typeof prop === 'symbol')\n return ReflectAdapter.deleteProperty(target, prop)\n\n const lowercased = prop.toLowerCase()\n\n // Let's find the original casing of the key. This assumes that there is\n // no mixed case keys (e.g. \"Content-Type\" and \"content-type\") in the\n // headers object.\n const original = Object.keys(headers).find(\n (o) => o.toLowerCase() === lowercased\n )\n\n // If the original casing doesn't exist, return true.\n if (typeof original === 'undefined') return true\n\n // If the original casing exists, delete the property.\n return ReflectAdapter.deleteProperty(target, original)\n },\n })\n }\n\n /**\n * Seals a Headers instance to prevent modification by throwing an error when\n * any mutating method is called.\n *\n * The sealed view stays live. Later writes to `headers` remain visible\n * through it.\n *\n * `hidden` omits the given header names from every read operation (`get`,\n * `has`, `getSetCookie`, `forEach`, and iteration). The names must be\n * lowercase. The underlying headers are neither copied nor mutated, so hidden\n * headers remain available to the framework.\n */\n public static seal(\n headers: Headers,\n hidden?: ReadonlySet<string>\n ): ReadonlyHeaders {\n const isHidden =\n hidden && hidden.size > 0\n ? (name: string): boolean => hidden.has(name.toLowerCase())\n : null\n\n // The methods are built once per sealed view and reused, so repeated access\n // returns the same function instead of a fresh closure. They are assigned\n // after the proxy exists because `forEach` hands the proxy to its callback.\n // Creating the proxy runs no trap, so nothing can read them before then.\n let methods: SealedHeaderMethods\n\n const sealed: ReadonlyHeaders = new Proxy<ReadonlyHeaders>(headers, {\n get(target, prop, receiver) {\n switch (prop) {\n case 'append':\n case 'delete':\n case 'set':\n return ReadonlyHeadersError.callable\n case Symbol.iterator:\n return methods[Symbol.iterator]\n case 'get':\n case 'has':\n case 'getSetCookie':\n case 'keys':\n case 'values':\n case 'entries':\n case 'forEach':\n return methods[prop]\n default:\n return ReflectAdapter.get(target, prop, receiver)\n }\n },\n })\n\n methods = isHidden\n ? createHidingMethods(headers, sealed, isHidden)\n : createPassThroughMethods(headers, sealed)\n\n return sealed\n }\n\n /**\n * @param headers\n * @returns A fresh object identity backed by the original value\n */\n public static fresh(headers: ReadonlyHeaders): ReadonlyHeaders {\n return new Proxy<ReadonlyHeaders>(headers, {\n get(target, prop, receiver) {\n return ReflectAdapter.get(target, prop, receiver)\n },\n })\n }\n\n /**\n * Merges a header value into a string. This stores multiple values as an\n * array, so we need to merge them into a string.\n *\n * @param value a header value\n * @returns a merged header value (a string)\n */\n private merge(value: string | string[]): string {\n if (Array.isArray(value)) return value.join(', ')\n\n return value\n }\n\n /**\n * Creates a Headers instance from a plain object or a Headers instance.\n *\n * @param headers a plain object or a Headers instance\n * @returns a headers instance\n */\n public static from(headers: IncomingHttpHeaders | Headers): Headers {\n if (headers instanceof Headers) return headers\n\n return new HeadersAdapter(headers)\n }\n\n public append(name: string, value: string): void {\n const existing = this.headers[name]\n if (typeof existing === 'string') {\n this.headers[name] = [existing, value]\n } else if (Array.isArray(existing)) {\n existing.push(value)\n } else {\n this.headers[name] = value\n }\n }\n\n public delete(name: string): void {\n delete this.headers[name]\n }\n\n public get(name: string): string | null {\n const value = this.headers[name]\n if (typeof value !== 'undefined') return this.merge(value)\n\n return null\n }\n\n public has(name: string): boolean {\n return typeof this.headers[name] !== 'undefined'\n }\n\n public set(name: string, value: string): void {\n this.headers[name] = value\n }\n\n public forEach(\n callbackfn: (value: string, name: string, parent: Headers) => void,\n thisArg?: any\n ): void {\n for (const [name, value] of this.entries()) {\n callbackfn.call(thisArg, value, name, this)\n }\n }\n\n public *entries(): HeadersIterator<[string, string]> {\n for (const key of Object.keys(this.headers)) {\n const name = key.toLowerCase()\n // We assert here that this is a string because we got it from the\n // Object.keys() call above.\n const value = this.get(name) as string\n\n yield [name, value] as [string, string]\n }\n }\n\n public *keys(): HeadersIterator<string> {\n for (const key of Object.keys(this.headers)) {\n const name = key.toLowerCase()\n yield name\n }\n }\n\n public *values(): HeadersIterator<string> {\n for (const key of Object.keys(this.headers)) {\n // We assert here that this is a string because we got it from the\n // Object.keys() call above.\n const value = this.get(key) as string\n\n yield value\n }\n }\n\n public [Symbol.iterator](): HeadersIterator<[string, string]> {\n return this.entries()\n }\n}\n","export class ReflectAdapter {\n static get<T extends object>(\n target: T,\n prop: string | symbol,\n receiver: unknown\n ): any {\n const value = Reflect.get(target, prop, receiver)\n if (typeof value === 'function') {\n return value.bind(target)\n }\n\n return value\n }\n\n static set<T extends object>(\n target: T,\n prop: string | symbol,\n value: any,\n receiver: any\n ): boolean {\n return Reflect.set(target, prop, value, receiver)\n }\n\n static has<T extends object>(target: T, prop: string | symbol): boolean {\n return Reflect.has(target, prop)\n }\n\n static deleteProperty<T extends object>(\n target: T,\n prop: string | symbol\n ): boolean {\n return Reflect.deleteProperty(target, prop)\n }\n}\n","import { RequestCookies } from '../cookies'\n\nimport { ResponseCookies } from '../cookies'\nimport { ReflectAdapter } from './reflect'\nimport { workAsyncStorage } from '../../../app-render/work-async-storage.external'\nimport type { RequestStore } from '../../../app-render/work-unit-async-storage.external'\nimport { ActionDidRevalidateStaticAndDynamic } from '../../../../shared/lib/action-revalidation-kind'\n\n/**\n * @internal\n */\nexport class ReadonlyRequestCookiesError extends Error {\n constructor() {\n super(\n 'Cookies can only be modified in a Server Action or Route Handler. Read more: https://nextjs.org/docs/app/api-reference/functions/cookies#options'\n )\n }\n\n public static callable() {\n throw new ReadonlyRequestCookiesError()\n }\n}\n\n// We use this to type some APIs but we don't construct instances directly\nexport type { ResponseCookies }\n\n// The `cookies()` API is a mix of request and response cookies. For `.get()` methods,\n// we want to return the request cookie if it exists. For mutative methods like `.set()`,\n// we want to return the response cookie.\nexport type ReadonlyRequestCookies = Omit<\n RequestCookies,\n 'set' | 'clear' | 'delete'\n> &\n Pick<ResponseCookies, 'set' | 'delete'>\n\nexport class RequestCookiesAdapter {\n public static seal(cookies: RequestCookies): ReadonlyRequestCookies {\n return new Proxy(cookies as any, {\n get(target, prop, receiver) {\n switch (prop) {\n case 'clear':\n case 'delete':\n case 'set':\n return ReadonlyRequestCookiesError.callable\n default:\n return ReflectAdapter.get(target, prop, receiver)\n }\n },\n })\n }\n\n /**\n * @param cookies\n * @returns A fresh object identity backed by the original value\n */\n public static fresh(cookies: ReadonlyRequestCookies): ReadonlyRequestCookies {\n return new Proxy(cookies, {\n get(target, prop, receiver) {\n return ReflectAdapter.get(target, prop, receiver)\n },\n })\n }\n}\n\nconst SYMBOL_MODIFY_COOKIE_VALUES = Symbol.for('next.mutated.cookies')\n\nexport function getModifiedCookieValues(\n cookies: ResponseCookies\n): ResponseCookie[] {\n const modified: ResponseCookie[] | undefined = (cookies as unknown as any)[\n SYMBOL_MODIFY_COOKIE_VALUES\n ]\n if (!modified || !Array.isArray(modified) || modified.length === 0) {\n return []\n }\n\n return modified\n}\n\ntype SetCookieArgs =\n | [key: string, value: string, cookie?: Partial<ResponseCookie>]\n | [options: ResponseCookie]\n\nexport function appendMutableCookies(\n headers: Headers,\n mutableCookies: ResponseCookies\n): boolean {\n const modifiedCookieValues = getModifiedCookieValues(mutableCookies)\n if (modifiedCookieValues.length === 0) {\n return false\n }\n\n // Return a new response that extends the response with\n // the modified cookies as fallbacks. `res` cookies\n // will still take precedence.\n const resCookies = new ResponseCookies(headers)\n const returnedCookies = resCookies.getAll()\n\n // Set the modified cookies as fallbacks.\n for (const cookie of modifiedCookieValues) {\n resCookies.set(cookie)\n }\n\n // Set the original cookies as the final values.\n for (const cookie of returnedCookies) {\n resCookies.set(cookie)\n }\n\n return true\n}\n\ntype ResponseCookie = NonNullable<\n ReturnType<InstanceType<typeof ResponseCookies>['get']>\n>\n\nexport class MutableRequestCookiesAdapter {\n public static wrap(\n cookies: RequestCookies,\n onUpdateCookies?: (cookies: string[]) => void\n ): ResponseCookies {\n const responseCookies = new ResponseCookies(new Headers())\n for (const cookie of cookies.getAll()) {\n responseCookies.set(cookie)\n }\n\n let modifiedValues: ResponseCookie[] = []\n const modifiedCookies = new Set<string>()\n const updateResponseCookies = () => {\n // TODO-APP: change method of getting workStore\n const workStore = workAsyncStorage.getStore()\n if (workStore) {\n workStore.pathWasRevalidated = ActionDidRevalidateStaticAndDynamic\n }\n\n const allCookies = responseCookies.getAll()\n modifiedValues = allCookies.filter((c) => modifiedCookies.has(c.name))\n if (onUpdateCookies) {\n const serializedCookies: string[] = []\n for (const cookie of modifiedValues) {\n const tempCookies = new ResponseCookies(new Headers())\n tempCookies.set(cookie)\n serializedCookies.push(tempCookies.toString())\n }\n\n onUpdateCookies(serializedCookies)\n }\n }\n\n const wrappedCookies = new Proxy(responseCookies, {\n get(target, prop, receiver) {\n switch (prop) {\n // A special symbol to get the modified cookie values\n case SYMBOL_MODIFY_COOKIE_VALUES:\n return modifiedValues\n\n // TODO: Throw error if trying to set a cookie after the response\n // headers have been set.\n case 'delete':\n return function (...args: [string] | [ResponseCookie]) {\n modifiedCookies.add(\n typeof args[0] === 'string' ? args[0] : args[0].name\n )\n try {\n target.delete(...args)\n return wrappedCookies\n } finally {\n updateResponseCookies()\n }\n }\n case 'set':\n return function (...args: SetCookieArgs) {\n modifiedCookies.add(\n typeof args[0] === 'string' ? args[0] : args[0].name\n )\n try {\n target.set(...args)\n return wrappedCookies\n } finally {\n updateResponseCookies()\n }\n }\n\n default:\n return ReflectAdapter.get(target, prop, receiver)\n }\n },\n })\n\n return wrappedCookies\n }\n}\n\nexport function createCookiesWithMutableAccessCheck(\n requestStore: RequestStore\n): ResponseCookies {\n const wrappedCookies = new Proxy(requestStore.mutableCookies, {\n get(target, prop, receiver) {\n switch (prop) {\n case 'delete':\n return function (...args: [string] | [ResponseCookie]) {\n ensureCookiesAreStillMutable(requestStore, 'cookies().delete')\n target.delete(...args)\n return wrappedCookies\n }\n case 'set':\n return function (...args: SetCookieArgs) {\n ensureCookiesAreStillMutable(requestStore, 'cookies().set')\n target.set(...args)\n return wrappedCookies\n }\n\n default:\n return ReflectAdapter.get(target, prop, receiver)\n }\n },\n })\n return wrappedCookies\n}\n\nexport function areCookiesMutableInCurrentPhase(requestStore: RequestStore) {\n return requestStore.phase === 'action'\n}\n\n/** Ensure that cookies() starts throwing on mutation\n * if we changed phases and can no longer mutate.\n *\n * This can happen when going:\n * 'render' -> 'after'\n * 'action' -> 'render'\n * */\nfunction ensureCookiesAreStillMutable(\n requestStore: RequestStore,\n _callingExpression: string\n) {\n if (!areCookiesMutableInCurrentPhase(requestStore)) {\n // TODO: maybe we can give a more precise error message based on callingExpression?\n throw new ReadonlyRequestCookiesError()\n }\n}\n\nexport function responseCookiesToRequestCookies(\n responseCookies: ResponseCookies\n): RequestCookies {\n const requestCookies = new RequestCookies(new Headers())\n for (const cookie of responseCookies.getAll()) {\n requestCookies.set(cookie)\n }\n return requestCookies\n}\n","export {\n RequestCookies,\n ResponseCookies,\n stringifyCookie,\n} from 'next/dist/compiled/@edge-runtime/cookies'\n","export type ActionRevalidationKind = 0 | 1 | 2\n\nexport const ActionDidNotRevalidate = 0\nexport const ActionDidRevalidateStaticAndDynamic = 1\nexport const ActionDidRevalidateDynamicOnly = 2\n","export function createUnrenderedSegmentError(\n route: string,\n missingFiles: readonly string[]\n): Error {\n let message = `Route \"${route}\": Could not validate that a segment in your UI has instant navigation.`\n if (missingFiles.length > 0) {\n const label =\n missingFiles.length === 1 ? 'Dropped segment' : 'Dropped segments'\n message +=\n `\\n\\nThis segment was dropped from rendering. Issues that would prevent instant navigation will go undetected.` +\n `\\n\\n${label}:\\n${missingFiles.map((p) => ` ${p}`).join('\\n')}` +\n `\\n\\nWays to fix this:` +\n `\\n - [render] Render the dropped segment` +\n `\\n - [ignore] Set \\`export const instant = false\\` to opt the dropped segment out of instant-navigation validation` +\n `\\n\\nLearn more: https://nextjs.org/docs/messages/instant-unrendered-segment`\n }\n return new Error(message)\n}\n\nexport function createLinkPrefetchPartialError(pathname: string): Error {\n return new Error(\n `Next.js encountered dynamic data during prefetching for \"${pathname}\".\\n\\n` +\n `This will lead to slower, more expensive prefetches.\\n\\n` +\n `Ways to fix this:\\n` +\n ` - [upgrade] Opt into Partial Prefetching by exporting \\`const prefetch = 'partial'\\` from the page or layout, or by setting \\`partialPrefetching: true\\` in next.config to opt the whole app in\\n` +\n ` - [disable] Remove \\`prefetch={true}\\` from the <Link> to use the default prefetch\\n` +\n ` - [ignore] Set \\`export const instant = false\\` to opt the route out of instant-navigation validation\\n\\n` +\n `Learn more: https://nextjs.org/docs/messages/instant-link-prefetch-partial`\n )\n}\n","export class InvariantError extends Error {\n constructor(message: string, options?: ErrorOptions) {\n super(\n `Invariant: ${message.endsWith('.') ? message : message + '.'} This is a bug in Next.js.`,\n options\n )\n this.name = 'InvariantError'\n }\n}\n","// This has to be a shared module which is shared between client component error boundary and dynamic component\nconst BAILOUT_TO_CSR = 'BAILOUT_TO_CLIENT_SIDE_RENDERING'\n\n/** An error that should be thrown when we want to bail out to client-side rendering. */\nexport class BailoutToCSRError extends Error {\n public readonly digest = BAILOUT_TO_CSR\n\n constructor(public readonly reason: string) {\n super(`Bail out to client-side rendering: ${reason}`)\n }\n}\n\n/** Checks if a passed argument is an error that is thrown if we want to bail out to client-side rendering. */\nexport function isBailoutToCSRError(err: unknown): err is BailoutToCSRError {\n if (typeof err !== 'object' || err === null || !('digest' in err)) {\n return false\n }\n\n return err.digest === BAILOUT_TO_CSR\n}\n","// This module is bundled separately into user code and the precompiled App\n// Router runtime. Use the global symbol registry so both copies recognize the\n// same browser bailout reason.\nconst REACT_BROWSER_BAILOUT_REASON = Symbol.for('next.browser-bailout-reason')\n\ntype ReactBrowserBailoutReason = {\n $$typeof: symbol\n reason: string\n}\n\nexport function createReactBrowserBailoutReason(\n reason: string\n): ReactBrowserBailoutReason {\n return {\n $$typeof: REACT_BROWSER_BAILOUT_REASON,\n reason,\n }\n}\n\nexport function getReactBrowserBailoutReason(\n error: unknown\n): string | undefined {\n const cause = (error as Error)?.cause as ReactBrowserBailoutReason | undefined\n\n return cause?.$$typeof === REACT_BROWSER_BAILOUT_REASON\n ? cause.reason\n : undefined\n}\n\nexport function isNextBrowserBailoutError(error: unknown): boolean {\n return getReactBrowserBailoutReason(error) !== undefined\n}\n","export function createPromiseWithResolvers<T>(): PromiseWithResolvers<T> {\n // Shim of Stage 4 Promise.withResolvers proposal\n let resolve: (value: T | PromiseLike<T>) => void\n let reject: (reason: any) => void\n const promise = new Promise<T>((res, rej) => {\n resolve = res\n reject = rej\n })\n return { resolve: resolve!, reject: reject!, promise }\n}\n","import { DEFAULT_SEGMENT_KEY } from '../../segment'\nimport type { LoaderTree } from '../../../../server/lib/app-dir-module'\n\nexport function parseLoaderTree(tree: LoaderTree) {\n const [segment, parallelRoutes, modules, staticSiblings] = tree\n const { layout, template } = modules\n let { page } = modules\n // a __DEFAULT__ segment means that this route didn't match any of the\n // segments in the route, so we should use the default page\n page = segment === DEFAULT_SEGMENT_KEY ? modules.defaultPage : page\n\n const conventionPath = layout?.[1] || template?.[1] || page?.[1]\n\n return {\n page,\n segment,\n modules,\n /* it can be either layout / template / page */\n conventionPath,\n parallelRoutes,\n staticSiblings,\n }\n}\n","import type { FlightRouterState, Segment } from './app-router-types'\n\nexport function getSegmentValue(segment: Segment) {\n return Array.isArray(segment) ? segment[1] : segment\n}\n\nexport function isGroupSegment(segment: string) {\n // Use array[0] for performant purpose\n return segment[0] === '(' && segment.endsWith(')')\n}\n\nexport function isParallelRouteSegment(segment: string) {\n return segment.startsWith('@') && segment !== '@children'\n}\n\nexport function computeSelectedLayoutSegment(\n segments: string[] | null,\n parallelRouteKey: string\n): string | null {\n if (!segments || segments.length === 0) {\n return null\n }\n\n // For 'children', use first segment; for other parallel routes, use last segment\n const rawSegment =\n parallelRouteKey === 'children'\n ? segments[0]\n : segments[segments.length - 1]\n\n // If the default slot is showing, return null since it's not technically \"selected\" (it's a fallback)\n // Returning an internal value like `__DEFAULT__` would be confusing\n return rawSegment === DEFAULT_SEGMENT_KEY ? null : rawSegment\n}\n\n/** Get the canonical parameters from the current level to the leaf node. */\nexport function getSelectedLayoutSegmentPath(\n tree: FlightRouterState,\n parallelRouteKey: string,\n first = true,\n segmentPath: string[] = []\n): string[] {\n let node: FlightRouterState\n if (first) {\n // Use the provided parallel route key on the first parallel route\n node = tree[1][parallelRouteKey]\n } else {\n // After first parallel route prefer children, if there's no children pick the first parallel route.\n const parallelRoutes = tree[1]\n node = parallelRoutes.children ?? Object.values(parallelRoutes)[0]\n }\n\n if (!node) return segmentPath\n const segment = node[0]\n\n let segmentValue = getSegmentValue(segment)\n\n if (!segmentValue || segmentValue === PAGE_SEGMENT_KEY) {\n return segmentPath\n }\n\n segmentPath.push(segmentValue)\n\n return getSelectedLayoutSegmentPath(\n node,\n parallelRouteKey,\n false,\n segmentPath\n )\n}\n\nexport const PAGE_SEGMENT_KEY = '__PAGE__'\nexport const DEFAULT_SEGMENT_KEY = '__DEFAULT__'\nexport const NOT_FOUND_SEGMENT_KEY = '/_not-found'\n","export * from '../client/components/navigation.react-server';\n\n//# sourceMappingURL=navigation.react-server.js.map","var _a;\nexport const $output = /*@__PURE__*/ Symbol(\"ZodOutput\");\nexport const $input = /*@__PURE__*/ Symbol(\"ZodInput\");\nexport class $ZodRegistry {\n constructor() {\n this._map = new WeakMap();\n this._idmap = new Map();\n }\n add(schema, ..._meta) {\n const meta = _meta[0];\n this._map.set(schema, meta);\n if (meta && typeof meta === \"object\" && \"id\" in meta) {\n this._idmap.set(meta.id, schema);\n }\n return this;\n }\n clear() {\n this._map = new WeakMap();\n this._idmap = new Map();\n return this;\n }\n remove(schema) {\n const meta = this._map.get(schema);\n if (meta && typeof meta === \"object\" && \"id\" in meta) {\n this._idmap.delete(meta.id);\n }\n this._map.delete(schema);\n return this;\n }\n get(schema) {\n // return this._map.get(schema) as any;\n // inherit metadata\n const p = schema._zod.parent;\n if (p) {\n const pm = { ...(this.get(p) ?? {}) };\n delete pm.id; // do not inherit id\n const f = { ...pm, ...this._map.get(schema) };\n return Object.keys(f).length ? f : undefined;\n }\n return this._map.get(schema);\n }\n has(schema) {\n return this._map.has(schema);\n }\n}\n// registries\nexport function registry() {\n return new $ZodRegistry();\n}\n(_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());\nexport const globalRegistry = globalThis.__zod_globalRegistry;\n","var _a;\nimport { members as installMembers } from \"./util.js\";\n/** A special constant with type `never` */\nexport const NEVER = /*@__PURE__*/ Object.freeze({\n status: \"aborted\",\n});\n/* Shared descriptor for installing `_zod`; defineProperty reads it\n * synchronously, so reusing one object avoids a per-instance allocation. */\nconst _zodDesc = { value: undefined, enumerable: false };\n// null where suppressing the capture would be unrecoverable: `parse()` puts the frames back with `captureStackTrace`, so without it the throw would lose its stack. also latched to null once `stackTraceLimit` proves unassignable, which a realm can do at any point by hardening Error\nlet _E = \"captureStackTrace\" in Error ? Error : null;\n// v8 captures a stack trace inside the Error constructor, which dominates a failed parse; costs only the frames, and parse() restores those. the constructor must RUN: Object.create is cheaper and passes instanceof, but Error.isError and util.types.isNativeError check an internal slot\nfunction newError(Definition) {\n const E = _E;\n if (E) {\n const saved = E.stackTraceLimit;\n if (typeof saved === \"number\") {\n try {\n E.stackTraceLimit = 0;\n }\n catch {\n _E = null;\n return new Definition();\n }\n try {\n return new Definition();\n }\n finally {\n E.stackTraceLimit = saved;\n }\n }\n }\n return new Definition();\n}\nexport /*@__NO_SIDE_EFFECTS__*/ function $constructor(name, initializer, \n/** This trait's members, installed once on every prototype that composes it. They cannot be declared in the initializer above: that runs per instance, and the prototype is shared. */\nproto, params) {\n // Prototype for this constructor's `_zod` internals. Lazily-derived fields (`values`, `pattern`, `optin`, …) install here once rather than as an accessor on every instance.\n const zodProto = {};\n // Assigning the fields in the constructor body is what gives instances in-object slots; building the object literally and reparenting it costs a second allocation and a generic property copy.\n function Internals(def) {\n this.def = def;\n this.constr = _;\n this.traits = new Set();\n }\n Internals.prototype = zodProto;\n const protoMembers = proto;\n // One trait's members land on every prototype whose chain composes it, so the answer is per prototype rather than per trait.\n const initialized = protoMembers && new WeakSet();\n function init(inst, def) {\n if (!inst._zod) {\n _zodDesc.value = new Internals(def);\n try {\n Object.defineProperty(inst, \"_zod\", _zodDesc);\n }\n finally {\n // Cleared even on throw, so the shared descriptor never leaks one instance's internals into the next.\n _zodDesc.value = undefined;\n }\n }\n else if (inst._zod.traits.has(name)) {\n return;\n }\n inst._zod.traits.add(name);\n initializer(inst, def);\n if (initialized) {\n // `super(def)` from a user subclass gives `this` a prototype the subclass owns, and installing there would overwrite whatever the subclass declared. `constr` built the instance, so its prototype is the one below the subclass's that should carry the members. A receiver whose chain never reaches that prototype installs on its own, which for a plain object handed straight to `init` means `Object.prototype` — unchanged from before.\n const own = Object.getPrototypeOf(inst);\n const ctorProto = inst._zod.constr.prototype;\n let up = own;\n while (up && up !== ctorProto)\n up = Object.getPrototypeOf(up);\n const target = up ?? own;\n if (!initialized.has(target)) {\n initialized.add(target);\n installMembers(target, protoMembers);\n }\n }\n // support prototype modifications; for-in avoids the array allocation of Object.keys on the (usually empty) prototype\n const proto = _.prototype;\n for (const k in proto) {\n if (!Object.prototype.hasOwnProperty.call(proto, k))\n continue;\n if (!(k in inst)) {\n inst[k] = proto[k].bind(inst);\n }\n }\n }\n // doesn't work if Parent has a constructor with arguments\n const Parent = params?.Parent ?? Object;\n class Definition extends Parent {\n }\n Object.defineProperty(Definition, \"name\", { value: name });\n function _(def) {\n const inst = params?.Parent ? newError(Definition) : this;\n init(inst, def);\n const deferred = inst._zod.deferred;\n if (deferred) {\n for (const fn of deferred) {\n fn();\n }\n // Released: initializers run once, and the list would otherwise be retained for the schema's lifetime.\n inst._zod.deferred = undefined;\n }\n // Global post-processor hook. Internal: installed by `import \"zod/compile\"` to enable AOT compilation for every constructed schema. Runs last, once the instance is fully built, because it hands the instance to compile(). The post-processor is expected to be reentrancy-guarded by its own implementation.\n const pp = globalThis.__zod_globalConfig?.postProcessor;\n if (pp)\n pp(inst);\n return inst;\n }\n Object.defineProperty(_, \"init\", { value: init });\n Object.defineProperty(_, Symbol.hasInstance, {\n value: (inst) => {\n if (params?.Parent && inst instanceof params.Parent)\n return true;\n return inst?._zod?.traits?.has(name);\n },\n });\n Object.defineProperty(_, \"name\", { value: name });\n return _;\n}\n////////////////////////////// UTILITIES ///////////////////////////////////////\nexport const $brand = /*@__PURE__*/ Symbol(\"zod_brand\");\nexport class $ZodAsyncError extends Error {\n constructor() {\n super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);\n }\n}\nexport class $ZodEncodeError extends Error {\n constructor(name) {\n super(`Encountered unidirectional transform during encode: ${name}`);\n this.name = \"ZodEncodeError\";\n }\n}\n(_a = globalThis).__zod_globalConfig ?? (_a.__zod_globalConfig = {});\nexport const globalConfig = globalThis.__zod_globalConfig;\nexport function config(newConfig) {\n if (newConfig)\n Object.assign(globalConfig, newConfig);\n return globalConfig;\n}\n","//#region \\0@oxc-project+runtime@0.149.0/helpers/esm/typeof.js\nfunction _typeof(o) {\n\t\"@babel/helpers - typeof\";\n\treturn _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(o) {\n\t\treturn typeof o;\n\t} : function(o) {\n\t\treturn o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n\t}, _typeof(o);\n}\n//#endregion\n//#region \\0@oxc-project+runtime@0.149.0/helpers/esm/toPrimitive.js\nfunction toPrimitive(t, r) {\n\tif (\"object\" != _typeof(t) || !t) return t;\n\tvar e = t[Symbol.toPrimitive];\n\tif (void 0 !== e) {\n\t\tvar i = e.call(t, r || \"default\");\n\t\tif (\"object\" != _typeof(i)) return i;\n\t\tthrow new TypeError(\"@@toPrimitive must return a primitive value.\");\n\t}\n\treturn (\"string\" === r ? String : Number)(t);\n}\n//#endregion\n//#region \\0@oxc-project+runtime@0.149.0/helpers/esm/toPropertyKey.js\nfunction toPropertyKey(t) {\n\tvar i = toPrimitive(t, \"string\");\n\treturn \"symbol\" == _typeof(i) ? i : i + \"\";\n}\n//#endregion\n//#region \\0@oxc-project+runtime@0.149.0/helpers/esm/defineProperty.js\nfunction _defineProperty(e, r, t) {\n\treturn (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n\t\tvalue: t,\n\t\tenumerable: !0,\n\t\tconfigurable: !0,\n\t\twritable: !0\n\t}) : e[r] = t, e;\n}\n//#endregion\n//#region \\0@oxc-project+runtime@0.149.0/helpers/esm/objectSpread2.js\nfunction ownKeys(e, r) {\n\tvar t = Object.keys(e);\n\tif (Object.getOwnPropertySymbols) {\n\t\tvar o = Object.getOwnPropertySymbols(e);\n\t\tr && (o = o.filter(function(r) {\n\t\t\treturn Object.getOwnPropertyDescriptor(e, r).enumerable;\n\t\t})), t.push.apply(t, o);\n\t}\n\treturn t;\n}\nfunction _objectSpread2(e) {\n\tfor (var r = 1; r < arguments.length; r++) {\n\t\tvar t = null != arguments[r] ? arguments[r] : {};\n\t\tr % 2 ? ownKeys(Object(t), !0).forEach(function(r) {\n\t\t\t_defineProperty(e, r, t[r]);\n\t\t}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) {\n\t\t\tObject.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n\t\t});\n\t}\n\treturn e;\n}\n//#endregion\nexport { _defineProperty as n, _objectSpread2 as t };\n","export class Doc {\n constructor(args = [], closed = {}) {\n this.content = [];\n this.indent = 0;\n this.args = args;\n this.closed = closed;\n }\n // the compiler catches a child's throw and keeps writing into this doc, so the indent has to unwind with it\n indented(fn) {\n this.indent += 1;\n try {\n fn(this);\n }\n finally {\n this.indent -= 1;\n }\n }\n write(arg) {\n if (typeof arg === \"function\") {\n arg(this, { execution: \"sync\" });\n arg(this, { execution: \"async\" });\n return;\n }\n const content = arg;\n const lines = content.split(\"\\n\").filter((x) => x);\n const minIndent = Math.min(...lines.map((x) => x.length - x.trimStart().length));\n const dedented = lines.map((x) => x.slice(minIndent)).map((x) => \" \".repeat(this.indent * 2) + x);\n for (const line of dedented) {\n this.content.push(line);\n }\n }\n compile() {\n const F = Function;\n const content = this?.content ?? [``];\n const factory = new F(...Object.keys(this.closed), `return function (${this.args.join(\", \")}) {\\n${content.join(\"\\n\")}\\n};`);\n return factory(...Object.values(this.closed));\n }\n}\n","export const version = {\n major: 4,\n minor: 6,\n patch: 7,\n};\n","import * as util from \"../core/util.js\";\nconst error = () => {\n const Sizable = {\n string: { unit: \"characters\", verb: \"to have\" },\n file: { unit: \"bytes\", verb: \"to have\" },\n array: { unit: \"items\", verb: \"to have\" },\n set: { unit: \"items\", verb: \"to have\" },\n map: { unit: \"entries\", verb: \"to have\" },\n };\n function getSizing(origin) {\n return Sizable[origin] ?? null;\n }\n const FormatDictionary = {\n regex: \"input\",\n email: \"email address\",\n url: \"URL\",\n emoji: \"emoji\",\n uuid: \"UUID\",\n uuidv4: \"UUIDv4\",\n uuidv6: \"UUIDv6\",\n nanoid: \"nanoid\",\n guid: \"GUID\",\n cuid: \"cuid\",\n cuid2: \"cuid2\",\n ulid: \"ULID\",\n xid: \"XID\",\n ksuid: \"KSUID\",\n datetime: \"ISO datetime\",\n date: \"ISO date\",\n time: \"ISO time\",\n duration: \"ISO duration\",\n ipv4: \"IPv4 address\",\n ipv6: \"IPv6 address\",\n mac: \"MAC address\",\n cidrv4: \"IPv4 range\",\n cidrv6: \"IPv6 range\",\n base64: \"base64-encoded string\",\n base64url: \"base64url-encoded string\",\n json_string: \"JSON string\",\n e164: \"E.164 number\",\n currency_code: \"currency code\",\n credit_card: \"credit card number\",\n iban: \"IBAN\",\n jwt: \"JWT\",\n template_literal: \"input\",\n };\n // type names: missing keys = do not translate (use raw value via ?? fallback)\n const TypeDictionary = {\n // Compatibility: \"nan\" -> \"NaN\" for display\n nan: \"NaN\",\n // All other type names omitted - they fall back to raw values via ?? operator\n };\n function getTypeName(type, input) {\n if (type === \"number\" && typeof input === \"number\" && !Number.isFinite(input)) {\n return String(input);\n }\n return TypeDictionary[type] ?? type;\n }\n return (issue) => {\n switch (issue.code) {\n case \"invalid_type\": {\n const expected = getTypeName(issue.expected);\n const receivedType = util.parsedType(issue.input);\n const received = getTypeName(receivedType, issue.input);\n return `Invalid input: expected ${expected}, received ${received}`;\n }\n case \"invalid_value\":\n if (issue.values.length === 1)\n return `Invalid input: expected ${util.stringifyPrimitive(issue.values[0])}`;\n return `Invalid option: expected one of ${util.joinValues(issue.values, \"|\")}`;\n case \"too_big\": {\n const adj = issue.exact ? \"exactly \" : issue.inclusive ? \"<=\" : \"<\";\n const sizing = getSizing(issue.origin);\n if (sizing)\n return `Too big: expected ${issue.origin ?? \"value\"} to have ${adj}${issue.maximum.toString()} ${sizing.unit ?? \"elements\"}`;\n return `Too big: expected ${issue.origin ?? \"value\"} to be ${adj}${issue.maximum.toString()}`;\n }\n case \"too_small\": {\n const adj = issue.exact ? \"exactly \" : issue.inclusive ? \">=\" : \">\";\n const sizing = getSizing(issue.origin);\n if (sizing) {\n return `Too small: expected ${issue.origin} to have ${adj}${issue.minimum.toString()} ${sizing.unit}`;\n }\n return `Too small: expected ${issue.origin} to be ${adj}${issue.minimum.toString()}`;\n }\n case \"invalid_format\": {\n const _issue = issue;\n if (_issue.format === \"starts_with\") {\n return `Invalid string: must start with \"${_issue.prefix}\"`;\n }\n if (_issue.format === \"ends_with\")\n return `Invalid string: must end with \"${_issue.suffix}\"`;\n if (_issue.format === \"includes\")\n return `Invalid string: must include \"${_issue.includes}\"`;\n if (_issue.format === \"regex\")\n return `Invalid string: must match pattern ${_issue.pattern}`;\n return `Invalid ${FormatDictionary[_issue.format] ?? issue.format}`;\n }\n case \"not_multiple_of\":\n return `Invalid number: must be a multiple of ${issue.divisor}`;\n case \"unrecognized_keys\":\n return `Unrecognized key${issue.keys.length > 1 ? \"s\" : \"\"}: ${util.joinValues(issue.keys, \", \")}`;\n case \"invalid_key\":\n return `Invalid key in ${issue.origin}`;\n case \"invalid_union\":\n if (issue.options && Array.isArray(issue.options) && issue.options.length > 0) {\n const opts = issue.options.map((o) => `'${o}'`).join(\" | \");\n return `Invalid discriminator value. Expected ${opts}`;\n }\n if (issue.inclusive === false) {\n return \"Invalid input: more than one option matched\";\n }\n return \"Invalid input\";\n case \"invalid_element\":\n return `Invalid value in ${issue.origin}`;\n default:\n return `Invalid input`;\n }\n };\n};\nexport default function () {\n return {\n localeError: error(),\n };\n}\n","import * as util from \"./util.js\";\nexport class $ZodCyclicError extends Error {\n constructor() {\n super(`Cannot parse a reference cycle that closes through a transform`);\n this.name = \"ZodCyclicError\";\n }\n}\n/** Keyed off the context object every schema in one parse call already shares. */\nconst STATE = \"~memo\";\nconst NO_ISSUES = [];\n// a value a cycle can close through\nfunction isRef(value) {\n return value !== null && typeof value === \"object\";\n}\n// Receivers prefix paths in place, so the cache and every hand-out need their own copies.\nfunction cloneIssues(issues) {\n return issues.map((iss) => (iss.path ? { ...iss, path: iss.path.slice() } : { ...iss }));\n}\nconst recursive = /*@__PURE__*/ new WeakMap();\n/** What the walk established, in order of certainty: ordered so the strongest answer among children wins. */\nconst NONE = 0;\nconst ASSUMED = 1;\nconst PROVEN = 2;\n/** Whether this schema's subtree contains a cycle, so one parse can re-enter it. */\nfunction isRecursive(inst, stack, resolve) {\n const cached = recursive.get(inst);\n if (cached !== undefined)\n return cached ? PROVEN : NONE;\n // Relative to the walk in progress, so not cached.\n if (stack.has(inst))\n return PROVEN;\n stack.add(inst);\n let result = NONE;\n const check = (child) => {\n if (result !== PROVEN && child?._zod) {\n const answer = isRecursive(child, stack, resolve);\n if (answer > result)\n result = answer;\n }\n };\n // `Reflect.ownKeys` rather than `Object.keys`, so a cycle through a declared symbol key is still seen\n const shape = (sh, spread) => {\n let answer = NONE;\n for (const key of Reflect.ownKeys(sh)) {\n const desc = Object.getOwnPropertyDescriptor(sh, key);\n // an object resolves its shape by spread, so a key it does not enumerate is never parsed; `z.properties` reads every own key and so keeps them all\n if (spread && !desc.enumerable)\n continue;\n // resolving runs user code, and a factory mints a fresh subtree per read, so an edge the walk can't follow counts as a cycle\n const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve) : NONE;\n if (child > answer)\n answer = child;\n }\n return answer;\n };\n const merge = (answer) => {\n if (answer > result)\n result = answer;\n };\n const def = inst._zod.def;\n const kind = def.type;\n switch (kind) {\n case \"object\": {\n const raw = util.rawShape(def);\n // a def with no raw shape answers `shape` from an accessor of its own, and running that can mint a whole fresh subtree\n merge(raw ? shape(raw, true) : ASSUMED);\n check(def.catchall);\n break;\n }\n case \"array\":\n check(def.element);\n break;\n case \"tuple\":\n for (const el of def.items)\n check(el);\n check(def.rest);\n break;\n case \"record\":\n case \"map\":\n check(def.keyType);\n check(def.valueType);\n break;\n case \"set\":\n check(def.valueType);\n break;\n case \"union\":\n for (const el of def.options)\n check(el);\n break;\n case \"intersection\":\n check(def.left);\n check(def.right);\n break;\n case \"optional\":\n case \"nullable\":\n case \"default\":\n case \"prefault\":\n case \"catch\":\n case \"readonly\":\n case \"nonoptional\":\n case \"promise\":\n case \"success\":\n check(def.innerType);\n break;\n case \"pipe\":\n check(def.in);\n check(def.out);\n break;\n case \"function\":\n check(def.input);\n check(def.output);\n break;\n // `$ZodLazy` caches its inner on the def, so a resolved edge is followed exactly\n case \"lazy\": {\n const inner = def._cachedInner ?? (resolve ? inst._zod.innerType : undefined);\n // walked with resolution off: one hop sees past the deferral, and a lazy that yields only another unresolved lazy is generative, so it stops there\n merge(inner ? isRecursive(inner, stack, false) : ASSUMED);\n break;\n }\n // a leaf by choice: `parts` are regex fragments, not data positions\n case \"template_literal\":\n // leaves\n case \"string\":\n case \"number\":\n case \"int\":\n case \"boolean\":\n case \"bigint\":\n case \"symbol\":\n case \"undefined\":\n case \"null\":\n case \"void\":\n case \"never\":\n case \"any\":\n case \"unknown\":\n case \"date\":\n case \"nan\":\n case \"enum\":\n case \"literal\":\n case \"file\":\n case \"transform\":\n case \"custom\":\n break;\n default: {\n // a new built-in kind becomes a compile error here\n kind;\n // a user-defined kind can still hold children, and only its author knows where, so fall back to scanning the def — skipping accessors, since reading one can run user code\n for (const key in def) {\n const desc = Object.getOwnPropertyDescriptor(def, key);\n if (!desc || desc.get)\n continue;\n const value = desc.value;\n if (!value || typeof value !== \"object\")\n continue;\n if (value._zod)\n check(value);\n else if (Array.isArray(value))\n for (const el of value)\n check(el);\n }\n }\n }\n stack.delete(inst);\n return settle(inst, result);\n}\n/** An assumed answer must not outlive the resolution that settles it, so only a certain one is cached. */\nfunction settle(inst, answer) {\n if (answer !== ASSUMED)\n recursive.set(inst, answer === PROVEN);\n return answer;\n}\n/**\n * Whether one parse can re-enter this schema, i.e. its subtree contains a cycle.\n * Exported for `z.compile`, which refuses to compile such a schema: cycle\n * breaking is driven from here off state keyed on the parse context, and a\n * generated fast path has no context to key on.\n */\nexport function isRecursiveSchema(inst) {\n // z.compile never parses, so nothing would ever resolve a lazy for it; it runs once and already treats a throw here as recursive\n return isRecursive(inst, new Set(), true) !== NONE;\n}\nfunction bucketFor(state, inst) {\n let bucket = state.buckets.get(inst);\n if (!bucket) {\n bucket = new WeakMap();\n state.buckets.set(inst, bucket);\n }\n return bucket;\n}\n// Set immediately before delegating to core and cleared immediately after, so `alloc` registers only for a visit this module is driving.\nlet handoff;\n// Allocated but unfinished entries. `alloc` and the matching pop both happen in the synchronous part of a parse, so they nest even when children are async, and one stack serves every schema.\nconst open = [];\nconst memo = {\n alloc(_inst, payload, empty) {\n const bucket = handoff;\n if (!bucket)\n return empty;\n handoff = undefined;\n const entry = { value: empty, issues: null };\n bucket.set(payload.value, entry);\n open.push(entry);\n return empty;\n },\n guard(inst) {\n var _a;\n (_a = inst._zod).deferred ?? (_a.deferred = []);\n inst._zod.deferred.push(() => {\n const base = inst._zod.parse;\n const wrapped = (payload, ctx) => {\n // The value is a placeholder a back-edge is still waiting on, so the cycle closes through this transform. Its output can't exist in time to bind.\n if (ctx.direction !== \"backward\" && isBackEdge(ctx, payload.value))\n throw new $ZodCyclicError();\n return base(payload, ctx);\n };\n inst._zod.parse = wrapped;\n if (inst._zod.run === base)\n inst._zod.run = wrapped;\n });\n },\n attach(inst) {\n var _a;\n let isRecursiveInst;\n let rechecked = false;\n // a recursive schema is re-entered many times per parse and its bucket never changes\n let lastCtx;\n let lastBucket;\n // Wraps `parse` in a deferred so it sees the container's final parse. Core's own deferred copies `parse` into `run` when there are no checks, and it ran first, so `run` is patched to match; with checks, `run` reads `parse` dynamically.\n (_a = inst._zod).deferred ?? (_a.deferred = []);\n inst._zod.deferred.push(() => {\n const base = inst._zod.parse;\n const wrapped = (payload, ctx) => {\n if (isRecursiveInst === undefined) {\n const walked = isRecursive(inst, new Set(), false);\n if (walked === NONE) {\n // Nothing here can ever fire, so take it back out.\n inst._zod.parse = base;\n if (inst._zod.run === wrapped)\n inst._zod.run = base;\n return base(payload, ctx);\n }\n // this parse resolves the deferred edges on its own path, so ask once more before latching\n if (walked === PROVEN || rechecked)\n isRecursiveInst = true;\n else\n rechecked = true;\n }\n const input = payload.value;\n if (!isRef(input))\n return base(payload, ctx);\n let state = ctx[STATE];\n if (!state) {\n state = { buckets: new WeakMap(), backEdges: undefined };\n ctx[STATE] = state;\n }\n let bucket;\n if (lastCtx === ctx) {\n bucket = lastBucket;\n }\n else {\n bucket = bucketFor(state, inst);\n lastCtx = ctx;\n lastBucket = bucket;\n }\n const hit = bucket.get(input);\n if (hit) {\n payload.value = hit.value;\n if (hit.issues) {\n if (hit.issues.length)\n payload.issues.push(...cloneIssues(hit.issues));\n }\n else {\n // Still being parsed: its own checks cover it, so skip them here.\n payload.memo = true;\n state.backEdges ?? (state.backEdges = new WeakSet());\n state.backEdges.add(hit.value);\n }\n return payload;\n }\n handoff = bucket;\n const depth = open.length;\n const result = base(payload, ctx);\n handoff = undefined;\n // A container that rejected its input outright allocated nothing.\n const entry = open.length > depth ? open.pop() : undefined;\n // Both paths written out so the sync one allocates no closure. It runs once per node, and capturing here cost more than everything else combined.\n if (result instanceof Promise) {\n return result.then((r) => {\n if (entry)\n entry.issues = r.issues.length ? cloneIssues(r.issues) : NO_ISSUES;\n return r;\n });\n }\n if (entry)\n entry.issues = result.issues.length ? cloneIssues(result.issues) : NO_ISSUES;\n return result;\n };\n inst._zod.parse = wrapped;\n if (inst._zod.run === base)\n inst._zod.run = wrapped;\n });\n },\n};\n/** The memoizer that gives containers cycle support. `zod` installs it by default; `zod/mini` opts in with `config({ memoizer: memoizer() })`. */\nexport function memoizer() {\n return memo;\n}\n/** Whether this value is a node a back-edge resolved to before it finished. */\nexport function isBackEdge(ctx, value) {\n const backEdges = ctx[STATE]?.backEdges;\n return backEdges !== undefined && isRef(value) && backEdges.has(value);\n}\n","import { globalRegistry } from \"./registries.js\";\nimport { assignProp } from \"./util.js\";\nfunction assignProps(target, ...sources) {\n for (const source of sources) {\n for (const key of Reflect.ownKeys(source)) {\n if (Object.prototype.propertyIsEnumerable.call(source, key)) {\n assignProp(target, key, source[key]);\n }\n }\n }\n return target;\n}\n// function initializeContext<T extends schemas.$ZodType>(inputs: JSONSchemaGeneratorParams<T>): ToJSONSchemaContext<T> {\n// return {\n// processor: inputs.processor,\n// metadataRegistry: inputs.metadata ?? globalRegistry,\n// target: inputs.target ?? \"draft-2020-12\",\n// unrepresentable: inputs.unrepresentable ?? \"throw\",\n// };\n// }\nexport function initializeContext(params) {\n // Normalize target: convert old non-hyphenated versions to hyphenated versions\n let target = params?.target ?? \"draft-2020-12\";\n if (target === \"draft-4\")\n target = \"draft-04\";\n if (target === \"draft-7\")\n target = \"draft-07\";\n return {\n processors: params.processors ?? {},\n metadataRegistry: params?.metadata ?? globalRegistry,\n target,\n unrepresentable: params?.unrepresentable ?? \"throw\",\n override: params?.override ?? (() => { }),\n io: params?.io ?? \"output\",\n counter: 0,\n seen: new Map(),\n sharedDefsExtractedFor: undefined,\n sharedEmitDoneFor: undefined,\n cycles: params?.cycles ?? \"ref\",\n reused: params?.reused ?? \"inline\",\n intersections: [],\n deferred: [],\n external: params?.external ?? undefined,\n };\n}\n/**\n * Applies the `unrepresentable` setting at a site that has no JSON Schema equivalent. Throws\n * `message` unless the setting (or the handler's return value) says otherwise. Returns `true` if a\n * custom JSON Schema was written into `json`, in which case the caller must not write its own.\n */\nexport function handleUnrepresentable(schema, ctx, json, params, message) {\n const result = typeof ctx.unrepresentable === \"function\"\n ? ctx.unrepresentable({ zodSchema: schema, path: params.path, message })\n : ctx.unrepresentable;\n if (result === \"any\")\n return false;\n if (result === undefined || result === \"throw\")\n throw new Error(message);\n Object.assign(json, result);\n return true;\n}\n// never rename this back to `process`: bundler polyfills inject a top-level `const process` that a lexical declaration of the same name collides with (#6397)\nexport function processSchema(schema, ctx, _params = { path: [], schemaPath: [] }) {\n var _a;\n const def = schema._zod.def;\n // check for schema in seens\n const seen = ctx.seen.get(schema);\n if (seen) {\n seen.count++;\n // check if cycle\n const isCycle = _params.schemaPath.includes(schema);\n if (isCycle) {\n seen.cycle = _params.path;\n }\n return seen.schema;\n }\n // initialize\n const result = { schema: {}, count: 1, cycle: undefined, path: _params.path };\n ctx.seen.set(schema, result);\n ctx.sharedDefsExtractedFor = undefined;\n ctx.sharedEmitDoneFor = undefined;\n // custom method overrides default behavior\n const overrideSchema = schema._zod.toJSONSchema?.();\n if (overrideSchema) {\n result.schema = overrideSchema;\n }\n else {\n const params = {\n ..._params,\n schemaPath: [..._params.schemaPath, schema],\n path: _params.path,\n };\n if (schema._zod.processJSONSchema) {\n schema._zod.processJSONSchema(ctx, result.schema, params);\n }\n else {\n const _json = result.schema;\n const processor = ctx.processors[def.type];\n if (!processor) {\n throw new Error(`[toJSONSchema]: Non-representable type encountered: ${def.type}`);\n }\n processor(schema, ctx, _json, params);\n }\n const parent = schema._zod.parent;\n if (parent) {\n // Also set ref if processor didn't (for inheritance)\n if (!result.ref)\n result.ref = parent;\n processSchema(parent, ctx, params);\n ctx.seen.get(parent).isParent = true;\n }\n }\n // metadata\n const meta = ctx.metadataRegistry.get(schema);\n if (meta)\n assignProps(result.schema, meta);\n if (ctx.io === \"input\" && isTransforming(schema)) {\n // examples/defaults only apply to output type of pipe\n delete result.schema.examples;\n delete result.schema.default;\n }\n // set prefault as default\n if (ctx.io === \"input\" && \"_prefault\" in result.schema)\n (_a = result.schema).default ?? (_a.default = result.schema._prefault);\n delete result.schema._prefault;\n // pulling fresh from ctx.seen in case it was overwritten\n const _result = ctx.seen.get(schema);\n return _result.schema;\n}\n/** @deprecated Renamed to `processSchema`. An export alias declares no binding, so it is safe to keep. */\nexport { processSchema as process };\n// Escape a reference token for use in a JSON Pointer fragment (RFC 6901): `~` becomes `~0` and `/` becomes `~1`. The `~` replacement must run first.\nfunction encodeJSONPointerSegment(segment) {\n return segment.replace(/~/g, \"~0\").replace(/\\//g, \"~1\");\n}\nexport function extractDefs(ctx, schema\n// params: EmitParams\n) {\n // iterate over seen map;\n const root = ctx.seen.get(schema);\n if (!root)\n throw new Error(\"Unprocessed schema. This is a bug in Zod.\");\n // With `external` set, every registered schema resolves through the external branch of `makeURI`, so the root branch below produces the same ref the external branch would — this pass is identical whichever schema it is called with, and only needs to run once.\n if (ctx.external && ctx.sharedDefsExtractedFor === ctx.external)\n return;\n // Track ids to detect duplicates across different schemas\n const idToSchema = new Map();\n for (const entry of ctx.seen.entries()) {\n const id = ctx.metadataRegistry.get(entry[0])?.id;\n if (id) {\n const existing = idToSchema.get(id);\n if (existing && existing !== entry[0]) {\n throw new Error(`Duplicate schema id \"${id}\" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);\n }\n idToSchema.set(id, entry[0]);\n }\n }\n // returns a ref to the schema defId will be empty if the ref points to an external schema (or #)\n const makeURI = (entry) => {\n // comparing the seen objects because sometimes multiple schemas map to the same seen object. e.g. lazy\n // external is configured\n const defsSegment = ctx.target === \"draft-2020-12\" ? \"$defs\" : \"definitions\";\n if (ctx.external) {\n const externalId = ctx.external.registry.get(entry[0])?.id; // ?? \"__shared\";// `__schema${ctx.counter++}`;\n // check if schema is in the external registry\n const uriGenerator = ctx.external.uri ?? ((id) => id);\n if (externalId) {\n return { ref: uriGenerator(externalId) };\n }\n // otherwise, add to __shared\n const id = entry[1].defId ?? entry[1].schema.id ?? `schema${ctx.counter++}`;\n entry[1].defId = id; // set defId so it will be reused if needed\n return { defId: id, ref: `${uriGenerator(\"__shared\")}#/${defsSegment}/${encodeJSONPointerSegment(id)}` };\n }\n const uriPrefix = `#`;\n const defUriPrefix = `${uriPrefix}/${defsSegment}/`;\n // an id-less root has nowhere to be extracted to, so it stays inline and self-references as `#`\n if (entry[1] === root && !entry[1].schema.id) {\n return { ref: uriPrefix };\n }\n // self-contained schema\n const defId = entry[1].schema.id ?? `__schema${ctx.counter++}`;\n return { defId, ref: defUriPrefix + encodeJSONPointerSegment(defId) };\n };\n // stored cached version in `def` property remove all properties, set $ref\n const extractToDef = (entry) => {\n // if the schema is already a reference, do not extract it\n if (entry[1].schema.$ref) {\n return;\n }\n const seen = entry[1];\n const { ref, defId } = makeURI(entry);\n seen.def = { ...seen.schema };\n // defId won't be set if the schema is a reference to an external schema or if the schema is the root schema\n if (defId)\n seen.defId = defId;\n // wipe away all properties except $ref\n const schema = seen.schema;\n for (const key in schema) {\n delete schema[key];\n }\n schema.$ref = ref;\n };\n // throw on cycles\n // break cycles\n if (ctx.cycles === \"throw\") {\n for (const entry of ctx.seen.entries()) {\n const seen = entry[1];\n if (seen.cycle) {\n throw new Error(\"Cycle detected: \" +\n `#/${seen.cycle?.join(\"/\")}/<root>` +\n '\\n\\nSet the `cycles` parameter to `\"ref\"` to resolve cyclical schemas with defs.');\n }\n }\n }\n // extract schemas into $defs\n for (const entry of ctx.seen.entries()) {\n const seen = entry[1];\n // convert root schema to # $ref\n if (schema === entry[0]) {\n extractToDef(entry); // this has special handling for the root schema\n continue;\n }\n // extract schemas that are in the external registry\n if (ctx.external) {\n const ext = ctx.external.registry.get(entry[0])?.id;\n if (schema !== entry[0] && ext) {\n extractToDef(entry);\n continue;\n }\n }\n // extract schemas with `id` meta\n const id = ctx.metadataRegistry.get(entry[0])?.id;\n if (id) {\n extractToDef(entry);\n continue;\n }\n // break cycles\n if (seen.cycle) {\n // any\n extractToDef(entry);\n continue;\n }\n // extract reused schemas\n if (seen.count > 1) {\n if (ctx.reused === \"ref\") {\n extractToDef(entry);\n }\n }\n }\n if (ctx.external)\n ctx.sharedDefsExtractedFor = ctx.external;\n}\n/** Rewrites `anyOf: [{type: \"a\"}, {type: \"b\"}]` to `type: [\"a\", \"b\"]`, which every JSON Schema draft treats as equivalent and most consumers render far better for the nullable case. Only branches that are a bare type assertion qualify — anything carrying a constraint, `$ref`, `const` or metadata is left alone. Runs after `flattenRef`, so a branch an override decorated or `$defs` extraction turned into a `$ref` is no longer bare and correctly stays in `anyOf`. `oneOf` is excluded: `integer` and `number` overlap, so \"exactly one\" and \"at least one\" are not the same there. OpenAPI 3.0 is excluded: its `type` must be a single string. */\nfunction compactTypeUnion(schema) {\n const options = schema.anyOf;\n if (!Array.isArray(options) || options.length === 0 || schema.type !== undefined)\n return;\n const types = [];\n for (const option of options) {\n if (!option || typeof option !== \"object\")\n return;\n // A branch that is itself a compactible union folds into this one — nested `anyOf` and a flat `type` array say the same thing. Compacting it first also makes the result independent of the order this pass walks the seen map in.\n compactTypeUnion(option);\n const keys = Object.keys(option);\n if (keys.length !== 1 || keys[0] !== \"type\")\n return;\n const type = option.type;\n for (const member of Array.isArray(type) ? type : [type]) {\n if (typeof member !== \"string\")\n return;\n if (!types.includes(member))\n types.push(member);\n }\n }\n delete schema.anyOf;\n // A `type` array must be non-empty and unique (metaschema); a single member is spelled as a bare string.\n schema.type = types.length === 1 ? types[0] : types;\n}\n/** Keywords `foldIntersection` knows how to combine. Anything else — `$ref`, `patternProperties`,\n * an annotation like `description` — makes a member unfoldable, so a constraint this does not\n * understand leaves the `allOf` alone instead of being silently dropped or misattributed. */\nconst FOLDABLE_KEYS = new Set([\"type\", \"properties\", \"required\", \"additionalProperties\"]);\nconst UNION_KEYS = [\"oneOf\", \"anyOf\"];\n/** A member's constraint on a key it does not declare itself. A `catchall` states one; `false`, an absent `additionalProperties`, and the empty schema a loose object emits state nothing. */\nfunction undeclaredConstraint(member) {\n const extra = member.additionalProperties;\n if (extra === undefined || extra === false || typeof extra !== \"object\" || extra === null)\n return null;\n return Object.keys(extra).length ? extra : null;\n}\n/** Combines object members into the single object they describe together, or returns `null` if any of them carries a keyword outside {@link FOLDABLE_KEYS}. */\nfunction foldObjects(members) {\n const objects = [];\n for (const member of members) {\n // A boolean subschema is legal JSON Schema and carries no keywords to fold.\n if (typeof member !== \"object\" || member.type !== \"object\")\n return null;\n for (const key in member) {\n if (!FOLDABLE_KEYS.has(key))\n return null;\n }\n objects.push(member);\n }\n const properties = {};\n const required = new Set();\n for (const object of objects) {\n for (const key in object.properties) {\n // `in` would report a `__proto__` key as already present via the prototype chain and skip it.\n if (Object.prototype.hasOwnProperty.call(properties, key))\n continue;\n // Every member constrains this key: the ones that declare it say how, and a `catchall` member constrains it too even though it does not name it. The key has to satisfy all of them, which is the same intersection one level down.\n const parts = [];\n for (const other of objects) {\n const part = other.properties?.[key] ?? undeclaredConstraint(other);\n if (part === null || part === undefined)\n continue;\n if (!parts.some((seen) => JSON.stringify(seen) === JSON.stringify(part)))\n parts.push(part);\n }\n const merged = parts.length === 1\n ? parts[0]\n : (foldObjects(parts) ?? { allOf: parts });\n assignProp(properties, key, merged);\n }\n for (const key of object.required ?? [])\n required.add(key);\n }\n const folded = { type: \"object\", properties };\n if (required.size)\n folded.required = [...required];\n // A key no member declares is rejected only when every member rejects it, so the fold is closed only when every member is. Otherwise it carries whatever the `catchall` members demand of such a key.\n if (objects.every((object) => object.additionalProperties === false)) {\n folded.additionalProperties = false;\n }\n else {\n const constraints = [];\n for (const object of objects) {\n const constraint = undeclaredConstraint(object);\n if (constraint && !constraints.some((seen) => JSON.stringify(seen) === JSON.stringify(constraint)))\n constraints.push(constraint);\n }\n if (constraints.length === 1)\n folded.additionalProperties = constraints[0];\n else if (constraints.length > 1)\n folded.additionalProperties = { allOf: constraints };\n }\n return folded;\n}\n/** `additionalProperties` in an `allOf` member sees only that member's own `properties`, so two\n * closed object members reject each other's keys and the schema validates nothing. Zod's parser\n * pools the key sets instead — `handleIntersectionResults` reports a key as unrecognized only when\n * *every* side rejects it — so the emitted schema has to pool them too, and folding the members\n * into one object is the encoding that says so on every target.\n *\n * This runs from `finalize`, after `extractDefs`, which is what keeps it clear of the `$ref`\n * machinery: a member extracted into `$defs` is already a `$ref` by now and declines to fold, so it\n * keeps its reference and its own closedness rather than being inlined as a stale copy. */\nfunction foldIntersection(json) {\n const allOf = json.allOf;\n if (!Array.isArray(allOf) || allOf.length < 2)\n return;\n // An `override` runs before this pass and may have written object keywords onto the intersection itself. Those are deliberate, so decline rather than overwrite them.\n for (const key of FOLDABLE_KEYS)\n if (key in json)\n return;\n // An intersection distributes over a union: `A & (X | Y)` is `(A & X) | (A & Y)`. Only the first union is distributed over; a second one stays among the members every branch folds against, where it fails the object check and declines the whole intersection rather than multiplying out.\n const unions = allOf.filter((m) => UNION_KEYS.some((k) => Array.isArray(m[k])));\n let folded = null;\n if (!unions.length) {\n folded = foldObjects(allOf);\n }\n else {\n const union = unions[0];\n const keyword = UNION_KEYS.find((k) => Array.isArray(union[k]));\n if (Object.keys(union).length !== 1)\n return;\n const rest = allOf.filter((m) => m !== union);\n const branches = union[keyword].map((branch) => foldObjects([...rest, branch]));\n if (branches.some((b) => !b))\n return;\n folded = { [keyword]: branches };\n }\n if (!folded)\n return;\n delete json.allOf;\n assignProps(json, folded);\n}\nexport function finalize(ctx, schema) {\n const root = ctx.seen.get(schema);\n if (!root)\n throw new Error(\"Unprocessed schema. This is a bug in Zod.\");\n // flatten refs - inherit properties from parent schemas\n const flattenRef = (zodSchema) => {\n const seen = ctx.seen.get(zodSchema);\n // already processed\n if (seen.ref === null)\n return;\n const schema = seen.def ?? seen.schema;\n const _cached = { ...schema };\n const ref = seen.ref;\n seen.ref = null; // prevent infinite recursion\n if (ref) {\n flattenRef(ref);\n const refSeen = ctx.seen.get(ref);\n const refSchema = refSeen.schema;\n // merge referenced schema into current\n if (refSchema.$ref && (ctx.target === \"draft-07\" || ctx.target === \"draft-04\" || ctx.target === \"openapi-3.0\")) {\n // older drafts can't combine $ref with other properties\n schema.allOf = schema.allOf ?? [];\n schema.allOf.push(refSchema);\n }\n else {\n assignProps(schema, refSchema);\n }\n // restore child's own properties (child wins)\n assignProps(schema, _cached);\n const isParentRef = zodSchema._zod.parent === ref;\n // For parent chain, child is a refinement - remove parent-only properties\n if (isParentRef) {\n for (const key in schema) {\n if (key === \"$ref\" || key === \"allOf\")\n continue;\n if (!(key in _cached)) {\n delete schema[key];\n }\n }\n }\n // When ref was extracted to $defs, remove properties that match the definition\n if (refSchema.$ref && refSeen.def) {\n for (const key in schema) {\n if (key === \"$ref\" || key === \"allOf\")\n continue;\n if (key in refSeen.def && JSON.stringify(schema[key]) === JSON.stringify(refSeen.def[key])) {\n delete schema[key];\n }\n }\n }\n }\n // If parent was extracted (has $ref), propagate $ref to this schema. This handles cases like: readonly().meta({id}).describe() where processor sets ref to innerType but parent should be referenced\n const parent = zodSchema._zod.parent;\n if (parent && parent !== ref) {\n // Ensure parent is processed first so its def has inherited properties\n flattenRef(parent);\n const parentSeen = ctx.seen.get(parent);\n if (parentSeen?.schema.$ref) {\n schema.$ref = parentSeen.schema.$ref;\n // De-duplicate with parent's definition\n if (parentSeen.def) {\n for (const key in schema) {\n if (key === \"$ref\" || key === \"allOf\")\n continue;\n if (key in parentSeen.def && JSON.stringify(schema[key]) === JSON.stringify(parentSeen.def[key])) {\n delete schema[key];\n }\n }\n }\n }\n }\n // execute overrides\n ctx.override({\n zodSchema: zodSchema,\n jsonSchema: schema,\n path: seen.path ?? [],\n });\n };\n // Flattening walks the whole map and clears each `ref` as it goes, so a second call over the same map is a no-op scan. Skip it outright once it has run for a registry conversion.\n if (!ctx.external || ctx.sharedEmitDoneFor !== ctx.external) {\n for (const entry of [...ctx.seen.entries()].reverse()) {\n flattenRef(entry[0]);\n }\n if (ctx.target !== \"openapi-3.0\") {\n for (const entry of ctx.seen.entries()) {\n compactTypeUnion(entry[1].def ?? entry[1].schema);\n }\n }\n for (const rewrite of ctx.deferred)\n rewrite();\n // After flattening, every member that was extracted is a `$ref`, so the fold sees the final shape. A schema that inherits an intersection — through `z.lazy`, or any `ref` chain — holds the same `allOf` array, so fold by array identity to catch every copy.\n if (ctx.intersections.length) {\n const carriers = new Map();\n for (const seen of ctx.seen.values()) {\n for (const json of [seen.schema, seen.def]) {\n const allOf = json?.allOf;\n if (!Array.isArray(allOf))\n continue;\n const existing = carriers.get(allOf);\n if (existing)\n existing.push(json);\n else\n carriers.set(allOf, [json]);\n }\n }\n for (const allOf of ctx.intersections) {\n for (const json of carriers.get(allOf) ?? [])\n foldIntersection(json);\n }\n }\n }\n const result = {};\n if (ctx.target === \"draft-2020-12\") {\n result.$schema = \"https://json-schema.org/draft/2020-12/schema\";\n }\n else if (ctx.target === \"draft-07\") {\n result.$schema = \"http://json-schema.org/draft-07/schema#\";\n }\n else if (ctx.target === \"draft-04\") {\n result.$schema = \"http://json-schema.org/draft-04/schema#\";\n }\n else if (ctx.target === \"openapi-3.0\") {\n // OpenAPI 3.0 schema objects should not include a $schema property\n }\n else {\n // Arbitrary string values are allowed but won't have a $schema property set\n }\n if (ctx.external?.uri) {\n const id = ctx.external.registry.get(schema)?.id;\n if (!id)\n throw new Error(\"Schema is missing an `id` property\");\n result.$id = ctx.external.uri(id);\n }\n // when the root was extracted into $defs, `root.schema` is the `$ref` wrapper and `root.def` is the body that now lives under $defs\n assignProps(result, root.defId ? root.schema : (root.def ?? root.schema));\n // The `id` in `.meta()` is a Zod-specific registration tag used to extract schemas into $defs — it is not user-facing JSON Schema metadata. Strip it from the output body where it would otherwise leak. The id is preserved implicitly via the $defs key (and via $ref paths).\n const rootMetaId = ctx.metadataRegistry.get(schema)?.id;\n if (rootMetaId !== undefined && result.id === rootMetaId)\n delete result.id;\n // build defs object. With `external`, `defs` is the shared object every schema writes into, so the same entries are reassigned on every call. Without it, `defs` is fresh per call and must be rebuilt.\n const defs = ctx.external?.defs ?? {};\n if (!ctx.external || ctx.sharedEmitDoneFor !== ctx.external) {\n for (const entry of ctx.seen.entries()) {\n const seen = entry[1];\n if (seen.def && seen.defId) {\n if (seen.def.id === seen.defId)\n delete seen.def.id;\n assignProp(defs, seen.defId, seen.def);\n }\n }\n }\n if (ctx.external)\n ctx.sharedEmitDoneFor = ctx.external;\n // set definitions in result\n if (ctx.external) {\n }\n else {\n if (Object.keys(defs).length > 0) {\n if (ctx.target === \"draft-2020-12\") {\n result.$defs = defs;\n }\n else {\n result.definitions = defs;\n }\n }\n }\n try {\n // this \"finalizes\" this schema and ensures all cycles are removed each call to finalize() is functionally independent though the seen map is shared\n const finalized = JSON.parse(JSON.stringify(result));\n Object.defineProperty(finalized, \"~standard\", {\n value: {\n ...schema[\"~standard\"],\n jsonSchema: {\n input: createStandardJSONSchemaMethod(schema, \"input\", ctx.processors),\n output: createStandardJSONSchemaMethod(schema, \"output\", ctx.processors),\n },\n },\n enumerable: false,\n writable: false,\n });\n return finalized;\n }\n catch (_err) {\n throw new Error(\"Error converting schema to JSON.\");\n }\n}\nfunction isTransforming(_schema, _ctx) {\n const ctx = _ctx ?? { seen: new Set() };\n if (ctx.seen.has(_schema))\n return false;\n ctx.seen.add(_schema);\n const def = _schema._zod.def;\n if (def.type === \"transform\")\n return true;\n if (def.type === \"array\")\n return isTransforming(def.element, ctx);\n if (def.type === \"set\")\n return isTransforming(def.valueType, ctx);\n if (def.type === \"lazy\")\n return isTransforming(def.getter(), ctx);\n if (def.type === \"promise\" ||\n def.type === \"optional\" ||\n def.type === \"nonoptional\" ||\n def.type === \"nullable\" ||\n def.type === \"readonly\" ||\n def.type === \"default\" ||\n def.type === \"prefault\" ||\n def.type === \"catch\") {\n return isTransforming(def.innerType, ctx);\n }\n if (def.type === \"intersection\") {\n return isTransforming(def.left, ctx) || isTransforming(def.right, ctx);\n }\n if (def.type === \"record\" || def.type === \"map\") {\n return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);\n }\n if (def.type === \"pipe\") {\n if (_schema._zod.traits.has(\"$ZodCodec\"))\n return true;\n return isTransforming(def.in, ctx) || isTransforming(def.out, ctx);\n }\n if (def.type === \"object\") {\n for (const key in def.shape) {\n if (isTransforming(def.shape[key], ctx))\n return true;\n }\n return false;\n }\n if (def.type === \"union\") {\n for (const option of def.options) {\n if (isTransforming(option, ctx))\n return true;\n }\n return false;\n }\n if (def.type === \"tuple\") {\n for (const item of def.items) {\n if (isTransforming(item, ctx))\n return true;\n }\n if (def.rest && isTransforming(def.rest, ctx))\n return true;\n return false;\n }\n return false;\n}\n/**\n * Creates a toJSONSchema method for a schema instance.\n * This encapsulates the logic of initializing context, processing, extracting defs, and finalizing.\n */\nexport const createToJSONSchemaMethod = (schema, processors = {}) => (params) => {\n const ctx = initializeContext({ ...params, processors });\n processSchema(schema, ctx);\n extractDefs(ctx, schema);\n return finalize(ctx, schema);\n};\nexport const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {\n const { libraryOptions, target } = params ?? {};\n const ctx = initializeContext({ ...(libraryOptions ?? {}), target, io, processors });\n processSchema(schema, ctx);\n extractDefs(ctx, schema);\n return finalize(ctx, schema);\n};\n","import { $constructor } from \"./core.js\";\nimport * as util from \"./util.js\";\n/* Computing the message eagerly is expensive (pretty-printed JSON of all\n * issues), so defer it until first read. The accessor functions and\n * descriptors are shared across instances to keep error construction\n * cheap; the computed message is cached on the internals object. The\n * setter preserves plain assignment semantics for consumers that\n * overwrite `message`. */\nfunction _getMessage() {\n const internals = this._zod;\n internals.message ?? (internals.message = JSON.stringify(internals.def, util.jsonStringifyReplacer, 2));\n return internals.message;\n}\nfunction _setMessage(value) {\n this._zod.message = value;\n}\nconst _messageDesc = {\n get: _getMessage,\n set: _setMessage,\n enumerable: true,\n configurable: true,\n};\nconst _issuesDesc = { value: undefined, enumerable: false };\n/* Prototypes that already carry the lazy `toString`. Seeded with the\n * intrinsics so that `init` on a foreign object — it accepts any object —\n * can never install an accessor onto a prototype we do not own. */\nconst _installedToString = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);\nconst initializer = (inst, def) => {\n inst.name = \"$ZodError\";\n // `_zod` is already non-enumerable: $constructor's init defined it with this same descriptor\n _issuesDesc.value = def;\n Object.defineProperty(inst, \"issues\", _issuesDesc);\n // Clear the shared slot; a retained `value` pins the last error's issues.\n _issuesDesc.value = undefined;\n Object.defineProperty(inst, \"message\", _messageDesc);\n /* `toString` lives as a non-enumerable lazy getter on the shared\n * prototype; on first access it caches a per-instance closure so\n * detached usage still works. */\n const proto = Object.getPrototypeOf(inst);\n if (!_installedToString.has(proto)) {\n _installedToString.add(proto);\n Object.defineProperty(proto, \"toString\", {\n configurable: true,\n enumerable: false,\n get() {\n const value = () => this.message;\n Object.defineProperty(this, \"toString\", { value, configurable: true, writable: true });\n return value;\n },\n set(value) {\n Object.defineProperty(this, \"toString\", { value, configurable: true, writable: true });\n },\n });\n }\n};\nexport const $ZodError = $constructor(\"$ZodError\", initializer);\nexport const $ZodRealError = $constructor(\"$ZodError\", initializer, undefined, {\n Parent: Error,\n});\n/** Get-or-create `obj[key]` as an own data property. A path segment naming an inherited member\n * (\"toString\", \"constructor\") would otherwise read through to the prototype, and assigning\n * \"__proto__\" would hit the setter instead of creating a key. */\nfunction node(obj, key, make) {\n if (!Object.prototype.hasOwnProperty.call(obj, key)) {\n if (key === \"__proto__\") {\n Object.defineProperty(obj, key, { value: make(), writable: true, enumerable: true, configurable: true });\n }\n else {\n obj[key] = make();\n }\n }\n return obj[key];\n}\nexport function flattenError(error, mapper = (issue) => issue.message) {\n const fieldErrors = {};\n const formErrors = [];\n for (const sub of error.issues) {\n if (sub.path.length > 0) {\n node(fieldErrors, sub.path[0], () => []).push(mapper(sub));\n }\n else {\n formErrors.push(mapper(sub));\n }\n }\n return { formErrors, fieldErrors };\n}\nexport function formatError(error, mapper = (issue) => issue.message) {\n const fieldErrors = { _errors: [] };\n const processError = (error, path = []) => {\n for (const issue of error.issues) {\n if (issue.code === \"invalid_union\" && issue.errors.length) {\n issue.errors.map((issues) => processError({ issues }, [...path, ...issue.path]));\n }\n else if (issue.code === \"invalid_key\") {\n processError({ issues: issue.issues }, [...path, ...issue.path]);\n }\n else if (issue.code === \"invalid_element\") {\n processError({ issues: issue.issues }, [...path, ...issue.path]);\n }\n else {\n const fullpath = [...path, ...issue.path];\n if (fullpath.length === 0) {\n fieldErrors._errors.push(mapper(issue));\n }\n else {\n let curr = fieldErrors;\n let i = 0;\n while (i < fullpath.length) {\n const el = fullpath[i];\n const terminal = i === fullpath.length - 1;\n // `_errors` is reserved by this legacy format, so merge a matching path segment into the current node instead of treating its array as a child.\n if (el === \"_errors\") {\n if (terminal)\n curr._errors.push(mapper(issue));\n i++;\n continue;\n }\n // A path element may collide with an inherited property name such as\n // \"__proto__\" or \"constructor\". Truthiness checks read the prototype\n // (so no node is created, then ._errors.push throws), and bracket\n // assignment of \"__proto__\" hits the setter instead of creating an\n // own key. Guard the read with hasOwnProperty and create the node\n // with defineProperty so any path element becomes a real own key.\n if (!Object.prototype.hasOwnProperty.call(curr, el)) {\n Object.defineProperty(curr, el, {\n value: { _errors: [] },\n enumerable: true,\n writable: true,\n configurable: true,\n });\n }\n const node = curr[el];\n if (terminal) {\n node._errors.push(mapper(issue));\n }\n curr = node;\n i++;\n }\n }\n }\n }\n };\n processError(error);\n return fieldErrors;\n}\nexport function treeifyError(error, mapper = (issue) => issue.message) {\n const result = { errors: [] };\n const processError = (error, path = []) => {\n var _a;\n for (const issue of error.issues) {\n if (issue.code === \"invalid_union\" && issue.errors.length) {\n // regular union error\n issue.errors.map((issues) => processError({ issues }, [...path, ...issue.path]));\n }\n else if (issue.code === \"invalid_key\") {\n processError({ issues: issue.issues }, [...path, ...issue.path]);\n }\n else if (issue.code === \"invalid_element\") {\n processError({ issues: issue.issues }, [...path, ...issue.path]);\n }\n else {\n const fullpath = [...path, ...issue.path];\n if (fullpath.length === 0) {\n result.errors.push(mapper(issue));\n continue;\n }\n let curr = result;\n let i = 0;\n while (i < fullpath.length) {\n const el = fullpath[i];\n const terminal = i === fullpath.length - 1;\n if (typeof el === \"string\") {\n curr.properties ?? (curr.properties = {});\n // el may collide with an inherited property name (\"__proto__\",\n // \"constructor\", ...); ??= reads the prototype so the node is never\n // created and curr.errors.push throws. Guard with hasOwnProperty and\n // create the node with defineProperty so \"__proto__\" becomes a real\n // own key rather than invoking the prototype setter.\n if (!Object.prototype.hasOwnProperty.call(curr.properties, el)) {\n Object.defineProperty(curr.properties, el, {\n value: { errors: [] },\n enumerable: true,\n writable: true,\n configurable: true,\n });\n }\n curr = curr.properties[el];\n }\n else {\n curr.items ?? (curr.items = []);\n (_a = curr.items)[el] ?? (_a[el] = { errors: [] });\n curr = curr.items[el];\n }\n if (terminal) {\n curr.errors.push(mapper(issue));\n }\n i++;\n }\n }\n }\n };\n processError(error);\n return result;\n}\n/** Format a ZodError as a human-readable string in the following form.\n *\n * From\n *\n * ```ts\n * ZodError {\n * issues: [\n * {\n * expected: 'string',\n * code: 'invalid_type',\n * path: [ 'username' ],\n * message: 'Invalid input: expected string'\n * },\n * {\n * expected: 'number',\n * code: 'invalid_type',\n * path: [ 'favoriteNumbers', 1 ],\n * message: 'Invalid input: expected number'\n * }\n * ];\n * }\n * ```\n *\n * to\n *\n * ```\n * username\n * ✖ Expected number, received string at \"username\n * favoriteNumbers[0]\n * ✖ Invalid input: expected number\n * ```\n */\nexport function toDotPath(_path) {\n const segs = [];\n const path = _path.map((seg) => (typeof seg === \"object\" ? seg.key : seg));\n for (const seg of path) {\n if (typeof seg === \"number\")\n segs.push(`[${seg}]`);\n else if (typeof seg === \"symbol\")\n segs.push(`[${JSON.stringify(String(seg))}]`);\n else if (/[^\\w$]/.test(seg))\n segs.push(`[${JSON.stringify(seg)}]`);\n else {\n if (segs.length)\n segs.push(\".\");\n segs.push(seg);\n }\n }\n return segs.join(\"\");\n}\nexport function prettifyError(error) {\n const lines = [];\n // sort by path length\n const issues = [...error.issues].sort((a, b) => (a.path ?? []).length - (b.path ?? []).length);\n // Process each issue\n for (const issue of issues) {\n lines.push(`✖ ${issue.message}`);\n if (issue.path?.length)\n lines.push(` → at ${toDotPath(issue.path)}`);\n }\n // Convert Map to formatted string\n return lines.join(\"\\n\");\n}\n","import { emptyObject } from './utils';\n\ninterface ProxyCallbackOptions {\n path: readonly string[];\n args: readonly unknown[];\n}\ntype ProxyCallback = (opts: ProxyCallbackOptions) => unknown;\n\nconst noop = () => {\n // noop\n};\n\nconst freezeIfAvailable = (obj: object) => {\n if (Object.freeze) {\n Object.freeze(obj);\n }\n};\n\nfunction createInnerProxy(\n callback: ProxyCallback,\n path: readonly string[],\n memo: Record<string, unknown>,\n) {\n const cacheKey = path.join('.');\n\n memo[cacheKey] ??= new Proxy(noop, {\n get(_obj, key) {\n if (typeof key !== 'string' || key === 'then') {\n // special case for if the proxy is accidentally treated\n // like a PromiseLike (like in `Promise.resolve(proxy)`)\n return undefined;\n }\n return createInnerProxy(callback, [...path, key], memo);\n },\n apply(_1, _2, args) {\n const lastOfPath = path[path.length - 1];\n\n // React 19 may call valueOf / toString / toJSON when coercing a proxy\n // to a primitive (e.g. during rendering or logging). Return a debug\n // string so the coercion does not recurse into the proxy. This only\n // triggers for direct calls (proxy.toString()), not for chained access\n // (proxy.toString.query()), preserving route naming freedom.\n if (\n lastOfPath === 'valueOf' ||\n lastOfPath === 'toString' ||\n lastOfPath === 'toJSON'\n ) {\n const debugPath = path.slice(0, -1).join('.');\n return `tRPC.proxy(${debugPath})`;\n }\n\n let opts = { args, path };\n // special handling for e.g. `trpc.hello.call(this, 'there')` and `trpc.hello.apply(this, ['there'])\n if (lastOfPath === 'call') {\n opts = {\n args: args.length >= 2 ? [args[1]] : [],\n path: path.slice(0, -1),\n };\n } else if (lastOfPath === 'apply') {\n opts = {\n args: args.length >= 2 ? args[1] : [],\n path: path.slice(0, -1),\n };\n }\n freezeIfAvailable(opts.args);\n freezeIfAvailable(opts.path);\n return callback(opts);\n },\n });\n\n return memo[cacheKey];\n}\n\n/**\n * Creates a proxy that calls the callback with the path and arguments\n *\n * @internal\n */\nexport const createRecursiveProxy = <TFaux = unknown>(\n callback: ProxyCallback,\n): TFaux => createInnerProxy(callback, [], emptyObject()) as TFaux;\n\n/**\n * Used in place of `new Proxy` where each handler will map 1 level deep to another value.\n *\n * @internal\n */\nexport const createFlatProxy = <TFaux>(\n callback: (path: keyof TFaux) => any,\n): TFaux => {\n return new Proxy(noop, {\n get(_obj, name) {\n if (name === 'then') {\n // special case for if the proxy is accidentally treated\n // like a PromiseLike (like in `Promise.resolve(proxy)`)\n return undefined;\n }\n return callback(name as any);\n },\n }) as TFaux;\n};\n","import * as core from \"../core/index.js\";\nimport { ZodRealError } from \"./errors.js\";\nexport const parse = /* @__PURE__ */ core._parse(ZodRealError);\nexport const parseAsync = /* @__PURE__ */ core._parseAsync(ZodRealError);\nexport const safeParse = /* @__PURE__ */ core._safeParse(ZodRealError);\nexport const safeParseAsync = /* @__PURE__ */ core._safeParseAsync(ZodRealError);\nexport { validate, validateAsync } from \"../core/index.js\";\n// Codec functions\nexport const encode = /* @__PURE__ */ core._encode(ZodRealError);\nexport const decode = /* @__PURE__ */ core._decode(ZodRealError);\nexport const encodeAsync = /* @__PURE__ */ core._encodeAsync(ZodRealError);\nexport const decodeAsync = /* @__PURE__ */ core._decodeAsync(ZodRealError);\nexport const safeEncode = /* @__PURE__ */ core._safeEncode(ZodRealError);\nexport const safeDecode = /* @__PURE__ */ core._safeDecode(ZodRealError);\nexport const safeEncodeAsync = /* @__PURE__ */ core._safeEncodeAsync(ZodRealError);\nexport const safeDecodeAsync = /* @__PURE__ */ core._safeDecodeAsync(ZodRealError);\n","import { globalConfig } from \"./core.js\";\n// functions\nexport function assertEqual(val) {\n return val;\n}\nexport function assertNotEqual(val) {\n return val;\n}\nexport function toZod() {\n return (schema) => schema;\n}\nexport function assertIs(_arg) { }\nexport function assertNever(_x) {\n throw new Error(\"Unexpected value in exhaustive check\");\n}\nexport function assert(_) { }\nexport function getEnumValues(entries) {\n const numericValues = Object.values(entries).filter((v) => typeof v === \"number\");\n const values = Object.entries(entries)\n .filter(([k, _]) => numericValues.indexOf(+k) === -1)\n .map(([_, v]) => v);\n return values;\n}\nexport function joinValues(array, separator = \"|\") {\n return array.map((val) => stringifyPrimitive(val)).join(separator);\n}\nexport function jsonStringifyReplacer(_, value) {\n if (typeof value === \"bigint\")\n return value.toString();\n return value;\n}\n// the accessor lives on a shared prototype: an own accessor makes every box a dictionary-mode object (~360 B and a slow load per read against ~100 B and an inlined getter here)\nclass Cached {\n constructor(getter) {\n this._getter = getter;\n this._value = undefined;\n }\n get value() {\n const getter = this._getter;\n if (getter !== undefined) {\n this._value = getter();\n this._getter = undefined;\n }\n return this._value;\n }\n}\nexport function cached(getter) {\n return new Cached(getter);\n}\nexport function nullish(input) {\n return input === null || input === undefined;\n}\nexport function cleanRegex(source) {\n const start = source.startsWith(\"^\") ? 1 : 0;\n const end = source.endsWith(\"$\") ? source.length - 1 : source.length;\n return source.slice(start, end);\n}\nexport function floatSafeRemainder(val, step) {\n const ratio = val / step;\n const roundedRatio = Math.round(ratio);\n // `val` and `step` each round to a double before the division rounds again, so a true decimal multiple's quotient can sit up to 1.5 of these scaled epsilons from the integer. A 1x tolerance therefore rejected 2.03 as a multiple of 0.07; 4x covers the worst case with margin.\n const tolerance = 4 * Number.EPSILON * Math.max(Math.abs(ratio), 1);\n if (Math.abs(ratio - roundedRatio) < tolerance)\n return 0;\n return ratio - roundedRatio;\n}\nconst EVALUATING = /* @__PURE__*/ Symbol(\"evaluating\");\nexport function defineLazy(object, key, getter) {\n let value = undefined;\n Object.defineProperty(object, key, {\n get() {\n if (value === EVALUATING) {\n // Circular reference detected, return undefined to break the cycle\n return undefined;\n }\n if (value === undefined) {\n value = EVALUATING;\n value = getter();\n }\n return value;\n },\n set(v) {\n Object.defineProperty(object, key, {\n value: v,\n // configurable: true,\n });\n // object[key] = v;\n },\n configurable: true,\n });\n}\nexport function objectClone(obj) {\n return Object.create(Object.getPrototypeOf(obj), Object.getOwnPropertyDescriptors(obj));\n}\nexport function assignProp(target, prop, value) {\n Object.defineProperty(target, prop, {\n value,\n writable: true,\n enumerable: true,\n configurable: true,\n });\n}\n/**\n * Whichever object a def's `shape` currently answers from: the one the caller passed until the first read, the frozen copy after it.\n *\n * Its keys and descriptors read without invoking anything, which is what lets a discriminated union check its discriminator, and the cycle walk read a shape, without resolving a getter that references the schema being constructed. A def that answers `shape` from an accessor of its own has none.\n */\nexport function rawShape(def) {\n const desc = Object.getOwnPropertyDescriptor(def, \"shape\");\n return desc?.get ? desc.get.raw : desc?.value;\n}\n// where a builder reads its source's keys and descriptors, resolving only a shape a def answers for itself. A shape resolves by object spread, so only its enumerable keys are ever part of it.\nfunction sourceShape(schema) {\n return rawShape(schema._zod.def) ?? schema._zod.def.shape;\n}\n// a key whose value is not settled yet, self-caching so every read after the first gets the same one\nfunction deferProp(target, key, getter) {\n Object.defineProperty(target, key, {\n get() {\n const value = getter();\n assignProp(this, key, value);\n return value;\n },\n enumerable: true,\n configurable: true,\n });\n}\n// Writes a settled key. A plain assignment is much cheaper than `defineProperty` and produces the same descriptor, but it runs whatever setter already answers to the key — an accessor this shape deferred, or an inherited one, which `__proto__` has on every object and prototype pollution can add for any name.\nfunction putProp(target, key, value) {\n if (key in target)\n assignProp(target, key, value);\n else\n target[key] = value;\n}\n/**\n * Copies `keys` of `source`'s shape onto `target`, each value passed through `wrap`.\n *\n * A key the source has resolved is copied through now, so the derived shape states it outright and nothing has to resolve it to learn what it holds. A key the source still defers stays deferred, and reads back through the source's own `shape`, so it resolves once and both shapes get that one schema.\n */\nfunction mirrorShape(target, source, keys, wrap) {\n const raw = sourceShape(source);\n for (const key of keys) {\n const desc = Object.getOwnPropertyDescriptor(raw, key);\n if (!desc.enumerable)\n continue;\n if (desc.get) {\n deferProp(target, key, () => {\n const value = source._zod.def.shape[key];\n return wrap ? wrap(value, key) : value;\n });\n }\n else\n putProp(target, key, wrap ? wrap(desc.value, key) : desc.value);\n }\n}\n// same, for a plain shape a caller passed rather than a schema's\nfunction mirrorProps(target, source) {\n for (const key of Reflect.ownKeys(source)) {\n const desc = Object.getOwnPropertyDescriptor(source, key);\n if (!desc.enumerable)\n continue;\n if (desc.get)\n deferProp(target, key, () => source[key]);\n else\n putProp(target, key, desc.value);\n }\n}\nexport function mergeDefs(...defs) {\n const mergedDescriptors = {};\n for (const def of defs) {\n const descriptors = Object.getOwnPropertyDescriptors(def);\n Object.assign(mergedDescriptors, descriptors);\n }\n return Object.defineProperties({}, mergedDescriptors);\n}\nexport function cloneDef(schema) {\n return mergeDefs(schema._zod.def);\n}\nexport function getElementAtPath(obj, path) {\n if (!path)\n return obj;\n return path.reduce((acc, key) => acc?.[key], obj);\n}\nexport function promiseAllObject(promisesObj) {\n const keys = Object.keys(promisesObj);\n const promises = keys.map((key) => promisesObj[key]);\n return Promise.all(promises).then((results) => {\n const resolvedObj = {};\n for (let i = 0; i < keys.length; i++) {\n resolvedObj[keys[i]] = results[i];\n }\n return resolvedObj;\n });\n}\nexport function randomString(length = 10) {\n const chars = \"abcdefghijklmnopqrstuvwxyz\";\n let str = \"\";\n for (let i = 0; i < length; i++) {\n str += chars[Math.floor(Math.random() * chars.length)];\n }\n return str;\n}\nexport function esc(str) {\n return JSON.stringify(str);\n}\nexport function slugify(input) {\n return input\n .toLowerCase()\n .trim()\n .replace(/[^\\w\\s-]/g, \"\")\n .replace(/[\\s_-]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\");\n}\nexport const captureStackTrace = (\"captureStackTrace\" in Error ? Error.captureStackTrace : (..._args) => { });\nexport function isObject(data) {\n return typeof data === \"object\" && data !== null && !Array.isArray(data);\n}\nexport const allowsEval = /* @__PURE__*/ cached(() => {\n // Skip the probe under `jitless`: strict CSPs report the caught `new Function` as a `securitypolicyviolation` even though the throw is swallowed.\n if (globalConfig.jitless) {\n return false;\n }\n // @ts-ignore\n if (typeof navigator !== \"undefined\" && navigator?.userAgent?.includes(\"Cloudflare\")) {\n return false;\n }\n try {\n const F = Function;\n new F(\"\");\n return true;\n }\n catch (_) {\n return false;\n }\n});\nexport function isPlainObject(o) {\n if (isObject(o) === false)\n return false;\n // modified constructor\n const ctor = o.constructor;\n if (ctor === undefined)\n return true;\n if (typeof ctor !== \"function\")\n return true;\n // modified prototype\n const prot = ctor.prototype;\n if (isObject(prot) === false)\n return false;\n // ctor doesn't have static `isPrototypeOf`\n if (Object.prototype.hasOwnProperty.call(prot, \"isPrototypeOf\") === false) {\n return false;\n }\n return true;\n}\nexport function shallowClone(o) {\n if (isPlainObject(o))\n return { ...o };\n if (Array.isArray(o))\n return [...o];\n if (o instanceof Map)\n return new Map(o);\n if (o instanceof Set)\n return new Set(o);\n return o;\n}\nexport function numKeys(data) {\n let keyCount = 0;\n for (const key in data) {\n if (Object.prototype.hasOwnProperty.call(data, key)) {\n keyCount++;\n }\n }\n return keyCount;\n}\nexport const getParsedType = (data) => {\n const t = typeof data;\n switch (t) {\n case \"undefined\":\n return \"undefined\";\n case \"string\":\n return \"string\";\n case \"number\":\n return Number.isNaN(data) ? \"nan\" : \"number\";\n case \"boolean\":\n return \"boolean\";\n case \"function\":\n return \"function\";\n case \"bigint\":\n return \"bigint\";\n case \"symbol\":\n return \"symbol\";\n case \"object\":\n if (Array.isArray(data)) {\n return \"array\";\n }\n if (data === null) {\n return \"null\";\n }\n if (data.then && typeof data.then === \"function\" && data.catch && typeof data.catch === \"function\") {\n return \"promise\";\n }\n if (typeof Map !== \"undefined\" && data instanceof Map) {\n return \"map\";\n }\n if (typeof Set !== \"undefined\" && data instanceof Set) {\n return \"set\";\n }\n if (typeof Date !== \"undefined\" && data instanceof Date) {\n return \"date\";\n }\n // @ts-ignore\n if (typeof File !== \"undefined\" && data instanceof File) {\n return \"file\";\n }\n return \"object\";\n default:\n throw new Error(`Unknown data type: ${t}`);\n }\n};\nexport const propertyKeyTypes = /* @__PURE__*/ new Set([\"string\", \"number\", \"symbol\"]);\nexport const primitiveTypes = /* @__PURE__*/ new Set([\n \"string\",\n \"number\",\n \"bigint\",\n \"boolean\",\n \"symbol\",\n \"undefined\",\n]);\nexport function escapeRegex(str) {\n return str.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n// zod-specific utils\nexport function clone(inst, def, params) {\n const cl = new inst._zod.constr(def ?? inst._zod.def);\n if (!def || params?.parent)\n cl._zod.parent = inst;\n return cl;\n}\nexport function normalizeParams(_params) {\n const params = _params;\n if (!params)\n return {};\n if (typeof params === \"string\")\n return { error: () => params };\n if (params?.message !== undefined) {\n if (params?.error !== undefined)\n throw new Error(\"Cannot specify both `message` and `error` params\");\n params.error = params.message;\n }\n delete params.message;\n if (typeof params.error === \"string\")\n return { ...params, error: () => params.error };\n return params;\n}\nexport function createTransparentProxy(getter) {\n let target;\n return new Proxy({}, {\n get(_, prop, receiver) {\n target ?? (target = getter());\n return Reflect.get(target, prop, receiver);\n },\n set(_, prop, value, receiver) {\n target ?? (target = getter());\n return Reflect.set(target, prop, value, receiver);\n },\n has(_, prop) {\n target ?? (target = getter());\n return Reflect.has(target, prop);\n },\n deleteProperty(_, prop) {\n target ?? (target = getter());\n return Reflect.deleteProperty(target, prop);\n },\n ownKeys(_) {\n target ?? (target = getter());\n return Reflect.ownKeys(target);\n },\n getOwnPropertyDescriptor(_, prop) {\n target ?? (target = getter());\n return Reflect.getOwnPropertyDescriptor(target, prop);\n },\n defineProperty(_, prop, descriptor) {\n target ?? (target = getter());\n return Reflect.defineProperty(target, prop, descriptor);\n },\n });\n}\nexport function stringifyPrimitive(value) {\n if (typeof value === \"bigint\")\n return value.toString() + \"n\";\n if (typeof value === \"string\")\n return `\"${value}\"`;\n return `${value}`;\n}\nexport function optionalKeys(shape) {\n return Object.keys(shape).filter((k) => {\n return shape[k]._zod.optin !== undefined && shape[k]._zod.optout === \"optional\";\n });\n}\n// Wrapped in a `@__PURE__` IIFE: esbuild never tree-shakes a top-level initializer that contains a member access on `Number`, so the bare object literal survived into every bundle.\nexport const NUMBER_FORMAT_RANGES = /*@__PURE__*/ (() => ({\n safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],\n int32: [-2147483648, 2147483647],\n uint32: [0, 4294967295],\n float32: [-3.4028234663852886e38, 3.4028234663852886e38],\n float64: [-Number.MAX_VALUE, Number.MAX_VALUE],\n}))();\nexport const BIGINT_FORMAT_RANGES = {\n int64: [/* @__PURE__*/ BigInt(\"-9223372036854775808\"), /* @__PURE__*/ BigInt(\"9223372036854775807\")],\n uint64: [/* @__PURE__*/ BigInt(0), /* @__PURE__*/ BigInt(\"18446744073709551615\")],\n};\nexport function pick(schema, mask) {\n const currDef = schema._zod.def;\n const checks = currDef.checks;\n const hasChecks = checks && checks.length > 0;\n if (hasChecks) {\n throw new Error(\".pick() cannot be used on object schemas containing refinements\");\n }\n const newShape = {};\n mirrorShape(newShape, schema, maskedKeys(schema, mask));\n return clone(schema, mergeDefs(currDef, { shape: newShape, checks: [] }));\n}\n// the mask keys that select something, checked against the source's shape without resolving it\nfunction maskedKeys(schema, mask) {\n const raw = sourceShape(schema);\n const keys = [];\n // `for...in` skips symbols, so a symbol in the mask would select nothing\n for (const key of Reflect.ownKeys(mask)) {\n if (!Object.getOwnPropertyDescriptor(raw, key)?.enumerable) {\n throw new Error(`Unrecognized key: \"${String(key)}\"`);\n }\n if (mask[key])\n keys.push(key);\n }\n return keys;\n}\nexport function omit(schema, mask) {\n const currDef = schema._zod.def;\n const checks = currDef.checks;\n const hasChecks = checks && checks.length > 0;\n if (hasChecks) {\n throw new Error(\".omit() cannot be used on object schemas containing refinements\");\n }\n const omitted = new Set(maskedKeys(schema, mask));\n const newShape = {};\n mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)).filter((key) => !omitted.has(key)));\n return clone(schema, mergeDefs(currDef, { shape: newShape, checks: [] }));\n}\nexport function extend(schema, shape) {\n if (!isPlainObject(shape)) {\n throw new Error(\"Invalid input to extend: expected a plain object\");\n }\n const checks = schema._zod.def.checks;\n const hasChecks = checks && checks.length > 0;\n if (hasChecks) {\n // Only throw if new shape overlaps with existing shape. Use getOwnPropertyDescriptor to check key existence without accessing values\n const existingShape = sourceShape(schema);\n for (const key of Reflect.ownKeys(shape)) {\n if (Object.getOwnPropertyDescriptor(existingShape, key) !== undefined) {\n throw new Error(\"Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.\");\n }\n }\n }\n return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));\n}\n// the source's keys, then the caller's overlaid on top\nfunction extended(schema, shape) {\n const newShape = {};\n mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)));\n mirrorProps(newShape, shape);\n return newShape;\n}\nexport function safeExtend(schema, shape) {\n if (!isPlainObject(shape)) {\n throw new Error(\"Invalid input to safeExtend: expected a plain object\");\n }\n return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));\n}\nexport function merge(a, b) {\n if (!b?._zod?.def) {\n throw new Error(\"Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.\");\n }\n if (a._zod.def.checks?.length) {\n throw new Error(\".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.\");\n }\n const newShape = {};\n mirrorShape(newShape, a, Reflect.ownKeys(sourceShape(a)));\n mirrorShape(newShape, b, Reflect.ownKeys(sourceShape(b)));\n const def = mergeDefs(a._zod.def, {\n shape: newShape,\n get catchall() {\n return b._zod.def.catchall;\n },\n checks: b._zod.def.checks ?? [],\n });\n return clone(a, def);\n}\nexport function partial(Class, schema, mask, name = \"partial\") {\n const currDef = schema._zod.def;\n const checks = currDef.checks;\n const hasChecks = checks && checks.length > 0;\n if (hasChecks) {\n throw new Error(`.${name}() cannot be used on object schemas containing refinements`);\n }\n const selected = mask ? new Set(maskedKeys(schema, mask)) : undefined;\n const newShape = {};\n mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), Class &&\n ((value, key) => (selected && !selected.has(key) ? value : new Class({ type: \"optional\", innerType: value }))));\n return clone(schema, mergeDefs(schema._zod.def, { shape: newShape, checks: [] }));\n}\nexport function required(Class, schema, mask) {\n const selected = mask ? new Set(maskedKeys(schema, mask)) : undefined;\n const newShape = {};\n mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), (value, key) => \n // overwrite with non-optional\n selected && !selected.has(key) ? value : new Class({ type: \"nonoptional\", innerType: value }));\n return clone(schema, mergeDefs(schema._zod.def, { shape: newShape }));\n}\n// invalid_type | too_big | too_small | invalid_format | not_multiple_of | unrecognized_keys | invalid_union | invalid_key | invalid_element | invalid_value | custom\nexport function aborted(x, startIndex = 0) {\n if (x.aborted === true)\n return true;\n for (let i = startIndex; i < x.issues.length; i++) {\n if (x.issues[i]?.continue !== true) {\n return true;\n }\n }\n return false;\n}\n// Checks for explicit abort (continue === false), as opposed to implicit abort (continue === undefined). Used to respect `abort: true` in .refine() even for checks that have a `when` function.\nexport function explicitlyAborted(x, startIndex = 0) {\n if (x.aborted === true)\n return true;\n for (let i = startIndex; i < x.issues.length; i++) {\n if (x.issues[i]?.continue === false) {\n return true;\n }\n }\n return false;\n}\nexport function prefixIssues(path, issues) {\n return issues.map((iss) => {\n var _a;\n (_a = iss).path ?? (_a.path = []);\n iss.path.unshift(path);\n return iss;\n });\n}\nexport function unwrapMessage(message) {\n return typeof message === \"string\" ? message : message?.message;\n}\n/* A check holds no link back to the schema it is attached to — the same check instance is shared by every clone of that schema — so the owner is stamped onto the issues a check just raised, at the only point where both are in scope. Runs on the failure path only; `start` is the issue count from before the check ran. */\n/** The leading size checks of `defChecks` that set an upper bound, each paired with it. */\nexport function sizeCaps(defChecks) {\n const caps = [];\n for (const ch of defChecks ?? []) {\n const d = ch._zod.def;\n // a later check may rewrite the value\n if (!/_(length|size)$|_equals$/.test(d.check))\n break;\n const max = d.maximum ?? d.length ?? d.size;\n if (max >= 0)\n caps.push([max, ch]);\n }\n return caps;\n}\nexport function attachSchema(issues, start, inst) {\n var _a;\n for (let i = start; i < issues.length; i++) {\n (_a = issues[i]).schema ?? (_a.schema = inst);\n }\n}\nexport function finalizeIssue(iss, ctx, config) {\n var _a;\n // A schema that raised an issue itself owns it outright, and outranks any stamp an enclosing check left in `attachSchema`. String formats and z.custom() are schema and check at once, so when they act as a check they defer to that stamp instead.\n const traits = iss.inst?._zod?.traits;\n if (traits?.has(\"$ZodType\")) {\n if (traits.has(\"$ZodCheck\"))\n (_a = iss).schema ?? (_a.schema = iss.inst);\n else\n iss.schema = iss.inst;\n }\n // Decreasing specificity, first map to return a message wins. `inst` is whatever raised the issue, so a check's own map outranks the owning schema's.\n const schemaError = iss.schema !== iss.inst ? iss.schema?._zod.def?.error : undefined;\n const message = iss.message\n ? iss.message\n : (unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ??\n unwrapMessage(schemaError?.(iss)) ??\n unwrapMessage(ctx?.error?.(iss)) ??\n unwrapMessage(config.customError?.(iss)) ??\n unwrapMessage(config.localeError?.(iss)) ??\n \"Invalid input\");\n // an explicit own-key copy beats object rest with excluded keys, which v8 routes through a generic runtime call; Object.keys rather than for-in so an issue pushed with a prototype does not leak inherited keys, and an own __proto__ key is dropped rather than assigned through the setter\n const full = {};\n for (const k of Object.keys(iss)) {\n if (k === \"inst\" || k === \"schema\" || k === \"continue\" || k === \"input\" || k === \"__proto__\")\n continue;\n full[k] = iss[k];\n }\n full.path ?? (full.path = []);\n full.message = message;\n if (ctx?.reportInput) {\n full.input = iss.input;\n }\n return full;\n}\nexport function getSizableOrigin(input) {\n if (input instanceof Set)\n return \"set\";\n if (input instanceof Map)\n return \"map\";\n // @ts-ignore\n if (input instanceof File)\n return \"file\";\n return \"unknown\";\n}\nconst highSurrogate = /[\\uD800-\\uDBFF]/;\n// Code points in `str`: a surrogate pair counts once, a lone surrogate as itself. Hand-rolled because the string iterator allocates and runs ~250x slower on this path; the regex probe exits ~50x quicker for a string with no astral characters.\nexport function codePointLength(str) {\n const units = str.length;\n if (!highSurrogate.test(str))\n return units;\n let count = units;\n for (let i = 0; i < units - 1; i++) {\n if ((str.charCodeAt(i) & 0xfc00) === 0xd800 && (str.charCodeAt(i + 1) & 0xfc00) === 0xdc00) {\n count--;\n i++;\n }\n }\n return count;\n}\nexport function getLengthableOrigin(input) {\n if (Array.isArray(input))\n return \"array\";\n if (typeof input === \"string\")\n return \"string\";\n return \"unknown\";\n}\nexport function parsedType(data) {\n const t = typeof data;\n switch (t) {\n case \"number\": {\n return Number.isNaN(data) ? \"nan\" : \"number\";\n }\n case \"object\": {\n if (data === null) {\n return \"null\";\n }\n if (Array.isArray(data)) {\n return \"array\";\n }\n const obj = data;\n if (obj && Object.getPrototypeOf(obj) !== Object.prototype && \"constructor\" in obj && obj.constructor) {\n return obj.constructor.name;\n }\n }\n }\n return t;\n}\nexport function issue(...args) {\n const [iss, input, inst] = args;\n if (typeof iss === \"string\") {\n return {\n message: iss,\n code: \"custom\",\n input,\n inst,\n };\n }\n return { ...iss };\n}\nexport function cleanEnum(obj) {\n return Object.entries(obj)\n .filter(([k, _]) => {\n // return true if NaN, meaning it's not a number, thus a string key\n return Number.isNaN(Number.parseInt(k, 10));\n })\n .map((el) => el[1]);\n}\n// Codec utility functions\nexport function base64ToUint8Array(base64) {\n const binaryString = atob(base64);\n const bytes = new Uint8Array(binaryString.length);\n for (let i = 0; i < binaryString.length; i++) {\n bytes[i] = binaryString.charCodeAt(i);\n }\n return bytes;\n}\nexport function uint8ArrayToBase64(bytes) {\n let binaryString = \"\";\n for (let i = 0; i < bytes.length; i++) {\n binaryString += String.fromCharCode(bytes[i]);\n }\n return btoa(binaryString);\n}\nexport function base64urlToUint8Array(base64url) {\n const base64 = base64url.replace(/-/g, \"+\").replace(/_/g, \"/\");\n const padding = \"=\".repeat((4 - (base64.length % 4)) % 4);\n return base64ToUint8Array(base64 + padding);\n}\nexport function uint8ArrayToBase64url(bytes) {\n return uint8ArrayToBase64(bytes).replace(/\\+/g, \"-\").replace(/\\//g, \"_\").replace(/=/g, \"\");\n}\nexport function hexToUint8Array(hex) {\n const cleanHex = hex.replace(/^0x/, \"\");\n if (cleanHex.length % 2 !== 0) {\n throw new Error(\"Invalid hex string length\");\n }\n const bytes = new Uint8Array(cleanHex.length / 2);\n for (let i = 0; i < cleanHex.length; i += 2) {\n bytes[i / 2] = Number.parseInt(cleanHex.slice(i, i + 2), 16);\n }\n return bytes;\n}\nexport function uint8ArrayToHex(bytes) {\n return Array.from(bytes)\n .map((b) => b.toString(16).padStart(2, \"0\"))\n .join(\"\");\n}\n// instanceof\nexport class Class {\n constructor(..._args) { }\n}\n////////// PROTOTYPE INSTALLERS //////////\n//\n// Members live on the prototype and materialize per instance on first read, which keeps own-property count under the step where V8 stops using inline slots. Changing anything here means re-measuring runtime, memory and bundle size together — see \"The three axes\" in AGENTS.md.\n/**\n * Installs a trait's members on its prototype. Each value builds that member for the instance on first read; the built value shadows the accessor as an own property, so a detached `const { parse } = schema` keeps working.\n *\n * Call this from a `proto` initializer, which runs once per prototype — never per instance.\n */\nexport function members(proto, table) {\n for (const key in table) {\n const desc = Object.getOwnPropertyDescriptor(table, key);\n // a getter installs as written, so it stays live: `description` reads through to the registry on every access. not enumerable: an object literal's is, and a prototype member never was\n if (desc.get)\n Object.defineProperty(proto, key, { ...desc, enumerable: false });\n // a method materializes bound on first read, which is what keeps a detached member working: `const opt = schema.optional; opt()`\n else\n defineBound(proto, key, desc.value);\n }\n}\n/** Shadows a prototype member with an own value, so a getter that builds from the instance runs once. */\nexport function own(inst, key, value, enumerable = true) {\n Object.defineProperty(inst, key, { configurable: true, writable: true, enumerable, value });\n return value;\n}\n/** Like {@link own}, for a member that was never an own data property and has to stay out of `Object.keys`. */\nexport function hide(inst, key, value) {\n return own(inst, key, value, false);\n}\n/** Adds members a table derives from the instance: each builds on first read and shadows as own data, and assignment shadows the same way, as when these were own properties. */\nexport /*@__NO_SIDE_EFFECTS__*/ function derived(computes, table) {\n for (const key in computes) {\n const compute = computes[key];\n // an object literal's accessor is configurable and enumerable, and `members` copies the descriptor as written\n Object.defineProperty(table, key, {\n configurable: true,\n enumerable: true,\n get() {\n return own(this, key, compute(this));\n },\n set(value) {\n own(this, key, value);\n },\n });\n }\n return table;\n}\nfunction defineBound(proto, key, fn) {\n Object.defineProperty(proto, key, {\n configurable: true,\n get() {\n // vitest's spyOn calls a prototype getter bare to find the function it wraps, so a nullish receiver answers the raw method\n return this == null ? fn : own(this, key, fn.bind(this));\n },\n set(value) {\n own(this, key, value);\n },\n });\n}\n/** Returns the prototype to install on, or `undefined` if this group is already installed on it. */\nfunction claim(inst, sentinel) {\n const proto = Object.getPrototypeOf(inst);\n // Runs on every construction, so `in` rather than the costlier `hasOwnProperty.call`. Sentinels are keys the group itself defines.\n return sentinel in proto ? undefined : proto;\n}\n// The internals whose init chain is installing. A second call for the same one is a derived constructor overriding its base, so it must not construct another schema in between or the override is dropped.\nlet installing;\n// Set while a getter is running, so a value that resolved through a recursion break is not memoized. One shared descriptor shadows the key for the duration, which costs no per-key allocation.\nlet broke = false;\nconst breaker = {\n configurable: true,\n get() {\n broke = true;\n return undefined;\n },\n};\n/**\n * Installs a lazily-derived internal on the `_zod` prototype of `inst`'s\n * constructor, computed from the internals object itself and cached there on\n * first read. One accessor per constructor rather than one per instance.\n */\nexport function defineLazyInternal(inst, key, compute) {\n const proto = Object.getPrototypeOf(inst._zod);\n if (key in proto && installing !== inst._zod) {\n // A repeat construction: everything is installed already. Cleared here so the reference is not held past the first construction of every type.\n installing = undefined;\n return;\n }\n installing = inst._zod;\n Object.defineProperty(proto, key, {\n configurable: true,\n get() {\n // Shadowed before computing so a re-entrant read from a recursive schema resolves to undefined instead of running the getter again.\n Object.defineProperty(this, key, breaker);\n const outer = broke;\n broke = false;\n try {\n const value = compute(this);\n // A result that resolved through a recursion break is recomputed once the graph is complete; everything else memoizes, undefined included.\n if (broke)\n delete this[key];\n else\n Object.defineProperty(this, key, { configurable: true, writable: true, value });\n broke = broke || outer;\n return value;\n }\n catch (err) {\n // A compute that threw memoizes nothing, so a later read runs it again and fails the same way. The shadow goes with it, since leaving it installed would answer undefined for every later read.\n delete this[key];\n broke = broke || outer;\n throw err;\n }\n },\n set(value) {\n Object.defineProperty(this, key, { configurable: true, writable: true, value });\n },\n });\n}\n/**\n * Installs `key` on `inst`'s prototype, computed by `make` on first read and cached there as an own\n * data property. One accessor per constructor rather than one per instance, because an own accessor\n * puts every instance after the first into v8 dictionary mode. The key doubles as the sentinel.\n */\nexport function installLazyProp(inst, key, make, enumerable) {\n const proto = claim(inst, key);\n if (!proto)\n return;\n Object.defineProperty(proto, key, {\n configurable: true,\n get() {\n // Shadowed before computing, so a re-entrant read from a self-referential shape resolves to undefined instead of running the getter again. A data property rather than an accessor: an own accessor is the dictionary-mode transition this exists to avoid.\n const desc = { configurable: true, writable: true, enumerable, value: undefined };\n Object.defineProperty(this, key, desc);\n // a compute that throws leaves the shadow behind, so later reads answer undefined instead of re-throwing; `defineLazy` did the same, and `defineLazyInternal`'s delete-on-catch would cost bytes in every bundle for a case only a throwing user getter reaches\n desc.value = make(this);\n Object.defineProperty(this, key, desc);\n return desc.value;\n },\n set(value) {\n Object.defineProperty(this, key, { configurable: true, writable: true, enumerable, value });\n },\n });\n}\n/** Marks the thunk `_catch` synthesises for a constant catch value. `Function.length` cannot tell that thunk from a user callback — rest and defaulted parameters both report arity 0 — and a user callback reads `ctx.error`, whose issues only finalize correctly against the caller's per-parse error map. Provenance can say what arity cannot. A plain string key rather than `Symbol.for`, whose call at module scope no bundler can prove pure — the same shape that anchored `urlCanParse` into every build. */\nexport const CONSTANT_CATCH = \"~constantCatch\";\n/** Wraps a constant catch value in a thunk tagged with {@link CONSTANT_CATCH}. */\nexport function constantCatch(value) {\n const fn = () => value;\n fn[CONSTANT_CATCH] = true;\n return fn;\n}\n","import { followChanges } from '../../../../features/overview/hooks/follow-changes';\n\nexport const dynamic = 'force-dynamic';\n\nexport function GET(request: Request): Promise<Response> {\n return followChanges(request);\n}\n","import * as core from \"./core.js\";\nimport * as errors from \"./errors.js\";\nimport * as util from \"./util.js\";\n// Always both keys, so the `_params` read site in `_parse` sees one object shape rather than two.\nfunction finalizeParams(callee, params) {\n return { callee: params?.callee ?? callee, Err: params?.Err };\n}\nexport const _parse = (_Err) => {\n const fn = (schema, value, _ctx, _params) => {\n const ctx = _ctx ? { ..._ctx, async: false } : { async: false };\n const result = schema._zod.run({ value, issues: [] }, ctx);\n if (result instanceof Promise) {\n throw new core.$ZodAsyncError();\n }\n if (result.issues.length) {\n const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())));\n util.captureStackTrace(e, _params?.callee ?? fn);\n throw e;\n }\n return result.value;\n };\n return fn;\n};\nexport const parse = /* @__PURE__*/ _parse(errors.$ZodRealError);\nexport const _parseAsync = (_Err) => {\n const fn = async (schema, value, _ctx, params) => {\n const ctx = _ctx ? { ..._ctx, async: true } : { async: true };\n let result = schema._zod.run({ value, issues: [] }, ctx);\n if (result instanceof Promise)\n result = await result;\n if (result.issues.length) {\n const e = new (params?.Err ?? _Err)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())));\n util.captureStackTrace(e, params?.callee ?? fn);\n throw e;\n }\n return result.value;\n };\n return fn;\n};\nexport const parseAsync = /* @__PURE__*/ _parseAsync(errors.$ZodRealError);\nexport const _safeParse = (_Err) => (schema, value, _ctx) => {\n const ctx = _ctx ? { ..._ctx, async: false } : { async: false };\n const result = schema._zod.run({ value, issues: [] }, ctx);\n if (result instanceof Promise) {\n throw new core.$ZodAsyncError();\n }\n return result.issues.length ? failure(_Err, result.issues, ctx) : { success: true, data: result.value };\n};\nexport const safeParse = /* @__PURE__*/ _safeParse(errors.$ZodRealError);\n// the error is built on the first read of `error`: finalizing the issues and constructing the instance is most of a failing parse, and a caller that only branches on `success` never pays it. a getter in the literal keeps this small; the alternative, one shared accessor descriptor plus a hidden state slot, reads ~15% faster but costs ~75 B gzipped in every bundle\nfunction failure(Err, issues, ctx) {\n let error;\n return {\n success: false,\n get error() {\n if (!error) {\n error = new Err(issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())));\n // finalizeIssue drops `input`, so the built error holds nothing; keeping the raw issues past this point pins the parsed value for the life of the result\n issues = undefined;\n ctx = undefined;\n }\n return error;\n },\n set error(e) {\n error = e;\n // a replacement makes the getter's branch unreachable, so the captures have to go here too\n issues = undefined;\n ctx = undefined;\n },\n };\n}\nexport const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {\n const ctx = _ctx ? { ..._ctx, async: true } : { async: true };\n let result = schema._zod.run({ value, issues: [] }, ctx);\n if (result instanceof Promise)\n result = await result;\n return result.issues.length ? failure(_Err, result.issues, ctx) : { success: true, data: result.value };\n};\nexport const safeParseAsync = /* @__PURE__*/ _safeParseAsync(errors.$ZodRealError);\n// registry mirrors of the compiler's sentinels, so this module never imports the compiler\nconst COMPILE_INVALID = /* @__PURE__ */ Symbol.for(\"zod.compile.invalid\");\nconst COMPILE_FALLBACK = /* @__PURE__ */ Symbol.for(\"zod.compile.fallback\");\n// Deliberately tiny, because v8 will not inline a body carrying the fallback's object literals and throw. Everything that is not the compiled happy path lives in validateFallback, and that split is worth ~35% on a compiled schema.\nexport const validate = ((schema, value, _ctx) => {\n const validator = schema._zod.bag.validator;\n if (validator !== undefined) {\n if (validator(value) !== COMPILE_INVALID)\n return true;\n // a definite sentinel means the runtime would reject, so skip the re-parse; a ctx can still change the answer\n if (validator.definite === true && _ctx === undefined)\n return false;\n }\n return validateFallback(schema, value, _ctx);\n});\nfunction validateFallback(schema, value, _ctx) {\n const ctx = _ctx\n ? { ..._ctx, async: false, abortEarly: true }\n : { async: false, abortEarly: true };\n const fallbackRun = schema._zod.bag.fallbackRun;\n let result;\n if (fallbackRun) {\n // skip nested fast paths on the fallback, so user callbacks keep the at-most-twice bound\n ctx[COMPILE_FALLBACK] = true;\n result = fallbackRun({ value, issues: [] }, ctx);\n }\n else {\n result = schema._zod.run({ value, issues: [] }, ctx);\n }\n if (result instanceof Promise) {\n throw new core.$ZodAsyncError();\n }\n return result.issues.length === 0;\n}\n// no fast path: the compiler keeps async parses on the runtime, because a promise-returning callback that is not declared async compiles to a throw\nexport const validateAsync = async (schema, value, _ctx) => {\n const ctx = _ctx\n ? { ..._ctx, async: true, abortEarly: true }\n : { async: true, abortEarly: true };\n let result = schema._zod.run({ value, issues: [] }, ctx);\n if (result instanceof Promise)\n result = await result;\n return result.issues.length === 0;\n};\nexport const _encode = (_Err) => {\n const parse = _parse(_Err);\n const fn = (schema, value, _ctx, _params) => {\n const ctx = _ctx ? { ..._ctx, direction: \"backward\" } : { direction: \"backward\" };\n return parse(schema, value, ctx, finalizeParams(fn, _params));\n };\n return fn;\n};\nexport const encode = /* @__PURE__*/ _encode(errors.$ZodRealError);\nexport const _decode = (_Err) => {\n const parse = _parse(_Err);\n const fn = (schema, value, _ctx, _params) => {\n return parse(schema, value, _ctx, finalizeParams(fn, _params));\n };\n return fn;\n};\nexport const decode = /* @__PURE__*/ _decode(errors.$ZodRealError);\nexport const _encodeAsync = (_Err) => {\n const parseAsync = _parseAsync(_Err);\n const fn = async (schema, value, _ctx, _params) => {\n const ctx = _ctx ? { ..._ctx, direction: \"backward\" } : { direction: \"backward\" };\n return (await parseAsync(schema, value, ctx, finalizeParams(fn, _params)));\n };\n return fn;\n};\nexport const encodeAsync = /* @__PURE__*/ _encodeAsync(errors.$ZodRealError);\nexport const _decodeAsync = (_Err) => {\n const parseAsync = _parseAsync(_Err);\n const fn = async (schema, value, _ctx, _params) => {\n return await parseAsync(schema, value, _ctx, finalizeParams(fn, _params));\n };\n return fn;\n};\nexport const decodeAsync = /* @__PURE__*/ _decodeAsync(errors.$ZodRealError);\nexport const _safeEncode = (_Err) => (schema, value, _ctx) => {\n const ctx = _ctx ? { ..._ctx, direction: \"backward\" } : { direction: \"backward\" };\n return _safeParse(_Err)(schema, value, ctx);\n};\nexport const safeEncode = /* @__PURE__*/ _safeEncode(errors.$ZodRealError);\nexport const _safeDecode = (_Err) => (schema, value, _ctx) => {\n return _safeParse(_Err)(schema, value, _ctx);\n};\nexport const safeDecode = /* @__PURE__*/ _safeDecode(errors.$ZodRealError);\nexport const _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {\n const ctx = _ctx ? { ..._ctx, direction: \"backward\" } : { direction: \"backward\" };\n return _safeParseAsync(_Err)(schema, value, ctx);\n};\nexport const safeEncodeAsync = /* @__PURE__*/ _safeEncodeAsync(errors.$ZodRealError);\nexport const _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {\n return _safeParseAsync(_Err)(schema, value, _ctx);\n};\nexport const safeDecodeAsync = /* @__PURE__*/ _safeDecodeAsync(errors.$ZodRealError);\n","import * as core from \"../core/index.js\";\nimport { $ZodError } from \"../core/index.js\";\nimport * as util from \"../core/util.js\";\n/* Prototypes that already carry the lazy helper methods. Seeded with the\n * intrinsics so that `init` on a foreign object — it accepts any object —\n * can never install an accessor onto a prototype we do not own. */\nconst _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);\n/* Helper methods live as non-enumerable lazy getters on the shared\n * prototype instead of own properties on every instance. On first\n * access the getter allocates the per-instance closure and caches it\n * as a non-enumerable own property, so detached usage still works and\n * the allocation only happens for methods actually touched. */\nfunction _lazyMethod(proto, key, make) {\n Object.defineProperty(proto, key, {\n configurable: true,\n enumerable: false,\n get() {\n const value = make(this);\n Object.defineProperty(this, key, { value, configurable: true, writable: true });\n return value;\n },\n set(value) {\n Object.defineProperty(this, key, { value, configurable: true, writable: true });\n },\n });\n}\nconst initializer = (inst, issues) => {\n $ZodError.init(inst, issues);\n inst.name = \"ZodError\";\n const proto = Object.getPrototypeOf(inst);\n if (_installedErrorProtos.has(proto))\n return;\n _installedErrorProtos.add(proto);\n _lazyMethod(proto, \"format\", (self) => (mapper) => core.formatError(self, mapper));\n _lazyMethod(proto, \"flatten\", (self) => (mapper) => core.flattenError(self, mapper));\n _lazyMethod(proto, \"addIssue\", (self) => (issue) => {\n self.issues.push(issue);\n self.message = JSON.stringify(self.issues, util.jsonStringifyReplacer, 2);\n });\n _lazyMethod(proto, \"addIssues\", (self) => (issues) => {\n self.issues.push(...issues);\n self.message = JSON.stringify(self.issues, util.jsonStringifyReplacer, 2);\n });\n Object.defineProperty(proto, \"isEmpty\", {\n configurable: true,\n enumerable: false,\n get() {\n return this.issues.length === 0;\n },\n });\n};\nexport const ZodError = /*@__PURE__*/ core.$constructor(\"ZodError\", initializer);\nexport const ZodRealError = /*@__PURE__*/ core.$constructor(\"ZodError\", initializer, undefined, {\n Parent: Error,\n});\n// /** @deprecated Use `z.core.$ZodErrorMapCtx` instead. */\n// export type ErrorMapCtx = core.$ZodErrorMapCtx;\n","import { observable } from '@trpc/server/observable';\nimport type { AnyRouter } from '@trpc/server/unstable-core-do-not-import';\nimport type {\n Operation,\n OperationLink,\n OperationResultObservable,\n} from '../types';\n\n/** @internal */\nexport function createChain<\n TRouter extends AnyRouter,\n TInput = unknown,\n TOutput = unknown,\n>(opts: {\n links: OperationLink<TRouter, TInput, TOutput>[];\n op: Operation<TInput>;\n}): OperationResultObservable<TRouter, TOutput> {\n return observable((observer) => {\n function execute(index = 0, op = opts.op) {\n const next = opts.links[index];\n if (!next) {\n throw new Error(\n 'No more links to execute - did you forget to add an ending link?',\n );\n }\n const subscription = next({\n op,\n next(nextOp) {\n const nextObserver = execute(index + 1, nextOp);\n\n return nextObserver;\n },\n });\n return subscription;\n }\n\n const obs$ = execute();\n return obs$.subscribe(observer);\n });\n}\n","import type { ProcedureType } from '../procedure';\nimport type {\n TRPC_ERROR_CODE_KEY,\n TRPC_ERROR_CODE_NUMBER,\n TRPCErrorShape,\n} from '../rpc';\nimport type { TRPCError } from './TRPCError';\n\n/**\n * @internal\n */\nexport type ErrorFormatter<TContext, TShape extends TRPCErrorShape> = (opts: {\n error: TRPCError;\n type: ProcedureType | 'unknown';\n path: string | undefined;\n input: unknown;\n ctx: TContext | undefined;\n shape: DefaultErrorShape;\n}) => TShape;\n\n/**\n * @internal\n */\nexport type DefaultErrorData = {\n code: TRPC_ERROR_CODE_KEY;\n httpStatus: number;\n /**\n * Path to the procedure that threw the error\n */\n path?: string;\n /**\n * Stack trace of the error (only in development)\n */\n stack?: string;\n};\n\n/**\n * @internal\n */\nexport interface DefaultErrorShape extends TRPCErrorShape<DefaultErrorData> {\n message: string;\n code: TRPC_ERROR_CODE_NUMBER;\n}\n\nexport const defaultFormatter: ErrorFormatter<any, any> = ({ shape }) => {\n return shape;\n};\n","import type { FetchEsque, NativeFetchEsque } from './internals/types';\n\ntype AnyFn = (...args: any[]) => unknown;\n\nconst isFunction = (fn: unknown): fn is AnyFn => typeof fn === 'function';\n\nexport function getFetch(\n customFetchImpl?: FetchEsque | NativeFetchEsque,\n): FetchEsque {\n if (customFetchImpl) {\n return customFetchImpl as FetchEsque;\n }\n\n // eslint-disable-next-line @typescript-eslint/unbound-method\n if (typeof window !== 'undefined' && isFunction(window.fetch)) {\n return window.fetch.bind(window);\n }\n\n if (typeof globalThis !== 'undefined' && isFunction(globalThis.fetch)) {\n return globalThis.fetch;\n }\n\n throw new Error('No fetch implementation found');\n}\n","import type { Result } from '../unstable-core-do-not-import';\nimport type {\n Observable,\n Observer,\n OperatorFunction,\n TeardownLogic,\n UnaryFunction,\n Unsubscribable,\n} from './types';\n\n/** @public */\nexport type inferObservableValue<TObservable> =\n TObservable extends Observable<infer TValue, unknown> ? TValue : never;\n\n/** @public */\nexport function isObservable(x: unknown): x is Observable<unknown, unknown> {\n return typeof x === 'object' && x !== null && 'subscribe' in x;\n}\n\n/** @public */\nexport function observable<TValue, TError = unknown>(\n subscribe: (observer: Observer<TValue, TError>) => TeardownLogic,\n): Observable<TValue, TError> {\n const self: Observable<TValue, TError> = {\n subscribe(observer) {\n let teardownRef: TeardownLogic | null = null;\n let isDone = false;\n let unsubscribed = false;\n let teardownImmediately = false;\n function unsubscribe() {\n if (teardownRef === null) {\n teardownImmediately = true;\n return;\n }\n if (unsubscribed) {\n return;\n }\n unsubscribed = true;\n\n if (typeof teardownRef === 'function') {\n teardownRef();\n } else if (teardownRef) {\n teardownRef.unsubscribe();\n }\n }\n teardownRef = subscribe({\n next(value) {\n if (isDone) {\n return;\n }\n observer.next?.(value);\n },\n error(err) {\n if (isDone) {\n return;\n }\n isDone = true;\n observer.error?.(err);\n unsubscribe();\n },\n complete() {\n if (isDone) {\n return;\n }\n isDone = true;\n observer.complete?.();\n unsubscribe();\n },\n });\n if (teardownImmediately) {\n unsubscribe();\n }\n return {\n unsubscribe,\n };\n },\n pipe(\n ...operations: OperatorFunction<any, any, any, any>[]\n ): Observable<any, any> {\n return operations.reduce(pipeReducer, self);\n },\n };\n return self;\n}\n\nfunction pipeReducer(prev: any, fn: UnaryFunction<any, any>) {\n return fn(prev);\n}\n\n/** @internal */\nexport function observableToPromise<TValue>(\n observable: Observable<TValue, unknown>,\n) {\n const ac = new AbortController();\n const promise = new Promise<TValue>((resolve, reject) => {\n let isDone = false;\n function onDone() {\n if (isDone) {\n return;\n }\n isDone = true;\n obs$.unsubscribe();\n }\n ac.signal.addEventListener('abort', () => {\n reject(ac.signal.reason);\n });\n const obs$ = observable.subscribe({\n next(data) {\n isDone = true;\n resolve(data);\n onDone();\n },\n error(data) {\n reject(data);\n },\n complete() {\n ac.abort();\n onDone();\n },\n });\n });\n return promise;\n}\n\n/**\n * @internal\n */\nfunction observableToReadableStream<TValue>(\n observable: Observable<TValue, unknown>,\n signal: AbortSignal,\n): ReadableStream<Result<TValue>> {\n let unsub: Unsubscribable | null = null;\n\n const onAbort = () => {\n unsub?.unsubscribe();\n unsub = null;\n signal.removeEventListener('abort', onAbort);\n };\n\n return new ReadableStream<Result<TValue>>({\n start(controller) {\n unsub = observable.subscribe({\n next(data) {\n controller.enqueue({ ok: true, value: data });\n },\n error(error) {\n controller.enqueue({ ok: false, error });\n controller.close();\n },\n complete() {\n controller.close();\n },\n });\n\n if (signal.aborted) {\n onAbort();\n } else {\n signal.addEventListener('abort', onAbort, { once: true });\n }\n },\n cancel() {\n onAbort();\n },\n });\n}\n\n/** @internal */\nexport function observableToAsyncIterable<TValue>(\n observable: Observable<TValue, unknown>,\n signal: AbortSignal,\n): AsyncIterable<TValue> {\n const stream = observableToReadableStream(observable, signal);\n\n const reader = stream.getReader();\n const iterator: AsyncIterator<TValue> = {\n async next() {\n const value = await reader.read();\n if (value.done) {\n return {\n value: undefined,\n done: true,\n };\n }\n const { value: result } = value;\n if (!result.ok) {\n throw result.error;\n }\n return {\n value: result.value,\n done: false,\n };\n },\n async return() {\n await reader.cancel();\n return {\n value: undefined,\n done: true,\n };\n },\n };\n return {\n [Symbol.asyncIterator]() {\n return iterator;\n },\n };\n}\n","import * as checks from \"./checks.js\";\nimport * as registries from \"./registries.js\";\nimport * as schemas from \"./schemas.js\";\nimport * as util from \"./util.js\";\nfunction snapshotChecks(def) {\n if (def.checks)\n def.checks = [...def.checks];\n return def;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _string(Class, params) {\n return new Class(snapshotChecks({ type: \"string\", ...util.normalizeParams(params) }));\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedString(Class, params) {\n return new Class(snapshotChecks({ type: \"string\", coerce: true, ...util.normalizeParams(params) }));\n}\n// @__NO_SIDE_EFFECTS__\nexport function _email(Class, params) {\n return new Class({\n type: \"string\",\n format: \"email\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _guid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"guid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uuid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uuidv4(Class, params) {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n version: \"v4\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uuidv6(Class, params) {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n version: \"v6\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uuidv7(Class, params) {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n version: \"v7\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _url(Class, params) {\n return new Class({\n type: \"string\",\n format: \"url\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _emoji(Class, params) {\n return new Class({\n type: \"string\",\n format: \"emoji\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _nanoid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"nanoid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n/**\n * @deprecated CUID v1 is deprecated by its authors due to information leakage\n * (timestamps embedded in the id). Use {@link _cuid2} instead.\n * See https://github.com/paralleldrive/cuid.\n */\n// @__NO_SIDE_EFFECTS__\nexport function _cuid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"cuid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _cuid2(Class, params) {\n return new Class({\n type: \"string\",\n format: \"cuid2\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _ulid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"ulid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _xid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"xid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _ksuid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"ksuid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _ipv4(Class, params) {\n return new Class({\n type: \"string\",\n format: \"ipv4\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _ipv6(Class, params) {\n return new Class({\n type: \"string\",\n format: \"ipv6\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _mac(Class, params) {\n return new Class({\n type: \"string\",\n format: \"mac\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _cidrv4(Class, params) {\n return new Class({\n type: \"string\",\n format: \"cidrv4\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _cidrv6(Class, params) {\n return new Class({\n type: \"string\",\n format: \"cidrv6\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _base64(Class, params) {\n return new Class({\n type: \"string\",\n format: \"base64\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _base64url(Class, params) {\n return new Class({\n type: \"string\",\n format: \"base64url\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _e164(Class, params) {\n return new Class({\n type: \"string\",\n format: \"e164\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _creditCard(Class, params) {\n return new Class({\n type: \"string\",\n format: \"credit_card\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _iban(Class, params) {\n return new Class({\n type: \"string\",\n format: \"iban\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _jwt(Class, params) {\n return new Class({\n type: \"string\",\n format: \"jwt\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport const TimePrecision = {\n Any: null,\n Minute: -1,\n Second: 0,\n Millisecond: 3,\n Microsecond: 6,\n};\n// @__NO_SIDE_EFFECTS__\nexport function _isoDateTime(Class, params) {\n return new Class({\n type: \"string\",\n format: \"datetime\",\n check: \"string_format\",\n offset: false,\n local: false,\n precision: null,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _isoDate(Class, params) {\n return new Class({\n type: \"string\",\n format: \"date\",\n check: \"string_format\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _isoTime(Class, params) {\n return new Class({\n type: \"string\",\n format: \"time\",\n check: \"string_format\",\n precision: null,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _isoDuration(Class, params) {\n return new Class({\n type: \"string\",\n format: \"duration\",\n check: \"string_format\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _number(Class, params) {\n return new Class(snapshotChecks({ type: \"number\", checks: [], ...util.normalizeParams(params) }));\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedNumber(Class, params) {\n return new Class(snapshotChecks({ type: \"number\", coerce: true, checks: [], ...util.normalizeParams(params) }));\n}\n// @__NO_SIDE_EFFECTS__\nexport function _int(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"safeint\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _float32(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"float32\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _float64(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"float64\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _int32(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"int32\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uint32(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"uint32\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _boolean(Class, params) {\n return new Class({\n type: \"boolean\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedBoolean(Class, params) {\n return new Class({\n type: \"boolean\",\n coerce: true,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _bigint(Class, params) {\n return new Class({\n type: \"bigint\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedBigint(Class, params) {\n return new Class({\n type: \"bigint\",\n coerce: true,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _int64(Class, params) {\n return new Class({\n type: \"bigint\",\n check: \"bigint_format\",\n abort: false,\n format: \"int64\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uint64(Class, params) {\n return new Class({\n type: \"bigint\",\n check: \"bigint_format\",\n abort: false,\n format: \"uint64\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _symbol(Class, params) {\n return new Class({\n type: \"symbol\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _undefined(Class, params) {\n return new Class({\n type: \"undefined\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _null(Class, params) {\n return new Class({\n type: \"null\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _any(Class) {\n return new Class({\n type: \"any\",\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _unknown(Class) {\n return new Class({\n type: \"unknown\",\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _never(Class, params) {\n return new Class({\n type: \"never\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _void(Class, params) {\n return new Class({\n type: \"void\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _date(Class, params) {\n return new Class({\n type: \"date\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedDate(Class, params) {\n return new Class({\n type: \"date\",\n coerce: true,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _nan(Class, params) {\n return new Class({\n type: \"nan\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _lt(value, params) {\n return new checks.$ZodCheckLessThan({\n check: \"less_than\",\n ...util.normalizeParams(params),\n value,\n inclusive: false,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _lte(value, params) {\n return new checks.$ZodCheckLessThan({\n check: \"less_than\",\n ...util.normalizeParams(params),\n value,\n inclusive: true,\n });\n}\nexport { \n/** @deprecated Use `z.lte()` instead. */\n_lte as _max, };\n// @__NO_SIDE_EFFECTS__\nexport function _gt(value, params) {\n return new checks.$ZodCheckGreaterThan({\n check: \"greater_than\",\n ...util.normalizeParams(params),\n value,\n inclusive: false,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _gte(value, params) {\n return new checks.$ZodCheckGreaterThan({\n check: \"greater_than\",\n ...util.normalizeParams(params),\n value,\n inclusive: true,\n });\n}\nexport { \n/** @deprecated Use `z.gte()` instead. */\n_gte as _min, };\n// @__NO_SIDE_EFFECTS__\nexport function _positive(params) {\n return _gt(0, params);\n}\n// negative\n// @__NO_SIDE_EFFECTS__\nexport function _negative(params) {\n return _lt(0, params);\n}\n// nonpositive\n// @__NO_SIDE_EFFECTS__\nexport function _nonpositive(params) {\n return _lte(0, params);\n}\n// nonnegative\n// @__NO_SIDE_EFFECTS__\nexport function _nonnegative(params) {\n return _gte(0, params);\n}\n// @__NO_SIDE_EFFECTS__\nexport function _multipleOf(value, params) {\n return new checks.$ZodCheckMultipleOf({\n check: \"multiple_of\",\n ...util.normalizeParams(params),\n value,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _maxSize(maximum, params) {\n return new checks.$ZodCheckMaxSize({\n check: \"max_size\",\n ...util.normalizeParams(params),\n maximum,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _minSize(minimum, params) {\n return new checks.$ZodCheckMinSize({\n check: \"min_size\",\n ...util.normalizeParams(params),\n minimum,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _size(size, params) {\n return new checks.$ZodCheckSizeEquals({\n check: \"size_equals\",\n ...util.normalizeParams(params),\n size,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _maxLength(maximum, params) {\n const ch = new checks.$ZodCheckMaxLength({\n check: \"max_length\",\n ...util.normalizeParams(params),\n maximum,\n });\n return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _minLength(minimum, params) {\n return new checks.$ZodCheckMinLength({\n check: \"min_length\",\n ...util.normalizeParams(params),\n minimum,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _length(length, params) {\n return new checks.$ZodCheckLengthEquals({\n check: \"length_equals\",\n ...util.normalizeParams(params),\n length,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _regex(pattern, params) {\n return new checks.$ZodCheckRegex({\n check: \"string_format\",\n format: \"regex\",\n ...util.normalizeParams(params),\n pattern,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _lowercase(params) {\n return new checks.$ZodCheckLowerCase({\n check: \"string_format\",\n format: \"lowercase\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uppercase(params) {\n return new checks.$ZodCheckUpperCase({\n check: \"string_format\",\n format: \"uppercase\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _includes(includes, params) {\n return new checks.$ZodCheckIncludes({\n check: \"string_format\",\n format: \"includes\",\n ...util.normalizeParams(params),\n includes,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _startsWith(prefix, params) {\n return new checks.$ZodCheckStartsWith({\n check: \"string_format\",\n format: \"starts_with\",\n ...util.normalizeParams(params),\n prefix,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _endsWith(suffix, params) {\n return new checks.$ZodCheckEndsWith({\n check: \"string_format\",\n format: \"ends_with\",\n ...util.normalizeParams(params),\n suffix,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _property(property, schema, params) {\n return new checks.$ZodCheckProperty({\n check: \"property\",\n property,\n schema,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _properties(shape, params) {\n return new checks.$ZodCheckProperties({\n check: \"properties\",\n shape,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _mime(types, params) {\n return new checks.$ZodCheckMimeType({\n check: \"mime_type\",\n mime: types,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _overwrite(tx) {\n return new checks.$ZodCheckOverwrite({\n check: \"overwrite\",\n tx,\n });\n}\n// normalize\n// @__NO_SIDE_EFFECTS__\nexport function _normalize(form) {\n return _overwrite((input) => input.normalize(form));\n}\n// trim\n// @__NO_SIDE_EFFECTS__\nexport function _trim() {\n return _overwrite((input) => input.trim());\n}\n// toLowerCase\n// @__NO_SIDE_EFFECTS__\nexport function _toLowerCase() {\n return _overwrite((input) => input.toLowerCase());\n}\n// toUpperCase\n// @__NO_SIDE_EFFECTS__\nexport function _toUpperCase() {\n return _overwrite((input) => input.toUpperCase());\n}\n// slugify\n// @__NO_SIDE_EFFECTS__\nexport function _slugify() {\n return _overwrite((input) => util.slugify(input));\n}\n// @__NO_SIDE_EFFECTS__\nexport function _array(Class, element, params) {\n return new Class({\n type: \"array\",\n element,\n // get element() {\n // return element;\n // },\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _union(Class, options, params) {\n return new Class({\n type: \"union\",\n options,\n ...util.normalizeParams(params),\n });\n}\nexport function _xor(Class, options, params) {\n return new Class({\n type: \"union\",\n options,\n inclusive: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _discriminatedUnion(Class, discriminator, options, params) {\n return new Class({\n type: \"union\",\n options: options,\n discriminator,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _intersection(Class, left, right) {\n return new Class({\n type: \"intersection\",\n left,\n right,\n });\n}\n// export function _tuple(\n// Class: util.SchemaClass<schemas.$ZodTuple>,\n// items: [],\n// params?: string | $ZodTupleParams\n// ): schemas.$ZodTuple<[], null>;\n// @__NO_SIDE_EFFECTS__\nexport function _tuple(Class, items, _paramsOrRest, _params) {\n const hasRest = _paramsOrRest instanceof schemas.$ZodType;\n const params = hasRest ? _params : _paramsOrRest;\n const rest = hasRest ? _paramsOrRest : null;\n return new Class({\n type: \"tuple\",\n items,\n rest,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _record(Class, keyType, valueType, params) {\n return new Class({\n type: \"record\",\n keyType,\n valueType,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _map(Class, keyType, valueType, params) {\n return new Class({\n type: \"map\",\n keyType,\n valueType,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _set(Class, valueType, params) {\n return new Class({\n type: \"set\",\n valueType,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _enum(Class, values, params) {\n const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;\n // if (Array.isArray(values)) {\n // for (const value of values) {\n // entries[value] = value;\n // }\n // } else {\n // Object.assign(entries, values);\n // }\n // const entries: util.EnumLike = {};\n // for (const val of values) {\n // entries[val] = val;\n // }\n return new Class({\n type: \"enum\",\n entries,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\n/** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.\n *\n * ```ts\n * enum Colors { red, green, blue }\n * z.enum(Colors);\n * ```\n */\nexport function _nativeEnum(Class, entries, params) {\n return new Class({\n type: \"enum\",\n entries,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _literal(Class, value, params) {\n return new Class({\n type: \"literal\",\n values: Array.isArray(value) ? value : [value],\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _file(Class, params) {\n return new Class({\n type: \"file\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _transform(Class, fn) {\n return new Class({\n type: \"transform\",\n transform: fn,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _optional(Class, innerType) {\n return new Class({\n type: \"optional\",\n innerType,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _nullable(Class, innerType) {\n return new Class({\n type: \"nullable\",\n innerType,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _default(Class, innerType, defaultValue) {\n return new Class({\n type: \"default\",\n innerType,\n get defaultValue() {\n return typeof defaultValue === \"function\" ? defaultValue() : util.shallowClone(defaultValue);\n },\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _nonoptional(Class, innerType, params) {\n return new Class({\n type: \"nonoptional\",\n innerType,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _success(Class, innerType) {\n return new Class({\n type: \"success\",\n innerType,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _catch(Class, innerType, catchValue) {\n return new Class({\n type: \"catch\",\n innerType,\n catchValue: (typeof catchValue === \"function\" ? catchValue : util.constantCatch(catchValue)),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _pipe(Class, in_, out) {\n return new Class({\n type: \"pipe\",\n in: in_,\n out,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _readonly(Class, innerType) {\n return new Class({\n type: \"readonly\",\n innerType,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _templateLiteral(Class, parts, params) {\n return new Class({\n type: \"template_literal\",\n parts,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _lazy(Class, getter) {\n return new Class({\n type: \"lazy\",\n getter,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _promise(Class, innerType) {\n return new Class({\n type: \"promise\",\n innerType,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _custom(Class, fn, _params) {\n const norm = util.normalizeParams(_params);\n norm.abort ?? (norm.abort = true); // default to abort:false\n const schema = new Class({\n type: \"custom\",\n check: \"custom\",\n fn: fn,\n ...norm,\n });\n return schema;\n}\n// same as _custom but defaults to abort:false\n// @__NO_SIDE_EFFECTS__\nexport function _refine(Class, fn, _params) {\n const schema = new Class({\n type: \"custom\",\n check: \"custom\",\n fn: fn,\n ...util.normalizeParams(_params),\n });\n return schema;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _superRefine(fn, params) {\n const ch = _check((payload) => {\n payload.addIssue = (issue) => {\n if (typeof issue === \"string\") {\n payload.issues.push(util.issue(issue, payload.value, ch._zod.def));\n }\n else {\n // for Zod 3 backwards compatibility\n const _issue = issue;\n if (_issue.fatal)\n _issue.continue = false;\n _issue.code ?? (_issue.code = \"custom\");\n if (!(\"input\" in _issue))\n _issue.input = payload.value;\n _issue.inst ?? (_issue.inst = ch);\n _issue.continue ?? (_issue.continue = !ch._zod.def.abort); // abort is always undefined, so this is always true...\n payload.issues.push(util.issue(_issue));\n }\n };\n return fn(payload.value, payload);\n }, params);\n return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _check(fn, params) {\n const ch = new checks.$ZodCheck({\n check: \"custom\",\n ...util.normalizeParams(params),\n });\n ch._zod.check = fn;\n return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function describe(description) {\n const ch = new checks.$ZodCheck({ check: \"describe\" });\n ch._zod.onattach = [\n (inst) => {\n const existing = registries.globalRegistry.get(inst) ?? {};\n registries.globalRegistry.add(inst, { ...existing, description });\n },\n ];\n ch._zod.check = () => { }; // no-op check\n return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function meta(metadata) {\n const ch = new checks.$ZodCheck({ check: \"meta\" });\n ch._zod.onattach = [\n (inst) => {\n const existing = registries.globalRegistry.get(inst) ?? {};\n registries.globalRegistry.add(inst, { ...existing, ...metadata });\n },\n ];\n ch._zod.check = () => { }; // no-op check\n return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _stringbool(Classes, _params) {\n const params = util.normalizeParams(_params);\n let truthyArray = params.truthy ?? [\"true\", \"1\", \"yes\", \"on\", \"y\", \"enabled\"];\n let falsyArray = params.falsy ?? [\"false\", \"0\", \"no\", \"off\", \"n\", \"disabled\"];\n if (params.case !== \"sensitive\") {\n truthyArray = truthyArray.map((v) => (typeof v === \"string\" ? v.toLowerCase() : v));\n falsyArray = falsyArray.map((v) => (typeof v === \"string\" ? v.toLowerCase() : v));\n }\n const truthySet = new Set(truthyArray);\n const falsySet = new Set(falsyArray);\n const _Codec = Classes.Codec ?? schemas.$ZodCodec;\n const _Boolean = Classes.Boolean ?? schemas.$ZodBoolean;\n const _String = Classes.String ?? schemas.$ZodString;\n const stringSchema = new _String({ type: \"string\", error: params.error });\n const booleanSchema = new _Boolean({ type: \"boolean\", error: params.error });\n const codec = new _Codec({\n type: \"pipe\",\n in: stringSchema,\n out: booleanSchema,\n transform: ((input, payload) => {\n let data = input;\n if (params.case !== \"sensitive\")\n data = data.toLowerCase();\n if (truthySet.has(data)) {\n return true;\n }\n else if (falsySet.has(data)) {\n return false;\n }\n else {\n payload.issues.push({\n code: \"invalid_value\",\n expected: \"stringbool\",\n values: [...truthySet, ...falsySet],\n input: payload.value,\n inst: codec,\n continue: false,\n });\n return {};\n }\n }),\n reverseTransform: ((input, _payload) => {\n if (input === true) {\n return truthyArray[0] || \"true\";\n }\n else {\n return falsyArray[0] || \"false\";\n }\n }),\n error: params.error,\n });\n codec._zod.bag.truthy = truthyArray;\n codec._zod.bag.falsy = falsyArray;\n codec._zod.bag.case = params.case ?? \"insensitive\";\n return codec;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _stringFormat(Class, format, fnOrRegex, _params = {}) {\n const params = util.normalizeParams(_params);\n const def = {\n check: \"string_format\",\n type: \"string\",\n format,\n fn: typeof fnOrRegex === \"function\" ? fnOrRegex : (val) => fnOrRegex.test(val),\n ...params,\n };\n if (fnOrRegex instanceof RegExp) {\n def.pattern = fnOrRegex;\n }\n const inst = new Class(def);\n return inst;\n}\n","import * as regexes from \"./regexes.js\";\nimport { base64Charset, base64urlCharset } from \"./schemas.js\";\nimport { extractDefs, finalize, handleUnrepresentable, initializeContext, processSchema, } from \"./to-json-schema.js\";\nimport { BIGINT_FORMAT_RANGES, NUMBER_FORMAT_RANGES, assignProp, getEnumValues } from \"./util.js\";\nconst narrowMin = (agg, key, value) => {\n if (agg[key] === undefined || value > agg[key])\n agg[key] = value;\n};\nconst narrowMax = (agg, key, value) => {\n if (agg[key] === undefined || value < agg[key])\n agg[key] = value;\n};\nconst narrowBoth = (agg, value) => {\n narrowMin(agg, \"minimum\", value);\n narrowMax(agg, \"maximum\", value);\n};\nconst addDivisor = (agg, value) => {\n agg.multipleOf ?? (agg.multipleOf = []);\n if (!agg.multipleOf.includes(value))\n agg.multipleOf.push(value);\n};\nconst addPattern = (agg, pattern) => {\n agg.patterns ?? (agg.patterns = new Set());\n agg.patterns.add(pattern);\n};\nconst intersectMime = (agg, mime) => {\n agg.mime = agg.mime ? agg.mime.filter((m) => mime.includes(m)) : [...mime];\n};\n// last-wins, matching the bag's historical write order; the flag keeps an integer format from being lost to a later float one\nconst setFormat = (agg, format) => {\n agg.format = format;\n if (format.includes(\"int\"))\n agg.isInt = true;\n};\nconst minContributor = (agg, def) => narrowMin(agg, \"minimum\", def.minimum);\nconst maxContributor = (agg, def) => narrowMax(agg, \"maximum\", def.maximum);\nconst formatContributor = (ranges) => (agg, def) => {\n setFormat(agg, def.format);\n const [minimum, maximum] = ranges[def.format];\n narrowMin(agg, \"minimum\", minimum);\n narrowMax(agg, \"maximum\", maximum);\n};\nconst contributors = {\n greater_than: (agg, def) => narrowMin(agg, def.inclusive ? \"minimum\" : \"exclusiveMinimum\", def.value),\n less_than: (agg, def) => narrowMax(agg, def.inclusive ? \"maximum\" : \"exclusiveMaximum\", def.value),\n multiple_of: (agg, def) => addDivisor(agg, def.value),\n number_format: formatContributor(NUMBER_FORMAT_RANGES),\n bigint_format: formatContributor(BIGINT_FORMAT_RANGES),\n min_length: minContributor,\n max_length: maxContributor,\n length_equals: (agg, def) => narrowBoth(agg, def.length),\n min_size: minContributor,\n max_size: maxContributor,\n size_equals: (agg, def) => narrowBoth(agg, def.size),\n string_format: (agg, def) => {\n setFormat(agg, def.format);\n if (def.pattern)\n addPattern(agg, def.pattern);\n if (def.format === \"base64\" || def.format === \"base64url\")\n agg.contentEncoding = def.format;\n if (def.local || def.precision === -1)\n agg.laxFormat = true;\n },\n mime_type: (agg, def) => intersectMime(agg, def.mime),\n};\nexport function aggregateChecks(schema) {\n const agg = {};\n const def = schema._zod.def;\n // a format schema is its own first check, same rule as $ZodType init\n const list = schema._zod.traits.has(\"$ZodCheck\")\n ? [schema, ...(def.checks ?? [])]\n : (def.checks ?? []);\n for (const ch of list)\n contributors[ch._zod.def.check]?.(agg, ch._zod.def);\n // reconcile with the bag so third-party onattach contributions still land; first-party residue is never tighter than the fold, so merging it back is idempotent for one and additive for the other\n const bag = schema._zod.bag;\n if (bag.minimum !== undefined)\n narrowMin(agg, \"minimum\", bag.minimum);\n if (bag.exclusiveMinimum !== undefined)\n narrowMin(agg, \"exclusiveMinimum\", bag.exclusiveMinimum);\n if (bag.maximum !== undefined)\n narrowMax(agg, \"maximum\", bag.maximum);\n if (bag.exclusiveMaximum !== undefined)\n narrowMax(agg, \"exclusiveMaximum\", bag.exclusiveMaximum);\n if (bag.multipleOf !== undefined)\n addDivisor(agg, bag.multipleOf);\n if (bag.format !== undefined) {\n agg.format ?? (agg.format = bag.format);\n if (bag.format.includes(\"int\"))\n agg.isInt = true;\n }\n if (bag.mime)\n intersectMime(agg, bag.mime);\n for (const pattern of bag.patterns ?? [])\n addPattern(agg, pattern);\n return agg;\n}\nconst formatMap = {\n guid: \"uuid\",\n url: \"uri\",\n datetime: \"date-time\",\n json_string: \"json-string\",\n regex: \"\", // do not set\n};\n// ==================== SIMPLE TYPE PROCESSORS ====================\n// the runtime patterns are lax so parse paths never overflow the regex stack; the emitted schema swaps in the exact block forms, which zod itself never executes\nconst exactPatterns = new Map([\n [base64Charset, regexes.base64],\n [base64urlCharset, regexes.base64url],\n]);\nconst exactPattern = (p) => exactPatterns.get(p) ?? p;\nexport const stringProcessor = (schema, ctx, _json, _params) => {\n const json = _json;\n json.type = \"string\";\n const { minimum, maximum, format, patterns, contentEncoding, laxFormat } = aggregateChecks(schema);\n if (typeof minimum === \"number\")\n json.minLength = minimum;\n if (typeof maximum === \"number\")\n json.maxLength = maximum;\n // custom pattern overrides format\n if (format) {\n json.format = formatMap[format] ?? format;\n if (json.format === \"\")\n delete json.format; // empty format is not valid\n // `z.iso.time()` is never full-time, and `laxFormat` carries the datetime shapes that also accept what their keyword forbids\n if (format === \"time\" || laxFormat) {\n delete json.format;\n }\n }\n if (contentEncoding)\n json.contentEncoding = contentEncoding;\n if (patterns && patterns.size > 0) {\n const patternList = [...patterns].map(exactPattern);\n if (patternList.length === 1)\n json.pattern = patternList[0].source;\n else if (patternList.length > 1) {\n json.allOf = [\n ...patternList.map((regex) => ({\n ...(ctx.target === \"draft-07\" || ctx.target === \"draft-04\" || ctx.target === \"openapi-3.0\"\n ? { type: \"string\" }\n : {}),\n pattern: regex.source,\n })),\n ];\n }\n }\n};\nexport const numberProcessor = (schema, ctx, _json, params) => {\n const json = _json;\n const { minimum, maximum, multipleOf, exclusiveMaximum, exclusiveMinimum, isInt } = aggregateChecks(schema);\n json.type = isInt ? \"integer\" : \"number\";\n // when both minimum and exclusiveMinimum exist, pick the more restrictive one\n const exMin = typeof exclusiveMinimum === \"number\" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY);\n const exMax = typeof exclusiveMaximum === \"number\" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY);\n const legacy = ctx.target === \"draft-04\" || ctx.target === \"openapi-3.0\";\n if (exMin) {\n if (legacy) {\n json.minimum = exclusiveMinimum;\n json.exclusiveMinimum = true;\n }\n else {\n json.exclusiveMinimum = exclusiveMinimum;\n }\n }\n else if (typeof minimum === \"number\") {\n json.minimum = minimum;\n }\n if (exMax) {\n if (legacy) {\n json.maximum = exclusiveMaximum;\n json.exclusiveMaximum = true;\n }\n else {\n json.exclusiveMaximum = exclusiveMaximum;\n }\n }\n else if (typeof maximum === \"number\") {\n json.maximum = maximum;\n }\n if (multipleOf) {\n // JSON Schema requires a divisor strictly greater than zero, and a non-finite one does not survive JSON at all. A negative divisor accepts exactly what its absolute value accepts, so it still maps; zero, NaN and Infinity have no keyword form.\n const divisors = new Set();\n for (const divisor of multipleOf) {\n if (Number.isFinite(divisor) && divisor !== 0)\n divisors.add(Math.abs(divisor));\n else\n handleUnrepresentable(schema, ctx, json, params, `A multipleOf divisor of ${divisor} cannot be represented in JSON Schema`);\n }\n // chained divisors are a conjunction the keyword cannot carry alone, so extras ride an allOf, same as stacked patterns\n const [first, ...rest] = divisors;\n if (first !== undefined)\n json.multipleOf = first;\n if (rest.length)\n json.allOf = [...(json.allOf ?? []), ...rest.map((m) => ({ multipleOf: m }))];\n }\n};\nexport const booleanProcessor = (_schema, _ctx, json, _params) => {\n json.type = \"boolean\";\n};\nexport const bigintProcessor = (schema, ctx, json, params) => {\n handleUnrepresentable(schema, ctx, json, params, \"BigInt cannot be represented in JSON Schema\");\n};\nexport const symbolProcessor = (schema, ctx, json, params) => {\n handleUnrepresentable(schema, ctx, json, params, \"Symbols cannot be represented in JSON Schema\");\n};\nexport const nullProcessor = (_schema, ctx, json, _params) => {\n if (ctx.target === \"openapi-3.0\") {\n json.type = \"string\";\n json.nullable = true;\n json.enum = [null];\n }\n else {\n json.type = \"null\";\n }\n};\nexport const undefinedProcessor = (schema, ctx, json, params) => {\n handleUnrepresentable(schema, ctx, json, params, \"Undefined cannot be represented in JSON Schema\");\n};\nexport const voidProcessor = (schema, ctx, json, params) => {\n handleUnrepresentable(schema, ctx, json, params, \"Void cannot be represented in JSON Schema\");\n};\nexport const neverProcessor = (_schema, _ctx, json, _params) => {\n json.not = {};\n};\nexport const anyProcessor = (_schema, _ctx, _json, _params) => {\n // empty schema accepts anything\n};\nexport const unknownProcessor = (_schema, _ctx, _json, _params) => {\n // empty schema accepts anything\n};\nexport const dateProcessor = (schema, ctx, json, params) => {\n handleUnrepresentable(schema, ctx, json, params, \"Date cannot be represented in JSON Schema\");\n};\nexport const enumProcessor = (schema, _ctx, json, _params) => {\n const def = schema._zod.def;\n const values = getEnumValues(def.entries);\n // an empty enum accepts nothing, same as z.never()\n if (values.length === 0) {\n json.not = {};\n return;\n }\n // Number enums can have both string and number values\n if (values.every((v) => typeof v === \"number\"))\n json.type = \"number\";\n if (values.every((v) => typeof v === \"string\"))\n json.type = \"string\";\n json.enum = values;\n};\nexport const literalProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n // a literal with no values accepts nothing, same as z.never()\n if (def.values.length === 0) {\n json.not = {};\n return;\n }\n const vals = [];\n for (const val of def.values) {\n if (val === undefined) {\n // a custom schema replaces the whole literal, so there is nothing left to accumulate\n if (handleUnrepresentable(schema, ctx, json, params, \"Literal `undefined` cannot be represented in JSON Schema\"))\n return;\n // otherwise do not add to vals\n }\n else if (typeof val === \"bigint\") {\n if (handleUnrepresentable(schema, ctx, json, params, \"BigInt literals cannot be represented in JSON Schema\"))\n return;\n vals.push(Number(val));\n }\n else {\n vals.push(val);\n }\n }\n if (vals.length === 0) {\n // do nothing (an undefined literal was stripped)\n }\n else if (vals.length === 1) {\n const val = vals[0];\n json.type = val === null ? \"null\" : typeof val;\n if (ctx.target === \"draft-04\" || ctx.target === \"openapi-3.0\") {\n json.enum = [val];\n }\n else {\n json.const = val;\n }\n }\n else {\n if (vals.every((v) => typeof v === \"number\"))\n json.type = \"number\";\n if (vals.every((v) => typeof v === \"string\"))\n json.type = \"string\";\n if (vals.every((v) => typeof v === \"boolean\"))\n json.type = \"boolean\";\n if (vals.every((v) => v === null))\n json.type = \"null\";\n json.enum = vals;\n }\n};\nexport const nanProcessor = (schema, ctx, json, params) => {\n handleUnrepresentable(schema, ctx, json, params, \"NaN cannot be represented in JSON Schema\");\n};\nexport const templateLiteralProcessor = (schema, _ctx, json, _params) => {\n const _json = json;\n const pattern = schema._zod.pattern;\n if (!pattern)\n throw new Error(\"Pattern not found in template literal\");\n _json.type = \"string\";\n _json.pattern = pattern.source;\n};\nexport const fileProcessor = (schema, _ctx, json, _params) => {\n const _json = json;\n _json.type = \"string\";\n _json.format = \"binary\";\n _json.contentEncoding = \"binary\";\n const { minimum, maximum, mime } = aggregateChecks(schema);\n if (minimum !== undefined)\n _json.minLength = minimum;\n if (maximum !== undefined)\n _json.maxLength = maximum;\n if (!mime)\n return;\n // an empty intersection means the mime checks share no value, so nothing passes at runtime; `anyOf` must be non-empty, so the false schema is `not: {}`\n if (mime.length === 0)\n _json.not = {};\n else if (mime.length === 1)\n _json.contentMediaType = mime[0];\n // only contentMediaType differs, so the shared props stay at the root\n else\n _json.anyOf = mime.map((m) => ({ contentMediaType: m }));\n};\nexport const successProcessor = (_schema, _ctx, json, _params) => {\n json.type = \"boolean\";\n};\nexport const customProcessor = (schema, ctx, json, params) => {\n handleUnrepresentable(schema, ctx, json, params, \"Custom types cannot be represented in JSON Schema\");\n};\nexport const functionProcessor = (schema, ctx, json, params) => {\n handleUnrepresentable(schema, ctx, json, params, \"Function types cannot be represented in JSON Schema\");\n};\nexport const transformProcessor = (schema, ctx, json, params) => {\n handleUnrepresentable(schema, ctx, json, params, \"Transforms cannot be represented in JSON Schema\");\n};\nexport const mapProcessor = (schema, ctx, json, params) => {\n handleUnrepresentable(schema, ctx, json, params, \"Map cannot be represented in JSON Schema\");\n};\nexport const setProcessor = (schema, ctx, json, params) => {\n handleUnrepresentable(schema, ctx, json, params, \"Set cannot be represented in JSON Schema\");\n};\n// ==================== COMPOSITE TYPE PROCESSORS ====================\nexport const arrayProcessor = (schema, ctx, _json, params) => {\n const json = _json;\n const def = schema._zod.def;\n const { minimum, maximum } = aggregateChecks(schema);\n if (typeof minimum === \"number\")\n json.minItems = minimum;\n if (typeof maximum === \"number\")\n json.maxItems = maximum;\n json.type = \"array\";\n json.items = processSchema(def.element, ctx, {\n ...params,\n path: [...params.path, \"items\"],\n });\n};\n// Transform and catch set `optin = \"optional\"` at runtime so the parser lets them observe an\n// absent key, but their declared input type stays required. An input JSON Schema describes the\n// declared type, so resolve past them to the schema that actually carries the optionality.\n// Used by both `objectProcessor` (for `required`) and `tupleProcessor` (for `minItems`); see\n// wiki/optionality.md, \"The JSON Schema emitter reads the *static* value\".\nfunction inputOptin(schema) {\n const def = schema._zod.def;\n if (def.type === \"pipe\" && def.in._zod.traits.has(\"$ZodTransform\")) {\n return inputOptin(def.out);\n }\n if (def.type === \"catch\") {\n return inputOptin(def.innerType);\n }\n return schema._zod.optin;\n}\nexport const objectProcessor = (schema, ctx, _json, params) => {\n const json = _json;\n const def = schema._zod.def;\n const shape = def.shape;\n // dropping it while still emitting `additionalProperties: false` would emit a schema that rejects data this one requires\n const symbolKeys = Object.getOwnPropertySymbols(shape);\n if (symbolKeys.length &&\n handleUnrepresentable(schema, ctx, json, params, \"Symbol keys cannot be represented in JSON Schema\")) {\n return;\n }\n json.type = \"object\";\n json.properties = {};\n for (const key in shape) {\n // assignProp so a __proto__ key becomes an own property instead of hitting the inherited setter on the plain {} we build into\n assignProp(json.properties, key, processSchema(shape[key], ctx, {\n ...params,\n path: [...params.path, \"properties\", key],\n }));\n }\n // required keys\n const requiredKeys = [];\n for (const key of Object.keys(shape)) {\n const field = def.shape[key];\n if (ctx.io === \"input\" ? inputOptin(field) === undefined : field._zod.optout === undefined) {\n requiredKeys.push(key);\n }\n }\n if (requiredKeys.length > 0) {\n json.required = requiredKeys;\n }\n // catchall\n if (def.catchall?._zod.def.type === \"never\") {\n // strict\n json.additionalProperties = false;\n }\n else if (!def.catchall) {\n // regular\n if (ctx.io === \"output\")\n json.additionalProperties = false;\n }\n else if (def.catchall) {\n json.additionalProperties = processSchema(def.catchall, ctx, {\n ...params,\n path: [...params.path, \"additionalProperties\"],\n });\n }\n};\nexport const unionProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n // Exclusive unions (inclusive === false) use oneOf (exactly one match) instead of anyOf (one or more matches). This includes both z.xor() and discriminated unions\n const isExclusive = def.inclusive === false;\n const options = def.options.map((x, i) => processSchema(x, ctx, {\n ...params,\n path: [...params.path, isExclusive ? \"oneOf\" : \"anyOf\", i],\n }));\n if (isExclusive) {\n json.oneOf = options;\n }\n else {\n json.anyOf = options;\n }\n};\nexport const intersectionProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n const a = processSchema(def.left, ctx, {\n ...params,\n path: [...params.path, \"allOf\", 0],\n });\n const b = processSchema(def.right, ctx, {\n ...params,\n path: [...params.path, \"allOf\", 1],\n });\n const isSimpleIntersection = (val) => \"allOf\" in val && Object.keys(val).length === 1;\n const allOf = [\n ...(isSimpleIntersection(a) ? a.allOf : [a]),\n ...(isSimpleIntersection(b) ? b.allOf : [b]),\n ];\n json.allOf = allOf;\n // Recorded innermost first, so a nested intersection has already folded by the time this one is considered. The array is the handle rather than the schema, because a wrapper that inherits this schema shares the same array; `finalize` folds every object holding it. See `foldIntersection`.\n ctx.intersections.push(allOf);\n};\nexport const tupleProcessor = (schema, ctx, _json, params) => {\n const json = _json;\n const def = schema._zod.def;\n json.type = \"array\";\n const prefixPath = ctx.target === \"draft-2020-12\" ? \"prefixItems\" : \"items\";\n const restPath = ctx.target === \"draft-2020-12\" ? \"items\" : ctx.target === \"openapi-3.0\" ? \"items\" : \"additionalItems\";\n const prefixItems = def.items.map((x, i) => processSchema(x, ctx, {\n ...params,\n path: [...params.path, prefixPath, i],\n }));\n const rest = def.rest\n ? processSchema(def.rest, ctx, {\n ...params,\n path: [...params.path, restPath, ...(ctx.target === \"openapi-3.0\" ? [def.items.length] : [])],\n })\n : null;\n let minItems = def.items.length;\n while (minItems > 0) {\n const item = def.items[minItems - 1];\n const optional = ctx.io === \"input\" ? inputOptin(item) !== undefined : item._zod.optout === \"optional\";\n if (!optional)\n break;\n minItems--;\n }\n const maxItems = def.items.length;\n const isClosed = !def.rest;\n if (ctx.target === \"draft-2020-12\") {\n json.prefixItems = prefixItems;\n if (isClosed) {\n json.items = false;\n }\n else if (rest) {\n json.items = rest;\n }\n if (minItems > 0)\n json.minItems = minItems;\n if (isClosed)\n json.maxItems = maxItems;\n }\n else if (ctx.target === \"openapi-3.0\") {\n json.items = {\n anyOf: prefixItems,\n };\n if (rest) {\n json.items.anyOf.push(rest);\n }\n if (minItems > 0)\n json.minItems = minItems;\n if (isClosed)\n json.maxItems = maxItems;\n }\n else {\n json.items = prefixItems;\n if (isClosed) {\n json.additionalItems = false;\n }\n else if (rest) {\n json.additionalItems = rest;\n }\n if (minItems > 0)\n json.minItems = minItems;\n if (isClosed)\n json.maxItems = maxItems;\n }\n // explicit user-defined length checks take precedence\n const { minimum, maximum } = aggregateChecks(schema);\n if (typeof minimum === \"number\")\n json.minItems = minimum;\n if (typeof maximum === \"number\")\n json.maxItems = maximum;\n};\n/** JSON object keys are always strings, so a numeric record key schema is re-expressed over the\n * numeric-string form the record parser matches. Deferred to `finalize`, after the flatten: a key\n * behind a wrapper only carries its own `type` before then, and a union key only has its branches.\n *\n * A numeric bound cannot apply to a property name, so `minimum` and its siblings are dropped rather\n * than carried over: keeping them beside `type: \"string\"` reproduces the match-nothing schema this\n * exists to fix. A key that carries one therefore emits wider than the record parses — `z.record(z.number().min(5), V)`\n * accepts `\"3\"` — which is the deliberate trade, since throwing on it would reject an ordinary schema\n * outright. */\nfunction stringifyKeyNames(bySchema, json, visited) {\n // an extracted key that rewrites cannot go on sharing its definition — the string form a key position needs is not the number form every other reference wants — so it inlines. One that does not rewrite keeps the `$ref`.\n if (json.$ref) {\n // a recursive key holds its own reference inside its definition, so a node already on the path is left alone rather than resolved again\n if (visited.has(json))\n return json;\n visited.add(json);\n const def = bySchema.get(json)?.def;\n if (!def)\n return json;\n const inlined = stringifyKeyNames(bySchema, def, visited);\n return inlined === def ? json : inlined;\n }\n for (const keyword of [\"anyOf\", \"oneOf\"]) {\n const branches = json[keyword];\n if (!Array.isArray(branches))\n continue;\n const mapped = branches.map((branch) => stringifyKeyNames(bySchema, branch, visited));\n // rebuilding regardless would detach a key that had nothing to re-express, dropping its `$ref` and leaking the internal `id`\n if (mapped.some((branch, i) => branch !== branches[i]))\n json = { ...json, [keyword]: mapped };\n }\n // a member that already admits a string leaves the key unconstrained, so the node's own type re-expresses only when every member is numeric\n const types = Array.isArray(json.type) ? json.type : [json.type];\n const numericType = !types.includes(\"string\") && types.some((t) => t === \"number\" || t === \"integer\");\n // a heterogeneous key carries no type at all, so its numeric members are caught here instead\n const values = json.enum ?? (json.const !== undefined ? [json.const] : undefined);\n if (!numericType && !values?.some((v) => typeof v === \"number\"))\n return json;\n const { minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf, format, id, ...rest } = json;\n if (rest.enum)\n rest.enum = rest.enum.map((v) => (typeof v === \"number\" ? String(v) : v));\n else if (typeof rest.const === \"number\")\n rest.const = String(rest.const);\n // a heterogeneous key keeps its absent type: the stringified members already say what a key may be\n if (!numericType)\n return rest;\n rest.type = \"string\";\n if (!values)\n rest.pattern = (types.includes(\"number\") ? regexes.number : regexes.integer).source;\n return rest;\n}\n/** Every record of one conversion, so the carriers are found in a single pass rather than once per record. */\nconst pendingRecords = new WeakMap();\nfunction rewriteKeyNames(ctx) {\n // an extracted key is resolved by the object `extractToDef` left in its place, so the map is built once rather than searched per reference. `_zod.toJSONSchema` can hand the same object to two schemas, so the first entry carrying a body wins, as a search would have found it.\n const bySchema = new Map();\n for (const entry of ctx.seen.values()) {\n if (entry.def && !bySchema.has(entry.schema))\n bySchema.set(entry.schema, entry);\n }\n const rewrites = new Map();\n for (const record of pendingRecords.get(ctx) ?? []) {\n const seen = ctx.seen.get(record);\n const names = (seen?.def ?? seen?.schema)?.propertyNames;\n if (!names || names === true || rewrites.has(names))\n continue;\n const rewritten = stringifyKeyNames(bySchema, names, new Set());\n if (rewritten !== names)\n rewrites.set(names, rewritten);\n }\n if (!rewrites.size)\n return;\n // the flatten has already copied each record's own properties onto every wrapper by reference, and an extracted body is another such copy, so every carrier holding a rewritten key is updated together\n for (const entry of ctx.seen.values()) {\n for (const carrier of [entry.schema, entry.def]) {\n const rewritten = carrier && rewrites.get(carrier.propertyNames);\n if (rewritten)\n carrier.propertyNames = rewritten;\n }\n }\n}\nexport const recordProcessor = (schema, ctx, _json, params) => {\n const json = _json;\n const def = schema._zod.def;\n json.type = \"object\";\n // For looseRecord with regex patterns, use patternProperties. This correctly represents \"only validate keys matching the pattern\" semantics and composes well with allOf (intersections)\n const keyType = def.keyType;\n const patterns = aggregateChecks(keyType).patterns;\n if (def.mode === \"loose\" && patterns && patterns.size > 0) {\n // Use patternProperties for looseRecord with regex patterns\n const valueSchema = processSchema(def.valueType, ctx, {\n ...params,\n path: [...params.path, \"patternProperties\", \"*\"],\n });\n json.patternProperties = {};\n for (const pattern of patterns) {\n assignProp(json.patternProperties, exactPattern(pattern).source, valueSchema);\n }\n }\n else {\n // Default behavior: use propertyNames + additionalProperties\n if (ctx.target === \"draft-07\" || ctx.target === \"draft-2020-12\") {\n json.propertyNames = processSchema(def.keyType, ctx, {\n ...params,\n path: [...params.path, \"propertyNames\"],\n });\n let pending = pendingRecords.get(ctx);\n if (!pending) {\n pending = [];\n pendingRecords.set(ctx, pending);\n ctx.deferred.push(() => rewriteKeyNames(ctx));\n }\n pending.push(schema);\n }\n json.additionalProperties = processSchema(def.valueType, ctx, {\n ...params,\n path: [...params.path, \"additionalProperties\"],\n });\n }\n // Add required for keys with discrete values (enum, literal, etc.)\n const keyValues = keyType._zod.values;\n // Every key shares one value schema, so an optional-in value makes the whole key set omittable on input. Output keeps them: the exhaustive branch assigns every key, even one whose value came back undefined.\n const omittableOnInput = ctx.io === \"input\" && inputOptin(def.valueType) !== undefined;\n if (keyValues && !def.partial && !omittableOnInput) {\n const validKeyValues = [...keyValues].filter((v) => typeof v === \"string\" || typeof v === \"number\");\n if (validKeyValues.length > 0) {\n json.required = validKeyValues.map(String);\n }\n }\n};\nexport const nullableProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n const inner = processSchema(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n if (ctx.target === \"openapi-3.0\") {\n seen.ref = def.innerType;\n json.nullable = true;\n }\n else {\n json.anyOf = [inner, { type: \"null\" }];\n }\n};\nexport const nonoptionalProcessor = (schema, ctx, _json, params) => {\n const def = schema._zod.def;\n processSchema(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n};\n/** Round-trips a default value through JSON so the emitted schema is guaranteed to be valid JSON.\n * A BigInt has no reliable encoding, so it goes through `unrepresentable` like any other\n * unrepresentable value. Returns a sentinel when the caller must not write a default of its own. */\nconst UNREPRESENTABLE_DEFAULT = Symbol();\nfunction serializeDefaultValue(value, schema, ctx, json, params) {\n let unrepresentable = false;\n const serialized = JSON.stringify(value, (_, val) => {\n if (typeof val !== \"bigint\")\n return val;\n unrepresentable = true;\n return null;\n });\n if (!unrepresentable)\n return JSON.parse(serialized);\n handleUnrepresentable(schema, ctx, json, params, \"BigInt defaults cannot be represented in JSON Schema\");\n return UNREPRESENTABLE_DEFAULT;\n}\nexport const defaultProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n processSchema(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n const value = serializeDefaultValue(def.defaultValue, schema, ctx, json, params);\n if (value !== UNREPRESENTABLE_DEFAULT)\n json.default = value;\n};\nexport const prefaultProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n processSchema(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n if (ctx.io !== \"input\")\n return;\n const value = serializeDefaultValue(def.defaultValue, schema, ctx, json, params);\n if (value !== UNREPRESENTABLE_DEFAULT)\n json._prefault = value;\n};\nexport const catchProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n processSchema(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n let catchValue;\n try {\n catchValue = def.catchValue(undefined);\n }\n catch {\n handleUnrepresentable(schema, ctx, json, params, \"Dynamic catch values are not supported in JSON Schema\");\n return;\n }\n json.default = catchValue;\n};\nexport const pipeProcessor = (schema, ctx, _json, params) => {\n const def = schema._zod.def;\n const inIsTransform = def.in._zod.traits.has(\"$ZodTransform\");\n const innerType = ctx.io === \"input\" ? (inIsTransform ? def.out : def.in) : def.out;\n processSchema(innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = innerType;\n};\nexport const readonlyProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n processSchema(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n json.readOnly = true;\n};\nexport const promiseProcessor = (schema, ctx, _json, params) => {\n const def = schema._zod.def;\n processSchema(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n};\nexport const optionalProcessor = (schema, ctx, _json, params) => {\n const def = schema._zod.def;\n processSchema(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n};\nexport const lazyProcessor = (schema, ctx, _json, params) => {\n const innerType = schema._zod.innerType;\n processSchema(innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = innerType;\n};\n// ==================== ALL PROCESSORS ====================\nexport const allProcessors = {\n string: stringProcessor,\n number: numberProcessor,\n boolean: booleanProcessor,\n bigint: bigintProcessor,\n symbol: symbolProcessor,\n null: nullProcessor,\n undefined: undefinedProcessor,\n void: voidProcessor,\n never: neverProcessor,\n any: anyProcessor,\n unknown: unknownProcessor,\n date: dateProcessor,\n enum: enumProcessor,\n literal: literalProcessor,\n nan: nanProcessor,\n template_literal: templateLiteralProcessor,\n file: fileProcessor,\n success: successProcessor,\n custom: customProcessor,\n function: functionProcessor,\n transform: transformProcessor,\n map: mapProcessor,\n set: setProcessor,\n array: arrayProcessor,\n object: objectProcessor,\n union: unionProcessor,\n intersection: intersectionProcessor,\n tuple: tupleProcessor,\n record: recordProcessor,\n nullable: nullableProcessor,\n nonoptional: nonoptionalProcessor,\n default: defaultProcessor,\n prefault: prefaultProcessor,\n catch: catchProcessor,\n pipe: pipeProcessor,\n readonly: readonlyProcessor,\n promise: promiseProcessor,\n optional: optionalProcessor,\n lazy: lazyProcessor,\n};\nexport function toJSONSchema(input, params) {\n if (\"_idmap\" in input) {\n // Registry case\n const registry = input;\n const ctx = initializeContext({ ...params, processors: allProcessors });\n const defs = {};\n // First pass: process all schemas to build the seen map\n for (const entry of registry._idmap.entries()) {\n const [_, schema] = entry;\n processSchema(schema, ctx);\n }\n const schemas = {};\n const external = {\n registry,\n uri: params?.uri,\n defs,\n };\n // Update the context with external configuration\n ctx.external = external;\n // Second pass: emit each schema\n for (const entry of registry._idmap.entries()) {\n const [key, schema] = entry;\n extractDefs(ctx, schema);\n assignProp(schemas, key, finalize(ctx, schema));\n }\n if (Object.keys(defs).length > 0) {\n const defsSegment = ctx.target === \"draft-2020-12\" ? \"$defs\" : \"definitions\";\n schemas.__shared = {\n [defsSegment]: defs,\n };\n }\n return { schemas };\n }\n // Single schema case\n const ctx = initializeContext({ ...params, processors: allProcessors });\n processSchema(input, ctx);\n extractDefs(ctx, input);\n return finalize(ctx, input);\n}\n","/// <reference lib=\"dom.iterable\" />\n\n// `dom.iterable` types are explicitly required for extracting `FormData` values,\n// as all implementations of `Symbol.iterable` are separated from the main `dom` types.\n// Using triple-slash directive makes sure that it will be available,\n// even if end-user `tsconfig.json` omits it in the `lib` array.\n\nimport { observable, tap } from '@trpc/server/observable';\nimport type {\n AnyRouter,\n InferrableClientTypes,\n} from '@trpc/server/unstable-core-do-not-import';\nimport type { TRPCClientError } from '../TRPCClientError';\nimport type { Operation, OperationResultEnvelope, TRPCLink } from './types';\n\ntype ConsoleEsque = {\n log: (...args: any[]) => void;\n error: (...args: any[]) => void;\n};\n\ntype EnableFnOptions<TRouter extends InferrableClientTypes> =\n | {\n direction: 'down';\n result:\n | OperationResultEnvelope<unknown, TRPCClientError<TRouter>>\n | TRPCClientError<TRouter>;\n }\n | (Operation & {\n direction: 'up';\n });\ntype EnabledFn<TRouter extends AnyRouter> = (\n opts: EnableFnOptions<TRouter>,\n) => boolean;\n\ntype LoggerLinkFnOptions<TRouter extends AnyRouter> = Operation &\n (\n | {\n /**\n * Request result\n */\n direction: 'down';\n result:\n | OperationResultEnvelope<unknown, TRPCClientError<TRouter>>\n | TRPCClientError<TRouter>;\n elapsedMs: number;\n }\n | {\n /**\n * Request was just initialized\n */\n direction: 'up';\n }\n );\n\ntype LoggerLinkFn<TRouter extends AnyRouter> = (\n opts: LoggerLinkFnOptions<TRouter>,\n) => void;\n\ntype ColorMode = 'ansi' | 'css' | 'none';\n\nexport interface LoggerLinkOptions<TRouter extends AnyRouter> {\n logger?: LoggerLinkFn<TRouter>;\n enabled?: EnabledFn<TRouter>;\n /**\n * Used in the built-in defaultLogger\n */\n console?: ConsoleEsque;\n /**\n * Color mode\n * @default typeof window === 'undefined' ? 'ansi' : 'css'\n */\n colorMode?: ColorMode;\n\n /**\n * Include context in the log - defaults to false unless `colorMode` is 'css'\n */\n withContext?: boolean;\n}\n\nfunction isFormData(value: unknown): value is FormData {\n if (typeof FormData === 'undefined') {\n // FormData is not supported\n return false;\n }\n return value instanceof FormData;\n}\n\nconst palettes = {\n css: {\n query: ['72e3ff', '3fb0d8'],\n mutation: ['c5a3fc', '904dfc'],\n subscription: ['ff49e1', 'd83fbe'],\n },\n ansi: {\n regular: {\n // Cyan background, black and white text respectively\n query: ['\\x1b[30;46m', '\\x1b[97;46m'],\n // Magenta background, black and white text respectively\n mutation: ['\\x1b[30;45m', '\\x1b[97;45m'],\n // Green background, black and white text respectively\n subscription: ['\\x1b[30;42m', '\\x1b[97;42m'],\n },\n bold: {\n query: ['\\x1b[1;30;46m', '\\x1b[1;97;46m'],\n mutation: ['\\x1b[1;30;45m', '\\x1b[1;97;45m'],\n subscription: ['\\x1b[1;30;42m', '\\x1b[1;97;42m'],\n },\n },\n} as const;\n\nfunction constructPartsAndArgs(\n opts: LoggerLinkFnOptions<any> & {\n colorMode: ColorMode;\n withContext?: boolean;\n },\n) {\n const { direction, type, withContext, path, id, input } = opts;\n\n const parts: string[] = [];\n const args: any[] = [];\n\n if (opts.colorMode === 'none') {\n parts.push(direction === 'up' ? '>>' : '<<', type, `#${id}`, path);\n } else if (opts.colorMode === 'ansi') {\n const [lightRegular, darkRegular] = palettes.ansi.regular[type];\n const [lightBold, darkBold] = palettes.ansi.bold[type];\n const reset = '\\x1b[0m';\n\n parts.push(\n direction === 'up' ? lightRegular : darkRegular,\n direction === 'up' ? '>>' : '<<',\n type,\n direction === 'up' ? lightBold : darkBold,\n `#${id}`,\n path,\n reset,\n );\n } else {\n // css color mode\n const [light, dark] = palettes.css[type];\n const css = `\n background-color: #${direction === 'up' ? light : dark};\n color: ${direction === 'up' ? 'black' : 'white'};\n padding: 2px;\n `;\n\n parts.push(\n '%c',\n direction === 'up' ? '>>' : '<<',\n type,\n `#${id}`,\n `%c${path}%c`,\n '%O',\n );\n args.push(\n css,\n `${css}; font-weight: bold;`,\n `${css}; font-weight: normal;`,\n );\n }\n\n if (direction === 'up') {\n args.push(withContext ? { input, context: opts.context } : { input });\n } else {\n args.push({\n input,\n result: opts.result,\n elapsedMs: opts.elapsedMs,\n ...(withContext && { context: opts.context }),\n });\n }\n\n return { parts, args };\n}\n\n// maybe this should be moved to it's own package\nconst defaultLogger =\n <TRouter extends AnyRouter>({\n c = console,\n colorMode = 'css',\n withContext,\n }: {\n c?: ConsoleEsque;\n colorMode?: ColorMode;\n withContext?: boolean;\n }): LoggerLinkFn<TRouter> =>\n (props) => {\n const rawInput = props.input;\n const input = isFormData(rawInput)\n ? Object.fromEntries(rawInput)\n : rawInput;\n\n const { parts, args } = constructPartsAndArgs({\n ...props,\n colorMode,\n input,\n withContext,\n });\n\n const fn: 'error' | 'log' =\n props.direction === 'down' &&\n props.result &&\n (props.result instanceof Error ||\n ('error' in props.result.result && props.result.result.error))\n ? 'error'\n : 'log';\n\n c[fn].apply(null, [parts.join(' ')].concat(args));\n };\n\n/**\n * @see https://trpc.io/docs/v11/client/links/loggerLink\n */\nexport function loggerLink<TRouter extends AnyRouter = AnyRouter>(\n opts: LoggerLinkOptions<TRouter> = {},\n): TRPCLink<TRouter> {\n const { enabled = () => true } = opts;\n\n const colorMode =\n opts.colorMode ?? (typeof window === 'undefined' ? 'ansi' : 'css');\n const withContext = opts.withContext ?? colorMode === 'css';\n const {\n logger = defaultLogger({ c: opts.console, colorMode, withContext }),\n } = opts;\n\n return () => {\n return ({ op, next }) => {\n return observable((observer) => {\n // ->\n if (enabled({ ...op, direction: 'up' })) {\n logger({\n ...op,\n direction: 'up',\n });\n }\n const requestStartTime = Date.now();\n function logResult(\n result:\n | OperationResultEnvelope<unknown, TRPCClientError<TRouter>>\n | TRPCClientError<TRouter>,\n ) {\n const elapsedMs = Date.now() - requestStartTime;\n\n if (enabled({ ...op, direction: 'down', result })) {\n logger({\n ...op,\n direction: 'down',\n elapsedMs,\n result,\n });\n }\n }\n return next(op)\n .pipe(\n tap({\n next(result) {\n logResult(result);\n },\n error(result) {\n logResult(result);\n },\n }),\n )\n .subscribe(observer);\n });\n };\n };\n}\n","import { observable } from './observable';\nimport type {\n MonoTypeOperatorFunction,\n Observer,\n OperatorFunction,\n Unsubscribable,\n} from './types';\n\nexport function map<TValueBefore, TError, TValueAfter>(\n project: (value: TValueBefore, index: number) => TValueAfter,\n): OperatorFunction<TValueBefore, TError, TValueAfter, TError> {\n return (source) => {\n return observable((destination) => {\n let index = 0;\n const subscription = source.subscribe({\n next(value) {\n destination.next(project(value, index++));\n },\n error(error) {\n destination.error(error);\n },\n complete() {\n destination.complete();\n },\n });\n return subscription;\n });\n };\n}\n\ninterface ShareConfig {}\nexport function share<TValue, TError>(\n _opts?: ShareConfig,\n): MonoTypeOperatorFunction<TValue, TError> {\n return (source) => {\n let refCount = 0;\n\n let subscription: Unsubscribable | null = null;\n const observers: Partial<Observer<TValue, TError>>[] = [];\n\n function startIfNeeded() {\n if (subscription) {\n return;\n }\n subscription = source.subscribe({\n next(value) {\n for (const observer of observers) {\n observer.next?.(value);\n }\n },\n error(error) {\n for (const observer of observers) {\n observer.error?.(error);\n }\n },\n complete() {\n for (const observer of observers) {\n observer.complete?.();\n }\n },\n });\n }\n function resetIfNeeded() {\n // \"resetOnRefCountZero\"\n if (refCount === 0 && subscription) {\n const _sub = subscription;\n subscription = null;\n _sub.unsubscribe();\n }\n }\n\n return observable((subscriber) => {\n refCount++;\n\n observers.push(subscriber);\n startIfNeeded();\n return {\n unsubscribe() {\n refCount--;\n resetIfNeeded();\n\n const index = observers.findIndex((v) => v === subscriber);\n\n if (index > -1) {\n observers.splice(index, 1);\n }\n },\n };\n });\n };\n}\n\nexport function tap<TValue, TError>(\n observer: Partial<Observer<TValue, TError>>,\n): MonoTypeOperatorFunction<TValue, TError> {\n return (source) => {\n return observable((destination) => {\n return source.subscribe({\n next(value) {\n observer.next?.(value);\n destination.next(value);\n },\n error(error) {\n observer.error?.(error);\n destination.error(error);\n },\n complete() {\n observer.complete?.();\n destination.complete();\n },\n });\n });\n };\n}\n\nconst distinctUnsetMarker = Symbol();\nexport function distinctUntilChanged<TValue, TError>(\n compare: (a: TValue, b: TValue) => boolean = (a, b) => a === b,\n): MonoTypeOperatorFunction<TValue, TError> {\n return (source) => {\n return observable((destination) => {\n let lastValue: TValue | typeof distinctUnsetMarker = distinctUnsetMarker;\n\n return source.subscribe({\n next(value) {\n if (lastValue !== distinctUnsetMarker && compare(lastValue, value)) {\n return;\n }\n lastValue = value;\n destination.next(value);\n },\n error(error) {\n destination.error(error);\n },\n complete() {\n destination.complete();\n },\n });\n });\n };\n}\n\nconst isDeepEqual = <T>(a: T, b: T): boolean => {\n if (a === b) {\n return true;\n }\n const bothAreObjects =\n a && b && typeof a === 'object' && typeof b === 'object';\n\n return (\n !!bothAreObjects &&\n Object.keys(a).length === Object.keys(b).length &&\n Object.entries(a).every(([k, v]) => isDeepEqual(v, b[k as keyof T]))\n );\n};\nexport function distinctUntilDeepChanged<\n TValue,\n TError,\n>(): MonoTypeOperatorFunction<TValue, TError> {\n return distinctUntilChanged(isDeepEqual);\n}\n","// import { $ZodType } from \"./schemas.js\";\nimport * as core from \"./core.js\";\nimport * as regexes from \"./regexes.js\";\nimport * as util from \"./util.js\";\nexport const $ZodCheck = /*@__PURE__*/ core.$constructor(\"$ZodCheck\", (inst, def) => {\n var _a;\n inst._zod ?? (inst._zod = {});\n inst._zod.def = def;\n (_a = inst._zod).onattach ?? (_a.onattach = []);\n});\n/** Default `when` for size-based checks: run only on non-nullish values with a `size`. */\nconst _whenHasSize = (payload) => {\n const val = payload.value;\n return !util.nullish(val) && val.size !== undefined;\n};\n/** Default `when` for length-based checks: run only on non-nullish values with a `length`. */\nconst _whenHasLength = (payload) => {\n const val = payload.value;\n return !util.nullish(val) && val.length !== undefined;\n};\nconst numericOriginMap = {\n number: \"number\",\n bigint: \"bigint\",\n object: \"date\",\n};\nexport const $ZodCheckLessThan = /*@__PURE__*/ core.$constructor(\"$ZodCheckLessThan\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const origin = numericOriginMap[typeof def.value];\n inst._zod.check = (payload) => {\n if (def.inclusive ? payload.value <= def.value : payload.value < def.value) {\n return;\n }\n payload.issues.push({\n origin: numericOriginMap[typeof payload.value] ?? origin,\n code: \"too_big\",\n maximum: typeof def.value === \"object\" ? def.value.getTime() : def.value,\n input: payload.value,\n inclusive: def.inclusive,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckGreaterThan = /*@__PURE__*/ core.$constructor(\"$ZodCheckGreaterThan\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const origin = numericOriginMap[typeof def.value];\n inst._zod.check = (payload) => {\n if (def.inclusive ? payload.value >= def.value : payload.value > def.value) {\n return;\n }\n payload.issues.push({\n origin: numericOriginMap[typeof payload.value] ?? origin,\n code: \"too_small\",\n minimum: typeof def.value === \"object\" ? def.value.getTime() : def.value,\n input: payload.value,\n inclusive: def.inclusive,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckMultipleOf = \n/*@__PURE__*/ core.$constructor(\"$ZodCheckMultipleOf\", (inst, def) => {\n $ZodCheck.init(inst, def);\n inst._zod.check = (payload) => {\n if (typeof payload.value !== typeof def.value)\n throw new Error(\"Cannot mix number and bigint in multiple_of check.\");\n const isMultiple = typeof payload.value === \"bigint\"\n ? // `value % 0n` throws, and nothing is a multiple of zero — the number branch already fails this way via NaN\n def.value !== BigInt(0) && payload.value % def.value === BigInt(0)\n : util.floatSafeRemainder(payload.value, def.value) === 0;\n if (isMultiple)\n return;\n payload.issues.push({\n origin: typeof payload.value,\n code: \"not_multiple_of\",\n divisor: def.value,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckNumberFormat = /*@__PURE__*/ core.$constructor(\"$ZodCheckNumberFormat\", (inst, def) => {\n $ZodCheck.init(inst, def); // no format checks\n def.format = def.format || \"float64\";\n const isInt = def.format?.includes(\"int\");\n const origin = isInt ? \"int\" : \"number\";\n const [minimum, maximum] = util.NUMBER_FORMAT_RANGES[def.format];\n inst._zod.check = (payload) => {\n const input = payload.value;\n if (isInt) {\n if (!Number.isInteger(input)) {\n // invalid_format issue\n // payload.issues.push({\n // expected: def.format,\n // format: def.format,\n // code: \"invalid_format\",\n // input,\n // inst,\n // });\n // invalid_type issue\n payload.issues.push({\n expected: origin,\n format: def.format,\n code: \"invalid_type\",\n continue: false,\n input,\n inst,\n });\n return;\n // not_multiple_of issue\n // payload.issues.push({\n // code: \"not_multiple_of\",\n // origin: \"number\",\n // input,\n // inst,\n // divisor: 1,\n // });\n }\n if (!Number.isSafeInteger(input)) {\n if (input > 0) {\n // too_big\n payload.issues.push({\n input,\n code: \"too_big\",\n maximum: Number.MAX_SAFE_INTEGER,\n note: \"Integers must be within the safe integer range.\",\n inst,\n origin,\n inclusive: true,\n continue: !def.abort,\n });\n }\n else {\n // too_small\n payload.issues.push({\n input,\n code: \"too_small\",\n minimum: Number.MIN_SAFE_INTEGER,\n note: \"Integers must be within the safe integer range.\",\n inst,\n origin,\n inclusive: true,\n continue: !def.abort,\n });\n }\n return;\n }\n }\n if (input < minimum) {\n payload.issues.push({\n origin: \"number\",\n input,\n code: \"too_small\",\n minimum,\n inclusive: true,\n inst,\n continue: !def.abort,\n });\n }\n if (input > maximum) {\n payload.issues.push({\n origin: \"number\",\n input,\n code: \"too_big\",\n maximum,\n inclusive: true,\n inst,\n continue: !def.abort,\n });\n }\n };\n});\nexport const $ZodCheckBigIntFormat = /*@__PURE__*/ core.$constructor(\"$ZodCheckBigIntFormat\", (inst, def) => {\n $ZodCheck.init(inst, def); // no format checks\n const [minimum, maximum] = util.BIGINT_FORMAT_RANGES[def.format];\n inst._zod.check = (payload) => {\n const input = payload.value;\n if (input < minimum) {\n payload.issues.push({\n origin: \"bigint\",\n input,\n code: \"too_small\",\n minimum: minimum,\n inclusive: true,\n inst,\n continue: !def.abort,\n });\n }\n if (input > maximum) {\n payload.issues.push({\n origin: \"bigint\",\n input,\n code: \"too_big\",\n maximum,\n inclusive: true,\n inst,\n continue: !def.abort,\n });\n }\n };\n});\nexport const $ZodCheckMaxSize = /*@__PURE__*/ core.$constructor(\"$ZodCheckMaxSize\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n (_a = inst._zod.def).when ?? (_a.when = _whenHasSize);\n inst._zod.check = (payload) => {\n const input = payload.value;\n const size = input.size;\n if (size <= def.maximum)\n return;\n payload.issues.push({\n origin: util.getSizableOrigin(input),\n code: \"too_big\",\n maximum: def.maximum,\n inclusive: true,\n input,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckMinSize = /*@__PURE__*/ core.$constructor(\"$ZodCheckMinSize\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n (_a = inst._zod.def).when ?? (_a.when = _whenHasSize);\n inst._zod.check = (payload) => {\n const input = payload.value;\n const size = input.size;\n if (size >= def.minimum)\n return;\n payload.issues.push({\n origin: util.getSizableOrigin(input),\n code: \"too_small\",\n minimum: def.minimum,\n inclusive: true,\n input,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckSizeEquals = /*@__PURE__*/ core.$constructor(\"$ZodCheckSizeEquals\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n (_a = inst._zod.def).when ?? (_a.when = _whenHasSize);\n inst._zod.check = (payload) => {\n const input = payload.value;\n const size = input.size;\n if (size === def.size)\n return;\n const tooBig = size > def.size;\n payload.issues.push({\n origin: util.getSizableOrigin(input),\n ...(tooBig ? { code: \"too_big\", maximum: def.size } : { code: \"too_small\", minimum: def.size }),\n inclusive: true,\n exact: true,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckMaxLength = /*@__PURE__*/ core.$constructor(\"$ZodCheckMaxLength\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n (_a = inst._zod.def).when ?? (_a.when = _whenHasLength);\n inst._zod.check = (payload) => {\n const input = payload.value;\n const units = input.length;\n // Strings are measured in Unicode code points, not UTF-16 units. A code point is at most two units, so a string that already fits in units fits in code points; only an overflow has to be counted.\n const length = typeof input === \"string\" && units > def.maximum ? util.codePointLength(input) : units;\n if (length <= def.maximum)\n return;\n const origin = util.getLengthableOrigin(input);\n payload.issues.push({\n origin,\n code: \"too_big\",\n maximum: def.maximum,\n inclusive: true,\n input,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckMinLength = /*@__PURE__*/ core.$constructor(\"$ZodCheckMinLength\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n (_a = inst._zod.def).when ?? (_a.when = _whenHasLength);\n inst._zod.check = (payload) => {\n const input = payload.value;\n const units = input.length;\n // A code point is one or two UTF-16 units, so fewer units than the floor can never reach it and twice the floor always clears it. Only in between is the exact count in doubt.\n const length = typeof input === \"string\" && units >= def.minimum && units < def.minimum * 2\n ? util.codePointLength(input)\n : units;\n if (length >= def.minimum)\n return;\n const origin = util.getLengthableOrigin(input);\n payload.issues.push({\n origin,\n code: \"too_small\",\n minimum: def.minimum,\n inclusive: true,\n input,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckLengthEquals = /*@__PURE__*/ core.$constructor(\"$ZodCheckLengthEquals\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n (_a = inst._zod.def).when ?? (_a.when = _whenHasLength);\n inst._zod.check = (payload) => {\n const input = payload.value;\n const units = input.length;\n // A code point is one or two UTF-16 units, so outside `[length, length * 2]` units the target is missed either way — and missed in the same direction in both measures.\n const length = typeof input === \"string\" && units >= def.length && units <= def.length * 2\n ? util.codePointLength(input)\n : units;\n if (length === def.length)\n return;\n const origin = util.getLengthableOrigin(input);\n const tooBig = length > def.length;\n payload.issues.push({\n origin,\n ...(tooBig ? { code: \"too_big\", maximum: def.length } : { code: \"too_small\", minimum: def.length }),\n inclusive: true,\n exact: true,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckStringFormat = /*@__PURE__*/ core.$constructor(\"$ZodCheckStringFormat\", (inst, def) => {\n var _a, _b;\n $ZodCheck.init(inst, def);\n if (def.pattern)\n (_a = inst._zod).check ?? (_a.check = (payload) => {\n def.pattern.lastIndex = 0;\n if (def.pattern.test(payload.value))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: def.format,\n input: payload.value,\n ...(def.pattern ? { pattern: def.pattern.toString() } : {}),\n inst,\n continue: !def.abort,\n });\n });\n else\n (_b = inst._zod).check ?? (_b.check = () => { });\n});\nexport const $ZodCheckRegex = /*@__PURE__*/ core.$constructor(\"$ZodCheckRegex\", (inst, def) => {\n $ZodCheckStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n def.pattern.lastIndex = 0;\n if (def.pattern.test(payload.value))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: \"regex\",\n input: payload.value,\n pattern: def.pattern.toString(),\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckLowerCase = /*@__PURE__*/ core.$constructor(\"$ZodCheckLowerCase\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.lowercase);\n $ZodCheckStringFormat.init(inst, def);\n});\nexport const $ZodCheckUpperCase = /*@__PURE__*/ core.$constructor(\"$ZodCheckUpperCase\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.uppercase);\n $ZodCheckStringFormat.init(inst, def);\n});\nexport const $ZodCheckIncludes = /*@__PURE__*/ core.$constructor(\"$ZodCheckIncludes\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const escapedRegex = util.escapeRegex(def.includes);\n // `String.prototype.includes(sub, position)` matches `sub` at `position`\n // OR LATER, so the pattern must allow at least `position` leading chars\n // (`{N,}`), not exactly `position` chars (`{N}`).\n const pattern = new RegExp(typeof def.position === \"number\" ? `^.{${def.position},}${escapedRegex}` : escapedRegex);\n def.pattern = pattern;\n inst._zod.check = (payload) => {\n if (payload.value.includes(def.includes, def.position))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: \"includes\",\n includes: def.includes,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckStartsWith = /*@__PURE__*/ core.$constructor(\"$ZodCheckStartsWith\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const pattern = new RegExp(`^${util.escapeRegex(def.prefix)}.*`);\n def.pattern ?? (def.pattern = pattern);\n inst._zod.check = (payload) => {\n if (payload.value.startsWith(def.prefix))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: \"starts_with\",\n prefix: def.prefix,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckEndsWith = /*@__PURE__*/ core.$constructor(\"$ZodCheckEndsWith\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const pattern = new RegExp(`.*${util.escapeRegex(def.suffix)}$`);\n def.pattern ?? (def.pattern = pattern);\n inst._zod.check = (payload) => {\n if (payload.value.endsWith(def.suffix))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: \"ends_with\",\n suffix: def.suffix,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\n///////////////////////////////////\n///// $ZodCheckProperty /////\n///////////////////////////////////\nfunction handleCheckPropertyResult(result, payload, property) {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(property, result.issues));\n }\n}\nexport const $ZodCheckProperty = /*@__PURE__*/ core.$constructor(\"$ZodCheckProperty\", (inst, def) => {\n $ZodCheck.init(inst, def);\n inst._zod.check = (payload) => {\n const result = def.schema._zod.run({\n value: payload.value[def.property],\n issues: [],\n }, {});\n if (result instanceof Promise) {\n return result.then((result) => handleCheckPropertyResult(result, payload, def.property));\n }\n handleCheckPropertyResult(result, payload, def.property);\n return;\n };\n});\nexport const $ZodCheckProperties = /*@__PURE__*/ core.$constructor(\"$ZodCheckProperties\", (inst, def) => {\n $ZodCheck.init(inst, def);\n util.hide(inst, Symbol.iterator, function* () {\n yield inst;\n });\n // key and schema snapshotted together: reading one live and the other cached lets a later mutation of the caller's shape object pair a stale key with a missing schema\n let entries;\n inst._zod.check = (payload) => {\n // the base schema already typed the value, so only a nullish one is rejected here: the properties read on a primitive too, matching z.property() on a string's length\n if (payload.value == null) {\n payload.issues.push({ expected: \"object\", code: \"invalid_type\", input: payload.value, inst });\n return undefined;\n }\n entries ?? (entries = Reflect.ownKeys(def.shape).map((key) => [key, def.shape[key]]));\n const input = payload.value;\n let proms;\n for (const [key, schema] of entries) {\n const result = schema._zod.run({ value: input[key], issues: [] }, {});\n if (result instanceof Promise) {\n proms ?? (proms = []);\n proms.push(result.then((result) => handleCheckPropertyResult(result, payload, key)));\n }\n else {\n handleCheckPropertyResult(result, payload, key);\n }\n }\n if (proms)\n return Promise.all(proms).then(() => undefined);\n return undefined;\n };\n});\nexport const $ZodCheckMimeType = /*@__PURE__*/ core.$constructor(\"$ZodCheckMimeType\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const mimeSet = new Set(def.mime);\n inst._zod.check = (payload) => {\n if (mimeSet.has(payload.value.type))\n return;\n payload.issues.push({\n code: \"invalid_value\",\n values: def.mime,\n input: payload.value.type,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckOverwrite = /*@__PURE__*/ core.$constructor(\"$ZodCheckOverwrite\", (inst, def) => {\n $ZodCheck.init(inst, def);\n inst._zod.check = (payload) => {\n payload.value = def.tx(payload.value);\n };\n});\n","import { TRPCError } from '../error/TRPCError';\nimport { isObject } from '../utils';\nimport type { TRPCRequestInfo } from './types';\n\nexport function parseConnectionParamsFromUnknown(\n parsed: unknown,\n): TRPCRequestInfo['connectionParams'] {\n try {\n if (parsed === null) {\n return null;\n }\n if (!isObject(parsed)) {\n throw new Error('Expected object');\n }\n const nonStringValues = Object.entries(parsed).filter(\n ([_key, value]) => typeof value !== 'string',\n );\n\n if (nonStringValues.length > 0) {\n throw new Error(\n `Expected connectionParams to be string values. Got ${nonStringValues\n .map(([key, value]) => `${key}: ${typeof value}`)\n .join(', ')}`,\n );\n }\n return parsed as Record<string, string>;\n } catch (cause) {\n throw new TRPCError({\n code: 'PARSE_ERROR',\n message: 'Invalid connection params shape',\n cause,\n });\n }\n}\nexport function parseConnectionParamsFromString(\n str: string,\n): TRPCRequestInfo['connectionParams'] {\n let parsed: unknown;\n try {\n parsed = JSON.parse(str);\n } catch (cause) {\n throw new TRPCError({\n code: 'PARSE_ERROR',\n message: 'Not JSON-parsable query params',\n cause,\n });\n }\n return parseConnectionParamsFromUnknown(parsed);\n}\n","/** @internal */\nexport type UnsetMarker = 'unsetMarker' & {\n __brand: 'unsetMarker';\n};\n\n/**\n * Ensures there are no duplicate keys when building a procedure.\n * @internal\n */\nexport function mergeWithoutOverrides<TType extends Record<string, unknown>>(\n obj1: TType,\n ...objs: Partial<TType>[]\n): TType {\n const newObj: TType = Object.assign(emptyObject(), obj1);\n\n for (const overrides of objs) {\n for (const key in overrides) {\n if (key in newObj && newObj[key] !== overrides[key]) {\n throw new Error(`Duplicate key ${key}`);\n }\n newObj[key as keyof TType] = overrides[key] as TType[keyof TType];\n }\n }\n return newObj;\n}\n\n/**\n * Check that value is object\n * @internal\n */\nexport function isObject(value: unknown): value is Record<string, unknown> {\n return !!value && !Array.isArray(value) && typeof value === 'object';\n}\n\ntype AnyFn = ((...args: any[]) => unknown) & Record<keyof any, unknown>;\nexport function isFunction(fn: unknown): fn is AnyFn {\n return typeof fn === 'function';\n}\n\n/**\n * Create an object without inheriting anything from `Object.prototype`\n * @internal\n */\nexport function emptyObject<TObj extends Record<string, unknown>>(): TObj {\n return Object.create(null);\n}\n\nconst asyncIteratorsSupported =\n typeof Symbol === 'function' && !!Symbol.asyncIterator;\n\nexport function isAsyncIterable<TValue>(\n value: unknown,\n): value is AsyncIterable<TValue> {\n return (\n asyncIteratorsSupported && isObject(value) && Symbol.asyncIterator in value\n );\n}\n\n/**\n * Run an IIFE\n */\nexport const run = <TValue>(fn: () => TValue): TValue => fn();\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nexport function noop(): void {}\n\nexport function identity<T>(it: T): T {\n return it;\n}\n\n/**\n * Generic runtime assertion function. Throws, if the condition is not `true`.\n *\n * Can be used as a slightly less dangerous variant of type assertions. Code\n * mistakes would be revealed at runtime then (hopefully during testing).\n */\nexport function assert(\n condition: boolean,\n msg = 'no additional info',\n): asserts condition {\n if (!condition) {\n throw new Error(`AssertionError: ${msg}`);\n }\n}\n\nexport function sleep(ms = 0): Promise<void> {\n return new Promise<void>((res) => setTimeout(res, ms));\n}\n\n/**\n * Ponyfill for\n * [`AbortSignal.any`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/any_static).\n */\nexport function abortSignalsAnyPonyfill(signals: AbortSignal[]): AbortSignal {\n if (typeof AbortSignal.any === 'function') {\n return AbortSignal.any(signals);\n }\n\n const ac = new AbortController();\n\n for (const signal of signals) {\n if (signal.aborted) {\n trigger();\n break;\n }\n signal.addEventListener('abort', trigger, { once: true });\n }\n\n return ac.signal;\n\n function trigger() {\n ac.abort();\n for (const signal of signals) {\n signal.removeEventListener('abort', trigger);\n }\n }\n}\n","/**\n * The gateway's API for a page of the web app and for its forms (server\n * actions): as the browser that asked, by its cookies, at the address the\n * gateway's server gave the web app, never one a request names.\n */\nimport { TRPCClientError } from '@trpc/client';\nimport { headers } from 'next/headers';\nimport { redirect } from 'next/navigation';\n\nimport type { GatewayRouter } from '../../../src/adapters/trpc/router.js';\nimport { gatewayApi, type GatewayApi } from './gateway-api';\nimport { FLEET_PARAMETER, pageAccountOf, type InView, type InViewRefusal } from './page-account';\n\n/** Set by the gateway's server as it starts the web app (src/adapters/web/next-web-app.ts). */\nconst API_URL_VARIABLE = 'AEOLUS_GATEWAY_API_URL';\n\n/** A page's search parameters, as Next.js hands them over. */\nexport type SearchParams = Record<string, string | string[] | undefined>;\n\n/** A page shown as the account signed in: the API as it, its fleet and its scopes there. */\nexport interface SignedInPage {\n kind: 'signedIn';\n api: GatewayApi;\n fleetId: string;\n scopes: readonly string[];\n}\n\n/** The gateway's own address, where the API answers. */\nexport function apiUrl(): string {\n const url = process.env[API_URL_VARIABLE];\n if (url === undefined) {\n throw new Error(`${API_URL_VARIABLE} is not set: the gateway's server starts the web app`);\n }\n return url;\n}\n\n/** The API as the browser that asked, in the fleet named. */\nexport async function requestApi(fleetId: string | undefined): Promise<GatewayApi> {\n return gatewayApi({ url: apiUrl(), cookie: (await headers()).get('cookie') ?? undefined, fleetId });\n}\n\nfunction isApiRefusal(error: unknown): error is TRPCClientError<GatewayRouter> {\n return error instanceof TRPCClientError;\n}\n\n/** The code the API refused a call with, if it refused it. */\nexport function refusalCodeOf(error: unknown): string | undefined {\n return isApiRefusal(error) ? error.data?.code : undefined;\n}\n\n/** Why the API refused a call, as it says it; anything else is no refusal and is thrown on. */\nexport function refusalMessageOf(error: unknown): string {\n if (!isApiRefusal(error)) {\n throw error;\n }\n return error.message;\n}\n\nfunction isInViewRefusal(code: string | undefined): code is InViewRefusal {\n return code === 'UNAUTHORIZED' || code === 'NOT_FOUND';\n}\n\n/**\n * The page as the account signed in, in the fleet its address names; or\n * the browser is sent where it may go. A gateway that signs no one in to\n * its pages answers noSignIn.\n */\nexport async function signedInPage(page: { path: string; searchParams: SearchParams }): Promise<SignedInPage | { kind: 'noSignIn' }> {\n const query = new URLSearchParams();\n for (const [name, value] of Object.entries(page.searchParams)) {\n if (typeof value === 'string') {\n query.set(name, value);\n }\n }\n const fleet = query.get(FLEET_PARAMETER) ?? undefined;\n const asked = query.size === 0 ? page.path : `${page.path}?${query.toString()}`;\n const api = await requestApi(fleet);\n let read: { inView: InView } | { refusal: InViewRefusal };\n try {\n read = { inView: await api.account.inView.query() };\n } catch (error) {\n const code = refusalCodeOf(error);\n if (!isInViewRefusal(code)) {\n throw error;\n }\n read = { refusal: code };\n }\n const account = pageAccountOf(read, asked);\n switch (account.kind) {\n case 'goTo':\n return redirect(account.location);\n case 'noSignIn':\n return account;\n case 'signedIn':\n return { kind: 'signedIn', api, fleetId: account.fleetId, scopes: account.scopes };\n }\n}\n\n/** What a page reads from the API, or why the API refused it, for the page to say in its place. */\nexport type Read<T> = { isOk: true; value: T } | { isOk: false; refusal: string };\n\nexport async function readOf<T>(call: Promise<T>): Promise<Read<T>> {\n try {\n return { isOk: true, value: await call };\n } catch (error) {\n return { isOk: false, refusal: refusalMessageOf(error) };\n }\n}\n","import type { Encoder } from '@trpc/server/adapters/ws';\n\nexport type { Encoder };\n\nexport const jsonEncoder: Encoder = {\n encode: (data) => JSON.stringify(data),\n decode: (data) => {\n if (typeof data !== 'string') {\n throw new Error(\n 'jsonEncoder received binary data. JSON uses text frames. ' +\n 'Use a binary encoder for binary data.',\n );\n }\n return JSON.parse(data);\n },\n};\n","import * as util from \"./util.js\";\n/**\n * @deprecated CUID v1 is deprecated by its authors due to information leakage\n * (timestamps embedded in the id). Use {@link cuid2} instead.\n * See https://github.com/paralleldrive/cuid.\n */\nexport const cuid = /^[cC][0-9a-z]{6,}$/;\nexport const cuid2 = /^[0-9a-z]+$/;\nexport const ulid = /^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/;\nexport const xid = /^[0-9a-vA-V]{20}$/;\nexport const ksuid = /^[A-Za-z0-9]{27}$/;\nexport const nanoid = /^[a-zA-Z0-9_-]{21}$/;\nexport function nanoidOfLength(length) {\n return new RegExp(`^[a-zA-Z0-9_-]{${length}}$`);\n}\n/** ISO 8601-1 duration regex. Does not support the 8601-2 extensions like negative durations or fractional/negative components. */\nexport const duration = /^P(?:(\\d+W)|(?!.*W)(?=\\d|T\\d)(\\d+Y)?(\\d+M)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+([.,]\\d+)?S)?)?)$/;\n/** Implements ISO 8601-2 extensions like explicit +- prefixes, mixing weeks with other units, and fractional/negative components. */\nexport const extendedDuration = /^[-+]?P(?!$)(?:(?:[-+]?\\d+Y)|(?:[-+]?\\d+[.,]\\d+Y$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:(?:[-+]?\\d+W)|(?:[-+]?\\d+[.,]\\d+W$))?(?:(?:[-+]?\\d+D)|(?:[-+]?\\d+[.,]\\d+D$))?(?:T(?=[\\d+-])(?:(?:[-+]?\\d+H)|(?:[-+]?\\d+[.,]\\d+H$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:[-+]?\\d+(?:[.,]\\d+)?S)?)??$/;\n/** A regex for any UUID-like identifier: 8-4-4-4-12 hex pattern */\nexport const guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;\n/** Returns a regex for validating an RFC 9562/4122 UUID.\n *\n * @param version Optionally specify a version 1-8. If no version is specified, all versions are supported. */\nexport const uuid = (version) => {\n if (!version)\n return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;\n return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);\n};\nexport const uuid4 = /*@__PURE__*/ uuid(4);\nexport const uuid6 = /*@__PURE__*/ uuid(6);\nexport const uuid7 = /*@__PURE__*/ uuid(7);\n/** Practical email validation */\nexport const email = /^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$/;\n/** Equivalent to the HTML5 input[type=email] validation implemented by browsers. Source: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/email */\nexport const html5Email = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n/** The classic emailregex.com regex for RFC 5322-compliant emails */\nexport const rfc5322Email = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n/** A loose regex that allows Unicode characters, enforces length limits, and that's about it. */\nexport const unicodeEmail = /^[^\\s@\"]{1,64}@[^\\s@]{1,255}$/u;\nexport const idnEmail = unicodeEmail;\nexport const browserEmail = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n// from https://thekevinscott.com/emojis-in-javascript/#writing-a-regular-expression\n// Single character class, not an alternation: the two properties overlap (U+1F9B0-U+1F9B3), so `(A|B)+` backtracks exponentially on a failed match. The leading lookahead then demands one anchor — a pictograph, a regional indicator, or the enclosing keycap — because `\\p{Emoji_Component}` on its own covers ASCII digits, `#`, `*`, ZWJ, variation selectors and skin tone modifiers, none of which is an emoji without a base.\nconst _emoji = `^(?=[\\\\s\\\\S]*[\\\\p{Extended_Pictographic}\\\\p{Regional_Indicator}\\\\u20E3])[\\\\p{Extended_Pictographic}\\\\p{Emoji_Component}]+$`;\nexport function emoji() {\n return new RegExp(_emoji, \"u\");\n}\nexport const ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;\nexport const ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;\nexport const mac = (delimiter) => {\n const escapedDelim = util.escapeRegex(delimiter ?? \":\");\n return new RegExp(`^(?:[0-9A-F]{2}${escapedDelim}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${escapedDelim}){5}[0-9a-f]{2}$`);\n};\nexport const cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/([0-9]|[1-2][0-9]|3[0-2])$/;\nexport const cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;\n// https://stackoverflow.com/questions/7860392/determine-if-string-is-in-base64-using-javascript\nexport const base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;\nexport const base64url = /^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;\n// based on https://stackoverflow.com/questions/106179/regular-expression-to-match-dns-hostname-or-ip-address\n// export const hostname: RegExp = /^([a-zA-Z0-9-]+\\.)*[a-zA-Z0-9-]+$/;\nexport const hostname = /^(?=.{1,253}\\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\\.?$/;\nexport const domain = /^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,63}$/;\nexport const httpProtocol = /^https?$/;\n// https://blog.stevenlevithan.com/archives/validate-phone-number#r4-3 (regex sans spaces) E.164: leading digit must be 1-9; total digits (excluding '+') between 7-15\nexport const e164 = /^\\+[1-9]\\d{6,14}$/;\n// Credit card shape: 12–19 digits, optionally separated by single spaces or single hyphens. ISO/IEC 7812 caps the PAN at 19 digits; 12 is the shortest issued length (Maestro).\nexport const creditCard = /^\\d(?:[ -]?\\d){11,18}$/;\n// ISO 4217 alpha codes from the SIX list, regenerated by scripts/update-iso-4217.ts\nexport const currencyCode = /^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/;\n// iban electronic format: 2-letter country, check digits 02-98 (the only values `98 - remainder` can produce), 11-30 bban characters\nexport const iban = /^[A-Z]{2}(?!00|01|99)\\d{2}[A-Z0-9]{11,30}$/;\nconst dateSource = `(?:(?:\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\\\d|30)|(?:02)-(?:0[1-9]|1\\\\d|2[0-8])))`;\n/** Anchors a pattern source. The interpolation lives here rather than at the call site because\n * esbuild will not drop a `@__PURE__` call whose own argument interpolates a variable, but it\n * will drop `anchor(dateSource)`. Keeping it inline pinned `date` into every bundle. */\nfunction anchor(source) {\n return new RegExp(`^${source}$`);\n}\nexport const date = /*@__PURE__*/ anchor(dateSource);\nfunction timeSource(args) {\n const hhmm = `(?:[01]\\\\d|2[0-3]):[0-5]\\\\d`;\n const regex = typeof args.precision === \"number\"\n ? args.precision === -1\n ? `${hhmm}`\n : args.precision === 0\n ? `${hhmm}:[0-5]\\\\d`\n : `${hhmm}:[0-5]\\\\d\\\\.\\\\d{${args.precision}}`\n : args.seconds\n ? `${hhmm}:[0-5]\\\\d(?:\\\\.\\\\d+)?`\n : `${hhmm}(?::[0-5]\\\\d(?:\\\\.\\\\d+)?)?`;\n return regex;\n}\nexport function time(args) {\n return new RegExp(`^${timeSource(args)}$`);\n}\n// Adapted from https://stackoverflow.com/a/3143231\nexport function datetime(args) {\n const opts = [\"Z\"];\n // if (args.offset) opts.push(`([+-]\\\\d{2}:\\\\d{2})`);\n if (args.offset)\n opts.push(`([+-](?:[01]\\\\d|2[0-3]):[0-5]\\\\d)`);\n // RFC 3339 mandates seconds wherever the time carries a `Z` or an offset, so only the unqualified form `local` adds may omit them\n const qualified = `${timeSource({ precision: args.precision, seconds: true })}(?:${opts.join(\"|\")})`;\n const timeRegex = args.local ? `${qualified}|${timeSource({ precision: args.precision })}` : qualified;\n return new RegExp(`^${dateSource}T(?:${timeRegex})$`);\n}\n// the unbounded form of `string()` as a literal, so every plain string shares one instance instead of building its own\nexport const anyString = /^[\\s\\S]{0,}$/;\nexport const string = (params) => {\n const regex = params ? `[\\\\s\\\\S]{${params?.minimum ?? 0},${params?.maximum ?? \"\"}}` : `[\\\\s\\\\S]*`;\n return new RegExp(`^${regex}$`);\n};\nexport const bigint = /^-?\\d+n?$/;\nexport const integer = /^-?\\d+$/;\nexport const number = /^-?\\d+(?:\\.\\d+)?$/;\nexport const boolean = /^(?:true|false)$/i;\nconst _null = /^null$/i;\nexport { _null as null };\nconst _undefined = /^undefined$/i;\nexport { _undefined as undefined };\n// regex for string with no uppercase letters\nexport const lowercase = /^[^A-Z]*$/;\n// regex for string with no lowercase letters\nexport const uppercase = /^[^a-z]*$/;\n// regex for hexadecimal strings (any length)\nexport const hex = /^[0-9a-fA-F]*$/;\n// Hash regexes for different algorithms and encodings\n// Helper function to create base64 regex with exact length and padding\nfunction fixedBase64(bodyLength, padding) {\n return new RegExp(`^[A-Za-z0-9+/]{${bodyLength}}${padding}$`);\n}\n// Helper function to create base64url regex with exact length (no padding)\nfunction fixedBase64url(length) {\n return new RegExp(`^[A-Za-z0-9_-]{${length}}$`);\n}\n// MD5 (16 bytes): base64 = 24 chars total (22 + \"==\")\nexport const md5_hex = /^[0-9a-fA-F]{32}$/;\nexport const md5_base64 = /*@__PURE__*/ fixedBase64(22, \"==\");\nexport const md5_base64url = /*@__PURE__*/ fixedBase64url(22);\n// SHA1 (20 bytes): base64 = 28 chars total (27 + \"=\")\nexport const sha1_hex = /^[0-9a-fA-F]{40}$/;\nexport const sha1_base64 = /*@__PURE__*/ fixedBase64(27, \"=\");\nexport const sha1_base64url = /*@__PURE__*/ fixedBase64url(27);\n// SHA256 (32 bytes): base64 = 44 chars total (43 + \"=\")\nexport const sha256_hex = /^[0-9a-fA-F]{64}$/;\nexport const sha256_base64 = /*@__PURE__*/ fixedBase64(43, \"=\");\nexport const sha256_base64url = /*@__PURE__*/ fixedBase64url(43);\n// SHA384 (48 bytes): base64 = 64 chars total (no padding)\nexport const sha384_hex = /^[0-9a-fA-F]{96}$/;\nexport const sha384_base64 = /*@__PURE__*/ fixedBase64(64, \"\");\nexport const sha384_base64url = /*@__PURE__*/ fixedBase64url(64);\n// SHA512 (64 bytes): base64 = 88 chars total (86 + \"==\")\nexport const sha512_hex = /^[0-9a-fA-F]{128}$/;\nexport const sha512_base64 = /*@__PURE__*/ fixedBase64(86, \"==\");\nexport const sha512_base64url = /*@__PURE__*/ fixedBase64url(86);\n","unable to read source [project]/node_modules/@aeolus-fleet/common/src/schemas/account-token.ts","import * as checks from \"./checks.js\";\nimport * as core from \"./core.js\";\nimport { Doc } from \"./doc.js\";\nimport { parse, parseAsync } from \"./parse.js\";\nimport * as regexes from \"./regexes.js\";\nimport * as util from \"./util.js\";\nimport { version } from \"./versions.js\";\nexport const $ZodType = /*@__PURE__*/ core.$constructor(\"$ZodType\", (inst, def) => {\n var _a;\n inst ?? (inst = {});\n inst._zod.def = def; // set _def property\n inst._zod.bag = inst._zod.bag || {}; // initialize _bag object\n inst._zod.version = version;\n const defChecks = inst._zod.def.checks;\n // if inst is itself a checks.$ZodCheck, run it as a check\n const checks = inst._zod.traits.has(\"$ZodCheck\")\n ? [inst, ...(defChecks ?? [])]\n : defChecks?.length\n ? [...defChecks]\n : [];\n for (const ch of checks) {\n for (const fn of ch._zod.onattach) {\n fn(inst);\n }\n }\n if (checks.length === 0) {\n // deferred initializer inst._zod.parse is not yet defined\n (_a = inst._zod).deferred ?? (_a.deferred = []);\n inst._zod.deferred?.push(() => {\n inst._zod.run = inst._zod.parse;\n });\n }\n else {\n const runChecks = (payload, checks, ctx) => {\n if (payload.memo)\n return payload;\n let isAborted = util.aborted(payload);\n let asyncResult;\n for (const ch of checks) {\n if (ch._zod.def.when) {\n if (util.explicitlyAborted(payload))\n continue;\n const shouldRun = ch._zod.def.when(payload);\n if (!shouldRun)\n continue;\n }\n else if (isAborted) {\n continue;\n }\n const currLen = payload.issues.length;\n const _ = ch._zod.check(payload);\n if (_ instanceof Promise && ctx?.async === false) {\n throw new core.$ZodAsyncError();\n }\n if (asyncResult || _ instanceof Promise) {\n asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {\n await _;\n const nextLen = payload.issues.length;\n if (nextLen === currLen)\n return;\n util.attachSchema(payload.issues, currLen, inst);\n if (!isAborted)\n isAborted = util.aborted(payload, currLen);\n });\n }\n else {\n const nextLen = payload.issues.length;\n if (nextLen === currLen)\n continue;\n util.attachSchema(payload.issues, currLen, inst);\n if (!isAborted)\n isAborted = util.aborted(payload, currLen);\n }\n }\n if (asyncResult) {\n return asyncResult.then(() => {\n return payload;\n });\n }\n return payload;\n };\n const handleCanaryResult = (canary, payload, ctx) => {\n // abort if the canary is aborted\n if (util.aborted(canary)) {\n canary.aborted = true;\n return canary;\n }\n // run checks first, then\n const checkResult = runChecks(payload, checks, ctx);\n if (checkResult instanceof Promise) {\n if (ctx.async === false)\n throw new core.$ZodAsyncError();\n return checkResult.then((checkResult) => inst._zod.parse(checkResult, ctx));\n }\n return inst._zod.parse(checkResult, ctx);\n };\n inst._zod.run = (payload, ctx) => {\n if (ctx.skipChecks) {\n return inst._zod.parse(payload, ctx);\n }\n if (ctx.direction === \"backward\") {\n // run canary initial pass (no checks)\n const canary = inst._zod.parse({ value: payload.value, issues: [] }, { ...ctx, skipChecks: true });\n if (canary instanceof Promise) {\n return canary.then((canary) => {\n return handleCanaryResult(canary, payload, ctx);\n });\n }\n return handleCanaryResult(canary, payload, ctx);\n }\n // forward\n const result = inst._zod.parse(payload, ctx);\n if (result instanceof Promise) {\n if (ctx.async === false)\n throw new core.$ZodAsyncError();\n return result.then((result) => runChecks(result, checks, ctx));\n }\n return runChecks(result, checks, ctx);\n };\n }\n}, {\n // Wrappers extend this by installing a richer factory over it; reading it eagerly would defeat the laziness.\n get \"~standard\"() {\n return util.hide(this, \"~standard\", standardProps(this));\n },\n set \"~standard\"(value) {\n util.own(this, \"~standard\", value);\n },\n});\n/** The Standard Schema surface for `inst`. Shared so wrappers can extend it without forcing it. */\n// a Standard Schema result only reports issues, so a failure finalizes them straight off the raw payload: no ZodError, and no lazy result to read through\nconst toStandardResult = (r, ctx) => r.issues.length ? { issues: r.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())) } : { value: r.value };\nasync function validateAsync(inst, value) {\n const ctx = { async: true };\n return toStandardResult((await inst._zod.run({ value, issues: [] }, ctx)), ctx);\n}\nexport function standardProps(inst) {\n return {\n validate: (value) => {\n const ctx = { async: false };\n try {\n const r = inst._zod.run({ value, issues: [] }, ctx);\n if (!(r instanceof Promise))\n return toStandardResult(r, ctx);\n }\n catch (_) { }\n // async function so a synchronously throwing check rejects instead of escaping validate\n return validateAsync(inst, value);\n },\n vendor: \"zod\",\n version: 1,\n };\n}\nexport { clone } from \"./util.js\";\nexport const $ZodString = /*@__PURE__*/ core.$constructor(\"$ZodString\", (inst, def) => {\n $ZodType.init(inst, def);\n // a format's own pattern, else unbounded; a template literal derives the check-aware form itself\n inst._zod.pattern = def.pattern ?? regexes.anyString;\n inst._zod.parse = (payload, _) => {\n if (def.coerce)\n try {\n payload.value = String(payload.value);\n }\n catch (_) { }\n if (typeof payload.value === \"string\")\n return payload;\n payload.issues.push({\n expected: \"string\",\n code: \"invalid_type\",\n input: payload.value,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodStringFormat = /*@__PURE__*/ core.$constructor(\"$ZodStringFormat\", (inst, def) => {\n // check initialization must come first\n checks.$ZodCheckStringFormat.init(inst, def);\n $ZodString.init(inst, def);\n});\nexport const $ZodGUID = /*@__PURE__*/ core.$constructor(\"$ZodGUID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.guid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodUUID = /*@__PURE__*/ core.$constructor(\"$ZodUUID\", (inst, def) => {\n if (def.version) {\n const versionMap = {\n v1: 1,\n v2: 2,\n v3: 3,\n v4: 4,\n v5: 5,\n v6: 6,\n v7: 7,\n v8: 8,\n };\n const v = versionMap[def.version];\n if (v === undefined)\n throw new Error(`Invalid UUID version: \"${def.version}\"`);\n def.pattern ?? (def.pattern = regexes.uuid(v));\n }\n else\n def.pattern ?? (def.pattern = regexes.uuid());\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodEmail = /*@__PURE__*/ core.$constructor(\"$ZodEmail\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.email);\n $ZodStringFormat.init(inst, def);\n});\n/** The `://` guard rejected the input before the URL constructor saw it. */\nexport const URL_BAD_FORMAT = 1;\n/** The URL parser rejected the input. */\nexport const URL_UNPARSEABLE = 2;\nexport function canParseURL(input) {\n try {\n if (typeof URL !== \"undefined\" && typeof URL.canParse === \"function\")\n return URL.canParse(input);\n new URL(input);\n return true;\n }\n catch {\n return false;\n }\n}\nexport function validateURL(trimmed, def) {\n if (!(\"normalize\" in def) && !(\"hostname\" in def) && !(\"protocol\" in def)) {\n return canParseURL(trimmed) || URL_UNPARSEABLE;\n }\n return parseURLObject(trimmed, def);\n}\n/** Parses a URL while preserving the non-normalizing HTTP guard. */\nexport function parseURLObject(trimmed, def) {\n // When normalize is off, require :// for http/https URLs. This prevents strings like \"http:example.com\" or \"https:/path\" from being silently accepted\n if (!def.normalize && def.protocol?.source === regexes.httpProtocol.source && !/^https?:\\/\\//i.test(trimmed)) {\n return URL_BAD_FORMAT;\n }\n try {\n if (typeof URL !== \"undefined\") {\n const URLStatic = URL;\n if (typeof URLStatic.parse === \"function\")\n return URLStatic.parse(trimmed) ?? URL_UNPARSEABLE;\n }\n // @ts-ignore\n return new URL(trimmed);\n }\n catch {\n return URL_UNPARSEABLE;\n }\n}\nconst asciiTabOrNewline = /[\\t\\n\\r]/g;\n/** The URL parser deletes every ASCII tab, LF and CR from its input before it parses, so `new URL(\"https://exa\\nmple.com\")` reports on `example.com`. Applying the same deletion to the returned value closes the half of that divergence which can move the host; the parser's other rewrite, stripping C0 controls at the edges, cannot. */\nexport function stripTabAndNewline(value) {\n return value.replace(asciiTabOrNewline, \"\");\n}\nexport function urlHostnameOk(url, hostname) {\n hostname.lastIndex = 0;\n return hostname.test(url.hostname);\n}\nexport function urlProtocolOk(url, protocol) {\n protocol.lastIndex = 0;\n return protocol.test(url.protocol.endsWith(\":\") ? url.protocol.slice(0, -1) : url.protocol);\n}\nexport const $ZodURL = /*@__PURE__*/ core.$constructor(\"$ZodURL\", (inst, def) => {\n $ZodStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n try {\n // Trim whitespace from input\n const trimmed = payload.value.trim();\n const url = validateURL(trimmed, def);\n if (url === URL_BAD_FORMAT) {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"url\",\n note: \"Invalid URL format\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n return;\n }\n if (url === URL_UNPARSEABLE) {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"url\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n return;\n }\n if (url === true) {\n payload.value = stripTabAndNewline(trimmed);\n return;\n }\n if (def.hostname && !urlHostnameOk(url, def.hostname)) {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"url\",\n note: \"Invalid hostname\",\n pattern: def.hostname.source,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n }\n if (def.protocol && !urlProtocolOk(url, def.protocol)) {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"url\",\n note: \"Invalid protocol\",\n pattern: def.protocol.source,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n }\n // Set the output value based on normalize flag\n payload.value = def.normalize ? url.href : stripTabAndNewline(trimmed);\n return;\n }\n catch (_) {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"url\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n }\n };\n});\nexport const $ZodEmoji = /*@__PURE__*/ core.$constructor(\"$ZodEmoji\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.emoji());\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodNanoID = /*@__PURE__*/ core.$constructor(\"$ZodNanoID\", (inst, def) => {\n if (def.length !== undefined && (!Number.isInteger(def.length) || def.length < 1))\n throw new Error(`Invalid nanoid length: ${def.length}`);\n def.pattern ?? (def.pattern = def.length === undefined ? regexes.nanoid : regexes.nanoidOfLength(def.length));\n $ZodStringFormat.init(inst, def);\n});\n/**\n * @deprecated CUID v1 is deprecated by its authors due to information leakage\n * (timestamps embedded in the id). Use {@link $ZodCUID2} instead.\n * See https://github.com/paralleldrive/cuid.\n */\nexport const $ZodCUID = /*@__PURE__*/ core.$constructor(\"$ZodCUID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.cuid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodCUID2 = /*@__PURE__*/ core.$constructor(\"$ZodCUID2\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.cuid2);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodULID = /*@__PURE__*/ core.$constructor(\"$ZodULID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.ulid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodXID = /*@__PURE__*/ core.$constructor(\"$ZodXID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.xid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodKSUID = /*@__PURE__*/ core.$constructor(\"$ZodKSUID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.ksuid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodISODateTime = /*@__PURE__*/ core.$constructor(\"$ZodISODateTime\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.datetime(def));\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodISODate = /*@__PURE__*/ core.$constructor(\"$ZodISODate\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.date);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodISOTime = /*@__PURE__*/ core.$constructor(\"$ZodISOTime\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.time(def));\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodISODuration = /*@__PURE__*/ core.$constructor(\"$ZodISODuration\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.duration);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodIPv4 = /*@__PURE__*/ core.$constructor(\"$ZodIPv4\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.ipv4);\n $ZodStringFormat.init(inst, def);\n});\n/** An IPv6 address is written with hex digits, colons and dots, and nothing else. The guard is what makes the check below an IPv6 check: `new URL(\"http://[...]\")` parses an authority, not an address, so `@` and `\\` re-delimit it and `\"::@1\\\\\"` validates against the host `0.0.0.1`. The URL parser also deletes ASCII tab, LF and CR rather than failing, which is how `\"::1\\n\"` validated as `::1`. */\nconst ipv6Alphabet = /^[0-9a-fA-F:.]+$/;\nexport function isValidIPv6(value) {\n if (!ipv6Alphabet.test(value))\n return false;\n return canParseURL(`http://[${value}]`);\n}\nexport const $ZodIPv6 = /*@__PURE__*/ core.$constructor(\"$ZodIPv6\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.ipv6);\n $ZodStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n if (!isValidIPv6(payload.value)) {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"ipv6\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n }\n };\n});\nexport const $ZodMAC = /*@__PURE__*/ core.$constructor(\"$ZodMAC\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.mac(def.delimiter));\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodCIDRv4 = /*@__PURE__*/ core.$constructor(\"$ZodCIDRv4\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.cidrv4);\n $ZodStringFormat.init(inst, def);\n});\nexport function isValidCIDRv6(value) {\n const parts = value.split(\"/\");\n if (parts.length !== 2)\n return false;\n const [address, prefix] = parts;\n if (!prefix)\n return false;\n const prefixNum = Number(prefix);\n if (`${prefixNum}` !== prefix)\n return false;\n if (prefixNum < 0 || prefixNum > 128)\n return false;\n return isValidIPv6(address);\n}\nexport const $ZodCIDRv6 = /*@__PURE__*/ core.$constructor(\"$ZodCIDRv6\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.cidrv6); // not used for validation\n $ZodStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n if (!isValidCIDRv6(payload.value)) {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"cidrv6\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n }\n };\n});\n////////////////////////////// ZodBase64 //////////////////////////////\nexport function isValidBase64(data) {\n if (data === \"\")\n return true;\n // atob ignores whitespace, so reject it up front.\n if (/\\s/.test(data))\n return false;\n if (data.length % 4 !== 0)\n return false;\n try {\n // @ts-ignore\n atob(data);\n return true;\n }\n catch {\n return false;\n }\n}\n// lax on purpose: the quantified regexes.base64 overflows the regex stack on multi-MB input and its leading ^$| alternation leaks through template-literal composition; isValidBase64 enforces length and padding\nexport const base64Charset = /^[0-9a-zA-Z+/]*={0,2}$/;\nexport const $ZodBase64 = /*@__PURE__*/ core.$constructor(\"$ZodBase64\", (inst, def) => {\n def.pattern ?? (def.pattern = base64Charset);\n $ZodStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n if (isValidBase64(payload.value))\n return;\n payload.issues.push({\n code: \"invalid_format\",\n format: \"base64\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\n////////////////////////////// ZodBase64URL //////////////////////////////\n// lax on purpose: the quantified regexes.base64url overflows the regex stack on multi-MB input; isValidBase64 enforces length on the padded string\nexport const base64urlCharset = /^[A-Za-z0-9_-]*$/;\nexport function isValidBase64URL(data) {\n if (!base64urlCharset.test(data))\n return false;\n const base64 = data.replace(/[-_]/g, (c) => (c === \"-\" ? \"+\" : \"/\"));\n const padded = base64.padEnd(Math.ceil(base64.length / 4) * 4, \"=\");\n return isValidBase64(padded);\n}\nexport const $ZodBase64URL = /*@__PURE__*/ core.$constructor(\"$ZodBase64URL\", (inst, def) => {\n def.pattern ?? (def.pattern = base64urlCharset);\n $ZodStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n if (isValidBase64URL(payload.value))\n return;\n payload.issues.push({\n code: \"invalid_format\",\n format: \"base64url\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodE164 = /*@__PURE__*/ core.$constructor(\"$ZodE164\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.e164);\n $ZodStringFormat.init(inst, def);\n});\n////////////////////////////// ZodCreditCard //////////////////////////////\nconst CC_SANITIZE = /[- ]/g;\n/** Luhn checksum on a digit-only string. Adapted from valibot (MIT). */\nfunction isLuhnAlgo(digits) {\n let length = digits.length;\n let bit = 1;\n let sum = 0;\n while (length) {\n const value = digits.charCodeAt(--length) - 48;\n bit ^= 1;\n sum += bit ? [0, 2, 4, 6, 8, 1, 3, 5, 7, 9][value] : value;\n }\n return sum % 10 === 0;\n}\nexport function isValidCreditCard(input) {\n if (!regexes.creditCard.test(input))\n return false;\n return isLuhnAlgo(input.replace(CC_SANITIZE, \"\"));\n}\nexport const $ZodCreditCard = /*@__PURE__*/ core.$constructor(\"$ZodCreditCard\", (inst, def) => {\n // Shape only — the Luhn check below is not expressible as a pattern, so consumers of `pattern` (JSON Schema, template literals) get the length and separator rules alone.\n def.pattern ?? (def.pattern = regexes.creditCard);\n $ZodStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n if (isValidCreditCard(payload.value))\n return;\n payload.issues.push({\n code: \"invalid_format\",\n format: \"credit_card\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\n////////////////////////////// ZodIBAN //////////////////////////////\n// iso 7064 mod 97-10 checksum without BigInt\nfunction isIso7064Mod97(iban) {\n let remainder = 0;\n const len = iban.length;\n for (let i = 4; i < len; i++) {\n const code = iban.charCodeAt(i);\n remainder = (code >= 65 ? remainder * 100 + (code - 55) : remainder * 10 + (code - 48)) % 97;\n }\n for (let i = 0; i < 4; i++) {\n const code = iban.charCodeAt(i);\n remainder = (code >= 65 ? remainder * 100 + (code - 55) : remainder * 10 + (code - 48)) % 97;\n }\n return remainder === 1;\n}\nexport function isValidIBAN(input) {\n if (!regexes.iban.test(input))\n return false;\n return isIso7064Mod97(input);\n}\nexport const $ZodIBAN = /*@__PURE__*/ core.$constructor(\"$ZodIBAN\", (inst, def) => {\n // shape only — checksum is not expressible as a pattern\n def.pattern ?? (def.pattern = regexes.iban);\n $ZodStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n if (isValidIBAN(payload.value))\n return;\n payload.issues.push({\n code: \"invalid_format\",\n format: \"iban\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\n////////////////////////////// ZodJWT //////////////////////////////\nexport function isValidJWT(token, algorithm = null) {\n try {\n const tokensParts = token.split(\".\");\n if (tokensParts.length !== 3)\n return false;\n const [header] = tokensParts;\n if (!header)\n return false;\n // @ts-ignore\n const parsedHeader = JSON.parse(atob(header));\n if (\"typ\" in parsedHeader && parsedHeader?.typ !== \"JWT\")\n return false;\n if (!parsedHeader.alg)\n return false;\n if (algorithm && (!(\"alg\" in parsedHeader) || parsedHeader.alg !== algorithm))\n return false;\n return true;\n }\n catch {\n return false;\n }\n}\nexport const $ZodJWT = /*@__PURE__*/ core.$constructor(\"$ZodJWT\", (inst, def) => {\n $ZodStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n if (isValidJWT(payload.value, def.alg))\n return;\n payload.issues.push({\n code: \"invalid_format\",\n format: \"jwt\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCustomStringFormat = /*@__PURE__*/ core.$constructor(\"$ZodCustomStringFormat\", (inst, def) => {\n $ZodStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n if (def.fn(payload.value))\n return;\n payload.issues.push({\n code: \"invalid_format\",\n format: def.format,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodNumber = /*@__PURE__*/ core.$constructor(\"$ZodNumber\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = regexes.number;\n inst._zod.parse = (payload, _ctx) => {\n if (def.coerce)\n try {\n payload.value = Number(payload.value);\n }\n catch (_) { }\n const input = payload.value;\n if (typeof input === \"number\" && !Number.isNaN(input) && Number.isFinite(input)) {\n return payload;\n }\n const received = typeof input === \"number\"\n ? Number.isNaN(input)\n ? \"NaN\"\n : !Number.isFinite(input)\n ? String(input)\n : undefined\n : undefined;\n payload.issues.push({\n expected: \"number\",\n code: \"invalid_type\",\n input,\n inst,\n ...(received ? { received } : {}),\n });\n return payload;\n };\n});\nexport const $ZodNumberFormat = /*@__PURE__*/ core.$constructor(\"$ZodNumberFormat\", (inst, def) => {\n checks.$ZodCheckNumberFormat.init(inst, def);\n $ZodNumber.init(inst, def); // no format checks\n});\nexport const $ZodBoolean = /*@__PURE__*/ core.$constructor(\"$ZodBoolean\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = regexes.boolean;\n inst._zod.parse = (payload, _ctx) => {\n if (def.coerce)\n try {\n payload.value = Boolean(payload.value);\n }\n catch (_) { }\n const input = payload.value;\n if (typeof input === \"boolean\")\n return payload;\n payload.issues.push({\n expected: \"boolean\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodBigInt = /*@__PURE__*/ core.$constructor(\"$ZodBigInt\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = regexes.bigint;\n inst._zod.parse = (payload, _ctx) => {\n if (def.coerce)\n try {\n payload.value = BigInt(payload.value);\n }\n catch (_) { }\n if (typeof payload.value === \"bigint\")\n return payload;\n payload.issues.push({\n expected: \"bigint\",\n code: \"invalid_type\",\n input: payload.value,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodBigIntFormat = /*@__PURE__*/ core.$constructor(\"$ZodBigIntFormat\", (inst, def) => {\n checks.$ZodCheckBigIntFormat.init(inst, def);\n $ZodBigInt.init(inst, def); // no format checks\n});\nexport const $ZodSymbol = /*@__PURE__*/ core.$constructor(\"$ZodSymbol\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (typeof input === \"symbol\")\n return payload;\n payload.issues.push({\n expected: \"symbol\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodUndefined = /*@__PURE__*/ core.$constructor(\"$ZodUndefined\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = regexes.undefined;\n inst._zod.values = new Set([undefined]);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (typeof input === \"undefined\")\n return payload;\n payload.issues.push({\n expected: \"undefined\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodNull = /*@__PURE__*/ core.$constructor(\"$ZodNull\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = regexes.null;\n inst._zod.values = new Set([null]);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (input === null)\n return payload;\n payload.issues.push({\n expected: \"null\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodAny = /*@__PURE__*/ core.$constructor(\"$ZodAny\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload) => payload;\n});\nexport const $ZodUnknown = /*@__PURE__*/ core.$constructor(\"$ZodUnknown\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload) => payload;\n});\nexport const $ZodNever = /*@__PURE__*/ core.$constructor(\"$ZodNever\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n payload.issues.push({\n expected: \"never\",\n code: \"invalid_type\",\n input: payload.value,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodVoid = /*@__PURE__*/ core.$constructor(\"$ZodVoid\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (typeof input === \"undefined\")\n return payload;\n payload.issues.push({\n expected: \"void\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodDate = /*@__PURE__*/ core.$constructor(\"$ZodDate\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n if (def.coerce) {\n try {\n payload.value = new Date(payload.value);\n }\n catch (_err) { }\n }\n const input = payload.value;\n const isDate = input instanceof Date;\n const isValidDate = isDate && !Number.isNaN(input.getTime());\n if (isValidDate)\n return payload;\n payload.issues.push({\n expected: \"date\",\n code: \"invalid_type\",\n input,\n ...(isDate ? { received: \"Invalid Date\" } : {}),\n inst,\n });\n return payload;\n };\n});\n// an oversized container fails its leading size checks before any element is parsed\nfunction capSize(inst, size) {\n const caps = util.sizeCaps(inst._zod.def.checks);\n if (!caps.length)\n return;\n const cap = Math.min(...caps.map((c) => c[0]));\n const parse = inst._zod.parse;\n inst._zod.parse = (payload, ctx) => {\n const n = size(payload.value);\n if (n > cap && !ctx?.skipChecks && ctx?.direction !== \"backward\") {\n for (const [max, ch] of util.sizeCaps(inst._zod.def.checks)) {\n if (n > max && ch._zod.def.when(payload)) {\n const start = payload.issues.length;\n ch._zod.check(payload);\n // the value is still the raw input, so no later check may read it\n payload.issues[start].continue = false;\n util.attachSchema(payload.issues, start, inst);\n return payload;\n }\n }\n }\n return parse(payload, ctx);\n };\n}\nconst arraySize = (input) => (Array.isArray(input) ? input.length : -1);\nconst mapSize = (input) => (input instanceof Map ? input.size : -1);\nconst setSize = (input) => (input instanceof Set ? input.size : -1);\nfunction handleArrayResult(result, final, index) {\n if (result.issues.length) {\n final.issues.push(...util.prefixIssues(index, result.issues));\n }\n final.value[index] = result.value;\n}\nexport const $ZodArray = /*@__PURE__*/ core.$constructor(\"$ZodArray\", (inst, def) => {\n $ZodType.init(inst, def);\n const memo = core.globalConfig.memoizer;\n memo?.attach(inst);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!Array.isArray(input)) {\n payload.issues.push({\n expected: \"array\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n }\n payload.value = memo ? memo.alloc(inst, payload, Array(input.length), ctx) : Array(input.length);\n const proms = [];\n const abortEarly = ctx?.abortEarly;\n for (let i = 0; i < input.length; i++) {\n const item = input[i];\n const result = def.element._zod.run({\n value: item,\n issues: [],\n }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => handleArrayResult(result, payload, i)));\n }\n else {\n handleArrayResult(result, payload, i);\n // the element's payload is authoritative here, since handleArrayResult forwards every issue; an object's is not, because it drops a failed absent optional\n if (abortEarly && result.issues.length !== 0 && util.aborted(result))\n break;\n }\n }\n if (proms.length) {\n return Promise.all(proms).then(() => payload);\n }\n return payload; //handleArrayResultsAsync(parseResults, final);\n };\n capSize(inst, arraySize);\n});\nfunction handlePropertyResult(result, final, key, input, optin, optout) {\n const isPresent = key in input;\n const isOptionalOut = optout === \"optional\";\n // The middle rung means \"absence permitted, nothing supplied in its place\", so an absent key contributes nothing — whatever the schema made of `undefined` is invented, not substituted. Only `optional` reaches this with a value: `defaulted` substitutes, and a schema that isn't optional-out has to keep the key.\n if (!isPresent && isOptionalOut && optin === \"optional\") {\n return;\n }\n if (result.issues.length) {\n // For optional-in/out schemas, ignore errors on absent keys.\n if (optin !== undefined && isOptionalOut && !isPresent) {\n return;\n }\n final.issues.push(...util.prefixIssues(key, result.issues));\n }\n if (!isPresent && optin === undefined) {\n if (!result.issues.length) {\n final.issues.push({\n code: \"invalid_type\",\n expected: \"nonoptional\",\n input: undefined,\n path: [key],\n });\n }\n return;\n }\n if (result.value === undefined) {\n if (isPresent || (optin === \"defaulted\" && !isOptionalOut)) {\n final.value[key] = undefined;\n }\n }\n else {\n final.value[key] = result.value;\n }\n}\n// one shared instance; a fresh [] per schema cost 56 bytes retained\nconst NO_SYMBOL_KEYS = [];\nfunction normalizeDef(def) {\n const keys = Object.keys(def.shape);\n const ownSymbols = Object.getOwnPropertySymbols(def.shape);\n const symbolKeys = ownSymbols.length ? ownSymbols : NO_SYMBOL_KEYS;\n // aliases `keys` when there are no symbols, so a string-only shape keeps one array\n const allKeys = symbolKeys.length ? [...keys, ...symbolKeys] : keys;\n for (const k of allKeys) {\n if (!def.shape?.[k]?._zod?.traits?.has(\"$ZodType\")) {\n throw new Error(`Invalid element at key \"${String(k)}\": expected a Zod schema`);\n }\n }\n const okeys = util.optionalKeys(def.shape);\n return {\n ...def,\n allKeys,\n symbolKeys,\n // string-only: handleCatchall matches it against `for...in`, which never yields a symbol\n keySet: new Set(keys),\n numKeys: keys.length,\n optionalKeys: new Set(okeys),\n };\n}\nfunction handleCatchall(proms, input, payload, ctx, def, inst, abortEarly) {\n const unrecognized = [];\n const keySet = def.keySet;\n const _catchall = def.catchall._zod;\n const t = _catchall.def.type;\n const optin = _catchall.optin;\n const optout = _catchall.optout;\n // starts at 0, not the current length: the shape phase already ran and may have aborted\n let seen = 0;\n for (const key in input) {\n if (abortEarly && payload.issues.length !== seen) {\n if (util.aborted(payload, seen))\n break;\n seen = payload.issues.length;\n }\n // Must precede the __proto__ branch: a declared key is not unrecognized, even though the shape loop deliberately strips __proto__ from the parsed output.\n if (keySet.has(key))\n continue;\n // Don't copy an undeclared __proto__ into the result; assignment to a plain {} would replace the result prototype. But in strict mode it is still an unknown key, so report it before skipping.\n if (key === \"__proto__\") {\n if (t === \"never\")\n unrecognized.push(key);\n continue;\n }\n if (t === \"never\") {\n unrecognized.push(key);\n continue;\n }\n const r = _catchall.run({ value: input[key], issues: [] }, ctx);\n if (r instanceof Promise) {\n proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, optin, optout)));\n }\n else {\n handlePropertyResult(r, payload, key, input, optin, optout);\n }\n }\n if (unrecognized.length) {\n payload.issues.push({\n code: \"unrecognized_keys\",\n keys: unrecognized,\n input,\n inst,\n // Describes the shape of the input, not the validity of the parsed value, so it never aborts. The parse still fails; the schema's own checks just get to run first, and an enclosing intersection can reconcile the key against a sibling operand.\n continue: true,\n });\n }\n if (!proms.length)\n return payload;\n return Promise.all(proms).then(() => {\n return payload;\n });\n}\nexport const $ZodObject = /*@__PURE__*/ core.$constructor(\"$ZodObject\", (inst, def) => {\n // requires cast because technically $ZodObject doesn't extend\n $ZodType.init(inst, def);\n const desc = Object.getOwnPropertyDescriptor(def, \"shape\");\n // a cloned def carries its source's accessor, which knows the shape it answers from; adopting that keeps the clone's keys readable without running it\n const sh = desc?.get ? desc.get.raw : (def.shape ?? {});\n if (sh) {\n // Freezes the shape on first read, so its getters resolve once and every later read sees the same schemas.\n const get = () => {\n const newSh = { ...sh };\n Object.defineProperty(def, \"shape\", { value: newSh });\n get.raw = newSh;\n return newSh;\n };\n get.raw = sh;\n Object.defineProperty(def, \"shape\", { get });\n }\n const _normalized = util.cached(() => normalizeDef(def));\n util.defineLazyInternal(inst, \"propValues\", (zod) => {\n const shape = zod.def.shape;\n const propValues = {};\n for (const key in shape) {\n const field = shape[key]._zod;\n if (field.values) {\n if (!Object.prototype.hasOwnProperty.call(propValues, key)) {\n util.assignProp(propValues, key, new Set());\n }\n for (const v of field.values)\n propValues[key].add(v);\n // An omittable slot reads back as undefined at a discriminator lookup, so it has to claim undefined: two options that can both omit the key are not discriminable on it.\n if (field.optin !== undefined)\n propValues[key].add(undefined);\n }\n }\n return propValues;\n });\n const isObject = util.isObject;\n const catchall = def.catchall;\n let value;\n const memo = core.globalConfig.memoizer;\n memo?.attach(inst);\n inst._zod.parse = (payload, ctx) => {\n value ?? (value = _normalized.value);\n const input = payload.value;\n if (!isObject(input)) {\n payload.issues.push({\n expected: \"object\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n }\n payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};\n const proms = [];\n const shape = value.shape;\n const abortEarly = ctx?.abortEarly;\n let seen = payload.issues.length;\n for (const key of value.allKeys) {\n if (abortEarly && payload.issues.length !== seen) {\n if (util.aborted(payload, seen))\n break;\n seen = payload.issues.length;\n }\n if (key === \"__proto__\")\n continue;\n const el = shape[key];\n const optin = el._zod.optin;\n const optout = el._zod.optout;\n const r = el._zod.run({ value: input[key], issues: [] }, ctx);\n if (r instanceof Promise) {\n proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, optin, optout)));\n }\n else {\n handlePropertyResult(r, payload, key, input, optin, optout);\n }\n }\n if (!catchall) {\n return proms.length ? Promise.all(proms).then(() => payload) : payload;\n }\n return handleCatchall(proms, input, payload, ctx, _normalized.value, inst, abortEarly === true);\n };\n});\nexport const $ZodObjectJIT = /*@__PURE__*/ core.$constructor(\"$ZodObjectJIT\", (inst, def) => {\n // requires cast because technically $ZodObject doesn't extend\n $ZodObject.init(inst, def);\n const superParse = inst._zod.parse;\n const _normalized = util.cached(() => normalizeDef(def));\n const memo = core.globalConfig.memoizer;\n const generateFastpass = (shape) => {\n const normalized = _normalized.value;\n const syms = normalized.symbolKeys;\n // a symbol has no source literal, so it is read as `syms[i]` off the closed-over scope\n const doc = new Doc([\"payload\", \"ctx\"], { shape, inst, memo, syms });\n const parseStr = (k) => `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;\n // prefixes in place, like util.prefixIssues. newResult must land before the early return: a catchall runs after this and would otherwise write onto the caller's input\n const prefixStr = (id, k) => `\n let ${id}_ab = false;\n for (let i = 0; i < ${id}.issues.length; i++) {\n const iss = ${id}.issues[i];\n iss.path = iss.path ? [${k}, ...iss.path] : [${k}];\n payload.issues.push(iss);\n if (iss.continue !== true) ${id}_ab = true;\n }\n if (${id}_ab && ctx && ctx.abortEarly) {\n payload.value = newResult;\n return payload;\n }`;\n doc.write(`const input = payload.value;`);\n const ids = Object.create(null);\n let counter = 0;\n for (const key of normalized.allKeys) {\n ids[key] = `key_${counter++}`;\n }\n // A: preserve key order {\n doc.write(memo ? `const newResult = memo.alloc(inst, payload, {}, ctx);` : `const newResult = {};`);\n for (const key of normalized.allKeys) {\n if (key === \"__proto__\")\n continue;\n const id = ids[key];\n const k = typeof key === \"symbol\" ? `syms[${syms.indexOf(key)}]` : util.esc(key);\n const isPresent = `${k} in input`;\n const schema = shape[key];\n const optin = schema?._zod?.optin;\n const isOptionalIn = optin !== undefined;\n const isOptionalOut = schema?._zod?.optout === \"optional\";\n doc.write(`const ${id} = ${parseStr(k)};`);\n if (isOptionalIn && isOptionalOut) {\n // For optional-in/out schemas, ignore errors on absent keys — and, like the interpreted path, drop the value produced alongside them. The middle rung goes further: it permits absence without supplying anything in its place, so an absent key contributes nothing at all.\n const assign = optin === \"optional\" ? `${id}_present` : `${id}.value !== undefined || ${id}_present`;\n doc.write(`\n const ${id}_present = ${isPresent};\n if (!${id}.issues.length || ${id}_present) {\n if (${id}.issues.length) {${prefixStr(id, k)}\n }\n\n if (${assign}) {\n newResult[${k}] = ${id}.value;\n }\n }\n\n `);\n }\n else if (!isOptionalIn) {\n doc.write(`\n const ${id}_present = ${isPresent};\n if (${id}.issues.length) {${prefixStr(id, k)}\n }\n if (!${id}_present && !${id}.issues.length) {\n payload.issues.push({\n code: \"invalid_type\",\n expected: \"nonoptional\",\n input: undefined,\n path: [${k}]\n });\n if (ctx && ctx.abortEarly) {\n payload.value = newResult;\n return payload;\n }\n }\n\n if (${id}_present) {\n newResult[${k}] = ${id}.value;\n }\n\n `);\n }\n else {\n doc.write(`\n if (${id}.issues.length) {${prefixStr(id, k)}\n }\n `);\n if (optin === \"defaulted\") {\n doc.write(`newResult[${k}] = ${id}.value;`);\n }\n else {\n doc.write(`\n if (${id}.value !== undefined || ${isPresent}) {\n newResult[${k}] = ${id}.value;\n }\n `);\n }\n }\n }\n doc.write(`payload.value = newResult;`);\n doc.write(`return payload;`);\n // closing `shape` in is what pays: turbofan specializes the parser against that one shape object, so every `shape[k]._zod.run` folds to a known callee. as a parameter it stays a generic load and measures 13% slower even with the forwarding frame gone\n return doc.compile();\n };\n let fastpass;\n const isObject = util.isObject;\n const jit = !core.globalConfig.jitless;\n const allowsEval = util.allowsEval;\n const fastEnabled = jit && allowsEval.value; // && !def.catchall;\n const catchall = def.catchall;\n let value;\n inst._zod.parse = (payload, ctx) => {\n value ?? (value = _normalized.value);\n const input = payload.value;\n if (!isObject(input)) {\n payload.issues.push({\n expected: \"object\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n }\n if (jit && fastEnabled && ctx?.async === false && ctx.jitless !== true) {\n // always synchronous\n if (!fastpass)\n fastpass = generateFastpass(def.shape);\n payload = fastpass(payload, ctx);\n if (!catchall)\n return payload;\n return handleCatchall([], input, payload, ctx, value, inst, ctx?.abortEarly === true);\n }\n return superParse(payload, ctx);\n };\n});\nfunction handleUnionResults(results, final, inst, ctx) {\n for (const result of results) {\n if (result.issues.length === 0) {\n final.value = result.value;\n return final;\n }\n }\n const nonaborted = results.filter((r) => !util.aborted(r));\n if (nonaborted.length === 1) {\n final.value = nonaborted[0].value;\n return nonaborted[0];\n }\n final.issues.push({\n code: \"invalid_union\",\n input: final.value,\n inst,\n errors: results.map((result) => result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),\n });\n return final;\n}\nexport const $ZodUnion = /*@__PURE__*/ core.$constructor(\"$ZodUnion\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazyInternal(inst, \"optin\", (zod) => zod.def.options.some((o) => o._zod.optin === \"defaulted\")\n ? \"defaulted\"\n : zod.def.options.some((o) => o._zod.optin !== undefined)\n ? \"optional\"\n : undefined);\n util.defineLazyInternal(inst, \"optout\", (zod) => zod.def.options.some((o) => o._zod.optout === \"optional\") ? \"optional\" : undefined);\n util.defineLazyInternal(inst, \"values\", (zod) => {\n if (zod.def.options.every((o) => o._zod.values)) {\n return new Set(zod.def.options.flatMap((option) => Array.from(option._zod.values)));\n }\n return undefined;\n });\n util.defineLazyInternal(inst, \"pattern\", (zod) => {\n if (zod.def.options.every((o) => o._zod.pattern)) {\n const patterns = zod.def.options.map((o) => o._zod.pattern);\n return new RegExp(`^(${patterns.map((p) => util.cleanRegex(p.source)).join(\"|\")})$`);\n }\n return undefined;\n });\n const first = def.options.length === 1 ? def.options[0]._zod.run : null;\n inst._zod.parse = (payload, ctx) => {\n if (first) {\n return first(payload, ctx);\n }\n let async = false;\n const results = [];\n for (const option of def.options) {\n const result = option._zod.run({\n value: payload.value,\n issues: [],\n }, ctx);\n if (result instanceof Promise) {\n results.push(result);\n async = true;\n }\n else {\n if (result.issues.length === 0)\n return result;\n results.push(result);\n }\n }\n if (!async)\n return handleUnionResults(results, payload, inst, ctx);\n return Promise.all(results).then((results) => {\n return handleUnionResults(results, payload, inst, ctx);\n });\n };\n});\nfunction handleExclusiveUnionResults(results, final, inst, ctx) {\n const matches = [];\n for (let i = 0; i < results.length; i++) {\n if (results[i].issues.length === 0)\n matches.push(i);\n }\n if (matches.length === 1) {\n final.value = results[matches[0]].value;\n return final;\n }\n if (matches.length === 0) {\n // No matches - same as regular union\n final.issues.push({\n code: \"invalid_union\",\n input: final.value,\n inst,\n errors: results.map((result) => result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),\n });\n }\n else {\n // Multiple matches - exclusive union failure\n final.issues.push({\n code: \"invalid_union\",\n input: final.value,\n inst,\n errors: [],\n inclusive: false,\n matches,\n });\n }\n return final;\n}\nexport const $ZodXor = /*@__PURE__*/ core.$constructor(\"$ZodXor\", (inst, def) => {\n $ZodUnion.init(inst, def);\n def.inclusive = false;\n const first = def.options.length === 1 ? def.options[0]._zod.run : null;\n inst._zod.parse = (payload, ctx) => {\n if (first) {\n return first(payload, ctx);\n }\n let async = false;\n const results = [];\n for (const option of def.options) {\n const result = option._zod.run({\n value: payload.value,\n issues: [],\n }, ctx);\n if (result instanceof Promise) {\n results.push(result);\n async = true;\n }\n else {\n results.push(result);\n }\n }\n if (!async)\n return handleExclusiveUnionResults(results, payload, inst, ctx);\n return Promise.all(results).then((results) => {\n return handleExclusiveUnionResults(results, payload, inst, ctx);\n });\n };\n});\n/** Returns the option whose discriminator claims `value`, or throws if ambiguous. */\nexport function getDiscriminatedOption(union, value) {\n const internals = union._zod;\n let map = internals.bag.optionsMap;\n if (!map) {\n map = discriminatorMap(internals.def);\n internals.bag.optionsMap = map;\n }\n const option = map.get(value);\n if (option === null)\n throw new Error(`Ambiguous discriminator value \"${String(value)}\"`);\n return option;\n}\nfunction discriminatorMap(def) {\n const map = new Map();\n for (const option of def.options) {\n const values = option._zod.propValues?.[def.discriminator];\n if (!values || values.size === 0)\n throw new Error(`Invalid discriminated union option at index \"${def.options.indexOf(option)}\"`);\n for (const value of values) {\n if (map.has(value)) {\n if (value !== undefined)\n throw new Error(`Duplicate discriminator value \"${String(value)}\"`);\n // keep the collision marked so a later member cannot reclaim it\n map.set(value, null);\n }\n else {\n map.set(value, option);\n }\n }\n }\n return map;\n}\nexport const $ZodDiscriminatedUnion = \n/*@__PURE__*/\ncore.$constructor(\"$ZodDiscriminatedUnion\", (inst, def) => {\n def.inclusive = false;\n $ZodUnion.init(inst, def);\n const _super = inst._zod.parse;\n util.defineLazyInternal(inst, \"propValues\", (zod) => {\n const propValues = {};\n let undefinedCount = 0;\n for (const option of zod.def.options) {\n const pv = option._zod.propValues;\n if (!pv || Object.keys(pv).length === 0)\n throw new Error(`Invalid discriminated union option at index \"${zod.def.options.indexOf(option)}\"`);\n if (pv[zod.def.discriminator]?.has(undefined))\n undefinedCount++;\n for (const [k, v] of Object.entries(pv)) {\n if (!Object.prototype.hasOwnProperty.call(propValues, k)) {\n util.assignProp(propValues, k, new Set());\n }\n for (const val of v) {\n propValues[k].add(val);\n }\n }\n }\n if (!zod.def.unionFallback && undefinedCount > 1)\n propValues[zod.def.discriminator]?.delete(undefined);\n return propValues;\n });\n // Checked now rather than in the lookup map below, so an option that lacks the discriminator fails at the `discriminatedUnion` call instead of on the first object parsed. Options whose shape cannot be enumerated without resolving it — pipes and lazies — are left to the map.\n def.options.forEach((option, i) => {\n const propShape = util.rawShape(option._zod.def);\n if (propShape && !Object.prototype.hasOwnProperty.call(propShape, def.discriminator)) {\n throw new Error(`Invalid discriminated union option at index \"${i}\"`);\n }\n });\n const disc = util.cached(() => discriminatorMap(def));\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!util.isObject(input)) {\n payload.issues.push({\n code: \"invalid_type\",\n expected: \"object\",\n input,\n inst,\n });\n return payload;\n }\n const value = input?.[def.discriminator];\n const opt = disc.value.get(value);\n // forward metadata cannot choose an encoder for an absent tag\n if (opt && (value !== undefined || ctx.direction !== \"backward\")) {\n return opt._zod.run(payload, ctx);\n }\n // Fall back to union matching when the fast discriminator path fails:\n // - explicitly enabled via unionFallback, or\n // - during backward direction (encode), since codec-based discriminators have different values in forward vs backward directions\n if (def.unionFallback || ctx.direction === \"backward\") {\n return _super(payload, ctx);\n }\n // no matching discriminator\n payload.issues.push({\n code: \"invalid_union\",\n errors: [],\n note: \"No matching discriminator\",\n discriminator: def.discriminator,\n options: Array.from(disc.value.keys()).filter((value) => disc.value.get(value) !== null),\n input,\n path: [def.discriminator],\n inst,\n });\n return payload;\n };\n});\nexport const $ZodIntersection = /*@__PURE__*/ core.$constructor(\"$ZodIntersection\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n const left = def.left._zod.run({ value: input, issues: [] }, ctx);\n const right = def.right._zod.run({ value: input, issues: [] }, ctx);\n const async = left instanceof Promise || right instanceof Promise;\n if (async) {\n return Promise.all([left, right]).then(([left, right]) => {\n return handleIntersectionResults(payload, left, right);\n });\n }\n return handleIntersectionResults(payload, left, right);\n };\n});\nexport function mergeValues(a, b) {\n // const aType = parse.t(a);\n // const bType = parse.t(b);\n if (a === b) {\n return { valid: true, data: a };\n }\n if (a instanceof Date && b instanceof Date && +a === +b) {\n return { valid: true, data: a };\n }\n if (util.isPlainObject(a) && util.isPlainObject(b)) {\n const bKeys = Object.keys(b);\n const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1);\n const newObj = { ...a, ...b };\n if (Object.prototype.hasOwnProperty.call(newObj, \"__proto__\"))\n delete newObj.__proto__;\n for (const key of sharedKeys) {\n if (key === \"__proto__\")\n continue;\n const sharedValue = mergeValues(a[key], b[key]);\n if (!sharedValue.valid) {\n return {\n valid: false,\n mergeErrorPath: [key, ...sharedValue.mergeErrorPath],\n };\n }\n newObj[key] = sharedValue.data;\n }\n return { valid: true, data: newObj };\n }\n if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length !== b.length) {\n return { valid: false, mergeErrorPath: [] };\n }\n const newArray = [];\n for (let index = 0; index < a.length; index++) {\n const itemA = a[index];\n const itemB = b[index];\n const sharedValue = mergeValues(itemA, itemB);\n if (!sharedValue.valid) {\n return {\n valid: false,\n mergeErrorPath: [index, ...sharedValue.mergeErrorPath],\n };\n }\n newArray.push(sharedValue.data);\n }\n return { valid: true, data: newArray };\n }\n return { valid: false, mergeErrorPath: [] };\n}\nfunction handleIntersectionResults(result, left, right) {\n // Track which side(s) reject each key. A key rejection is reported only when BOTH sides reject it, so a key owned by one branch survives the other's key schema. strictObject reports these as unrecognized_keys; a record with an open key schema reports one invalid_key per key.\n const unrecKeys = new Map();\n let unrecIssue;\n const keyIssues = new Map();\n const collect = (iss, side) => {\n let keys;\n if (iss.code === \"unrecognized_keys\" && !iss.path?.length) {\n unrecIssue ?? (unrecIssue = iss);\n keys = iss.keys;\n }\n else if (iss.code === \"invalid_key\" && iss.origin === \"record\" && iss.path?.length === 1) {\n const k = String(iss.path[0]);\n if (!keyIssues.has(k))\n keyIssues.set(k, iss);\n keys = [k];\n }\n else {\n return false;\n }\n for (const k of keys) {\n if (!unrecKeys.has(k))\n unrecKeys.set(k, {});\n unrecKeys.get(k)[side] = true;\n }\n return true;\n };\n for (const iss of left.issues) {\n if (!collect(iss, \"l\"))\n result.issues.push(iss);\n }\n for (const iss of right.issues) {\n if (!collect(iss, \"r\"))\n result.issues.push(iss);\n }\n // Report only keys rejected by BOTH sides\n const bothKeys = [...unrecKeys].filter(([, f]) => f.l && f.r).map(([k]) => k);\n if (bothKeys.length) {\n const aggregated = unrecIssue ? bothKeys.filter((k) => unrecIssue.keys.includes(k)) : [];\n if (aggregated.length)\n result.issues.push({ ...unrecIssue, keys: aggregated });\n for (const k of bothKeys) {\n if (!aggregated.includes(k) && keyIssues.has(k))\n result.issues.push(keyIssues.get(k));\n }\n }\n const merged = mergeValues(left.value, right.value);\n if (!merged.valid) {\n if (util.aborted(result))\n return result;\n throw new Error(`Unmergable intersection. Error path: ` + `${JSON.stringify(merged.mergeErrorPath)}`);\n }\n result.value = merged.data;\n return result;\n}\nexport const $ZodTuple = /*@__PURE__*/ core.$constructor(\"$ZodTuple\", (inst, def) => {\n $ZodType.init(inst, def);\n const items = def.items;\n const memo = core.globalConfig.memoizer;\n memo?.attach(inst);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!Array.isArray(input)) {\n payload.issues.push({\n input,\n inst,\n expected: \"tuple\",\n code: \"invalid_type\",\n });\n return payload;\n }\n payload.value = memo ? memo.alloc(inst, payload, [], ctx) : [];\n const proms = [];\n const optinStart = getTupleOptStart(items, \"optin\");\n const optoutStart = getTupleOptStart(items, \"optout\");\n if (!def.rest) {\n if (input.length < optinStart) {\n payload.issues.push({\n code: \"too_small\",\n minimum: optinStart,\n inclusive: true,\n input,\n inst,\n origin: \"array\",\n });\n return payload;\n }\n if (input.length > items.length) {\n payload.issues.push({\n code: \"too_big\",\n maximum: items.length,\n inclusive: true,\n input,\n inst,\n origin: \"array\",\n });\n }\n }\n // Run every item in parallel, collecting results into an indexed array. The post-processing in `handleTupleResults` walks them in order so it can decide whether an absent optional-output error can truncate the tail or must be reported to preserve required output.\n const itemResults = new Array(items.length);\n // only tracked when there is a rest loop to skip\n const abortEarly = def.rest ? ctx?.abortEarly : undefined;\n let itemAborted = false;\n for (let i = 0; i < items.length; i++) {\n const r = items[i]._zod.run({ value: input[i], issues: [] }, ctx);\n if (r instanceof Promise) {\n proms.push(r.then((rr) => {\n itemResults[i] = rr;\n }));\n }\n else {\n itemResults[i] = r;\n if (abortEarly && !itemAborted && r.issues.length)\n itemAborted = util.aborted(r);\n }\n }\n // sound because rest is non-empty exactly when every fixed index is present, the one case handleTupleResults cannot discard an item's issues\n if (def.rest && !itemAborted) {\n let i = items.length - 1;\n const rest = input.slice(items.length);\n let seen = payload.issues.length;\n for (const el of rest) {\n if (abortEarly && payload.issues.length !== seen) {\n if (util.aborted(payload, seen))\n break;\n seen = payload.issues.length;\n }\n i++;\n const result = def.rest._zod.run({ value: el, issues: [] }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((r) => handleTupleResult(r, payload, i)));\n }\n else {\n handleTupleResult(result, payload, i);\n }\n }\n }\n if (proms.length) {\n return Promise.all(proms).then(() => handleTupleResults(itemResults, payload, items, input, optoutStart));\n }\n return handleTupleResults(itemResults, payload, items, input, optoutStart);\n };\n});\nfunction getTupleOptStart(items, key) {\n for (let i = items.length - 1; i >= 0; i--) {\n // optin is a three-rung ladder so any rung above `undefined` permits an absent slot; optout stays two-valued.\n const omittable = key === \"optin\" ? items[i]._zod.optin !== undefined : items[i]._zod.optout === \"optional\";\n if (!omittable)\n return i + 1;\n }\n return 0;\n}\nfunction handleTupleResult(result, final, index) {\n if (result.issues.length) {\n final.issues.push(...util.prefixIssues(index, result.issues));\n }\n final.value[index] = result.value;\n}\nfunction handleTupleResults(itemResults, final, items, input, optoutStart) {\n // Walk results in order. Mirror $ZodObject's swallow-on-absent-optional rule, but only after `optoutStart`: the first index where the output tuple tail can be absent.\n for (let i = 0; i < items.length; i++) {\n const r = itemResults[i];\n const isPresent = i < input.length;\n // The array analog of `handlePropertyResult`'s absent-key early return: the middle rung permits absence without supplying anything in its place, so the tail truncates here instead of materializing whatever the item made of `undefined`.\n if (!isPresent && i >= optoutStart && items[i]._zod.optin === \"optional\") {\n final.value.length = i;\n break;\n }\n if (r.issues.length) {\n if (!isPresent && i >= optoutStart) {\n final.value.length = i;\n break;\n }\n final.issues.push(...util.prefixIssues(i, r.issues));\n }\n final.value[i] = r.value;\n }\n // Drop trailing slots that produced `undefined` for absent input\n // (the array analog of an absent optional key on an object). The\n // `i >= input.length` floor is critical: an explicit `undefined`\n // *inside* the input must be preserved even when the schema is\n // optional-out (e.g. `z.string().or(z.undefined())` accepting an\n // explicit undefined value).\n for (let i = final.value.length - 1; i >= input.length; i--) {\n if (items[i]._zod.optout === \"optional\" && final.value[i] === undefined) {\n final.value.length = i;\n }\n else {\n break;\n }\n }\n return final;\n}\nexport const $ZodRecord = /*@__PURE__*/ core.$constructor(\"$ZodRecord\", (inst, def) => {\n $ZodType.init(inst, def);\n const memo = core.globalConfig.memoizer;\n memo?.attach(inst);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!util.isPlainObject(input)) {\n payload.issues.push({\n expected: \"record\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n }\n // no guard in either loop below: a record's invalid_key aborts but an enclosing intersection can reconcile it, so a stopped loop hides keys the sibling does not own and the intersection then rejects nothing\n const proms = [];\n const values = def.keyType._zod.values;\n if (values && !def.partial) {\n payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};\n const recordKeys = new Set();\n for (const key of values) {\n if (typeof key === \"string\" || typeof key === \"number\" || typeof key === \"symbol\") {\n recordKeys.add(typeof key === \"number\" ? key.toString() : key);\n // A declared __proto__ is stripped but is not an unrecognized key.\n if (key === \"__proto__\")\n continue;\n const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);\n if (keyResult instanceof Promise) {\n throw new Error(\"Async schemas not supported in object keys currently\");\n }\n if (keyResult.issues.length) {\n payload.issues.push({\n code: \"invalid_key\",\n origin: \"record\",\n issues: keyResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n input: key,\n path: [key],\n inst,\n });\n continue;\n }\n const outKey = keyResult.value;\n if (outKey === \"__proto__\")\n continue;\n const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(key, result.issues));\n }\n payload.value[outKey] = result.value;\n }));\n }\n else {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(key, result.issues));\n }\n payload.value[outKey] = result.value;\n }\n }\n }\n let unrecognized;\n for (const key in input) {\n if (!recordKeys.has(key)) {\n if (def.mode === \"loose\") {\n // skip __proto__ so it can't replace the result prototype via the assignment setter on the plain {} we build into\n if (key === \"__proto__\")\n continue;\n payload.value[key] = input[key];\n }\n else {\n unrecognized = unrecognized ?? [];\n unrecognized.push(key);\n }\n }\n }\n if (unrecognized && unrecognized.length > 0) {\n payload.issues.push({\n code: \"unrecognized_keys\",\n input,\n inst,\n keys: unrecognized,\n continue: true,\n });\n }\n }\n else {\n payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};\n // An enumerable key schema declares which keys the record owns, so a key outside the set is unrecognized. A non-enumerable one (regex, refine) is a constraint every key must satisfy, so a failing key is invalid. Only the former is reconcilable against the other side of an intersection.\n let unrecognized;\n // Reflect.ownKeys for Symbol-key support; filter non-enumerable to match z.object()\n for (const key of Reflect.ownKeys(input)) {\n if (key === \"__proto__\")\n continue;\n if (!Object.prototype.propertyIsEnumerable.call(input, key))\n continue;\n let keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);\n if (keyResult instanceof Promise) {\n throw new Error(\"Async schemas not supported in object keys currently\");\n }\n // Numeric string fallback: if key is a numeric string and failed, retry with Number(key). This handles z.number(), z.literal([1, 2, 3]), and unions containing numeric literals\n const checkNumericKey = typeof key === \"string\" && regexes.number.test(key) && keyResult.issues.length;\n if (checkNumericKey) {\n const retryResult = def.keyType._zod.run({ value: Number(key), issues: [] }, ctx);\n if (retryResult instanceof Promise) {\n throw new Error(\"Async schemas not supported in object keys currently\");\n }\n if (retryResult.issues.length === 0) {\n keyResult = retryResult;\n }\n }\n if (keyResult.issues.length) {\n if (def.mode === \"loose\") {\n // Pass through unchanged\n payload.value[key] = input[key];\n }\n else if (values) {\n unrecognized = unrecognized ?? [];\n unrecognized.push(key);\n }\n else {\n // Default \"strict\" behavior: error on invalid key\n payload.issues.push({\n code: \"invalid_key\",\n origin: \"record\",\n issues: keyResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n input: key,\n path: [key],\n inst,\n });\n }\n continue;\n }\n // the guard above tests the raw input key, but the key schema can normalize an ordinary key into __proto__; re-check the key we actually write under\n const outKey = keyResult.value;\n if (outKey === \"__proto__\")\n continue;\n const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(key, result.issues));\n }\n payload.value[outKey] = result.value;\n }));\n }\n else {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(key, result.issues));\n }\n payload.value[outKey] = result.value;\n }\n }\n if (unrecognized && unrecognized.length > 0) {\n payload.issues.push({\n code: \"unrecognized_keys\",\n input,\n inst,\n keys: unrecognized,\n continue: true,\n });\n }\n }\n if (proms.length) {\n return Promise.all(proms).then(() => payload);\n }\n return payload;\n };\n});\nexport const $ZodMap = /*@__PURE__*/ core.$constructor(\"$ZodMap\", (inst, def) => {\n $ZodType.init(inst, def);\n const memo = core.globalConfig.memoizer;\n memo?.attach(inst);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!(input instanceof Map)) {\n payload.issues.push({\n expected: \"map\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n }\n const proms = [];\n payload.value = memo ? memo.alloc(inst, payload, new Map(), ctx) : new Map();\n const abortEarly = ctx?.abortEarly;\n let seen = payload.issues.length;\n for (const [key, value] of input) {\n if (abortEarly && payload.issues.length !== seen) {\n if (util.aborted(payload, seen))\n break;\n seen = payload.issues.length;\n }\n const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);\n const valueResult = def.valueType._zod.run({ value: value, issues: [] }, ctx);\n if (keyResult instanceof Promise || valueResult instanceof Promise) {\n proms.push(Promise.all([keyResult, valueResult]).then(([keyResult, valueResult]) => {\n handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx);\n }));\n }\n else {\n handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx);\n }\n }\n if (proms.length)\n return Promise.all(proms).then(() => payload);\n return payload;\n };\n capSize(inst, mapSize);\n});\nfunction handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {\n if (keyResult.issues.length) {\n if (util.propertyKeyTypes.has(typeof key)) {\n final.issues.push(...util.prefixIssues(key, keyResult.issues));\n }\n else {\n final.issues.push({\n code: \"invalid_key\",\n origin: \"map\",\n input,\n inst,\n issues: keyResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n });\n }\n }\n if (valueResult.issues.length) {\n if (util.propertyKeyTypes.has(typeof key)) {\n final.issues.push(...util.prefixIssues(key, valueResult.issues));\n }\n else {\n final.issues.push({\n origin: \"map\",\n code: \"invalid_element\",\n input,\n inst,\n key: key,\n issues: valueResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n });\n }\n }\n final.value.set(keyResult.value, valueResult.value);\n}\nexport const $ZodSet = /*@__PURE__*/ core.$constructor(\"$ZodSet\", (inst, def) => {\n $ZodType.init(inst, def);\n const memo = core.globalConfig.memoizer;\n memo?.attach(inst);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!(input instanceof Set)) {\n payload.issues.push({\n input,\n inst,\n expected: \"set\",\n code: \"invalid_type\",\n });\n return payload;\n }\n const proms = [];\n payload.value = memo ? memo.alloc(inst, payload, new Set(), ctx) : new Set();\n const abortEarly = ctx?.abortEarly;\n let seen = payload.issues.length;\n for (const item of input) {\n if (abortEarly && payload.issues.length !== seen) {\n if (util.aborted(payload, seen))\n break;\n seen = payload.issues.length;\n }\n const result = def.valueType._zod.run({ value: item, issues: [] }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => handleSetResult(result, payload)));\n }\n else\n handleSetResult(result, payload);\n }\n if (proms.length)\n return Promise.all(proms).then(() => payload);\n return payload;\n };\n capSize(inst, setSize);\n});\nfunction handleSetResult(result, final) {\n if (result.issues.length) {\n final.issues.push(...result.issues);\n }\n final.value.add(result.value);\n}\nexport const $ZodEnum = /*@__PURE__*/ core.$constructor(\"$ZodEnum\", (inst, def) => {\n $ZodType.init(inst, def);\n const values = util.getEnumValues(def.entries);\n const valuesSet = new Set(values);\n inst._zod.values = valuesSet;\n util.defineLazyInternal(inst, \"pattern\", (zod) => {\n const patternValues = util.getEnumValues(zod.def.entries).filter((k) => util.propertyKeyTypes.has(typeof k));\n // unmatchable fallback, RE2-safe: an empty alternation would compile to /^()$/, which matches \"\"\n return new RegExp(patternValues.length ? `^(${patternValues.map((o) => util.escapeRegex(o.toString())).join(\"|\")})$` : \"^[^\\\\s\\\\S]$\");\n });\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (valuesSet.has(input)) {\n return payload;\n }\n payload.issues.push({\n code: \"invalid_value\",\n values,\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodLiteral = /*@__PURE__*/ core.$constructor(\"$ZodLiteral\", (inst, def) => {\n $ZodType.init(inst, def);\n const values = new Set(def.values);\n inst._zod.values = values;\n util.defineLazyInternal(inst, \"pattern\", (zod) => {\n const vals = zod.def.values;\n // unmatchable fallback, RE2-safe: an empty alternation would compile to /^()$/, which matches \"\"\n return new RegExp(vals.length\n ? `^(${vals\n .map((o) => typeof o === \"string\" ? util.escapeRegex(o) : o ? util.escapeRegex(o.toString()) : String(o))\n .join(\"|\")})$`\n : \"^[^\\\\s\\\\S]$\");\n });\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (values.has(input)) {\n return payload;\n }\n payload.issues.push({\n code: \"invalid_value\",\n values: def.values,\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodFile = /*@__PURE__*/ core.$constructor(\"$ZodFile\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n // @ts-ignore\n if (input instanceof File)\n return payload;\n payload.issues.push({\n expected: \"file\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodTransform = /*@__PURE__*/ core.$constructor(\"$ZodTransform\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.optin = \"optional\";\n core.globalConfig.memoizer?.guard(inst);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n throw new core.$ZodEncodeError(inst.constructor.name);\n }\n const _out = def.transform(payload.value, payload);\n if (ctx.async) {\n const output = _out instanceof Promise ? _out : Promise.resolve(_out);\n return output.then((output) => {\n payload.value = output;\n return payload;\n });\n }\n if (_out instanceof Promise) {\n throw new core.$ZodAsyncError();\n }\n payload.value = _out;\n return payload;\n };\n});\nfunction handleOptionalResult(payload, result) {\n // A substituting schema that still failed has no usable answer; yield undefined. Its issues are simply dropped: it ran on a payload of its own, so there is no shared array to truncate and nothing of the caller's to lose with it.\n payload.value = result.issues.length ? undefined : result.value;\n return payload;\n}\nexport const $ZodOptional = /*@__PURE__*/ core.$constructor(\"$ZodOptional\", (inst, def) => {\n $ZodType.init(inst, def);\n // .optional() propagates absence rather than substituting for it, so a defaulted inner keeps its rung.\n util.defineLazyInternal(inst, \"optin\", (zod) => zod.def.innerType._zod.optin === \"defaulted\" ? \"defaulted\" : \"optional\");\n inst._zod.optout = \"optional\";\n util.defineLazyInternal(inst, \"values\", (zod) => {\n const values = zod.def.innerType._zod.values;\n return values ? new Set([...values, undefined]) : undefined;\n });\n util.defineLazyInternal(inst, \"pattern\", (zod) => {\n const pattern = zod.def.innerType._zod.pattern;\n return pattern ? new RegExp(`^(${util.cleanRegex(pattern.source)})?$`) : undefined;\n });\n inst._zod.parse = (payload, ctx) => {\n if (payload.value === undefined) {\n // Only the top rung substitutes a value for absence; everything else leaves it intact, which is what .optional() means.\n if (def.innerType._zod.optin !== \"defaulted\")\n return payload;\n // Its own payload, for the same reason $ZodCatch gets one: a pipe forwards an unrecognized key through the caller's issues array, and this must not read that as the substituting schema failing and drop it.\n const result = def.innerType._zod.run({ value: payload.value, issues: [] }, ctx);\n if (result instanceof Promise)\n return result.then((result) => handleOptionalResult(payload, result));\n return handleOptionalResult(payload, result);\n }\n return def.innerType._zod.run(payload, ctx);\n };\n});\nexport const $ZodExactOptional = /*@__PURE__*/ core.$constructor(\"$ZodExactOptional\", (inst, def) => {\n // Call parent init - inherits optin/optout = \"optional\"\n $ZodOptional.init(inst, def);\n // Override values/pattern to NOT add undefined\n util.defineLazyInternal(inst, \"values\", (zod) => zod.def.innerType._zod.values);\n util.defineLazyInternal(inst, \"pattern\", (zod) => zod.def.innerType._zod.pattern);\n // Override parse to just delegate (no undefined handling)\n inst._zod.parse = (payload, ctx) => {\n return def.innerType._zod.run(payload, ctx);\n };\n});\nexport const $ZodNullable = /*@__PURE__*/ core.$constructor(\"$ZodNullable\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazyInternal(inst, \"optin\", (zod) => zod.def.innerType._zod.optin);\n util.defineLazyInternal(inst, \"optout\", (zod) => zod.def.innerType._zod.optout);\n util.defineLazyInternal(inst, \"pattern\", (zod) => {\n const pattern = zod.def.innerType._zod.pattern;\n return pattern ? new RegExp(`^(${util.cleanRegex(pattern.source)}|null)$`) : undefined;\n });\n util.defineLazyInternal(inst, \"values\", (zod) => {\n return zod.def.innerType._zod.values ? new Set([...zod.def.innerType._zod.values, null]) : undefined;\n });\n inst._zod.parse = (payload, ctx) => {\n // Forward direction (decode): allow null to pass through\n if (payload.value === null)\n return payload;\n return def.innerType._zod.run(payload, ctx);\n };\n});\nexport const $ZodDefault = /*@__PURE__*/ core.$constructor(\"$ZodDefault\", (inst, def) => {\n $ZodType.init(inst, def);\n // inst._zod.qin = \"true\";\n inst._zod.optin = \"defaulted\";\n util.defineLazyInternal(inst, \"values\", (zod) => zod.def.innerType._zod.values);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n return def.innerType._zod.run(payload, ctx);\n }\n // Forward direction (decode): apply defaults for undefined input\n if (payload.value === undefined) {\n payload.value = def.defaultValue;\n /**\n * $ZodDefault returns the default value immediately in forward direction.\n * It doesn't pass the default value into the validator (\"prefault\"). There's no reason to pass the default value through validation. The validity of the default is enforced by TypeScript statically. Otherwise, it's the responsibility of the user to ensure the default is valid. In the case of pipes with divergent in/out types, you can specify the default on the `in` schema of your ZodPipe to set a \"prefault\" for the pipe. */\n return payload;\n }\n // Forward direction: continue with default handling\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then((result) => handleDefaultResult(result, def));\n }\n return handleDefaultResult(result, def);\n };\n});\nfunction handleDefaultResult(payload, def) {\n if (payload.value === undefined) {\n payload.value = def.defaultValue;\n }\n return payload;\n}\nexport const $ZodPrefault = /*@__PURE__*/ core.$constructor(\"$ZodPrefault\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.optin = \"defaulted\";\n util.defineLazyInternal(inst, \"values\", (zod) => zod.def.innerType._zod.values);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n return def.innerType._zod.run(payload, ctx);\n }\n // Forward direction (decode): apply prefault for undefined input\n if (payload.value === undefined) {\n payload.value = def.defaultValue;\n }\n return def.innerType._zod.run(payload, ctx);\n };\n});\nexport const $ZodNonOptional = /*@__PURE__*/ core.$constructor(\"$ZodNonOptional\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazyInternal(inst, \"values\", (zod) => {\n const v = zod.def.innerType._zod.values;\n return v ? new Set([...v].filter((x) => x !== undefined)) : undefined;\n });\n inst._zod.parse = (payload, ctx) => {\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then((result) => handleNonOptionalResult(result, inst));\n }\n return handleNonOptionalResult(result, inst);\n };\n});\nfunction handleNonOptionalResult(payload, inst) {\n if (!payload.issues.length && payload.value === undefined) {\n payload.issues.push({\n code: \"invalid_type\",\n expected: \"nonoptional\",\n input: payload.value,\n inst,\n });\n }\n return payload;\n}\nexport const $ZodSuccess = /*@__PURE__*/ core.$constructor(\"$ZodSuccess\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n throw new core.$ZodEncodeError(\"ZodSuccess\");\n }\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then((result) => {\n payload.value = result.issues.length === 0;\n return payload;\n });\n }\n payload.value = result.issues.length === 0;\n return payload;\n };\n});\nfunction handleCatchResult(payload, result, def, ctx) {\n if (!result.issues.length) {\n payload.value = result.value;\n // The value carries up, so the flag describing it has to carry with it: a back-edge into a node still being parsed must not be frozen by an enclosing readonly, and its checks belong to the node itself. Guarded so the ordinary case adds no own property.\n if (result.memo)\n payload.memo = true;\n return payload;\n }\n // Spread the inner's own payload, not ours: `value` has to stay the input the catch was handed, and the inner ran on a payload of its own so its issues are already private to this call.\n payload.value = def.catchValue({\n ...result,\n value: payload.value,\n error: {\n issues: result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n },\n input: payload.value,\n });\n return payload;\n}\nexport const $ZodCatch = /*@__PURE__*/ core.$constructor(\"$ZodCatch\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazyInternal(inst, \"optin\", (zod) => zod.def.innerType._zod.optin === \"defaulted\" ? \"defaulted\" : \"optional\");\n util.defineLazyInternal(inst, \"optout\", (zod) => zod.def.innerType._zod.optout);\n util.defineLazyInternal(inst, \"values\", (zod) => zod.def.innerType._zod.values);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n return def.innerType._zod.run(payload, ctx);\n }\n // Forward direction (decode): apply catch logic\n const result = def.innerType._zod.run({ value: payload.value, issues: [] }, ctx);\n if (result instanceof Promise) {\n return result.then((result) => handleCatchResult(payload, result, def, ctx));\n }\n return handleCatchResult(payload, result, def, ctx);\n };\n});\nexport const $ZodNaN = /*@__PURE__*/ core.$constructor(\"$ZodNaN\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n if (typeof payload.value !== \"number\" || !Number.isNaN(payload.value)) {\n payload.issues.push({\n input: payload.value,\n inst,\n expected: \"nan\",\n code: \"invalid_type\",\n });\n return payload;\n }\n return payload;\n };\n});\nexport const $ZodPipe = /*@__PURE__*/ core.$constructor(\"$ZodPipe\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazyInternal(inst, \"values\", (zod) => zod.def.in._zod.values);\n util.defineLazyInternal(inst, \"optin\", (zod) => zod.def.in._zod.optin);\n util.defineLazyInternal(inst, \"optout\", (zod) => zod.def.out._zod.optout);\n util.defineLazyInternal(inst, \"propValues\", (zod) => zod.def.in._zod.propValues);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n const right = def.out._zod.run(payload, ctx);\n if (right instanceof Promise) {\n return right.then((right) => handlePipeResult(right, def.in, ctx));\n }\n return handlePipeResult(right, def.in, ctx);\n }\n const left = def.in._zod.run(payload, ctx);\n if (left instanceof Promise) {\n return left.then((left) => handlePipeResult(left, def.out, ctx));\n }\n return handlePipeResult(left, def.out, ctx);\n };\n});\nfunction handlePipeResult(left, next, ctx) {\n // Any issue stops the pipe, so a failing refinement never feeds its transform. An unrecognized key is the exception: it describes the input's extra properties, not the value being piped, and an enclosing intersection may yet reconcile it.\n if (left.issues.some((iss) => iss.code !== \"unrecognized_keys\")) {\n // prevent further checks\n left.aborted = true;\n return left;\n }\n return next._zod.run({ value: left.value, issues: left.issues }, ctx);\n}\nexport const $ZodCodec = /*@__PURE__*/ core.$constructor(\"$ZodCodec\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazyInternal(inst, \"values\", (zod) => zod.def.in._zod.values);\n util.defineLazyInternal(inst, \"optin\", (zod) => zod.def.in._zod.optin);\n util.defineLazyInternal(inst, \"optout\", (zod) => zod.def.out._zod.optout);\n util.defineLazyInternal(inst, \"propValues\", (zod) => zod.def.in._zod.propValues);\n inst._zod.parse = (payload, ctx) => {\n const direction = ctx.direction || \"forward\";\n if (direction === \"forward\") {\n const left = def.in._zod.run(payload, ctx);\n if (left instanceof Promise) {\n return left.then((left) => handleCodecAResult(left, def, ctx));\n }\n return handleCodecAResult(left, def, ctx);\n }\n else {\n const right = def.out._zod.run(payload, ctx);\n if (right instanceof Promise) {\n return right.then((right) => handleCodecAResult(right, def, ctx));\n }\n return handleCodecAResult(right, def, ctx);\n }\n };\n});\nfunction handleCodecAResult(result, def, ctx) {\n if (result.issues.length) {\n // prevent further checks\n result.aborted = true;\n return result;\n }\n const direction = ctx.direction || \"forward\";\n if (direction === \"forward\") {\n const transformed = def.transform(result.value, result);\n if (transformed instanceof Promise) {\n return transformed.then((value) => handleCodecTxResult(result, value, def.out, ctx));\n }\n return handleCodecTxResult(result, transformed, def.out, ctx);\n }\n else {\n const transformed = def.reverseTransform(result.value, result);\n if (transformed instanceof Promise) {\n return transformed.then((value) => handleCodecTxResult(result, value, def.in, ctx));\n }\n return handleCodecTxResult(result, transformed, def.in, ctx);\n }\n}\nfunction handleCodecTxResult(left, value, nextSchema, ctx) {\n // Check if transform added any issues\n if (left.issues.length) {\n left.aborted = true;\n return left;\n }\n return nextSchema._zod.run({ value, issues: left.issues }, ctx);\n}\nexport const $ZodPreprocess = /*@__PURE__*/ core.$constructor(\"$ZodPreprocess\", (inst, def) => {\n $ZodPipe.init(inst, def);\n});\nexport const $ZodReadonly = /*@__PURE__*/ core.$constructor(\"$ZodReadonly\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazyInternal(inst, \"propValues\", (zod) => zod.def.innerType._zod.propValues);\n util.defineLazyInternal(inst, \"values\", (zod) => zod.def.innerType._zod.values);\n util.defineLazyInternal(inst, \"optin\", (zod) => zod.def.innerType?._zod?.optin);\n util.defineLazyInternal(inst, \"optout\", (zod) => zod.def.innerType?._zod?.optout);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n return def.innerType._zod.run(payload, ctx);\n }\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then(handleReadonlyResult);\n }\n return handleReadonlyResult(result);\n };\n});\nfunction handleReadonlyResult(payload) {\n // A repeat visit hands back a node that is still being built; freezing it here would make the rest of its keys fail to assign.\n if (!payload.memo)\n payload.value = Object.freeze(payload.value);\n return payload;\n}\n// a leaf's pattern source with its own checks folded in: the last pattern-carrying check wins, else length bounds narrow the catch-all, else an integer format narrows the number form. the fold lives here instead of on `_zod.pattern` so a bundle without template literals never pays for it\nfunction leafPattern(schema) {\n const def = schema._zod.def;\n let pattern = def.pattern;\n let isInt = !!def.format?.includes(\"int\");\n let minimum;\n let maximum;\n for (const ch of def.checks ?? []) {\n const d = ch._zod.def;\n if (d.pattern)\n pattern = d.pattern;\n isInt || (isInt = !!d.format?.includes(\"int\"));\n const lo = d.minimum ?? d.length;\n const hi = d.maximum ?? d.length;\n if (lo !== undefined && (minimum === undefined || lo > minimum))\n minimum = lo;\n if (hi !== undefined && (maximum === undefined || hi < maximum))\n maximum = hi;\n }\n if (pattern)\n return pattern.source;\n // an empty range matches nothing at runtime, and `{8,5}` is not a legal quantifier\n if (minimum !== undefined && maximum !== undefined && minimum > maximum)\n return \"(?!)\";\n if (minimum !== undefined || maximum !== undefined)\n return regexes.string({ minimum, maximum }).source;\n const own = schema._zod.pattern;\n return (isInt && own === regexes.number ? regexes.integer : own)?.source;\n}\n// a part's pattern source. a wrapper's pattern embeds its inner pattern's source verbatim, so the folded form is substituted in place without knowing the wrapper's own composition; a union's options are joined the way the union builds its own pattern\nfunction partPattern(schema) {\n const def = schema._zod.def;\n const own = schema._zod.pattern?.source;\n // lazy resolves its inner on the internals, not the def\n const inner = def.innerType ?? schema._zod.innerType;\n if (inner) {\n const before = inner._zod.pattern?.source;\n const after = partPattern(inner);\n if (own && before && after && after !== before) {\n return own.replace(util.cleanRegex(before), () => util.cleanRegex(after));\n }\n return own;\n }\n if (def.options) {\n const sources = def.options.map(partPattern);\n if (sources.every(Boolean))\n return `^(${sources.map((s) => util.cleanRegex(s)).join(\"|\")})$`;\n }\n return leafPattern(schema);\n}\nexport const $ZodTemplateLiteral = /*@__PURE__*/ core.$constructor(\"$ZodTemplateLiteral\", (inst, def) => {\n $ZodType.init(inst, def);\n const regexParts = [];\n for (const part of def.parts) {\n if (typeof part === \"object\" && part !== null) {\n // is Zod schema\n const source = partPattern(part);\n if (!source) {\n throw new Error(`Invalid template literal part, no pattern found: ${[...part._zod.traits].shift()}`);\n }\n regexParts.push(util.cleanRegex(source));\n }\n else if (part === null || util.primitiveTypes.has(typeof part)) {\n regexParts.push(util.escapeRegex(`${part}`));\n }\n else {\n throw new Error(`Invalid template literal part: ${part}`);\n }\n }\n inst._zod.pattern = new RegExp(`^${regexParts.join(\"\")}$`);\n inst._zod.parse = (payload, _ctx) => {\n if (typeof payload.value !== \"string\") {\n payload.issues.push({\n input: payload.value,\n inst,\n expected: \"string\",\n code: \"invalid_type\",\n });\n return payload;\n }\n inst._zod.pattern.lastIndex = 0;\n if (!inst._zod.pattern.test(payload.value)) {\n payload.issues.push({\n input: payload.value,\n inst,\n code: \"invalid_format\",\n format: def.format ?? \"template_literal\",\n pattern: inst._zod.pattern.source,\n });\n return payload;\n }\n return payload;\n };\n});\nexport const $ZodFunction = /*@__PURE__*/ core.$constructor(\"$ZodFunction\", (inst, def) => {\n $ZodType.init(inst, def);\n // Defined, not assigned: the classic prototype exposes `_def` as a getter with no setter.\n Object.defineProperty(inst, \"_def\", { value: def });\n inst._zod.def = def;\n inst.implement = (func) => {\n if (typeof func !== \"function\") {\n throw new Error(\"implement() must be called with a function\");\n }\n // Defined inline so the closure stays anonymous: binding it to a `const` first names it, which costs 256 bytes per implemented function.\n return Object.defineProperty(function (...args) {\n const parsedArgs = inst._def.input ? parse(inst._def.input, args) : args;\n const result = Reflect.apply(func, this, parsedArgs);\n if (inst._def.output) {\n return parse(inst._def.output, result);\n }\n return result;\n }, \"_zod\", { value: inst._zod, enumerable: false });\n };\n inst.implementAsync = (func) => {\n if (typeof func !== \"function\") {\n throw new Error(\"implementAsync() must be called with a function\");\n }\n return Object.defineProperty(async function (...args) {\n const parsedArgs = inst._def.input ? await parseAsync(inst._def.input, args) : args;\n const result = await Reflect.apply(func, this, parsedArgs);\n if (inst._def.output) {\n return await parseAsync(inst._def.output, result);\n }\n return result;\n }, \"_zod\", { value: inst._zod, enumerable: false });\n };\n inst._zod.parse = (payload, _ctx) => {\n if (typeof payload.value !== \"function\") {\n payload.issues.push({\n code: \"invalid_type\",\n expected: \"function\",\n input: payload.value,\n inst,\n });\n return payload;\n }\n // Check if output is a promise type to determine if we should use async implementation\n const hasPromiseOutput = inst._def.output && inst._def.output._zod.def.type === \"promise\";\n if (hasPromiseOutput) {\n payload.value = inst.implementAsync(payload.value);\n }\n else {\n payload.value = inst.implement(payload.value);\n }\n return payload;\n };\n inst.input = (...args) => {\n const F = inst.constructor;\n if (Array.isArray(args[0])) {\n return new F({\n type: \"function\",\n input: new $ZodTuple({\n type: \"tuple\",\n items: args[0],\n rest: args[1],\n }),\n output: inst._def.output,\n });\n }\n return new F({\n type: \"function\",\n input: args[0],\n output: inst._def.output,\n });\n };\n inst.output = (output) => {\n const F = inst.constructor;\n return new F({\n type: \"function\",\n input: inst._def.input,\n output,\n });\n };\n return inst;\n});\nexport const $ZodPromise = /*@__PURE__*/ core.$constructor(\"$ZodPromise\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n return Promise.resolve(payload.value).then((inner) => def.innerType._zod.run({ value: inner, issues: [] }, ctx));\n };\n});\nexport const $ZodLazy = /*@__PURE__*/ core.$constructor(\"$ZodLazy\", (inst, def) => {\n $ZodType.init(inst, def);\n // Cache the resolved inner type on the shared `def` so all clones of this lazy (e.g. via `.describe()`/`.meta()`) share the same inner instance, preserving identity for cycle detection on recursive schemas.\n util.defineLazy(inst._zod, \"innerType\", () => {\n const d = def;\n if (!d._cachedInner)\n d._cachedInner = def.getter();\n return d._cachedInner;\n });\n util.defineLazyInternal(inst, \"pattern\", (zod) => zod.innerType?._zod?.pattern);\n util.defineLazyInternal(inst, \"propValues\", (zod) => zod.innerType?._zod?.propValues);\n util.defineLazyInternal(inst, \"optin\", (zod) => zod.innerType?._zod?.optin ?? undefined);\n util.defineLazyInternal(inst, \"optout\", (zod) => zod.innerType?._zod?.optout ?? undefined);\n inst._zod.parse = (payload, ctx) => {\n const inner = inst._zod.innerType;\n return inner._zod.run(payload, ctx);\n };\n});\nexport const $ZodCustom = /*@__PURE__*/ core.$constructor(\"$ZodCustom\", (inst, def) => {\n checks.$ZodCheck.init(inst, def);\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _) => {\n return payload;\n };\n inst._zod.check = (payload) => {\n const input = payload.value;\n const r = def.fn(input);\n if (r instanceof Promise) {\n return r.then((r) => handleRefineResult(r, payload, input, inst));\n }\n handleRefineResult(r, payload, input, inst);\n return;\n };\n});\nfunction handleRefineResult(result, payload, input, inst) {\n if (!result) {\n const _iss = {\n code: \"custom\",\n input,\n inst, // incorporates params.error into issue reporting\n path: [...(inst._zod.def.path ?? [])], // incorporates params.error into issue reporting\n continue: !inst._zod.def.abort,\n // params: inst._zod.def.params,\n };\n if (inst._zod.def.params)\n _iss.params = inst._zod.def.params;\n payload.issues.push(util.issue(_iss));\n }\n}\n","export function isOctetType(\n input: unknown,\n): input is Uint8Array<ArrayBuffer> | Blob {\n return (\n input instanceof Uint8Array ||\n // File extends from Blob but is only available in nodejs from v20\n input instanceof Blob\n );\n}\n\nexport function isFormData(input: unknown) {\n return input instanceof FormData;\n}\n\nexport function isNonJsonSerializable(input: unknown) {\n return isOctetType(input) || isFormData(input);\n}\n","import type {\n inferClientTypes,\n InferrableClientTypes,\n Maybe,\n TRPCErrorResponse,\n} from '@trpc/server/unstable-core-do-not-import';\nimport {\n isObject,\n type DefaultErrorShape,\n} from '@trpc/server/unstable-core-do-not-import';\n\ntype inferErrorShape<TInferrable extends InferrableClientTypes> =\n inferClientTypes<TInferrable>['errorShape'];\nexport interface TRPCClientErrorBase<TShape extends DefaultErrorShape> {\n readonly message: string;\n readonly shape: Maybe<TShape>;\n readonly data: Maybe<TShape['data']>;\n}\nexport type TRPCClientErrorLike<TInferrable extends InferrableClientTypes> =\n TRPCClientErrorBase<inferErrorShape<TInferrable>>;\n\nexport function isTRPCClientError<TInferrable extends InferrableClientTypes>(\n cause: unknown,\n): cause is TRPCClientError<TInferrable> {\n return cause instanceof TRPCClientError;\n}\n\nfunction isTRPCErrorResponse(obj: unknown): obj is TRPCErrorResponse<any> {\n return (\n isObject(obj) &&\n isObject(obj['error']) &&\n typeof obj['error']['code'] === 'number' &&\n typeof obj['error']['message'] === 'string'\n );\n}\n\nfunction getMessageFromUnknownError(err: unknown, fallback: string): string {\n if (typeof err === 'string') {\n return err;\n }\n if (isObject(err) && typeof err['message'] === 'string') {\n return err['message'];\n }\n return fallback;\n}\n\nexport class TRPCClientError<TRouterOrProcedure extends InferrableClientTypes>\n extends Error\n implements TRPCClientErrorBase<inferErrorShape<TRouterOrProcedure>>\n{\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore override doesn't work in all environments due to \"This member cannot have an 'override' modifier because it is not declared in the base class 'Error'\"\n public override readonly cause;\n public readonly shape: Maybe<inferErrorShape<TRouterOrProcedure>>;\n public readonly data: Maybe<inferErrorShape<TRouterOrProcedure>['data']>;\n\n /**\n * Additional meta data about the error\n * In the case of HTTP-errors, we'll have `response` and potentially `responseJSON` here\n */\n public meta;\n\n constructor(\n message: string,\n opts?: {\n result?: Maybe<TRPCErrorResponse<inferErrorShape<TRouterOrProcedure>>>;\n cause?: Error;\n meta?: Record<string, unknown>;\n },\n ) {\n const cause = opts?.cause;\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore https://github.com/tc39/proposal-error-cause\n super(message, { cause });\n\n this.meta = opts?.meta;\n\n this.cause = cause;\n this.shape = opts?.result?.error;\n this.data = opts?.result?.error.data;\n this.name = 'TRPCClientError';\n\n Object.setPrototypeOf(this, TRPCClientError.prototype);\n }\n\n public static from<TRouterOrProcedure extends InferrableClientTypes>(\n _cause: Error | TRPCErrorResponse<any> | object,\n opts: { meta?: Record<string, unknown>; cause?: Error } = {},\n ): TRPCClientError<TRouterOrProcedure> {\n const cause = _cause as unknown;\n\n if (isTRPCClientError(cause)) {\n if (opts.meta) {\n // Decorate with meta error data\n cause.meta = {\n ...cause.meta,\n ...opts.meta,\n };\n }\n return cause;\n }\n if (isTRPCErrorResponse(cause)) {\n return new TRPCClientError(cause.error.message, {\n ...opts,\n result: cause,\n cause: opts.cause,\n });\n }\n return new TRPCClientError(\n getMessageFromUnknownError(cause, 'Unknown error'),\n {\n ...opts,\n cause: cause as any,\n },\n );\n }\n}\n","import * as core from \"../core/index.js\";\nimport { util } from \"../core/index.js\";\nimport * as processors from \"../core/json-schema-processors.js\";\nimport * as regexes from \"../core/regexes.js\";\nimport { createStandardJSONSchemaMethod, createToJSONSchemaMethod } from \"../core/to-json-schema.js\";\nimport en from \"../locales/en.js\";\nimport * as checks from \"./checks.js\";\nimport * as parse from \"./parse.js\";\n// Register English as the default locale on first ZodType construction. Hooked into the `ZodType` `$constructor` (rather than a top-level `config(en())` in `external.ts`) so bundlers honoring `sideEffects: false` can't tree-shake it out — see #5953, #5725. An explicit `z.config(z.locales.xx())` call wins regardless of order, since this only sets the default when none is present.\nfunction _ensureDefaultLocale() {\n if (!core.globalConfig.localeError)\n core.config(en());\n}\n// the default memoizer is read by the core container init, which runs before `ZodType.init`, so each container calls this first\nfunction _ensureDefaultMemoizer() {\n if (!core.globalConfig.memoizer)\n core.config({ memoizer: core.memoizer() });\n}\nexport const ZodType = /*@__PURE__*/ core.$constructor(\"ZodType\", (inst, def) => {\n _ensureDefaultLocale();\n core.$ZodType.init(inst, def);\n inst.def = def;\n inst.type = def.type;\n return inst;\n}, {\n check(...chks) {\n const def = this.def;\n return this.clone(util.mergeDefs(def, {\n checks: [\n ...(def.checks ?? []),\n ...chks.map((ch) => typeof ch === \"function\" ? { _zod: { check: ch, def: { check: \"custom\" }, onattach: [] } } : ch),\n ],\n }), { parent: true });\n },\n with(...chks) {\n return this.check(...chks);\n },\n clone(def, params) {\n return core.clone(this, def, params);\n },\n brand() {\n return this;\n },\n register(reg, meta) {\n reg.add(this, meta);\n return this;\n },\n refine(check, params) {\n return this.check(refine(check, params));\n },\n superRefine(refinement, params) {\n return this.check(superRefine(refinement, params));\n },\n overwrite(fn) {\n return this.check(checks.overwrite(fn));\n },\n optional() {\n return optional(this);\n },\n exactOptional() {\n return exactOptional(this);\n },\n nullable() {\n return nullable(this);\n },\n nullish() {\n return optional(nullable(this));\n },\n nonoptional(params) {\n return nonoptional(this, params);\n },\n array() {\n return array(this);\n },\n or(arg) {\n return union([this, arg]);\n },\n and(arg) {\n return intersection(this, arg);\n },\n transform(tx) {\n return pipe(this, transform(tx));\n },\n default(d) {\n return _default(this, d);\n },\n prefault(d) {\n return prefault(this, d);\n },\n catch(params) {\n return _catch(this, params);\n },\n pipe(target) {\n return pipe(this, target);\n },\n readonly() {\n return readonly(this);\n },\n describe(description) {\n const cl = this.clone();\n core.globalRegistry.add(cl, { description });\n return cl;\n },\n meta(...args) {\n // overloaded: meta() returns the registered metadata, meta(data) returns a clone with `data` registered. The mapped type picks up the second overload, so we accept variadic any-args and return `any` to satisfy both at runtime.\n if (args.length === 0)\n return core.globalRegistry.get(this);\n const cl = this.clone();\n core.globalRegistry.add(cl, args[0]);\n return cl;\n },\n isOptional() {\n return this.safeParse(undefined).success;\n },\n isNullable() {\n return this.safeParse(null).success;\n },\n apply(fn, ...args) {\n return args.length === 0 ? fn(this) : fn(this, ...args);\n },\n // Overrides core's `~standard` to add `jsonSchema`. Must stay a prototype entry: redefining it per instance demotes instances to dictionary mode.\n get \"~standard\"() {\n return util.hide(this, \"~standard\", {\n ...core.standardProps(this),\n jsonSchema: {\n input: createStandardJSONSchemaMethod(this, \"input\"),\n output: createStandardJSONSchemaMethod(this, \"output\"),\n },\n });\n },\n set \"~standard\"(value) {\n util.own(this, \"~standard\", value);\n },\n parse: function _parse(data, params) {\n return parse.parse(this, data, params, { callee: _parse });\n },\n parseAsync: async function _parseAsync(data, params) {\n return await parse.parseAsync(this, data, params, { callee: _parseAsync });\n },\n safeParse(data, params) {\n return parse.safeParse(this, data, params);\n },\n async safeParseAsync(data, params) {\n return parse.safeParseAsync(this, data, params);\n },\n // `spa` is an alias: same function object as `safeParseAsync`, as before.\n get spa() {\n return this?.safeParseAsync;\n },\n set spa(value) {\n util.own(this, \"spa\", value);\n },\n validate(data, params) {\n return parse.validate(this, data, params);\n },\n validateAsync(data, params) {\n return parse.validateAsync(this, data, params);\n },\n encode: function _encode(data, params) {\n return parse.encode(this, data, params, { callee: _encode });\n },\n decode: function _decode(data, params) {\n return parse.decode(this, data, params, { callee: _decode });\n },\n encodeAsync: async function _encodeAsync(data, params) {\n return await parse.encodeAsync(this, data, params, { callee: _encodeAsync });\n },\n decodeAsync: async function _decodeAsync(data, params) {\n return await parse.decodeAsync(this, data, params, { callee: _decodeAsync });\n },\n safeEncode(data, params) {\n return parse.safeEncode(this, data, params);\n },\n safeDecode(data, params) {\n return parse.safeDecode(this, data, params);\n },\n async safeEncodeAsync(data, params) {\n return parse.safeEncodeAsync(this, data, params);\n },\n async safeDecodeAsync(data, params) {\n return parse.safeDecodeAsync(this, data, params);\n },\n toJSONSchema(params) {\n return createToJSONSchemaMethod(this, {})(params);\n },\n // Reads through to the registry on every access, so it must not cache.\n get description() {\n return core.globalRegistry.get(this)?.description;\n },\n // No setter: `schema._def = x` throws, as it did when `_def` was a non-writable own property.\n get _def() {\n return this._zod.def;\n },\n});\n/** @internal */\nexport const _ZodString = /*@__PURE__*/ core.$constructor(\"_ZodString\", (inst, def) => {\n core.$ZodString.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.stringProcessor(inst, ctx, json, params);\n}, \n/*@__PURE__*/ util.derived({\n format: (inst) => processors.aggregateChecks(inst).format ?? null,\n minLength: (inst) => processors.aggregateChecks(inst).minimum ?? null,\n maxLength: (inst) => processors.aggregateChecks(inst).maximum ?? null,\n}, {\n regex(...args) {\n return this.check(checks.regex(...args));\n },\n includes(...args) {\n return this.check(checks.includes(...args));\n },\n startsWith(...args) {\n return this.check(checks.startsWith(...args));\n },\n endsWith(...args) {\n return this.check(checks.endsWith(...args));\n },\n min(...args) {\n return this.check(checks.minLength(...args));\n },\n max(...args) {\n return this.check(checks.maxLength(...args));\n },\n length(...args) {\n return this.check(checks.length(...args));\n },\n nonempty(...args) {\n return this.check(checks.minLength(1, ...args));\n },\n lowercase(params) {\n return this.check(checks.lowercase(params));\n },\n uppercase(params) {\n return this.check(checks.uppercase(params));\n },\n trim() {\n return this.check(checks.trim());\n },\n normalize(...args) {\n return this.check(checks.normalize(...args));\n },\n toLowerCase() {\n return this.check(checks.toLowerCase());\n },\n toUpperCase() {\n return this.check(checks.toUpperCase());\n },\n slugify() {\n return this.check(checks.slugify());\n },\n}));\nexport const ZodString = /*@__PURE__*/ core.$constructor(\"ZodString\", (inst, def) => {\n core.$ZodString.init(inst, def);\n _ZodString.init(inst, def);\n}, {\n email(params) {\n return this.check(core._email(ZodEmail, params));\n },\n url(params) {\n return this.check(core._url(ZodURL, params));\n },\n jwt(params) {\n return this.check(core._jwt(ZodJWT, params));\n },\n emoji(params) {\n return this.check(core._emoji(ZodEmoji, params));\n },\n guid(params) {\n return this.check(core._guid(ZodGUID, params));\n },\n uuid(params) {\n return this.check(core._uuid(ZodUUID, params));\n },\n uuidv4(params) {\n return this.check(core._uuidv4(ZodUUID, params));\n },\n uuidv6(params) {\n return this.check(core._uuidv6(ZodUUID, params));\n },\n uuidv7(params) {\n return this.check(core._uuidv7(ZodUUID, params));\n },\n nanoid(params) {\n return this.check(core._nanoid(ZodNanoID, params));\n },\n cuid(params) {\n return this.check(core._cuid(ZodCUID, params));\n },\n cuid2(params) {\n return this.check(core._cuid2(ZodCUID2, params));\n },\n ulid(params) {\n return this.check(core._ulid(ZodULID, params));\n },\n base64(params) {\n return this.check(core._base64(ZodBase64, params));\n },\n base64url(params) {\n return this.check(core._base64url(ZodBase64URL, params));\n },\n xid(params) {\n return this.check(core._xid(ZodXID, params));\n },\n ksuid(params) {\n return this.check(core._ksuid(ZodKSUID, params));\n },\n ipv4(params) {\n return this.check(core._ipv4(ZodIPv4, params));\n },\n ipv6(params) {\n return this.check(core._ipv6(ZodIPv6, params));\n },\n cidrv4(params) {\n return this.check(core._cidrv4(ZodCIDRv4, params));\n },\n cidrv6(params) {\n return this.check(core._cidrv6(ZodCIDRv6, params));\n },\n e164(params) {\n return this.check(core._e164(ZodE164, params));\n },\n datetime(params) {\n return this.check(core._isoDateTime(ZodISODateTime, params));\n },\n date(params) {\n return this.check(core._isoDate(ZodISODate, params));\n },\n time(params) {\n return this.check(core._isoTime(ZodISOTime, params));\n },\n duration(params) {\n return this.check(core._isoDuration(ZodISODuration, params));\n },\n});\nexport function string(params) {\n return core._string(ZodString, params);\n}\nexport const ZodStringFormat = /*@__PURE__*/ core.$constructor(\"ZodStringFormat\", (inst, def) => {\n core.$ZodStringFormat.init(inst, def);\n _ZodString.init(inst, def);\n});\nexport const ZodISODateTime = /*@__PURE__*/ core.$constructor(\"ZodISODateTime\", (inst, def) => {\n core.$ZodISODateTime.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport const ZodISODate = /*@__PURE__*/ core.$constructor(\"ZodISODate\", (inst, def) => {\n core.$ZodISODate.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport const ZodISOTime = /*@__PURE__*/ core.$constructor(\"ZodISOTime\", (inst, def) => {\n core.$ZodISOTime.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport const ZodISODuration = /*@__PURE__*/ core.$constructor(\"ZodISODuration\", (inst, def) => {\n core.$ZodISODuration.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport const ZodEmail = /*@__PURE__*/ core.$constructor(\"ZodEmail\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodEmail.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function email(params) {\n return core._email(ZodEmail, params);\n}\nexport const ZodGUID = /*@__PURE__*/ core.$constructor(\"ZodGUID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodGUID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function guid(params) {\n return core._guid(ZodGUID, params);\n}\nexport const ZodUUID = /*@__PURE__*/ core.$constructor(\"ZodUUID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodUUID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function uuid(params) {\n return core._uuid(ZodUUID, params);\n}\nexport function uuidv4(params) {\n return core._uuidv4(ZodUUID, params);\n}\n// ZodUUIDv6\nexport function uuidv6(params) {\n return core._uuidv6(ZodUUID, params);\n}\n// ZodUUIDv7\nexport function uuidv7(params) {\n return core._uuidv7(ZodUUID, params);\n}\nexport const ZodURL = /*@__PURE__*/ core.$constructor(\"ZodURL\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodURL.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function url(params) {\n return core._url(ZodURL, params);\n}\nexport function httpUrl(params) {\n return core._url(ZodURL, {\n protocol: regexes.httpProtocol,\n hostname: regexes.domain,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodEmoji = /*@__PURE__*/ core.$constructor(\"ZodEmoji\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodEmoji.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function emoji(params) {\n return core._emoji(ZodEmoji, params);\n}\nexport const ZodNanoID = /*@__PURE__*/ core.$constructor(\"ZodNanoID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodNanoID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function nanoid(params) {\n return core._nanoid(ZodNanoID, params);\n}\n/**\n * @deprecated CUID v1 is deprecated by its authors due to information leakage\n * (timestamps embedded in the id). Use {@link ZodCUID2} instead.\n * See https://github.com/paralleldrive/cuid.\n */\nexport const ZodCUID = /*@__PURE__*/ core.$constructor(\"ZodCUID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodCUID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\n/**\n * Validates a CUID v1 string.\n *\n * @deprecated CUID v1 is deprecated by its authors due to information leakage\n * (timestamps embedded in the id). Use {@link cuid2 | `z.cuid2()`} instead.\n * See https://github.com/paralleldrive/cuid.\n */\nexport function cuid(params) {\n return core._cuid(ZodCUID, params);\n}\nexport const ZodCUID2 = /*@__PURE__*/ core.$constructor(\"ZodCUID2\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodCUID2.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function cuid2(params) {\n return core._cuid2(ZodCUID2, params);\n}\nexport const ZodULID = /*@__PURE__*/ core.$constructor(\"ZodULID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodULID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function ulid(params) {\n return core._ulid(ZodULID, params);\n}\nexport const ZodXID = /*@__PURE__*/ core.$constructor(\"ZodXID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodXID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function xid(params) {\n return core._xid(ZodXID, params);\n}\nexport const ZodKSUID = /*@__PURE__*/ core.$constructor(\"ZodKSUID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodKSUID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function ksuid(params) {\n return core._ksuid(ZodKSUID, params);\n}\nexport const ZodIPv4 = /*@__PURE__*/ core.$constructor(\"ZodIPv4\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodIPv4.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function ipv4(params) {\n return core._ipv4(ZodIPv4, params);\n}\nexport const ZodMAC = /*@__PURE__*/ core.$constructor(\"ZodMAC\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodMAC.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function mac(params) {\n return core._mac(ZodMAC, params);\n}\nexport const ZodIPv6 = /*@__PURE__*/ core.$constructor(\"ZodIPv6\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodIPv6.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function ipv6(params) {\n return core._ipv6(ZodIPv6, params);\n}\nexport const ZodCIDRv4 = /*@__PURE__*/ core.$constructor(\"ZodCIDRv4\", (inst, def) => {\n core.$ZodCIDRv4.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function cidrv4(params) {\n return core._cidrv4(ZodCIDRv4, params);\n}\nexport const ZodCIDRv6 = /*@__PURE__*/ core.$constructor(\"ZodCIDRv6\", (inst, def) => {\n core.$ZodCIDRv6.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function cidrv6(params) {\n return core._cidrv6(ZodCIDRv6, params);\n}\nexport const ZodBase64 = /*@__PURE__*/ core.$constructor(\"ZodBase64\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodBase64.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function base64(params) {\n return core._base64(ZodBase64, params);\n}\nexport const ZodBase64URL = /*@__PURE__*/ core.$constructor(\"ZodBase64URL\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodBase64URL.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function base64url(params) {\n return core._base64url(ZodBase64URL, params);\n}\nexport const ZodE164 = /*@__PURE__*/ core.$constructor(\"ZodE164\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodE164.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function e164(params) {\n return core._e164(ZodE164, params);\n}\nexport const ZodCreditCard = /*@__PURE__*/ core.$constructor(\"ZodCreditCard\", (inst, def) => {\n core.$ZodCreditCard.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function creditCard(params) {\n return core._creditCard(ZodCreditCard, params);\n}\nexport const ZodIBAN = /*@__PURE__*/ core.$constructor(\"ZodIBAN\", (inst, def) => {\n core.$ZodIBAN.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function iban(params) {\n return core._iban(ZodIBAN, params);\n}\nexport const ZodJWT = /*@__PURE__*/ core.$constructor(\"ZodJWT\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodJWT.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function jwt(params) {\n return core._jwt(ZodJWT, params);\n}\nexport const ZodCustomStringFormat = /*@__PURE__*/ core.$constructor(\"ZodCustomStringFormat\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodCustomStringFormat.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function stringFormat(format, fnOrRegex, _params = {}) {\n return core._stringFormat(ZodCustomStringFormat, format, fnOrRegex, _params);\n}\nexport function hostname(_params) {\n return core._stringFormat(ZodCustomStringFormat, \"hostname\", regexes.hostname, _params);\n}\nexport function hex(_params) {\n return core._stringFormat(ZodCustomStringFormat, \"hex\", regexes.hex, _params);\n}\nexport function currencyCode(_params) {\n return core._stringFormat(ZodCustomStringFormat, \"currency_code\", regexes.currencyCode, _params);\n}\nexport function hash(alg, params) {\n const enc = params?.enc ?? \"hex\";\n const format = `${alg}_${enc}`;\n const regex = core.regexes[format];\n if (!regex)\n throw new Error(`Unrecognized hash format: ${format}`);\n return core._stringFormat(ZodCustomStringFormat, format, regex, params);\n}\nexport const ZodNumber = /*@__PURE__*/ core.$constructor(\"ZodNumber\", (inst, def) => {\n core.$ZodNumber.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.numberProcessor(inst, ctx, json, params);\n inst.isFinite = true;\n}, \n/*@__PURE__*/ util.derived({\n minValue: (inst) => {\n const { minimum, exclusiveMinimum } = processors.aggregateChecks(inst);\n return Math.max(minimum ?? Number.NEGATIVE_INFINITY, exclusiveMinimum ?? Number.NEGATIVE_INFINITY);\n },\n maxValue: (inst) => {\n const { maximum, exclusiveMaximum } = processors.aggregateChecks(inst);\n return Math.min(maximum ?? Number.POSITIVE_INFINITY, exclusiveMaximum ?? Number.POSITIVE_INFINITY);\n },\n isInt: (inst) => {\n const { isInt, multipleOf } = processors.aggregateChecks(inst);\n return !!isInt || !!multipleOf?.some(Number.isSafeInteger);\n },\n format: (inst) => processors.aggregateChecks(inst).format ?? null,\n}, {\n gt(value, params) {\n return this.check(checks.gt(value, params));\n },\n gte(value, params) {\n return this.check(checks.gte(value, params));\n },\n min(value, params) {\n return this.check(checks.gte(value, params));\n },\n lt(value, params) {\n return this.check(checks.lt(value, params));\n },\n lte(value, params) {\n return this.check(checks.lte(value, params));\n },\n max(value, params) {\n return this.check(checks.lte(value, params));\n },\n int(params) {\n return this.check(int(params));\n },\n safe(params) {\n return this.check(int(params));\n },\n positive(params) {\n return this.check(checks.gt(0, params));\n },\n nonnegative(params) {\n return this.check(checks.gte(0, params));\n },\n negative(params) {\n return this.check(checks.lt(0, params));\n },\n nonpositive(params) {\n return this.check(checks.lte(0, params));\n },\n multipleOf(value, params) {\n return this.check(checks.multipleOf(value, params));\n },\n step(value, params) {\n return this.check(checks.multipleOf(value, params));\n },\n finite() {\n return this;\n },\n}));\nexport function number(params) {\n return core._number(ZodNumber, params);\n}\nexport const ZodNumberFormat = /*@__PURE__*/ core.$constructor(\"ZodNumberFormat\", (inst, def) => {\n core.$ZodNumberFormat.init(inst, def);\n ZodNumber.init(inst, def);\n});\nexport function int(params) {\n return core._int(ZodNumberFormat, params);\n}\nexport function float32(params) {\n return core._float32(ZodNumberFormat, params);\n}\nexport function float64(params) {\n return core._float64(ZodNumberFormat, params);\n}\nexport function int32(params) {\n return core._int32(ZodNumberFormat, params);\n}\nexport function uint32(params) {\n return core._uint32(ZodNumberFormat, params);\n}\nexport const ZodBoolean = /*@__PURE__*/ core.$constructor(\"ZodBoolean\", (inst, def) => {\n core.$ZodBoolean.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.booleanProcessor(inst, ctx, json, params);\n});\nexport function boolean(params) {\n return core._boolean(ZodBoolean, params);\n}\nexport const ZodBigInt = /*@__PURE__*/ core.$constructor(\"ZodBigInt\", (inst, def) => {\n core.$ZodBigInt.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.bigintProcessor(inst, ctx, json, params);\n}, \n/*@__PURE__*/ util.derived({\n minValue: (inst) => processors.aggregateChecks(inst).minimum ?? null,\n maxValue: (inst) => processors.aggregateChecks(inst).maximum ?? null,\n format: (inst) => processors.aggregateChecks(inst).format ?? null,\n}, {\n gte(value, params) {\n return this.check(checks.gte(value, params));\n },\n min(value, params) {\n return this.check(checks.gte(value, params));\n },\n gt(value, params) {\n return this.check(checks.gt(value, params));\n },\n lt(value, params) {\n return this.check(checks.lt(value, params));\n },\n lte(value, params) {\n return this.check(checks.lte(value, params));\n },\n max(value, params) {\n return this.check(checks.lte(value, params));\n },\n positive(params) {\n return this.check(checks.gt(BigInt(0), params));\n },\n negative(params) {\n return this.check(checks.lt(BigInt(0), params));\n },\n nonpositive(params) {\n return this.check(checks.lte(BigInt(0), params));\n },\n nonnegative(params) {\n return this.check(checks.gte(BigInt(0), params));\n },\n multipleOf(value, params) {\n return this.check(checks.multipleOf(value, params));\n },\n}));\nexport function bigint(params) {\n return core._bigint(ZodBigInt, params);\n}\nexport const ZodBigIntFormat = /*@__PURE__*/ core.$constructor(\"ZodBigIntFormat\", (inst, def) => {\n core.$ZodBigIntFormat.init(inst, def);\n ZodBigInt.init(inst, def);\n});\nexport function int64(params) {\n return core._int64(ZodBigIntFormat, params);\n}\nexport function uint64(params) {\n return core._uint64(ZodBigIntFormat, params);\n}\nexport const ZodSymbol = /*@__PURE__*/ core.$constructor(\"ZodSymbol\", (inst, def) => {\n core.$ZodSymbol.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.symbolProcessor(inst, ctx, json, params);\n});\nexport function symbol(params) {\n return core._symbol(ZodSymbol, params);\n}\nexport const ZodUndefined = /*@__PURE__*/ core.$constructor(\"ZodUndefined\", (inst, def) => {\n core.$ZodUndefined.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.undefinedProcessor(inst, ctx, json, params);\n});\nfunction _undefined(params) {\n return core._undefined(ZodUndefined, params);\n}\nexport { _undefined as undefined };\nexport const ZodNull = /*@__PURE__*/ core.$constructor(\"ZodNull\", (inst, def) => {\n core.$ZodNull.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.nullProcessor(inst, ctx, json, params);\n});\nfunction _null(params) {\n return core._null(ZodNull, params);\n}\nexport { _null as null };\nexport const ZodAny = /*@__PURE__*/ core.$constructor(\"ZodAny\", (inst, def) => {\n core.$ZodAny.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.anyProcessor(inst, ctx, json, params);\n});\nexport function any() {\n return core._any(ZodAny);\n}\nexport const ZodUnknown = /*@__PURE__*/ core.$constructor(\"ZodUnknown\", (inst, def) => {\n core.$ZodUnknown.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.unknownProcessor(inst, ctx, json, params);\n});\nexport function unknown() {\n return core._unknown(ZodUnknown);\n}\nexport const ZodNever = /*@__PURE__*/ core.$constructor(\"ZodNever\", (inst, def) => {\n core.$ZodNever.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.neverProcessor(inst, ctx, json, params);\n});\nexport function never(params) {\n return core._never(ZodNever, params);\n}\nexport const ZodVoid = /*@__PURE__*/ core.$constructor(\"ZodVoid\", (inst, def) => {\n core.$ZodVoid.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.voidProcessor(inst, ctx, json, params);\n});\nfunction _void(params) {\n return core._void(ZodVoid, params);\n}\nexport { _void as void };\nexport const ZodDate = /*@__PURE__*/ core.$constructor(\"ZodDate\", (inst, def) => {\n core.$ZodDate.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.dateProcessor(inst, ctx, json, params);\n inst.min = (value, params) => inst.check(checks.gte(value, params));\n inst.max = (value, params) => inst.check(checks.lte(value, params));\n}, \n/*@__PURE__*/ util.derived({\n minDate: (inst) => {\n const { minimum } = processors.aggregateChecks(inst);\n return minimum ? new Date(minimum) : null;\n },\n maxDate: (inst) => {\n const { maximum } = processors.aggregateChecks(inst);\n return maximum ? new Date(maximum) : null;\n },\n}, {}));\nexport function date(params) {\n return core._date(ZodDate, params);\n}\nexport const ZodArray = /*@__PURE__*/ core.$constructor(\"ZodArray\", (inst, def) => {\n _ensureDefaultMemoizer();\n core.$ZodArray.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.arrayProcessor(inst, ctx, json, params);\n inst.element = def.element;\n}, {\n min(n, params) {\n return this.check(checks.minLength(n, params));\n },\n nonempty(params) {\n return this.check(checks.minLength(1, params));\n },\n max(n, params) {\n return this.check(checks.maxLength(n, params));\n },\n length(n, params) {\n return this.check(checks.length(n, params));\n },\n unwrap() {\n return this.element;\n },\n});\nexport function array(element, params) {\n return core._array(ZodArray, element, params);\n}\n// .keyof\nexport function keyof(schema) {\n const shape = schema._zod.def.shape;\n return _enum(Object.keys(shape));\n}\nexport const ZodObject = /*@__PURE__*/ core.$constructor(\"ZodObject\", (inst, def) => {\n _ensureDefaultMemoizer();\n core.$ZodObjectJIT.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.objectProcessor(inst, ctx, json, params);\n util.installLazyProp(inst, \"shape\", (self) => self._zod.def.shape, false);\n}, {\n keyof() {\n return _enum(Object.keys(this._zod.def.shape));\n },\n catchall(catchall) {\n // `mergeDefs` rather than a spread: spreading reads `shape`, and resolving it can mint a whole fresh subtree\n return this.clone(util.mergeDefs(this._zod.def, { catchall: catchall }));\n },\n passthrough() {\n return this.clone(util.mergeDefs(this._zod.def, { catchall: unknown() }));\n },\n loose() {\n return this.clone(util.mergeDefs(this._zod.def, { catchall: unknown() }));\n },\n strict() {\n return this.clone(util.mergeDefs(this._zod.def, { catchall: never() }));\n },\n strip() {\n return this.clone(util.mergeDefs(this._zod.def, { catchall: undefined }));\n },\n extend(incoming) {\n return util.extend(this, incoming);\n },\n safeExtend(incoming) {\n return util.safeExtend(this, incoming);\n },\n merge(other) {\n return util.merge(this, other);\n },\n pick(mask) {\n return util.pick(this, mask);\n },\n omit(mask) {\n return util.omit(this, mask);\n },\n partial(...args) {\n return util.partial(ZodOptional, this, args[0]);\n },\n exactPartial(...args) {\n return util.partial(ZodExactOptional, this, args[0], \"exactPartial\");\n },\n required(...args) {\n return util.required(ZodNonOptional, this, args[0]);\n },\n});\nexport function object(shape, params) {\n const def = {\n type: \"object\",\n shape: shape ?? {},\n ...util.normalizeParams(params),\n };\n return new ZodObject(def);\n}\n// strictObject\nexport function strictObject(shape, params) {\n return new ZodObject({\n type: \"object\",\n shape,\n catchall: never(),\n ...util.normalizeParams(params),\n });\n}\n// looseObject\nexport function looseObject(shape, params) {\n return new ZodObject({\n type: \"object\",\n shape,\n catchall: unknown(),\n ...util.normalizeParams(params),\n });\n}\nexport const ZodUnion = /*@__PURE__*/ core.$constructor(\"ZodUnion\", (inst, def) => {\n core.$ZodUnion.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.unionProcessor(inst, ctx, json, params);\n inst.options = def.options;\n});\nexport function union(options, params) {\n return new ZodUnion({\n type: \"union\",\n options: options,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodXor = /*@__PURE__*/ core.$constructor(\"ZodXor\", (inst, def) => {\n ZodUnion.init(inst, def);\n core.$ZodXor.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.unionProcessor(inst, ctx, json, params);\n inst.options = def.options;\n});\n/** Creates an exclusive union (XOR) where exactly one option must match.\n * Unlike regular unions that succeed when any option matches, xor fails if\n * zero or more than one option matches the input. */\nexport function xor(options, params) {\n return new ZodXor({\n type: \"union\",\n options: options,\n inclusive: false,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodDiscriminatedUnion = /*@__PURE__*/ core.$constructor(\"ZodDiscriminatedUnion\", (inst, def) => {\n ZodUnion.init(inst, def);\n core.$ZodDiscriminatedUnion.init(inst, def);\n});\nexport function discriminatedUnion(discriminator, options, params) {\n // const [options, params] = args;\n return new ZodDiscriminatedUnion({\n type: \"union\",\n options: options,\n discriminator,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodIntersection = /*@__PURE__*/ core.$constructor(\"ZodIntersection\", (inst, def) => {\n core.$ZodIntersection.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.intersectionProcessor(inst, ctx, json, params);\n});\nexport function intersection(left, right) {\n return new ZodIntersection({\n type: \"intersection\",\n left: left,\n right: right,\n });\n}\nexport const ZodTuple = /*@__PURE__*/ core.$constructor(\"ZodTuple\", (inst, def) => {\n _ensureDefaultMemoizer();\n core.$ZodTuple.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.tupleProcessor(inst, ctx, json, params);\n}, {\n rest(rest) {\n return this.clone({\n ...this._zod.def,\n rest: rest,\n });\n },\n partial() {\n const def = this._zod.def;\n // a refinement was authored against the full arity; partialing would run it on a shorter array\n if (def.checks?.length)\n throw new Error(\".partial() cannot be used on tuple schemas containing refinements\");\n return this.clone({\n ...def,\n items: def.items.map((item) => new ZodOptional({ type: \"optional\", innerType: item })),\n });\n },\n});\nexport function tuple(items, _paramsOrRest, _params) {\n const hasRest = _paramsOrRest instanceof core.$ZodType;\n const params = hasRest ? _params : _paramsOrRest;\n const rest = hasRest ? _paramsOrRest : null;\n return new ZodTuple({\n type: \"tuple\",\n items: items,\n rest,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodRecord = /*@__PURE__*/ core.$constructor(\"ZodRecord\", (inst, def) => {\n _ensureDefaultMemoizer();\n core.$ZodRecord.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.recordProcessor(inst, ctx, json, params);\n inst.keyType = def.keyType;\n inst.valueType = def.valueType;\n});\nexport function record(keyType, valueType, params) {\n // v3-compat: z.record(valueType, params?) — defaults keyType to z.string()\n if (!valueType || !valueType._zod) {\n return new ZodRecord({\n type: \"record\",\n keyType: string(),\n valueType: keyType,\n ...util.normalizeParams(valueType),\n });\n }\n return new ZodRecord({\n type: \"record\",\n keyType,\n valueType: valueType,\n ...util.normalizeParams(params),\n });\n}\n// type alksjf = core.output<core.$ZodRecordKey>;\nexport function partialRecord(keyType, valueType, params) {\n return new ZodRecord({\n type: \"record\",\n keyType,\n valueType: valueType,\n ...util.normalizeParams(params),\n partial: true,\n });\n}\nexport function looseRecord(keyType, valueType, params) {\n return new ZodRecord({\n type: \"record\",\n keyType,\n valueType: valueType,\n mode: \"loose\",\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMap = /*@__PURE__*/ core.$constructor(\"ZodMap\", (inst, def) => {\n _ensureDefaultMemoizer();\n core.$ZodMap.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.mapProcessor(inst, ctx, json, params);\n inst.keyType = def.keyType;\n inst.valueType = def.valueType;\n inst.min = (...args) => inst.check(core._minSize(...args));\n inst.nonempty = (params) => inst.check(core._minSize(1, params));\n inst.max = (...args) => inst.check(core._maxSize(...args));\n inst.size = (...args) => inst.check(core._size(...args));\n});\nexport function map(keyType, valueType, params) {\n return new ZodMap({\n type: \"map\",\n keyType: keyType,\n valueType: valueType,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodSet = /*@__PURE__*/ core.$constructor(\"ZodSet\", (inst, def) => {\n _ensureDefaultMemoizer();\n core.$ZodSet.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.setProcessor(inst, ctx, json, params);\n inst.min = (...args) => inst.check(core._minSize(...args));\n inst.nonempty = (params) => inst.check(core._minSize(1, params));\n inst.max = (...args) => inst.check(core._maxSize(...args));\n inst.size = (...args) => inst.check(core._size(...args));\n});\nexport function set(valueType, params) {\n return new ZodSet({\n type: \"set\",\n valueType: valueType,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodEnum = /*@__PURE__*/ core.$constructor(\"ZodEnum\", (inst, def) => {\n core.$ZodEnum.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.enumProcessor(inst, ctx, json, params);\n inst.enum = def.entries;\n // reuse the parsed value set so a numeric TS enum's reverse-mapping keys stay out\n inst.options = [...inst._zod.values];\n const keys = new Set(Object.keys(def.entries));\n inst.extract = (values, params) => {\n const newEntries = {};\n for (const value of values) {\n if (keys.has(value)) {\n newEntries[value] = def.entries[value];\n }\n else\n throw new Error(`Key ${value} not found in enum`);\n }\n return new ZodEnum({\n ...def,\n checks: [],\n ...util.normalizeParams(params),\n entries: newEntries,\n });\n };\n inst.exclude = (values, params) => {\n const newEntries = { ...def.entries };\n for (const value of values) {\n if (keys.has(value)) {\n delete newEntries[value];\n }\n else\n throw new Error(`Key ${value} not found in enum`);\n }\n return new ZodEnum({\n ...def,\n checks: [],\n ...util.normalizeParams(params),\n entries: newEntries,\n });\n };\n});\nfunction _enum(values, params) {\n const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;\n return new ZodEnum({\n type: \"enum\",\n entries,\n ...util.normalizeParams(params),\n });\n}\nexport { _enum as enum };\n/** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.\n *\n * ```ts\n * enum Colors { red, green, blue }\n * z.enum(Colors);\n * ```\n */\nexport function nativeEnum(entries, params) {\n return new ZodEnum({\n type: \"enum\",\n entries,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodLiteral = /*@__PURE__*/ core.$constructor(\"ZodLiteral\", (inst, def) => {\n core.$ZodLiteral.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.literalProcessor(inst, ctx, json, params);\n inst.values = new Set(def.values);\n Object.defineProperty(inst, \"value\", {\n get() {\n if (def.values.length > 1) {\n throw new Error(\"This schema contains multiple valid literal values. Use `.values` instead.\");\n }\n return def.values[0];\n },\n });\n});\nexport function literal(value, params) {\n return new ZodLiteral({\n type: \"literal\",\n values: Array.isArray(value) ? value : [value],\n ...util.normalizeParams(params),\n });\n}\nexport const ZodFile = /*@__PURE__*/ core.$constructor(\"ZodFile\", (inst, def) => {\n core.$ZodFile.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.fileProcessor(inst, ctx, json, params);\n inst.min = (size, params) => inst.check(core._minSize(size, params));\n inst.max = (size, params) => inst.check(core._maxSize(size, params));\n inst.mime = (types, params) => inst.check(core._mime(Array.isArray(types) ? types : [types], params));\n});\nexport function file(params) {\n return core._file(ZodFile, params);\n}\nexport const ZodTransform = /*@__PURE__*/ core.$constructor(\"ZodTransform\", (inst, def) => {\n _ensureDefaultMemoizer();\n core.$ZodTransform.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.transformProcessor(inst, ctx, json, params);\n inst._zod.parse = (payload, _ctx) => {\n if (_ctx.direction === \"backward\") {\n throw new core.$ZodEncodeError(inst.constructor.name);\n }\n payload.addIssue = (issue) => {\n if (typeof issue === \"string\") {\n payload.issues.push(util.issue(issue, payload.value, def));\n }\n else {\n // for Zod 3 backwards compatibility\n const _issue = issue;\n if (_issue.fatal)\n _issue.continue = false;\n _issue.code ?? (_issue.code = \"custom\");\n if (!(\"input\" in _issue))\n _issue.input = payload.value;\n _issue.inst ?? (_issue.inst = inst);\n // _issue.continue ??= true;\n payload.issues.push(util.issue(_issue));\n }\n };\n const output = def.transform(payload.value, payload);\n if (output instanceof Promise) {\n return output.then((output) => {\n payload.value = output;\n return payload;\n });\n }\n payload.value = output;\n return payload;\n };\n});\nexport function transform(fn) {\n return new ZodTransform({\n type: \"transform\",\n transform: fn,\n });\n}\nexport const ZodOptional = /*@__PURE__*/ core.$constructor(\"ZodOptional\", (inst, def) => {\n core.$ZodOptional.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.optionalProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function optional(innerType) {\n return new ZodOptional({\n type: \"optional\",\n innerType: innerType,\n });\n}\nexport const ZodExactOptional = /*@__PURE__*/ core.$constructor(\"ZodExactOptional\", (inst, def) => {\n core.$ZodExactOptional.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.optionalProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function exactOptional(innerType) {\n return new ZodExactOptional({\n type: \"optional\",\n innerType: innerType,\n });\n}\nexport const ZodNullable = /*@__PURE__*/ core.$constructor(\"ZodNullable\", (inst, def) => {\n core.$ZodNullable.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.nullableProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function nullable(innerType) {\n return new ZodNullable({\n type: \"nullable\",\n innerType: innerType,\n });\n}\n// nullish\nexport function nullish(innerType) {\n return optional(nullable(innerType));\n}\nexport const ZodDefault = /*@__PURE__*/ core.$constructor(\"ZodDefault\", (inst, def) => {\n core.$ZodDefault.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.defaultProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n inst.removeDefault = inst.unwrap;\n});\nexport function _default(innerType, defaultValue) {\n return new ZodDefault({\n type: \"default\",\n innerType: innerType,\n get defaultValue() {\n return typeof defaultValue === \"function\" ? defaultValue() : util.shallowClone(defaultValue);\n },\n });\n}\nexport const ZodPrefault = /*@__PURE__*/ core.$constructor(\"ZodPrefault\", (inst, def) => {\n core.$ZodPrefault.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.prefaultProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function prefault(innerType, defaultValue) {\n return new ZodPrefault({\n type: \"prefault\",\n innerType: innerType,\n get defaultValue() {\n return typeof defaultValue === \"function\" ? defaultValue() : util.shallowClone(defaultValue);\n },\n });\n}\nexport const ZodNonOptional = /*@__PURE__*/ core.$constructor(\"ZodNonOptional\", (inst, def) => {\n core.$ZodNonOptional.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.nonoptionalProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function nonoptional(innerType, params) {\n return new ZodNonOptional({\n type: \"nonoptional\",\n innerType: innerType,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodSuccess = /*@__PURE__*/ core.$constructor(\"ZodSuccess\", (inst, def) => {\n core.$ZodSuccess.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.successProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function success(innerType) {\n return new ZodSuccess({\n type: \"success\",\n innerType: innerType,\n });\n}\nexport const ZodCatch = /*@__PURE__*/ core.$constructor(\"ZodCatch\", (inst, def) => {\n core.$ZodCatch.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.catchProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n inst.removeCatch = inst.unwrap;\n});\nfunction _catch(innerType, catchValue) {\n return new ZodCatch({\n type: \"catch\",\n innerType: innerType,\n catchValue: (typeof catchValue === \"function\" ? catchValue : core.util.constantCatch(catchValue)),\n });\n}\nexport { _catch as catch };\nexport const ZodNaN = /*@__PURE__*/ core.$constructor(\"ZodNaN\", (inst, def) => {\n core.$ZodNaN.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.nanProcessor(inst, ctx, json, params);\n});\nexport function nan(params) {\n return core._nan(ZodNaN, params);\n}\nexport const ZodPipe = /*@__PURE__*/ core.$constructor(\"ZodPipe\", (inst, def) => {\n core.$ZodPipe.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.pipeProcessor(inst, ctx, json, params);\n inst.in = def.in;\n inst.out = def.out;\n});\nexport function pipe(in_, out) {\n return new ZodPipe({\n type: \"pipe\",\n in: in_,\n out: out,\n // ...util.normalizeParams(params),\n });\n}\nexport const ZodCodec = /*@__PURE__*/ core.$constructor(\"ZodCodec\", (inst, def) => {\n ZodPipe.init(inst, def);\n core.$ZodCodec.init(inst, def);\n});\nexport function codec(in_, out, params) {\n return new ZodCodec({\n type: \"pipe\",\n in: in_,\n out: out,\n transform: params.decode,\n reverseTransform: params.encode,\n });\n}\nexport function invertCodec(codec) {\n const def = codec._zod.def;\n return new ZodCodec({\n type: \"pipe\",\n in: def.out,\n out: def.in,\n transform: def.reverseTransform,\n reverseTransform: def.transform,\n });\n}\nexport const ZodPreprocess = /*@__PURE__*/ core.$constructor(\"ZodPreprocess\", (inst, def) => {\n ZodPipe.init(inst, def);\n core.$ZodPreprocess.init(inst, def);\n});\nexport const ZodReadonly = /*@__PURE__*/ core.$constructor(\"ZodReadonly\", (inst, def) => {\n core.$ZodReadonly.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.readonlyProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function readonly(innerType) {\n return new ZodReadonly({\n type: \"readonly\",\n innerType: innerType,\n });\n}\nexport const ZodTemplateLiteral = /*@__PURE__*/ core.$constructor(\"ZodTemplateLiteral\", (inst, def) => {\n core.$ZodTemplateLiteral.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.templateLiteralProcessor(inst, ctx, json, params);\n});\nexport function templateLiteral(parts, params) {\n return new ZodTemplateLiteral({\n type: \"template_literal\",\n parts,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodLazy = /*@__PURE__*/ core.$constructor(\"ZodLazy\", (inst, def) => {\n core.$ZodLazy.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.lazyProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.getter();\n});\nexport function lazy(getter) {\n return new ZodLazy({\n type: \"lazy\",\n getter: getter,\n });\n}\nexport const ZodPromise = /*@__PURE__*/ core.$constructor(\"ZodPromise\", (inst, def) => {\n core.$ZodPromise.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.promiseProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function promise(innerType) {\n return new ZodPromise({\n type: \"promise\",\n innerType: innerType,\n });\n}\nexport const ZodFunction = /*@__PURE__*/ core.$constructor(\"ZodFunction\", (inst, def) => {\n core.$ZodFunction.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.functionProcessor(inst, ctx, json, params);\n});\nexport function _function(params) {\n return new ZodFunction({\n type: \"function\",\n input: Array.isArray(params?.input) ? tuple(params?.input) : (params?.input ?? array(unknown())),\n output: params?.output ?? unknown(),\n });\n}\nexport { _function as function };\nexport const ZodCustom = /*@__PURE__*/ core.$constructor(\"ZodCustom\", (inst, def) => {\n core.$ZodCustom.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.customProcessor(inst, ctx, json, params);\n});\n// custom checks\nexport function check(fn) {\n const ch = new core.$ZodCheck({\n check: \"custom\",\n // ...util.normalizeParams(params),\n });\n ch._zod.check = fn;\n return ch;\n}\nexport function custom(fn, _params) {\n return core._custom(ZodCustom, fn ?? (() => true), _params);\n}\nexport function refine(fn, _params = {}) {\n return core._refine(ZodCustom, fn, _params);\n}\n// superRefine\nexport function superRefine(fn, params) {\n return core._superRefine(fn, params);\n}\n// Re-export describe and meta from core\nexport const describe = core.describe;\nexport const meta = core.meta;\nexport const ZodInstanceOf = /*@__PURE__*/ core.$constructor(\"ZodInstanceOf\", (inst, def) => {\n ZodCustom.init(inst, def);\n}, {\n properties(shape, params) {\n // asserts in place, so the narrowed output type is truthful without a wrapper\n return this.check(core._properties(shape, params));\n },\n});\nfunction _instanceof(cls, params = {}) {\n const inst = new ZodInstanceOf({\n type: \"custom\",\n check: \"custom\",\n fn: (data) => data instanceof cls,\n abort: true,\n ...util.normalizeParams(params),\n });\n inst._zod.bag.Class = cls;\n // Override check to emit invalid_type instead of custom\n inst._zod.check = (payload) => {\n if (!(payload.value instanceof cls)) {\n payload.issues.push({\n code: \"invalid_type\",\n expected: cls.name,\n input: payload.value,\n inst,\n path: [...(inst._zod.def.path ?? [])],\n });\n }\n };\n return inst;\n}\nexport { _instanceof as instanceof };\n// stringbool\nexport const stringbool = (...args) => core._stringbool({\n Codec: ZodCodec,\n Boolean: ZodBoolean,\n String: ZodString,\n}, ...args);\nexport function json(params) {\n const jsonSchema = lazy(() => {\n return union([string(params), number(), boolean(), _null(), array(jsonSchema), record(string(), jsonSchema)]);\n });\n return jsonSchema;\n}\n// preprocess\nexport function preprocess(fn, schema) {\n return new ZodPreprocess({\n type: \"pipe\",\n in: transform(fn),\n out: schema,\n });\n}\n","import type { TRPC_ERROR_CODE_KEY } from '../rpc/codes';\nimport { isObject } from '../utils';\n\nclass UnknownCauseError extends Error {\n [key: string]: unknown;\n\n constructor(cause: object) {\n super(getMessage(cause));\n Object.assign(this, cause);\n }\n}\n\nfunction getMessage(cause: object) {\n if ('message' in cause) return String(cause.message);\n\n return undefined;\n}\n\nexport function getCauseFromUnknown(cause: unknown): Error | undefined {\n if (cause instanceof Error) {\n return cause;\n }\n\n const type = typeof cause;\n if (type === 'undefined' || type === 'function' || cause === null) {\n return undefined;\n }\n\n // Primitive types just get wrapped in an error\n if (type !== 'object') {\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n return new Error(String(cause));\n }\n\n // If it's an object, we'll create a synthetic error\n if (isObject(cause)) {\n return new UnknownCauseError(cause);\n }\n\n return undefined;\n}\n\nexport function getTRPCErrorFromUnknown(cause: unknown): TRPCError {\n if (cause instanceof TRPCError) {\n return cause;\n }\n if (cause instanceof Error && cause.name === 'TRPCError') {\n // https://github.com/trpc/trpc/pull/4848\n return cause as TRPCError;\n }\n\n const trpcError = new TRPCError({\n code: 'INTERNAL_SERVER_ERROR',\n cause,\n });\n\n // Inherit stack from error\n if (cause instanceof Error && cause.stack) {\n trpcError.stack = cause.stack;\n }\n\n return trpcError;\n}\n\nexport class TRPCError extends Error {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore override doesn't work in all environments due to \"This member cannot have an 'override' modifier because it is not declared in the base class 'Error'\"\n public override readonly cause?: Error;\n public readonly code;\n\n constructor(opts: {\n message?: string;\n code: TRPC_ERROR_CODE_KEY;\n cause?: unknown;\n }) {\n const cause = getCauseFromUnknown(opts.cause);\n const message = opts.message ?? cause?.message ?? opts.code;\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore https://github.com/tc39/proposal-error-cause\n super(message, { cause });\n\n this.code = opts.code;\n this.name = 'TRPCError';\n this.cause ??= cause;\n }\n}\n","import type {\n AnyClientTypes,\n CombinedDataTransformer,\n DataTransformerOptions,\n TypeError,\n} from '@trpc/server/unstable-core-do-not-import';\n\n/**\n * @internal\n */\nexport type CoercedTransformerParameters = {\n transformer?: DataTransformerOptions;\n};\n\ntype TransformerOptionYes = {\n /**\n * Data transformer\n *\n * You must use the same transformer on the backend and frontend\n * @see https://trpc.io/docs/v11/data-transformers\n **/\n transformer: DataTransformerOptions;\n};\ntype TransformerOptionNo = {\n /**\n * Data transformer\n *\n * You must use the same transformer on the backend and frontend\n * @see https://trpc.io/docs/v11/data-transformers\n **/\n transformer?: TypeError<'You must define a transformer on your your `initTRPC`-object first'>;\n};\n\n/**\n * @internal\n */\nexport type TransformerOptions<\n TRoot extends Pick<AnyClientTypes, 'transformer'>,\n> = TRoot['transformer'] extends true\n ? TransformerOptionYes\n : TransformerOptionNo;\n/**\n * @internal\n */\n\n/**\n * @internal\n */\nexport function getTransformer(\n transformer:\n | TransformerOptions<{ transformer: false }>['transformer']\n | TransformerOptions<{ transformer: true }>['transformer']\n | undefined,\n): CombinedDataTransformer {\n const _transformer =\n transformer as CoercedTransformerParameters['transformer'];\n if (!_transformer) {\n return {\n input: {\n serialize: (data) => data,\n deserialize: (data) => data,\n },\n output: {\n serialize: (data) => data,\n deserialize: (data) => data,\n },\n };\n }\n if ('input' in _transformer) {\n return _transformer;\n }\n return {\n input: _transformer,\n output: _transformer,\n };\n}\n","unable to read source [project]/node_modules/@aeolus-fleet/common/src/ids/index.ts","/**\n * The Overview's live updates for the browser: the web app's server follows\n * the API's stream of the fleet's request changes as the browser that asked,\n * by its shared sign-in alone, and passes each on. A change carries nothing\n * of what changed; the page reads itself again.\n */\nimport { FLEET_HEADER } from '@aeolus-fleet/common';\n\nimport { forwardedCookieOf } from '../../../lib/gateway-api/gateway-api';\nimport { FLEET_PARAMETER } from '../../../lib/gateway-api/page-account';\nimport { apiUrl } from '../../../lib/gateway-api/page-api';\n\n/** What the call to the API's stream carries: the shared sign-in alone, as every call of the web app's server, and the fleet the page names. */\nexport function upstreamHeadersOf(request: Request): Record<string, string> {\n const fleet = new URL(request.url).searchParams.get(FLEET_PARAMETER);\n const cookie = forwardedCookieOf(request.headers.get('cookie') ?? undefined);\n return { accept: 'text/event-stream', ...(cookie === undefined ? {} : { cookie }), ...(fleet === null ? {} : { [FLEET_HEADER]: fleet }) };\n}\n\nexport async function followChanges(request: Request): Promise<Response> {\n const upstream = await fetch(`${apiUrl()}/trpc/requests.changes`, { headers: upstreamHeadersOf(request), signal: request.signal });\n return new Response(upstream.body, { status: upstream.status, headers: { 'content-type': upstream.headers.get('content-type') ?? 'text/event-stream', 'cache-control': 'no-store' } });\n}\n","/**\n * The web app's server calling the gateway's API (header design part 5,\n * decision 0033): one tRPC client per page request, as the browser that\n * asked, by its shared sign-in forwarded, in the fleet its page names. Server\n * only: a browser never calls the API from a page.\n */\nimport { FLEET_HEADER } from '@aeolus-fleet/common';\nimport { createTRPCClient, httpLink, type TRPCClient } from '@trpc/client';\n\nimport type { GatewayRouter } from '../../../src/adapters/trpc/router.js';\n\n/** The gateway's API, as the web app's server calls it. */\nexport type GatewayApi = TRPCClient<GatewayRouter>;\n\n/** The shared account sign-in's cookie (header design H5): src/core/account-sign-in/ports.ts names the same. */\nconst SHARED_SIGN_IN_COOKIE = 'aeolus_account_session';\n\n/**\n * The browser's cookies the API is sent: the shared sign-in alone. The API\n * would take the gateway's old page session or argo's console session first,\n * as another account or fleet than the page shows.\n */\nexport function forwardedCookieOf(header: string | undefined): string | undefined {\n const prefix = `${SHARED_SIGN_IN_COOKIE}=`;\n const signIn = header\n ?.split(';')\n .map((part) => part.trim())\n .find((part) => part.startsWith(prefix) && part.length > prefix.length);\n return signIn;\n}\n\n/** The header the waiting page sends its browser's secret in, so it never travels in an address (src/adapters/trpc/router.ts names the same). */\nconst WAITING_SECRET_HEADER = 'aeolus-waiting-secret';\n\n/** What a call of the API is sent besides its input: the shared sign-in, the fleet the page names, and the waiting page's browser secret. */\nexport interface ApiSent {\n cookie: string | undefined;\n fleetId: string | undefined;\n waitingSecret?: string;\n}\n\nexport function apiHeadersOf(sent: ApiSent): Record<string, string> {\n const cookie = forwardedCookieOf(sent.cookie);\n return {\n ...(cookie === undefined ? {} : { cookie }),\n ...(sent.fleetId === undefined ? {} : { [FLEET_HEADER]: sent.fleetId }),\n ...(sent.waitingSecret === undefined ? {} : { [WAITING_SECRET_HEADER]: sent.waitingSecret }),\n };\n}\n\nexport function gatewayApi(sent: ApiSent & { url: string }): GatewayApi {\n return createTRPCClient<GatewayRouter>({ links: [httpLink({ url: `${sent.url}/trpc`, headers: apiHeadersOf(sent) })] });\n}\n","import type {\n inferObservableValue,\n Unsubscribable,\n} from '@trpc/server/observable';\nimport { observableToPromise, share } from '@trpc/server/observable';\nimport type {\n AnyRouter,\n inferAsyncIterableYield,\n InferrableClientTypes,\n Maybe,\n TypeError,\n} from '@trpc/server/unstable-core-do-not-import';\nimport { createChain } from '../links/internals/createChain';\nimport type { TRPCConnectionState } from '../links/internals/subscriptions';\nimport type {\n OperationContext,\n OperationLink,\n TRPCClientRuntime,\n TRPCLink,\n} from '../links/types';\nimport { TRPCClientError } from '../TRPCClientError';\n\ntype TRPCType = 'mutation' | 'query' | 'subscription';\nexport interface TRPCRequestOptions {\n /**\n * Pass additional context to links\n */\n context?: OperationContext;\n signal?: AbortSignal;\n}\n\nexport interface TRPCSubscriptionObserver<TValue, TError> {\n onStarted: (opts: { context: OperationContext | undefined }) => void;\n onData: (value: inferAsyncIterableYield<TValue>) => void;\n onError: (err: TError) => void;\n onStopped: () => void;\n onComplete: () => void;\n onConnectionStateChange: (state: TRPCConnectionState<TError>) => void;\n}\n\n/** @internal */\nexport type CreateTRPCClientOptions<TRouter extends InferrableClientTypes> = {\n links: TRPCLink<TRouter>[];\n transformer?: TypeError<'The transformer property has moved to httpLink/httpBatchLink/wsLink'>;\n};\n\nexport class TRPCUntypedClient<TInferrable extends InferrableClientTypes> {\n private readonly links: OperationLink<TInferrable>[];\n public readonly runtime: TRPCClientRuntime;\n private requestId: number;\n\n constructor(opts: CreateTRPCClientOptions<TInferrable>) {\n this.requestId = 0;\n\n this.runtime = {};\n\n // Initialize the links\n this.links = opts.links.map((link) => link(this.runtime));\n }\n\n private $request<TInput = unknown, TOutput = unknown>(opts: {\n type: TRPCType;\n input: TInput;\n path: string;\n context?: OperationContext;\n signal: Maybe<AbortSignal>;\n }) {\n const chain$ = createChain<AnyRouter, TInput, TOutput>({\n links: this.links as OperationLink<any, any, any>[],\n op: {\n ...opts,\n context: opts.context ?? {},\n id: ++this.requestId,\n },\n });\n return chain$.pipe(share());\n }\n\n private async requestAsPromise<TInput = unknown, TOutput = unknown>(opts: {\n type: TRPCType;\n input: TInput;\n path: string;\n context?: OperationContext;\n signal: Maybe<AbortSignal>;\n }): Promise<TOutput> {\n try {\n const req$ = this.$request<TInput, TOutput>(opts);\n type TValue = inferObservableValue<typeof req$>;\n\n const envelope = await observableToPromise<TValue>(req$);\n const data = (envelope.result as any).data;\n return data;\n } catch (err) {\n throw TRPCClientError.from(err as Error);\n }\n }\n public query(path: string, input?: unknown, opts?: TRPCRequestOptions) {\n return this.requestAsPromise<unknown, unknown>({\n type: 'query',\n path,\n input,\n context: opts?.context,\n signal: opts?.signal,\n });\n }\n public mutation(path: string, input?: unknown, opts?: TRPCRequestOptions) {\n return this.requestAsPromise<unknown, unknown>({\n type: 'mutation',\n path,\n input,\n context: opts?.context,\n signal: opts?.signal,\n });\n }\n public subscription(\n path: string,\n input: unknown,\n opts: Partial<\n TRPCSubscriptionObserver<unknown, TRPCClientError<AnyRouter>>\n > &\n TRPCRequestOptions,\n ): Unsubscribable {\n const observable$ = this.$request({\n type: 'subscription',\n path,\n input,\n context: opts.context,\n signal: opts.signal,\n });\n return observable$.subscribe({\n next(envelope) {\n switch (envelope.result.type) {\n case 'state': {\n opts.onConnectionStateChange?.(envelope.result);\n break;\n }\n case 'started': {\n opts.onStarted?.({\n context: envelope.context,\n });\n break;\n }\n case 'stopped': {\n opts.onStopped?.();\n break;\n }\n case 'data':\n case undefined: {\n opts.onData?.(envelope.result.data);\n break;\n }\n }\n },\n error(err) {\n opts.onError?.(err);\n },\n complete() {\n opts.onComplete?.();\n },\n });\n }\n}\n","import type { UrlOptionsWithConnectionParams } from '../../internals/urlWithConnectionParams';\nimport type { Encoder } from './encoder';\n\nexport interface WebSocketClientOptions extends UrlOptionsWithConnectionParams {\n /**\n * Ponyfill which WebSocket implementation to use\n */\n WebSocket?: typeof WebSocket;\n /**\n * The number of milliseconds before a reconnect is attempted.\n * @default {@link exponentialBackoff}\n */\n retryDelayMs?: (attemptIndex: number) => number;\n /**\n * Triggered when a WebSocket connection is established\n */\n onOpen?: () => void;\n /**\n * Triggered when a WebSocket connection encounters an error\n */\n onError?: (evt?: Event) => void;\n /**\n * Triggered when a WebSocket connection is closed\n */\n onClose?: (cause?: { code?: number }) => void;\n /**\n * Lazy mode will close the WebSocket automatically after a period of inactivity (no messages sent or received and no pending requests)\n */\n lazy?: {\n /**\n * Enable lazy mode\n * @default false\n */\n enabled: boolean;\n /**\n * Close the WebSocket after this many milliseconds\n * @default 0\n */\n closeMs: number;\n };\n /**\n * Send ping messages to the server and kill the connection if no pong message is returned\n */\n keepAlive?: {\n /**\n * @default false\n */\n enabled: boolean;\n /**\n * Send a ping message every this many milliseconds\n * @default 5_000\n */\n intervalMs?: number;\n /**\n * Close the WebSocket after this many milliseconds if the server does not respond\n * @default 1_000\n */\n pongTimeoutMs?: number;\n };\n /**\n * Custom encoder for wire encoding (e.g. custom binary formats)\n * @default jsonEncoder\n */\n experimental_encoder?: Encoder;\n}\n\n/**\n * Default options for lazy WebSocket connections.\n * Determines whether the connection should be established lazily and defines the delay before closure.\n */\nexport type LazyOptions = Required<NonNullable<WebSocketClientOptions['lazy']>>;\nexport const lazyDefaults: LazyOptions = {\n enabled: false,\n closeMs: 0,\n};\n\n/**\n * Default options for the WebSocket keep-alive mechanism.\n * Configures whether keep-alive is enabled and specifies the timeout and interval for ping-pong messages.\n */\nexport type KeepAliveOptions = Required<\n NonNullable<WebSocketClientOptions['keepAlive']>\n>;\nexport const keepAliveDefaults: KeepAliveOptions = {\n enabled: false,\n pongTimeoutMs: 1_000,\n intervalMs: 5_000,\n};\n\n/**\n * Calculates a delay for exponential backoff based on the retry attempt index.\n * The delay starts at 0 for the first attempt and doubles for each subsequent attempt,\n * capped at 30 seconds.\n */\nexport const exponentialBackoff = (attemptIndex: number) => {\n return attemptIndex === 0 ? 0 : Math.min(1000 * 2 ** attemptIndex, 30000);\n};\n","import { observable } from '@trpc/server/observable';\nimport type {\n AnyClientTypes,\n AnyRouter,\n} from '@trpc/server/unstable-core-do-not-import';\nimport { transformResult } from '@trpc/server/unstable-core-do-not-import';\nimport { raceAbortSignals } from '../internals/signals';\nimport { TRPCClientError } from '../TRPCClientError';\nimport type {\n HTTPLinkBaseOptions,\n HTTPResult,\n Requester,\n} from './internals/httpUtils';\nimport {\n getUrl,\n httpRequest,\n jsonHttpRequester,\n resolveHTTPLinkOptions,\n} from './internals/httpUtils';\nimport {\n isFormData,\n isOctetType,\n type HTTPHeaders,\n type Operation,\n type TRPCLink,\n} from './types';\n\nexport type HTTPLinkOptions<TRoot extends AnyClientTypes> =\n HTTPLinkBaseOptions<TRoot> & {\n /**\n * Headers to be set on outgoing requests or a callback that of said headers\n * @see http://trpc.io/docs/client/headers\n */\n headers?:\n | HTTPHeaders\n | ((opts: { op: Operation }) => HTTPHeaders | Promise<HTTPHeaders>);\n };\n\nconst universalRequester: Requester = (opts) => {\n if ('input' in opts) {\n const { input } = opts;\n if (isFormData(input)) {\n if (opts.type !== 'mutation' && opts.methodOverride !== 'POST') {\n throw new Error('FormData is only supported for mutations');\n }\n\n return httpRequest({\n ...opts,\n // The browser will set this automatically and include the boundary= in it\n contentTypeHeader: undefined,\n getUrl,\n getBody: () => input,\n });\n }\n\n if (isOctetType(input)) {\n if (opts.type !== 'mutation' && opts.methodOverride !== 'POST') {\n throw new Error('Octet type input is only supported for mutations');\n }\n\n return httpRequest({\n ...opts,\n contentTypeHeader: 'application/octet-stream',\n getUrl,\n getBody: () => input,\n });\n }\n }\n\n return jsonHttpRequester(opts);\n};\n\n/**\n * @see https://trpc.io/docs/client/links/httpLink\n */\nexport function httpLink<TRouter extends AnyRouter = AnyRouter>(\n opts: HTTPLinkOptions<TRouter['_def']['_config']['$types']>,\n): TRPCLink<TRouter> {\n const resolvedOpts = resolveHTTPLinkOptions(opts);\n return () => {\n return (operationOpts) => {\n const { op } = operationOpts;\n return observable((observer) => {\n const { path, input, type } = op;\n /* istanbul ignore if -- @preserve */\n if (type === 'subscription') {\n throw new Error(\n 'Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`',\n );\n }\n\n const ac = new AbortController();\n const request = universalRequester({\n ...resolvedOpts,\n type,\n path,\n input,\n signal: raceAbortSignals(op.signal, ac.signal),\n headers() {\n if (!opts.headers) {\n return {};\n }\n if (typeof opts.headers === 'function') {\n return opts.headers({\n op,\n });\n }\n return opts.headers;\n },\n });\n let isDone = false;\n let meta: HTTPResult['meta'] | undefined = undefined;\n request\n .then((res) => {\n isDone = true;\n meta = res.meta;\n const transformed = transformResult(\n res.json,\n resolvedOpts.transformer.output,\n );\n\n if (!transformed.ok) {\n observer.error(\n TRPCClientError.from(transformed.error, {\n meta,\n }),\n );\n return;\n }\n observer.next({\n context: res.meta,\n result: transformed.result,\n });\n observer.complete();\n })\n .catch((cause) => {\n isDone = true;\n observer.error(TRPCClientError.from(cause, { meta }));\n });\n\n return () => {\n if (!isDone) {\n ac.abort();\n }\n };\n });\n };\n };\n}\n","unable to read source [project]/node_modules/@aeolus-fleet/common/src/fleet/index.ts","/**\n * What a page of the web app does with the API's account.inView (header\n * design H5, H9): show its fleet as the account signed in, or send the\n * browser where it may go: the same page in the fleet the account may open,\n * the app it may open there, or sign-in and back to the page.\n */\n\n/** The API's answer to account.inView. */\nexport type InView =\n | { kind: 'signedIn'; fleetId: string; accountId: string; scopes: string[] }\n | { kind: 'goTo'; fleetId: string }\n | { kind: 'elsewhere'; url: string };\n\n/** The API's refusals of account.inView a page answers: signed in to no account, and no shared sign-in at this gateway. */\nexport type InViewRefusal = 'UNAUTHORIZED' | 'NOT_FOUND';\n\nexport type PageAccount = { kind: 'signedIn'; fleetId: string; scopes: readonly string[] } | { kind: 'goTo'; location: string } | { kind: 'noSignIn' };\n\nconst SIGN_IN_START = '/sign-in/start';\n\n/** The parameter a page names its fleet by. */\nexport const FLEET_PARAMETER = 'fleet';\n\n/** A page of the web app in a fleet: every link keeps the fleet in its address. */\nexport function inFleet(page: string, fleetId: string): string {\n const [path = '', query = ''] = page.split('?');\n const parameters = new URLSearchParams(query);\n parameters.set(FLEET_PARAMETER, fleetId);\n return `${path}?${parameters.toString()}`;\n}\n\n/** Reads the answer for the page asked for, its path and query as the browser sent them. */\nexport function pageAccountOf(read: { inView: InView } | { refusal: InViewRefusal }, page: string): PageAccount {\n if ('refusal' in read) {\n return read.refusal === 'UNAUTHORIZED' ? { kind: 'goTo', location: `${SIGN_IN_START}?${new URLSearchParams({ return_to: page }).toString()}` } : { kind: 'noSignIn' };\n }\n const { inView } = read;\n switch (inView.kind) {\n case 'signedIn':\n return { kind: 'signedIn', fleetId: inView.fleetId, scopes: inView.scopes };\n case 'goTo':\n return { kind: 'goTo', location: inFleet(page, inView.fleetId) };\n case 'elsewhere':\n return { kind: 'goTo', location: inView.url };\n }\n}\n","import type { Maybe } from '@trpc/server/unstable-core-do-not-import';\n\n/**\n * Like `Promise.all()` but for abort signals\n * - When all signals have been aborted, the merged signal will be aborted\n * - If one signal is `null`, no signal will be aborted\n */\nexport function allAbortSignals(...signals: Maybe<AbortSignal>[]): AbortSignal {\n const ac = new AbortController();\n\n const count = signals.length;\n\n let abortedCount = 0;\n\n const onAbort = () => {\n if (++abortedCount === count) {\n ac.abort();\n }\n };\n\n for (const signal of signals) {\n if (signal?.aborted) {\n onAbort();\n } else {\n signal?.addEventListener('abort', onAbort, {\n once: true,\n });\n }\n }\n\n return ac.signal;\n}\n\n/**\n * Like `Promise.race` but for abort signals\n *\n * Basically, a ponyfill for\n * [`AbortSignal.any`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/any_static).\n */\nexport function raceAbortSignals(\n ...signals: Maybe<AbortSignal>[]\n): AbortSignal {\n const ac = new AbortController();\n\n for (const signal of signals) {\n if (signal?.aborted) {\n ac.abort();\n } else {\n signal?.addEventListener('abort', () => ac.abort(), { once: true });\n }\n }\n\n return ac.signal;\n}\n\nexport function abortSignalToPromise(signal: AbortSignal): Promise<never> {\n return new Promise((_, reject) => {\n if (signal.aborted) {\n reject(signal.reason);\n return;\n }\n signal.addEventListener(\n 'abort',\n () => {\n reject(signal.reason);\n },\n { once: true },\n );\n });\n}\n","import { observable } from '@trpc/server/observable';\nimport type { AnyRouter } from '@trpc/server/unstable-core-do-not-import';\nimport { createChain } from './internals/createChain';\nimport type { Operation, TRPCLink } from './types';\n\nfunction asArray<TType>(value: TType | TType[]) {\n return Array.isArray(value) ? value : [value];\n}\nexport function splitLink<TRouter extends AnyRouter = AnyRouter>(opts: {\n condition: (op: Operation) => boolean;\n /**\n * The link to execute next if the test function returns `true`.\n */\n true: TRPCLink<TRouter> | TRPCLink<TRouter>[];\n /**\n * The link to execute next if the test function returns `false`.\n */\n false: TRPCLink<TRouter> | TRPCLink<TRouter>[];\n}): TRPCLink<TRouter> {\n return (runtime) => {\n const yes = asArray(opts.true).map((link) => link(runtime));\n const no = asArray(opts.false).map((link) => link(runtime));\n return (props) => {\n return observable((observer) => {\n const links = opts.condition(props.op) ? yes : no;\n return createChain({ op: props.op, links }).subscribe(observer);\n });\n };\n };\n}\n","/* eslint-disable @typescript-eslint/no-non-null-assertion */\n\ntype BatchItem<TKey, TValue> = {\n aborted: boolean;\n key: TKey;\n resolve: ((value: TValue) => void) | null;\n reject: ((error: Error) => void) | null;\n batch: Batch<TKey, TValue> | null;\n};\ntype Batch<TKey, TValue> = {\n items: BatchItem<TKey, TValue>[];\n};\nexport type BatchLoader<TKey, TValue> = {\n validate: (keys: TKey[]) => boolean;\n fetch: (keys: TKey[]) => Promise<TValue[] | Promise<TValue>[]>;\n};\n\n/**\n * A function that should never be called unless we messed something up.\n */\nconst throwFatalError = () => {\n throw new Error(\n 'Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new',\n );\n};\n\n/**\n * Dataloader that's very inspired by https://github.com/graphql/dataloader\n * Less configuration, no caching, and allows you to cancel requests\n * When cancelling a single fetch the whole batch will be cancelled only when _all_ items are cancelled\n */\nexport function dataLoader<TKey, TValue>(\n batchLoader: BatchLoader<TKey, TValue>,\n) {\n let pendingItems: BatchItem<TKey, TValue>[] | null = null;\n let dispatchTimer: ReturnType<typeof setTimeout> | null = null;\n\n const destroyTimerAndPendingItems = () => {\n clearTimeout(dispatchTimer as any);\n dispatchTimer = null;\n pendingItems = null;\n };\n\n /**\n * Iterate through the items and split them into groups based on the `batchLoader`'s validate function\n */\n function groupItems(items: BatchItem<TKey, TValue>[]) {\n const groupedItems: BatchItem<TKey, TValue>[][] = [[]];\n let index = 0;\n while (true) {\n const item = items[index];\n if (!item) {\n // we're done\n break;\n }\n const lastGroup = groupedItems[groupedItems.length - 1]!;\n\n if (item.aborted) {\n // Item was aborted before it was dispatched\n item.reject?.(new Error('Aborted'));\n index++;\n continue;\n }\n\n const isValid = batchLoader.validate(\n lastGroup.concat(item).map((it) => it.key),\n );\n\n if (isValid) {\n lastGroup.push(item);\n index++;\n continue;\n }\n\n if (lastGroup.length === 0) {\n item.reject?.(new Error('Input is too big for a single dispatch'));\n index++;\n continue;\n }\n // Create new group, next iteration will try to add the item to that\n groupedItems.push([]);\n }\n return groupedItems;\n }\n\n function dispatch() {\n const groupedItems = groupItems(pendingItems!);\n destroyTimerAndPendingItems();\n\n // Create batches for each group of items\n for (const items of groupedItems) {\n if (!items.length) {\n continue;\n }\n const batch: Batch<TKey, TValue> = {\n items,\n };\n for (const item of items) {\n item.batch = batch;\n }\n const promise = batchLoader.fetch(batch.items.map((_item) => _item.key));\n\n promise\n .then(async (result) => {\n await Promise.all(\n result.map(async (valueOrPromise, index) => {\n const item = batch.items[index]!;\n try {\n const value = await Promise.resolve(valueOrPromise);\n\n item.resolve?.(value);\n } catch (cause) {\n item.reject?.(cause as Error);\n }\n\n item.batch = null;\n item.reject = null;\n item.resolve = null;\n }),\n );\n\n for (const item of batch.items) {\n item.reject?.(new Error('Missing result'));\n item.batch = null;\n }\n })\n .catch((cause) => {\n for (const item of batch.items) {\n item.reject?.(cause);\n item.batch = null;\n }\n });\n }\n }\n function load(key: TKey): Promise<TValue> {\n const item: BatchItem<TKey, TValue> = {\n aborted: false,\n key,\n batch: null,\n resolve: throwFatalError,\n reject: throwFatalError,\n };\n\n const promise = new Promise<TValue>((resolve, reject) => {\n item.reject = reject;\n item.resolve = resolve;\n\n pendingItems ??= [];\n pendingItems.push(item);\n });\n\n dispatchTimer ??= setTimeout(dispatch);\n\n return promise;\n }\n\n return {\n load,\n };\n}\n","import { TRPCError } from '../error/TRPCError';\nimport type { ProcedureType } from '../procedure';\nimport { getProcedureAtPath, type AnyRouter } from '../router';\nimport { emptyObject, isObject } from '../utils';\nimport { parseConnectionParamsFromString } from './parseConnectionParams';\nimport type { TRPCAcceptHeader, TRPCRequestInfo } from './types';\n\nexport function getAcceptHeader(headers: Headers): TRPCAcceptHeader | null {\n return (\n (headers.get('trpc-accept') as TRPCAcceptHeader | null) ??\n (headers\n .get('accept')\n ?.split(',')\n .some((t) => t.trim() === 'application/jsonl')\n ? 'application/jsonl'\n : null)\n );\n}\n\ntype GetRequestInfoOptions = {\n path: string;\n req: Request;\n url: URL | null;\n searchParams: URLSearchParams;\n headers: Headers;\n router: AnyRouter;\n maxBatchSize?: number;\n};\n\ntype ContentTypeHandler = {\n isMatch: (opts: Request) => boolean;\n parse: (opts: GetRequestInfoOptions) => Promise<TRPCRequestInfo>;\n};\n\n/**\n * Memoize a function that takes no arguments\n * @internal\n */\nfunction memo<TReturn>(fn: () => Promise<TReturn>) {\n let promise: Promise<TReturn> | null = null;\n const sym = Symbol.for('@trpc/server/http/memo');\n let value: TReturn | typeof sym = sym;\n return {\n /**\n * Lazily read the value\n */\n read: async (): Promise<TReturn> => {\n if (value !== sym) {\n return value;\n }\n\n // dedupes promises and catches errors\n promise ??= fn().catch((cause) => {\n if (cause instanceof TRPCError) {\n throw cause;\n }\n throw new TRPCError({\n code: 'BAD_REQUEST',\n message: cause instanceof Error ? cause.message : 'Invalid input',\n cause,\n });\n });\n\n value = await promise;\n promise = null;\n\n return value;\n },\n /**\n * Get an already stored result\n */\n result: (): TReturn | undefined => {\n return value !== sym ? value : undefined;\n },\n };\n}\n\nconst jsonContentTypeHandler: ContentTypeHandler = {\n isMatch(req) {\n return !!req.headers.get('content-type')?.startsWith('application/json');\n },\n async parse(opts) {\n const { req } = opts;\n const isBatchCall = opts.searchParams.get('batch') === '1';\n const maxBatchSize = opts.maxBatchSize;\n\n const paths = isBatchCall ? opts.path.split(',') : [opts.path];\n if (\n isBatchCall &&\n typeof maxBatchSize === 'number' &&\n paths.length > maxBatchSize\n ) {\n throw new TRPCError({\n code: 'BAD_REQUEST',\n message: `Batch call exceeds maximum size`,\n });\n }\n\n type InputRecord = Record<number, unknown>;\n const getInputs = memo(async (): Promise<InputRecord> => {\n let inputs: unknown = undefined;\n if (req.method === 'GET') {\n const queryInput = opts.searchParams.get('input');\n if (queryInput) {\n inputs = JSON.parse(queryInput);\n }\n } else {\n inputs = await req.json();\n }\n if (inputs === undefined) {\n return emptyObject();\n }\n\n if (!isBatchCall) {\n const result: InputRecord = emptyObject();\n result[0] =\n opts.router._def._config.transformer.input.deserialize(inputs);\n return result;\n }\n\n if (!isObject(inputs)) {\n throw new TRPCError({\n code: 'BAD_REQUEST',\n message: '\"input\" needs to be an object when doing a batch call',\n });\n }\n const acc: InputRecord = emptyObject();\n for (const index of paths.keys()) {\n const input = inputs[index];\n if (input !== undefined) {\n acc[index] =\n opts.router._def._config.transformer.input.deserialize(input);\n }\n }\n\n return acc;\n });\n\n const calls = await Promise.all(\n paths.map(\n async (path, index): Promise<TRPCRequestInfo['calls'][number]> => {\n const procedure = await getProcedureAtPath(opts.router, path);\n return {\n batchIndex: index,\n path,\n procedure,\n getRawInput: async () => {\n const inputs = await getInputs.read();\n let input = inputs[index];\n\n if (procedure?._def.type === 'subscription') {\n const lastEventId =\n opts.headers.get('last-event-id') ??\n opts.searchParams.get('lastEventId') ??\n opts.searchParams.get('Last-Event-Id');\n\n if (lastEventId) {\n if (isObject(input)) {\n input = {\n ...input,\n lastEventId: lastEventId,\n };\n } else {\n input ??= {\n lastEventId: lastEventId,\n };\n }\n }\n }\n return input;\n },\n result: () => {\n return getInputs.result()?.[index];\n },\n };\n },\n ),\n );\n\n const types = new Set(\n calls.map((call) => call.procedure?._def.type).filter(Boolean),\n );\n\n /* istanbul ignore if -- @preserve */\n if (types.size > 1) {\n throw new TRPCError({\n code: 'BAD_REQUEST',\n message: `Cannot mix procedure types in call: ${Array.from(types).join(\n ', ',\n )}`,\n });\n }\n const type: ProcedureType | 'unknown' =\n types.values().next().value ?? 'unknown';\n\n const connectionParamsStr = opts.searchParams.get('connectionParams');\n\n const info: TRPCRequestInfo = {\n isBatchCall,\n accept: getAcceptHeader(req.headers),\n calls,\n type,\n connectionParams:\n connectionParamsStr === null\n ? null\n : parseConnectionParamsFromString(connectionParamsStr),\n signal: req.signal,\n url: opts.url,\n };\n return info;\n },\n};\n\nconst formDataContentTypeHandler: ContentTypeHandler = {\n isMatch(req) {\n return !!req.headers.get('content-type')?.startsWith('multipart/form-data');\n },\n async parse(opts) {\n const { req } = opts;\n if (req.method !== 'POST') {\n throw new TRPCError({\n code: 'METHOD_NOT_SUPPORTED',\n message:\n 'Only POST requests are supported for multipart/form-data requests',\n });\n }\n const getInputs = memo(async () => {\n const fd = await req.formData();\n return fd;\n });\n const procedure = await getProcedureAtPath(opts.router, opts.path);\n return {\n accept: null,\n calls: [\n {\n batchIndex: 0,\n path: opts.path,\n getRawInput: getInputs.read,\n result: getInputs.result,\n procedure,\n },\n ],\n isBatchCall: false,\n type: 'mutation',\n connectionParams: null,\n signal: req.signal,\n url: opts.url,\n };\n },\n};\n\nconst octetStreamContentTypeHandler: ContentTypeHandler = {\n isMatch(req) {\n return !!req.headers\n .get('content-type')\n ?.startsWith('application/octet-stream');\n },\n async parse(opts) {\n const { req } = opts;\n if (req.method !== 'POST') {\n throw new TRPCError({\n code: 'METHOD_NOT_SUPPORTED',\n message:\n 'Only POST requests are supported for application/octet-stream requests',\n });\n }\n const getInputs = memo(async () => {\n return req.body;\n });\n return {\n calls: [\n {\n batchIndex: 0,\n path: opts.path,\n getRawInput: getInputs.read,\n result: getInputs.result,\n procedure: await getProcedureAtPath(opts.router, opts.path),\n },\n ],\n isBatchCall: false,\n accept: null,\n type: 'mutation',\n connectionParams: null,\n signal: req.signal,\n url: opts.url,\n };\n },\n};\n\nconst handlers = [\n jsonContentTypeHandler,\n formDataContentTypeHandler,\n octetStreamContentTypeHandler,\n];\n\nfunction getContentTypeHandler(req: Request): ContentTypeHandler {\n const handler = handlers.find((handler) => handler.isMatch(req));\n if (handler) {\n return handler;\n }\n\n if (!handler && req.method === 'GET') {\n // fallback to JSON for get requests so GET-requests can be opened in browser easily\n return jsonContentTypeHandler;\n }\n\n throw new TRPCError({\n code: 'UNSUPPORTED_MEDIA_TYPE',\n message: req.headers.has('content-type')\n ? `Unsupported content-type \"${req.headers.get('content-type')}`\n : 'Missing content-type header',\n });\n}\n\nexport async function getRequestInfo(\n opts: GetRequestInfoOptions,\n): Promise<TRPCRequestInfo> {\n const handler = getContentTypeHandler(opts.req);\n return await handler.parse(opts);\n}\n","import { type TRPCRequestInfo } from '@trpc/server/http';\n\n/**\n * Get the result of a value or function that returns a value\n * It also optionally accepts typesafe arguments for the function\n */\nexport const resultOf = <T, TArgs extends any[]>(\n value: T | ((...args: TArgs) => T),\n ...args: TArgs\n): T => {\n return typeof value === 'function'\n ? (value as (...args: TArgs) => T)(...args)\n : value;\n};\n\n/**\n * A value that can be wrapped in callback\n */\nexport type CallbackOrValue<T> = T | (() => T | Promise<T>);\n\nexport interface UrlOptionsWithConnectionParams {\n /**\n * The URL to connect to (can be a function that returns a URL)\n */\n url: CallbackOrValue<string>;\n\n /**\n * Connection params that are available in `createContext()`\n * - For `wsLink`/`wsClient`, these are sent as the first message\n * - For `httpSubscriptionLink`, these are serialized as part of the URL under the `connectionParams` query\n */\n connectionParams?: CallbackOrValue<TRPCRequestInfo['connectionParams']>;\n}\n","import type {\n TRPCConnectionParamsMessage,\n TRPCRequestInfo,\n} from '@trpc/server/unstable-core-do-not-import';\nimport type {\n CallbackOrValue,\n UrlOptionsWithConnectionParams,\n} from '../../internals/urlWithConnectionParams';\nimport { resultOf } from '../../internals/urlWithConnectionParams';\nimport type { Encoder } from './encoder';\n\nexport class TRPCWebSocketClosedError extends Error {\n constructor(opts: { message: string; cause?: unknown }) {\n super(opts.message, {\n cause: opts.cause,\n });\n this.name = 'TRPCWebSocketClosedError';\n Object.setPrototypeOf(this, TRPCWebSocketClosedError.prototype);\n }\n}\n\n/**\n * Utility class for managing a timeout that can be started, stopped, and reset.\n * Useful for scenarios where the timeout duration is reset dynamically based on events.\n */\nexport class ResettableTimeout {\n private timeout: ReturnType<typeof setTimeout> | undefined;\n\n constructor(\n private readonly onTimeout: () => void,\n private readonly timeoutMs: number,\n ) {}\n\n /**\n * Resets the current timeout, restarting it with the same duration.\n * Does nothing if no timeout is active.\n */\n public reset() {\n if (!this.timeout) return;\n\n clearTimeout(this.timeout);\n this.timeout = setTimeout(this.onTimeout, this.timeoutMs);\n }\n\n public start() {\n clearTimeout(this.timeout);\n this.timeout = setTimeout(this.onTimeout, this.timeoutMs);\n }\n\n public stop() {\n clearTimeout(this.timeout);\n this.timeout = undefined;\n }\n}\n\n// Ponyfill for Promise.withResolvers https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/withResolvers\nexport function withResolvers<T>() {\n let resolve: (value: T | PromiseLike<T>) => void;\n let reject: (reason?: any) => void;\n const promise = new Promise<T>((res, rej) => {\n resolve = res;\n reject = rej;\n });\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return { promise, resolve: resolve!, reject: reject! };\n}\n\n/**\n * Resolves a WebSocket URL and optionally appends connection parameters.\n *\n * If connectionParams are provided, appends 'connectionParams=1' query parameter.\n */\nexport async function prepareUrl(urlOptions: UrlOptionsWithConnectionParams) {\n const url = await resultOf(urlOptions.url);\n\n if (!urlOptions.connectionParams) return url;\n\n // append `?connectionParams=1` when connection params are used\n const prefix = url.includes('?') ? '&' : '?';\n const connectionParams = `${prefix}connectionParams=1`;\n\n return url + connectionParams;\n}\n\nexport async function buildConnectionMessage(\n connectionParams: CallbackOrValue<TRPCRequestInfo['connectionParams']>,\n encoder: Encoder,\n) {\n const message: TRPCConnectionParamsMessage = {\n method: 'connectionParams',\n data: await resultOf(connectionParams),\n };\n\n return encoder.encode(message);\n}\n","import type { AnyRootTypes, RootConfig } from './rootConfig';\nimport type { AnyRouter, inferRouterError } from './router';\nimport type {\n TRPCResponse,\n TRPCResponseMessage,\n TRPCResultMessage,\n} from './rpc';\nimport { isObject } from './utils';\n\n/**\n * @public\n */\nexport interface DataTransformer {\n serialize(object: any): any;\n deserialize(object: any): any;\n}\n\ninterface InputDataTransformer extends DataTransformer {\n /**\n * This function runs **on the client** before sending the data to the server.\n */\n serialize(object: any): any;\n /**\n * This function runs **on the server** to transform the data before it is passed to the resolver\n */\n deserialize(object: any): any;\n}\n\ninterface OutputDataTransformer extends DataTransformer {\n /**\n * This function runs **on the server** before sending the data to the client.\n */\n serialize(object: any): any;\n /**\n * This function runs **only on the client** to transform the data sent from the server.\n */\n deserialize(object: any): any;\n}\n\n/**\n * @public\n */\nexport interface CombinedDataTransformer {\n /**\n * Specify how the data sent from the client to the server should be transformed.\n */\n input: InputDataTransformer;\n /**\n * Specify how the data sent from the server to the client should be transformed.\n */\n output: OutputDataTransformer;\n}\n\n/**\n * @public\n */\nexport type CombinedDataTransformerClient = {\n input: Pick<CombinedDataTransformer['input'], 'serialize'>;\n output: Pick<CombinedDataTransformer['output'], 'deserialize'>;\n};\n\n/**\n * @public\n */\nexport type DataTransformerOptions = CombinedDataTransformer | DataTransformer;\n\n/**\n * @internal\n */\nexport function getDataTransformer(\n transformer: DataTransformerOptions,\n): CombinedDataTransformer {\n if ('input' in transformer) {\n return transformer;\n }\n return { input: transformer, output: transformer };\n}\n\n/**\n * @internal\n */\nexport const defaultTransformer: CombinedDataTransformer = {\n input: { serialize: (obj) => obj, deserialize: (obj) => obj },\n output: { serialize: (obj) => obj, deserialize: (obj) => obj },\n};\n\nfunction transformTRPCResponseItem<\n TResponseItem extends TRPCResponse | TRPCResponseMessage,\n>(config: RootConfig<AnyRootTypes>, item: TResponseItem): TResponseItem {\n if ('error' in item) {\n return {\n ...item,\n error: config.transformer.output.serialize(item.error),\n };\n }\n\n if ('data' in item.result) {\n return {\n ...item,\n result: {\n ...item.result,\n data: config.transformer.output.serialize(item.result.data),\n },\n };\n }\n\n return item;\n}\n\n/**\n * Takes a unserialized `TRPCResponse` and serializes it with the router's transformers\n **/\nexport function transformTRPCResponse<\n TResponse extends\n TRPCResponse | TRPCResponse[] | TRPCResponseMessage | TRPCResponseMessage[],\n>(config: RootConfig<AnyRootTypes>, itemOrItems: TResponse) {\n return Array.isArray(itemOrItems)\n ? itemOrItems.map((item) => transformTRPCResponseItem(config, item))\n : transformTRPCResponseItem(config, itemOrItems);\n}\n\n// FIXME:\n// - the generics here are probably unnecessary\n// - the RPC-spec could probably be simplified to combine HTTP + WS\n/** @internal */\nfunction transformResultInner<TRouter extends AnyRouter, TOutput>(\n response:\n | TRPCResponse<TOutput, inferRouterError<TRouter>>\n | TRPCResponseMessage<TOutput, inferRouterError<TRouter>>,\n transformer: DataTransformer,\n) {\n if ('error' in response) {\n const error = transformer.deserialize(\n response.error,\n ) as inferRouterError<TRouter>;\n return {\n ok: false,\n error: {\n ...response,\n error,\n },\n } as const;\n }\n\n const result = {\n ...response.result,\n ...((!response.result.type || response.result.type === 'data') && {\n type: 'data',\n data: transformer.deserialize(response.result.data),\n }),\n } as TRPCResultMessage<TOutput>['result'];\n return { ok: true, result } as const;\n}\n\nclass TransformResultError extends Error {\n constructor() {\n super('Unable to transform response from server');\n }\n}\n\n/**\n * Transforms and validates that the result is a valid TRPCResponse\n * @internal\n */\nexport function transformResult<TRouter extends AnyRouter, TOutput>(\n response:\n | TRPCResponse<TOutput, inferRouterError<TRouter>>\n | TRPCResponseMessage<TOutput, inferRouterError<TRouter>>,\n transformer: DataTransformer,\n): ReturnType<typeof transformResultInner> {\n let result: ReturnType<typeof transformResultInner>;\n try {\n // Use the data transformers on the JSON-response\n result = transformResultInner(response, transformer);\n } catch {\n throw new TransformResultError();\n }\n\n // check that output of the transformers is a valid TRPCResponse\n if (\n !result.ok &&\n (!isObject(result.error.error) ||\n typeof result.error.error['code'] !== 'number')\n ) {\n throw new TransformResultError();\n }\n if (result.ok && !isObject(result.result)) {\n throw new TransformResultError();\n }\n return result;\n}\n","import type { TRPCError } from '../error/TRPCError';\nimport type { TRPC_ERROR_CODES_BY_KEY, TRPCResponse } from '../rpc';\nimport { TRPC_ERROR_CODES_BY_NUMBER } from '../rpc';\nimport type { InvertKeyValue, ValueOf } from '../types';\nimport { isObject } from '../utils';\n\nexport const JSONRPC2_TO_HTTP_CODE: Record<\n keyof typeof TRPC_ERROR_CODES_BY_KEY,\n number\n> = {\n PARSE_ERROR: 400,\n BAD_REQUEST: 400,\n UNAUTHORIZED: 401,\n PAYMENT_REQUIRED: 402,\n FORBIDDEN: 403,\n NOT_FOUND: 404,\n METHOD_NOT_SUPPORTED: 405,\n TIMEOUT: 408,\n CONFLICT: 409,\n PRECONDITION_FAILED: 412,\n PAYLOAD_TOO_LARGE: 413,\n UNSUPPORTED_MEDIA_TYPE: 415,\n UNPROCESSABLE_CONTENT: 422,\n PRECONDITION_REQUIRED: 428,\n TOO_MANY_REQUESTS: 429,\n CLIENT_CLOSED_REQUEST: 499,\n INTERNAL_SERVER_ERROR: 500,\n NOT_IMPLEMENTED: 501,\n BAD_GATEWAY: 502,\n SERVICE_UNAVAILABLE: 503,\n GATEWAY_TIMEOUT: 504,\n};\n\nexport const HTTP_CODE_TO_JSONRPC2: InvertKeyValue<\n typeof JSONRPC2_TO_HTTP_CODE\n> = {\n 400: 'BAD_REQUEST',\n 401: 'UNAUTHORIZED',\n 402: 'PAYMENT_REQUIRED',\n 403: 'FORBIDDEN',\n 404: 'NOT_FOUND',\n 405: 'METHOD_NOT_SUPPORTED',\n 408: 'TIMEOUT',\n 409: 'CONFLICT',\n 412: 'PRECONDITION_FAILED',\n 413: 'PAYLOAD_TOO_LARGE',\n 415: 'UNSUPPORTED_MEDIA_TYPE',\n 422: 'UNPROCESSABLE_CONTENT',\n 428: 'PRECONDITION_REQUIRED',\n 429: 'TOO_MANY_REQUESTS',\n 499: 'CLIENT_CLOSED_REQUEST',\n 500: 'INTERNAL_SERVER_ERROR',\n 501: 'NOT_IMPLEMENTED',\n 502: 'BAD_GATEWAY',\n 503: 'SERVICE_UNAVAILABLE',\n 504: 'GATEWAY_TIMEOUT',\n} as const;\n\nexport function getStatusCodeFromKey(\n code: keyof typeof TRPC_ERROR_CODES_BY_KEY,\n) {\n return JSONRPC2_TO_HTTP_CODE[code] ?? 500;\n}\n\nexport function getStatusKeyFromCode(\n code: keyof typeof HTTP_CODE_TO_JSONRPC2,\n): ValueOf<typeof HTTP_CODE_TO_JSONRPC2> {\n return HTTP_CODE_TO_JSONRPC2[code] ?? 'INTERNAL_SERVER_ERROR';\n}\n\nexport function getHTTPStatusCode(json: TRPCResponse | TRPCResponse[]) {\n const arr = Array.isArray(json) ? json : [json];\n const httpStatuses = new Set<number>(\n arr.map((res) => {\n if ('error' in res && isObject(res.error.data)) {\n if (typeof res.error.data?.['httpStatus'] === 'number') {\n return res.error.data['httpStatus'];\n }\n const code = TRPC_ERROR_CODES_BY_NUMBER[res.error.code];\n return getStatusCodeFromKey(code);\n }\n return 200;\n }),\n );\n\n if (httpStatuses.size !== 1) {\n return 207;\n }\n\n const httpStatus = httpStatuses.values().next().value;\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return httpStatus!;\n}\n\nexport function getHTTPStatusCodeFromError(error: TRPCError) {\n return getStatusCodeFromKey(error.code);\n}\n","import type {\n AnyClientTypes,\n CombinedDataTransformer,\n Maybe,\n ProcedureType,\n TRPCAcceptHeader,\n TRPCResponse,\n} from '@trpc/server/unstable-core-do-not-import';\nimport { getFetch } from '../../getFetch';\nimport type {\n FetchEsque,\n RequestInitEsque,\n ResponseEsque,\n} from '../../internals/types';\nimport type { TransformerOptions } from '../../unstable-internals';\nimport { getTransformer } from '../../unstable-internals';\nimport type { HTTPHeaders } from '../types';\n\n/**\n * @internal\n */\nexport type HTTPLinkBaseOptions<\n TRoot extends Pick<AnyClientTypes, 'transformer'>,\n> = {\n url: string | URL;\n /**\n * Add ponyfill for fetch\n */\n fetch?: FetchEsque;\n /**\n * Send all requests `as POST`s requests regardless of the procedure type\n * The HTTP handler must separately allow overriding the method. See:\n * @see https://trpc.io/docs/rpc\n */\n methodOverride?: 'POST';\n} & TransformerOptions<TRoot>;\n\nexport interface ResolvedHTTPLinkOptions {\n url: string;\n fetch?: FetchEsque;\n transformer: CombinedDataTransformer;\n methodOverride?: 'POST';\n}\n\nexport function resolveHTTPLinkOptions(\n opts: HTTPLinkBaseOptions<AnyClientTypes>,\n): ResolvedHTTPLinkOptions {\n return {\n url: opts.url.toString(),\n fetch: opts.fetch,\n transformer: getTransformer(opts.transformer),\n methodOverride: opts.methodOverride,\n };\n}\n\n// https://github.com/trpc/trpc/pull/669\nfunction arrayToDict(array: unknown[]) {\n const dict: Record<number, unknown> = {};\n for (let index = 0; index < array.length; index++) {\n const element = array[index];\n dict[index] = element;\n }\n return dict;\n}\n\nconst METHOD = {\n query: 'GET',\n mutation: 'POST',\n subscription: 'PATCH',\n} as const;\n\nexport interface HTTPResult {\n json: TRPCResponse;\n meta: {\n response: ResponseEsque;\n responseJSON?: unknown;\n };\n}\n\ntype GetInputOptions = {\n transformer: CombinedDataTransformer;\n} & ({ input: unknown } | { inputs: unknown[] });\n\nexport function getInput(opts: GetInputOptions) {\n return 'input' in opts\n ? opts.transformer.input.serialize(opts.input)\n : arrayToDict(\n opts.inputs.map((_input) => opts.transformer.input.serialize(_input)),\n );\n}\n\nexport type HTTPBaseRequestOptions = GetInputOptions &\n ResolvedHTTPLinkOptions & {\n type: ProcedureType;\n path: string;\n signal: Maybe<AbortSignal>;\n };\n\ntype GetUrl = (opts: HTTPBaseRequestOptions) => string;\ntype GetBody = (opts: HTTPBaseRequestOptions) => RequestInitEsque['body'];\n\nexport type ContentOptions = {\n trpcAcceptHeader?: TRPCAcceptHeader;\n trpcAcceptHeaderKey?: 'trpc-accept' | 'accept';\n contentTypeHeader?: string;\n getUrl: GetUrl;\n getBody: GetBody;\n};\n\nexport const getUrl: GetUrl = (opts) => {\n const parts = opts.url.split('?') as [string, string?];\n const base = parts[0].replace(/\\/$/, ''); // Remove any trailing slashes\n\n let url = base + '/' + opts.path;\n const queryParts: string[] = [];\n\n if (parts[1]) {\n queryParts.push(parts[1]);\n }\n if ('inputs' in opts) {\n queryParts.push('batch=1');\n }\n if (opts.type === 'query' || opts.type === 'subscription') {\n const input = getInput(opts);\n if (input !== undefined && opts.methodOverride !== 'POST') {\n queryParts.push(`input=${encodeURIComponent(JSON.stringify(input))}`);\n }\n }\n if (queryParts.length) {\n url += '?' + queryParts.join('&');\n }\n return url;\n};\n\nexport const getBody: GetBody = (opts) => {\n if (opts.type === 'query' && opts.methodOverride !== 'POST') {\n return undefined;\n }\n const input = getInput(opts);\n return input !== undefined ? JSON.stringify(input) : undefined;\n};\n\nexport type Requester = (\n opts: HTTPBaseRequestOptions & {\n headers: () => HTTPHeaders | Promise<HTTPHeaders>;\n },\n) => Promise<HTTPResult>;\n\nexport const jsonHttpRequester: Requester = (opts) => {\n return httpRequest({\n ...opts,\n contentTypeHeader: 'application/json',\n getUrl,\n getBody,\n });\n};\n\n/**\n * Polyfill for DOMException with AbortError name\n */\nclass AbortError extends Error {\n constructor() {\n const name = 'AbortError';\n super(name);\n this.name = name;\n this.message = name;\n }\n}\n\nexport type HTTPRequestOptions = ContentOptions &\n HTTPBaseRequestOptions & {\n headers: () => HTTPHeaders | Promise<HTTPHeaders>;\n };\n\n/**\n * Polyfill for `signal.throwIfAborted()`\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/throwIfAborted\n */\nconst throwIfAborted = (signal: Maybe<AbortSignal>) => {\n if (!signal?.aborted) {\n return;\n }\n // If available, use the native implementation\n signal.throwIfAborted?.();\n\n // If we have `DOMException`, use it\n if (typeof DOMException !== 'undefined') {\n throw new DOMException('AbortError', 'AbortError');\n }\n\n // Otherwise, use our own implementation\n throw new AbortError();\n};\n\nexport async function fetchHTTPResponse(opts: HTTPRequestOptions) {\n throwIfAborted(opts.signal);\n\n const url = opts.getUrl(opts);\n const body = opts.getBody(opts);\n const method = opts.methodOverride ?? METHOD[opts.type];\n const resolvedHeaders = await (async () => {\n const heads = await opts.headers();\n if (Symbol.iterator in heads) {\n return Object.fromEntries(heads);\n }\n return heads;\n })();\n const headers = {\n ...(opts.contentTypeHeader && method !== 'GET'\n ? { 'content-type': opts.contentTypeHeader }\n : {}),\n ...(opts.trpcAcceptHeader\n ? { [opts.trpcAcceptHeaderKey ?? 'trpc-accept']: opts.trpcAcceptHeader }\n : undefined),\n ...resolvedHeaders,\n };\n\n return getFetch(opts.fetch)(url, {\n method,\n signal: opts.signal,\n body,\n headers,\n });\n}\n\nexport async function httpRequest(\n opts: HTTPRequestOptions,\n): Promise<HTTPResult> {\n const meta = {} as HTTPResult['meta'];\n\n const res = await fetchHTTPResponse(opts);\n meta.response = res;\n\n const json = await res.json();\n\n meta.responseJSON = json;\n\n return {\n json: json as TRPCResponse,\n meta,\n };\n}\n","import type { InvertKeyValue, ValueOf } from '../types';\n\n// reference: https://www.jsonrpc.org/specification\n\n/**\n * JSON-RPC 2.0 Error codes\n *\n * `-32000` to `-32099` are reserved for implementation-defined server-errors.\n * For tRPC we're copying the last digits of HTTP 4XX errors.\n */\nexport const TRPC_ERROR_CODES_BY_KEY = {\n /**\n * Invalid JSON was received by the server.\n * An error occurred on the server while parsing the JSON text.\n */\n PARSE_ERROR: -32700,\n /**\n * The JSON sent is not a valid Request object.\n */\n BAD_REQUEST: -32600, // 400\n\n // Internal JSON-RPC error\n INTERNAL_SERVER_ERROR: -32603, // 500\n NOT_IMPLEMENTED: -32603, // 501\n BAD_GATEWAY: -32603, // 502\n SERVICE_UNAVAILABLE: -32603, // 503\n GATEWAY_TIMEOUT: -32603, // 504\n\n // Implementation specific errors\n UNAUTHORIZED: -32001, // 401\n PAYMENT_REQUIRED: -32002, // 402\n FORBIDDEN: -32003, // 403\n NOT_FOUND: -32004, // 404\n METHOD_NOT_SUPPORTED: -32005, // 405\n TIMEOUT: -32008, // 408\n CONFLICT: -32009, // 409\n PRECONDITION_FAILED: -32012, // 412\n PAYLOAD_TOO_LARGE: -32013, // 413\n UNSUPPORTED_MEDIA_TYPE: -32015, // 415\n UNPROCESSABLE_CONTENT: -32022, // 422\n PRECONDITION_REQUIRED: -32028, // 428\n TOO_MANY_REQUESTS: -32029, // 429\n CLIENT_CLOSED_REQUEST: -32099, // 499\n} as const;\n\n// pure\nexport const TRPC_ERROR_CODES_BY_NUMBER: InvertKeyValue<\n typeof TRPC_ERROR_CODES_BY_KEY\n> = {\n [-32700]: 'PARSE_ERROR',\n [-32600]: 'BAD_REQUEST',\n [-32603]: 'INTERNAL_SERVER_ERROR',\n [-32001]: 'UNAUTHORIZED',\n [-32002]: 'PAYMENT_REQUIRED',\n [-32003]: 'FORBIDDEN',\n [-32004]: 'NOT_FOUND',\n [-32005]: 'METHOD_NOT_SUPPORTED',\n [-32008]: 'TIMEOUT',\n [-32009]: 'CONFLICT',\n [-32012]: 'PRECONDITION_FAILED',\n [-32013]: 'PAYLOAD_TOO_LARGE',\n [-32015]: 'UNSUPPORTED_MEDIA_TYPE',\n [-32022]: 'UNPROCESSABLE_CONTENT',\n [-32028]: 'PRECONDITION_REQUIRED',\n [-32029]: 'TOO_MANY_REQUESTS',\n [-32099]: 'CLIENT_CLOSED_REQUEST',\n};\n\nexport type TRPC_ERROR_CODE_NUMBER = ValueOf<typeof TRPC_ERROR_CODES_BY_KEY>;\nexport type TRPC_ERROR_CODE_KEY = keyof typeof TRPC_ERROR_CODES_BY_KEY;\n\n/**\n * tRPC error codes that are considered retryable\n * With out of the box SSE, the client will reconnect when these errors are encountered\n */\nexport const retryableRpcCodes: TRPC_ERROR_CODE_NUMBER[] = [\n TRPC_ERROR_CODES_BY_KEY.BAD_GATEWAY,\n TRPC_ERROR_CODES_BY_KEY.SERVICE_UNAVAILABLE,\n TRPC_ERROR_CODES_BY_KEY.GATEWAY_TIMEOUT,\n TRPC_ERROR_CODES_BY_KEY.INTERNAL_SERVER_ERROR,\n];\n","import type { AnyRouter } from '@trpc/server/unstable-core-do-not-import';\nimport type { CreateTRPCClientOptions } from './internals/TRPCUntypedClient';\nimport { TRPCUntypedClient } from './internals/TRPCUntypedClient';\n\nexport function createTRPCUntypedClient<TRouter extends AnyRouter>(\n opts: CreateTRPCClientOptions<TRouter>,\n): TRPCUntypedClient<TRouter> {\n return new TRPCUntypedClient(opts);\n}\n\nexport type {\n CreateTRPCClientOptions,\n TRPCRequestOptions,\n} from './internals/TRPCUntypedClient';\nexport { TRPCUntypedClient } from './internals/TRPCUntypedClient';\n","/* eslint-disable @typescript-eslint/no-non-null-assertion */\nimport type { Unsubscribable } from '@trpc/server/observable';\nimport type {\n AnyProcedure,\n AnyRouter,\n inferClientTypes,\n inferProcedureInput,\n InferrableClientTypes,\n inferTransformedProcedureOutput,\n ProcedureType,\n RouterRecord,\n} from '@trpc/server/unstable-core-do-not-import';\nimport {\n createFlatProxy,\n createRecursiveProxy,\n} from '@trpc/server/unstable-core-do-not-import';\nimport type { CreateTRPCClientOptions } from './createTRPCUntypedClient';\nimport type { TRPCSubscriptionObserver } from './internals/TRPCUntypedClient';\nimport { TRPCUntypedClient } from './internals/TRPCUntypedClient';\nimport type { TRPCProcedureOptions } from './internals/types';\nimport type { TRPCClientError } from './TRPCClientError';\n\n/**\n * @public\n * @deprecated use {@link TRPCClient} instead, will be removed in v12\n **/\nexport type inferRouterClient<TRouter extends AnyRouter> = TRPCClient<TRouter>;\n\n/**\n * @public\n * @deprecated use {@link TRPCClient} instead, will be removed in v12\n **/\nexport type CreateTRPCClient<TRouter extends AnyRouter> = TRPCClient<TRouter>;\n\nconst untypedClientSymbol = Symbol.for('trpc_untypedClient');\n\n/**\n * @public\n **/\nexport type TRPCClient<TRouter extends AnyRouter> = DecoratedProcedureRecord<\n {\n transformer: TRouter['_def']['_config']['$types']['transformer'];\n errorShape: TRouter['_def']['_config']['$types']['errorShape'];\n },\n TRouter['_def']['record']\n> & {\n [untypedClientSymbol]: TRPCUntypedClient<TRouter>;\n};\n\n/** @internal */\nexport type TRPCResolverDef = {\n input: any;\n output: any;\n transformer: boolean;\n errorShape: any;\n};\n\ntype coerceAsyncGeneratorToIterable<T> =\n T extends AsyncGenerator<infer $T, infer $Return, infer $Next>\n ? AsyncIterable<$T, $Return, $Next>\n : T;\n\n/** @internal */\nexport type Resolver<TDef extends TRPCResolverDef> = (\n input: TDef['input'],\n opts?: TRPCProcedureOptions,\n) => Promise<coerceAsyncGeneratorToIterable<TDef['output']>>;\n\n/** @internal */\nexport type SubscriptionResolver<TDef extends TRPCResolverDef> = (\n input: TDef['input'],\n opts: Partial<\n TRPCSubscriptionObserver<TDef['output'], TRPCClientError<TDef>>\n > &\n TRPCProcedureOptions,\n) => Unsubscribable;\n\ntype DecorateProcedure<\n TType extends ProcedureType,\n TDef extends TRPCResolverDef,\n> = TType extends 'query'\n ? {\n query: Resolver<TDef>;\n }\n : TType extends 'mutation'\n ? {\n mutate: Resolver<TDef>;\n }\n : TType extends 'subscription'\n ? {\n subscribe: SubscriptionResolver<TDef>;\n }\n : never;\n\n/**\n * @internal\n */\ntype DecoratedProcedureRecord<\n TRoot extends InferrableClientTypes,\n TRecord extends RouterRecord,\n> = {\n [TKey in keyof TRecord]: TRecord[TKey] extends infer $Value\n ? $Value extends AnyProcedure\n ? DecorateProcedure<\n $Value['_def']['type'],\n {\n input: inferProcedureInput<$Value>;\n output: inferTransformedProcedureOutput<\n inferClientTypes<TRoot>,\n $Value\n >;\n errorShape: inferClientTypes<TRoot>['errorShape'];\n transformer: inferClientTypes<TRoot>['transformer'];\n }\n >\n : $Value extends RouterRecord\n ? DecoratedProcedureRecord<TRoot, $Value>\n : never\n : never;\n};\n\nconst clientCallTypeMap: Record<\n keyof DecorateProcedure<any, any>,\n ProcedureType\n> = {\n query: 'query',\n mutate: 'mutation',\n subscribe: 'subscription',\n};\n\n/** @internal */\nexport const clientCallTypeToProcedureType = (\n clientCallType: string,\n): ProcedureType => {\n return clientCallTypeMap[clientCallType as keyof typeof clientCallTypeMap];\n};\n\n/**\n * @internal\n */\nexport function createTRPCClientProxy<TRouter extends AnyRouter>(\n client: TRPCUntypedClient<TRouter>,\n): TRPCClient<TRouter> {\n const proxy = createRecursiveProxy<TRPCClient<TRouter>>(({ path, args }) => {\n const pathCopy = [...path];\n const procedureType = clientCallTypeToProcedureType(pathCopy.pop()!);\n\n const fullPath = pathCopy.join('.');\n\n return (client[procedureType] as any)(fullPath, ...(args as any));\n });\n return createFlatProxy<TRPCClient<TRouter>>((key) => {\n if (key === untypedClientSymbol) {\n return client;\n }\n return proxy[key];\n });\n}\n\nexport function createTRPCClient<TRouter extends AnyRouter>(\n opts: CreateTRPCClientOptions<TRouter>,\n): TRPCClient<TRouter> {\n const client = new TRPCUntypedClient(opts);\n const proxy = createTRPCClientProxy<TRouter>(client);\n return proxy;\n}\n\n/**\n * Get an untyped client from a proxy client\n * @internal\n */\nexport function getUntypedClient<TRouter extends AnyRouter>(\n client: TRPCClient<TRouter>,\n): TRPCUntypedClient<TRouter> {\n return client[untypedClientSymbol];\n}\n","import type { AnyRouter, ProcedureType } from '@trpc/server';\nimport { observable } from '@trpc/server/observable';\nimport { transformResult } from '@trpc/server/unstable-core-do-not-import';\nimport type { BatchLoader } from '../internals/dataLoader';\nimport { dataLoader } from '../internals/dataLoader';\nimport { allAbortSignals, raceAbortSignals } from '../internals/signals';\nimport type { NonEmptyArray } from '../internals/types';\nimport { TRPCClientError } from '../TRPCClientError';\nimport type { HTTPBatchLinkOptions } from './HTTPBatchLinkOptions';\nimport type { HTTPResult } from './internals/httpUtils';\nimport {\n getUrl,\n jsonHttpRequester,\n resolveHTTPLinkOptions,\n} from './internals/httpUtils';\nimport type { Operation, TRPCLink } from './types';\n\n/**\n * @see https://trpc.io/docs/client/links/httpBatchLink\n */\nexport function httpBatchLink<TRouter extends AnyRouter>(\n opts: HTTPBatchLinkOptions<TRouter['_def']['_config']['$types']>,\n): TRPCLink<TRouter> {\n const resolvedOpts = resolveHTTPLinkOptions(opts);\n const maxURLLength = opts.maxURLLength ?? Infinity;\n const maxItems = opts.maxItems ?? Infinity;\n\n return () => {\n const batchLoader = (\n type: ProcedureType,\n ): BatchLoader<Operation, HTTPResult> => {\n return {\n validate(batchOps) {\n if (maxURLLength === Infinity && maxItems === Infinity) {\n // escape hatch for quick calcs\n return true;\n }\n if (batchOps.length > maxItems) {\n return false;\n }\n const path = batchOps.map((op) => op.path).join(',');\n const inputs = batchOps.map((op) => op.input);\n\n const url = getUrl({\n ...resolvedOpts,\n type,\n path,\n inputs,\n signal: null,\n });\n\n return url.length <= maxURLLength;\n },\n async fetch(batchOps) {\n const path = batchOps.map((op) => op.path).join(',');\n const inputs = batchOps.map((op) => op.input);\n const signal = allAbortSignals(...batchOps.map((op) => op.signal));\n\n const res = await jsonHttpRequester({\n ...resolvedOpts,\n path,\n inputs,\n type,\n headers() {\n if (!opts.headers) {\n return {};\n }\n if (typeof opts.headers === 'function') {\n return opts.headers({\n opList: batchOps as NonEmptyArray<Operation>,\n });\n }\n return opts.headers;\n },\n signal,\n });\n const resJSON = Array.isArray(res.json)\n ? res.json\n : batchOps.map(() => res.json);\n const result = resJSON.map((item) => ({\n meta: res.meta,\n json: item,\n }));\n return result;\n },\n };\n };\n\n const query = dataLoader(batchLoader('query'));\n const mutation = dataLoader(batchLoader('mutation'));\n\n const loaders = { query, mutation };\n return ({ op }) => {\n return observable((observer) => {\n /* istanbul ignore if -- @preserve */\n if (op.type === 'subscription') {\n throw new Error(\n 'Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`',\n );\n }\n const ac = new AbortController();\n const loader = loaders[op.type];\n const promise = loader.load({\n ...op,\n signal: raceAbortSignals(op.signal, ac.signal),\n });\n\n let isDone = false;\n let _res = undefined as HTTPResult | undefined;\n promise\n .then((res) => {\n isDone = true;\n _res = res;\n const transformed = transformResult(\n res.json,\n resolvedOpts.transformer.output,\n );\n\n if (!transformed.ok) {\n observer.error(\n TRPCClientError.from(transformed.error, {\n meta: res.meta,\n }),\n );\n return;\n }\n observer.next({\n context: res.meta,\n result: transformed.result,\n });\n observer.complete();\n })\n .catch((err) => {\n isDone = true;\n observer.error(\n TRPCClientError.from(err, {\n meta: _res?.meta,\n }),\n );\n });\n\n return () => {\n if (!isDone) {\n ac.abort();\n }\n };\n });\n };\n };\n}\n","import type { AnyTRPCRouter, inferRouterError } from '@trpc/server';\nimport type { Observer } from '@trpc/server/observable';\nimport type {\n TRPCClientOutgoingMessage,\n TRPCResponseMessage,\n} from '@trpc/server/unstable-core-do-not-import';\nimport type { TRPCClientError } from '../../../TRPCClientError';\nimport { withResolvers } from './utils';\n\nexport type TCallbacks = Observer<\n TRPCResponseMessage<unknown, inferRouterError<AnyTRPCRouter>>,\n TRPCClientError<AnyTRPCRouter>\n>;\n\ntype MessageId = string;\ntype MessageIdLike = string | number | null;\n\n/**\n * Represents a WebSocket request managed by the RequestManager.\n * Combines the network message, a utility promise (`end`) that mirrors the lifecycle\n * handled by `callbacks`, and a set of state monitoring callbacks.\n */\ninterface Request {\n message: TRPCClientOutgoingMessage;\n end: Promise<void>;\n callbacks: TCallbacks;\n}\n\n/**\n * Manages WebSocket requests, tracking their lifecycle and providing utility methods\n * for handling outgoing and pending requests.\n *\n * - **Outgoing requests**: Requests that are queued and waiting to be sent.\n * - **Pending requests**: Requests that have been sent and are in flight awaiting a response.\n * For subscriptions, multiple responses may be received until the subscription is closed.\n */\nexport class RequestManager {\n /**\n * Stores requests that are outgoing, meaning they are registered but not yet sent over the WebSocket.\n */\n private outgoingRequests = new Array<Request & { id: MessageId }>();\n\n /**\n * Stores requests that are pending (in flight), meaning they have been sent over the WebSocket\n * and are awaiting responses. For subscriptions, this includes requests\n * that may receive multiple responses.\n */\n private pendingRequests: Record<MessageId, Request> = {};\n\n /**\n * Registers a new request by adding it to the outgoing queue and setting up\n * callbacks for lifecycle events such as completion or error.\n *\n * @param message - The outgoing message to be sent.\n * @param callbacks - Callback functions to observe the request's state.\n * @returns A cleanup function to manually remove the request.\n */\n public register(message: TRPCClientOutgoingMessage, callbacks: TCallbacks) {\n const { promise: end, resolve } = withResolvers<void>();\n\n this.outgoingRequests.push({\n id: String(message.id),\n message,\n end,\n callbacks: {\n next: callbacks.next,\n complete: () => {\n callbacks.complete();\n resolve();\n },\n error: (e) => {\n callbacks.error(e);\n resolve();\n },\n },\n });\n\n return () => {\n this.delete(message.id);\n callbacks.complete();\n resolve();\n };\n }\n\n /**\n * Deletes a request from both the outgoing and pending collections, if it exists.\n */\n public delete(messageId: MessageIdLike) {\n if (messageId === null) return;\n\n this.outgoingRequests = this.outgoingRequests.filter(\n ({ id }) => id !== String(messageId),\n );\n delete this.pendingRequests[String(messageId)];\n }\n\n /**\n * Moves all outgoing requests to the pending state and clears the outgoing queue.\n *\n * The caller is expected to handle the actual sending of the requests\n * (e.g., sending them over the network) after this method is called.\n *\n * @returns The list of requests that were transitioned to the pending state.\n */\n public flush() {\n const requests = this.outgoingRequests;\n this.outgoingRequests = [];\n\n for (const request of requests) {\n this.pendingRequests[request.id] = request;\n }\n return requests;\n }\n\n /**\n * Retrieves all currently pending requests, which are in flight awaiting responses\n * or handling ongoing subscriptions.\n */\n public getPendingRequests() {\n return Object.values(this.pendingRequests);\n }\n\n /**\n * Retrieves a specific pending request by its message ID.\n */\n public getPendingRequest(messageId: MessageIdLike) {\n if (messageId === null) return null;\n\n return this.pendingRequests[String(messageId)];\n }\n\n /**\n * Retrieves all outgoing requests, which are waiting to be sent.\n */\n public getOutgoingRequests() {\n return this.outgoingRequests;\n }\n\n /**\n * Retrieves all requests, both outgoing and pending, with their respective states.\n *\n * @returns An array of all requests with their state (\"outgoing\" or \"pending\").\n */\n public getRequests() {\n return [\n ...this.getOutgoingRequests().map((request) => ({\n state: 'outgoing' as const,\n message: request.message,\n end: request.end,\n callbacks: request.callbacks,\n })),\n ...this.getPendingRequests().map((request) => ({\n state: 'pending' as const,\n message: request.message,\n end: request.end,\n callbacks: request.callbacks,\n })),\n ];\n }\n\n /**\n * Checks if there are any pending requests, including ongoing subscriptions.\n */\n public hasPendingRequests() {\n return this.getPendingRequests().length > 0;\n }\n\n /**\n * Checks if there are any pending subscriptions\n */\n public hasPendingSubscriptions() {\n return this.getPendingRequests().some(\n (request) => request.message.method === 'subscription',\n );\n }\n\n /**\n * Checks if there are any outgoing requests waiting to be sent.\n */\n public hasOutgoingRequests() {\n return this.outgoingRequests.length > 0;\n }\n}\n","import type { Observable } from '../observable';\nimport { createRecursiveProxy } from './createProxy';\nimport { defaultFormatter } from './error/formatter';\nimport { getTRPCErrorFromUnknown, TRPCError } from './error/TRPCError';\nimport type {\n AnyProcedure,\n ErrorHandlerOptions,\n inferProcedureInput,\n inferProcedureOutput,\n LegacyObservableSubscriptionProcedure,\n} from './procedure';\nimport type { ProcedureCallOptions } from './procedureBuilder';\nimport type { AnyRootTypes, RootConfig } from './rootConfig';\nimport { defaultTransformer } from './transformer';\nimport type { MaybePromise, ValueOf } from './types';\nimport {\n emptyObject,\n isFunction,\n isObject,\n mergeWithoutOverrides,\n} from './utils';\n\nexport interface RouterRecord {\n [key: string]: AnyProcedure | RouterRecord;\n}\n\ntype DecorateProcedure<TProcedure extends AnyProcedure> = (\n input: inferProcedureInput<TProcedure>,\n) => Promise<\n TProcedure['_def']['type'] extends 'subscription'\n ? TProcedure extends LegacyObservableSubscriptionProcedure<any>\n ? Observable<inferProcedureOutput<TProcedure>, TRPCError>\n : inferProcedureOutput<TProcedure>\n : inferProcedureOutput<TProcedure>\n>;\n\n/**\n * @internal\n */\nexport type DecorateRouterRecord<TRecord extends RouterRecord> = {\n [TKey in keyof TRecord]: TRecord[TKey] extends infer $Value\n ? $Value extends AnyProcedure\n ? DecorateProcedure<$Value>\n : $Value extends RouterRecord\n ? DecorateRouterRecord<$Value>\n : never\n : never;\n};\n\n/**\n * @internal\n */\n\nexport type RouterCallerErrorHandler<TContext> = (\n opts: ErrorHandlerOptions<TContext>,\n) => void;\n\n/**\n * @internal\n */\nexport type RouterCaller<\n TRoot extends AnyRootTypes,\n TRecord extends RouterRecord,\n> = (\n /**\n * @note\n * If passing a function, we recommend it's a cached function\n * e.g. wrapped in `React.cache` to avoid unnecessary computations\n */\n ctx: TRoot['ctx'] | (() => MaybePromise<TRoot['ctx']>),\n options?: {\n onError?: RouterCallerErrorHandler<TRoot['ctx']>;\n signal?: AbortSignal;\n },\n) => DecorateRouterRecord<TRecord>;\n\n/**\n * @internal\n */\nconst lazyMarker = 'lazyMarker' as 'lazyMarker' & {\n __brand: 'lazyMarker';\n};\nexport type Lazy<TAny> = (() => Promise<TAny>) & { [lazyMarker]: true };\n\ntype LazyLoader<TAny> = {\n load: () => Promise<void>;\n ref: Lazy<TAny>;\n};\n\nfunction once<T>(fn: () => T): () => T {\n const uncalled = Symbol();\n let result: T | typeof uncalled = uncalled;\n return (): T => {\n if (result === uncalled) {\n result = fn();\n }\n return result;\n };\n}\n\n/**\n * Lazy load a router\n * @see https://trpc.io/docs/server/merging-routers#lazy-load\n */\nexport function lazy<TRouter extends AnyRouter>(\n importRouter: () => Promise<\n | TRouter\n | {\n [key: string]: TRouter;\n }\n >,\n): Lazy<NoInfer<TRouter>> {\n async function resolve(): Promise<TRouter> {\n const mod = await importRouter();\n\n // if the module is a router, return it\n if (isRouter(mod)) {\n return mod;\n }\n\n const routers = Object.values(mod);\n\n if (routers.length !== 1 || !isRouter(routers[0])) {\n throw new Error(\n \"Invalid router module - either define exactly 1 export or return the router directly.\\nExample: `lazy(() => import('./slow.js').then((m) => m.slowRouter))`\",\n );\n }\n\n return routers[0];\n }\n\n (resolve as Lazy<NoInfer<TRouter>>)[lazyMarker] = true as const;\n\n return resolve as Lazy<NoInfer<TRouter>>;\n}\n\nfunction isLazy<TAny>(input: unknown): input is Lazy<TAny> {\n return typeof input === 'function' && lazyMarker in input;\n}\n\n/**\n * @internal\n */\nexport interface RouterDef<\n TRoot extends AnyRootTypes,\n TRecord extends RouterRecord,\n> {\n _config: RootConfig<TRoot>;\n router: true;\n procedure?: never;\n procedures: TRecord;\n record: TRecord;\n lazy: Record<string, LazyLoader<AnyRouter>>;\n}\n\nexport interface Router<\n TRoot extends AnyRootTypes,\n TRecord extends RouterRecord,\n> {\n _def: RouterDef<TRoot, TRecord>;\n /**\n * @see https://trpc.io/docs/v11/server/server-side-calls\n */\n createCaller: RouterCaller<TRoot, TRecord>;\n}\n\nexport type BuiltRouter<\n TRoot extends AnyRootTypes,\n TRecord extends RouterRecord,\n> = Router<TRoot, TRecord> & TRecord;\n\nexport interface RouterBuilder<TRoot extends AnyRootTypes> {\n <TIn extends CreateRouterOptions>(\n _: TIn,\n ): BuiltRouter<TRoot, DecorateCreateRouterOptions<TIn>>;\n}\n\nexport type AnyRouter = Router<any, any>;\n\nexport type inferRouterRootTypes<TRouter extends AnyRouter> =\n TRouter['_def']['_config']['$types'];\n\nexport type inferRouterContext<TRouter extends AnyRouter> =\n inferRouterRootTypes<TRouter>['ctx'];\nexport type inferRouterError<TRouter extends AnyRouter> =\n inferRouterRootTypes<TRouter>['errorShape'];\nexport type inferRouterMeta<TRouter extends AnyRouter> =\n inferRouterRootTypes<TRouter>['meta'];\n\nfunction isRouter(value: unknown): value is AnyRouter {\n return (\n isObject(value) && isObject(value['_def']) && 'router' in value['_def']\n );\n}\n\nconst emptyRouter = {\n _ctx: null as any,\n _errorShape: null as any,\n _meta: null as any,\n queries: {},\n mutations: {},\n subscriptions: {},\n errorFormatter: defaultFormatter,\n transformer: defaultTransformer,\n};\n\n/**\n * Reserved words that can't be used as router or procedure names\n */\nconst reservedWords = [\n /**\n * Then is a reserved word because otherwise we can't return a promise that returns a Proxy\n * since JS will think that `.then` is something that exists\n */\n 'then',\n /**\n * `fn.call()` and `fn.apply()` are reserved words because otherwise we can't call a function using `.call` or `.apply`\n */\n 'call',\n 'apply',\n];\n\n/** @internal */\nexport type CreateRouterOptions = {\n [key: string]:\n AnyProcedure | AnyRouter | CreateRouterOptions | Lazy<AnyRouter>;\n};\n\n/** @internal */\nexport type DecorateCreateRouterOptions<\n TRouterOptions extends CreateRouterOptions,\n> = {\n [K in keyof TRouterOptions]: TRouterOptions[K] extends infer $Value\n ? $Value extends AnyProcedure\n ? $Value\n : $Value extends Router<any, infer TRecord>\n ? TRecord\n : $Value extends Lazy<Router<any, infer TRecord>>\n ? TRecord\n : $Value extends CreateRouterOptions\n ? DecorateCreateRouterOptions<$Value>\n : never\n : never;\n};\n\n/**\n * @internal\n */\nexport function createRouterFactory<TRoot extends AnyRootTypes>(\n config: RootConfig<TRoot>,\n) {\n function createRouterInner<TInput extends CreateRouterOptions>(\n input: TInput,\n ): BuiltRouter<TRoot, DecorateCreateRouterOptions<TInput>> {\n const reservedWordsUsed = new Set(\n Object.keys(input).filter((v) => reservedWords.includes(v)),\n );\n if (reservedWordsUsed.size > 0) {\n throw new Error(\n 'Reserved words used in `router({})` call: ' +\n Array.from(reservedWordsUsed).join(', '),\n );\n }\n\n const procedures: Record<string, AnyProcedure> = emptyObject();\n const lazy: Record<string, LazyLoader<AnyRouter>> = emptyObject();\n\n function createLazyLoader(opts: {\n ref: Lazy<AnyRouter>;\n path: readonly string[];\n key: string;\n aggregate: RouterRecord;\n }): LazyLoader<AnyRouter> {\n return {\n ref: opts.ref,\n load: once(async () => {\n const router = await opts.ref();\n const lazyPath = [...opts.path, opts.key];\n const lazyKey = lazyPath.join('.');\n\n opts.aggregate[opts.key] = step(router._def.record, lazyPath);\n\n delete lazy[lazyKey];\n\n // add lazy loaders for nested routers\n for (const [nestedKey, nestedItem] of Object.entries(\n router._def.lazy,\n )) {\n const nestedRouterKey = [...lazyPath, nestedKey].join('.');\n\n // console.log('adding lazy', nestedRouterKey);\n lazy[nestedRouterKey] = createLazyLoader({\n ref: nestedItem.ref,\n path: lazyPath,\n key: nestedKey,\n aggregate: opts.aggregate[opts.key] as RouterRecord,\n });\n }\n }),\n };\n }\n\n function step(from: CreateRouterOptions, path: readonly string[] = []) {\n const aggregate: RouterRecord = emptyObject();\n for (const [key, item] of Object.entries(from ?? {})) {\n if (isLazy(item)) {\n lazy[[...path, key].join('.')] = createLazyLoader({\n path,\n ref: item,\n key,\n aggregate,\n });\n continue;\n }\n if (isRouter(item)) {\n aggregate[key] = step(item._def.record, [...path, key]);\n continue;\n }\n if (!isProcedure(item)) {\n // RouterRecord\n aggregate[key] = step(item, [...path, key]);\n continue;\n }\n\n const newPath = [...path, key].join('.');\n\n if (procedures[newPath]) {\n throw new Error(`Duplicate key: ${newPath}`);\n }\n\n procedures[newPath] = item;\n aggregate[key] = item;\n }\n\n return aggregate;\n }\n const record = step(input);\n\n const _def: AnyRouter['_def'] = {\n _config: config,\n router: true,\n procedures,\n lazy,\n ...emptyRouter,\n record,\n };\n\n const router: BuiltRouter<TRoot, {}> = {\n ...(record as {}),\n _def,\n createCaller: createCallerFactory<TRoot>()({\n _def,\n }),\n };\n return router as BuiltRouter<TRoot, DecorateCreateRouterOptions<TInput>>;\n }\n\n return createRouterInner;\n}\n\nfunction isProcedure(\n procedureOrRouter: ValueOf<CreateRouterOptions>,\n): procedureOrRouter is AnyProcedure {\n return typeof procedureOrRouter === 'function';\n}\n\n/**\n * @internal\n */\nexport async function getProcedureAtPath(\n router: Pick<Router<any, any>, '_def'>,\n path: string,\n): Promise<AnyProcedure | null> {\n const { _def } = router;\n let procedure = _def.procedures[path];\n\n while (!procedure) {\n const key = Object.keys(_def.lazy).find(\n (key) => path === key || path.startsWith(key + '.'),\n );\n // console.log(`found lazy: ${key ?? 'NOPE'} (fullPath: ${fullPath})`);\n\n if (!key) {\n return null;\n }\n // console.log('loading', key, '.......');\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const lazyRouter = _def.lazy[key]!;\n await lazyRouter.load();\n\n procedure = _def.procedures[path];\n }\n\n return procedure;\n}\n\n/**\n * @internal\n */\nexport async function callProcedure(\n opts: ProcedureCallOptions<unknown> & {\n router: AnyRouter;\n allowMethodOverride?: boolean;\n },\n) {\n const { type, path } = opts;\n const proc = await getProcedureAtPath(opts.router, path);\n if (\n !proc ||\n !isProcedure(proc) ||\n (proc._def.type !== type && !opts.allowMethodOverride)\n ) {\n throw new TRPCError({\n code: 'NOT_FOUND',\n message: `No \"${type}\"-procedure on path \"${path}\"`,\n });\n }\n\n /* istanbul ignore if -- @preserve */\n if (\n proc._def.type !== type &&\n opts.allowMethodOverride &&\n proc._def.type === 'subscription'\n ) {\n throw new TRPCError({\n code: 'METHOD_NOT_SUPPORTED',\n message: `Method override is not supported for subscriptions`,\n });\n }\n\n return proc(opts);\n}\n\nexport interface RouterCallerFactory<TRoot extends AnyRootTypes> {\n <TRecord extends RouterRecord>(\n router: Pick<Router<TRoot, TRecord>, '_def'>,\n ): RouterCaller<TRoot, TRecord>;\n}\n\nexport function createCallerFactory<\n TRoot extends AnyRootTypes,\n>(): RouterCallerFactory<TRoot> {\n return function createCallerInner<TRecord extends RouterRecord>(\n router: Pick<Router<TRoot, TRecord>, '_def'>,\n ): RouterCaller<TRoot, TRecord> {\n const { _def } = router;\n type Context = TRoot['ctx'];\n\n return function createCaller(ctxOrCallback, opts) {\n return createRecursiveProxy<ReturnType<RouterCaller<any, any>>>(\n async (innerOpts) => {\n const { path, args } = innerOpts;\n const fullPath = path.join('.');\n\n if (path.length === 1 && path[0] === '_def') {\n return _def;\n }\n\n const procedure = await getProcedureAtPath(router, fullPath);\n\n let ctx: Context | undefined = undefined;\n try {\n if (!procedure) {\n throw new TRPCError({\n code: 'NOT_FOUND',\n message: `No procedure found on path \"${path}\"`,\n });\n }\n ctx = isFunction(ctxOrCallback)\n ? await Promise.resolve(ctxOrCallback())\n : ctxOrCallback;\n\n return await procedure({\n path: fullPath,\n getRawInput: async () => args[0],\n ctx,\n type: procedure._def.type,\n signal: opts?.signal,\n batchIndex: 0,\n });\n } catch (cause) {\n opts?.onError?.({\n ctx,\n error: getTRPCErrorFromUnknown(cause),\n input: args[0],\n path: fullPath,\n type: procedure?._def.type ?? 'unknown',\n });\n throw cause;\n }\n },\n );\n };\n };\n}\n\n/** @internal */\nexport type MergeRouters<\n TRouters extends AnyRouter[],\n TRoot extends AnyRootTypes = TRouters[0]['_def']['_config']['$types'],\n TRecord extends RouterRecord = {},\n> = TRouters extends [\n infer Head extends AnyRouter,\n ...infer Tail extends AnyRouter[],\n]\n ? MergeRouters<Tail, TRoot, Head['_def']['record'] & TRecord>\n : BuiltRouter<TRoot, TRecord>;\n\nexport function mergeRouters<TRouters extends AnyRouter[]>(\n ...routerList: [...TRouters]\n): MergeRouters<TRouters> {\n const record = mergeWithoutOverrides(\n {},\n ...routerList.map((r) => r._def.record),\n );\n const errorFormatter = routerList.reduce(\n (currentErrorFormatter, nextRouter) => {\n if (\n nextRouter._def._config.errorFormatter &&\n nextRouter._def._config.errorFormatter !== defaultFormatter\n ) {\n if (\n currentErrorFormatter !== defaultFormatter &&\n currentErrorFormatter !== nextRouter._def._config.errorFormatter\n ) {\n throw new Error('You seem to have several error formatters');\n }\n return nextRouter._def._config.errorFormatter;\n }\n return currentErrorFormatter;\n },\n defaultFormatter,\n );\n\n const transformer = routerList.reduce((prev, current) => {\n if (\n current._def._config.transformer &&\n current._def._config.transformer !== defaultTransformer\n ) {\n if (\n prev !== defaultTransformer &&\n prev !== current._def._config.transformer\n ) {\n throw new Error('You seem to have several transformers');\n }\n return current._def._config.transformer;\n }\n return prev;\n }, defaultTransformer);\n\n const router = createRouterFactory({\n errorFormatter,\n transformer,\n isDev: routerList.every((r) => r._def._config.isDev),\n allowOutsideOfServer: routerList.every(\n (r) => r._def._config.allowOutsideOfServer,\n ),\n isServer: routerList.every((r) => r._def._config.isServer),\n $types: routerList[0]?._def._config.$types,\n sse: routerList[0]?._def._config.sse,\n })(record);\n\n return router as MergeRouters<TRouters>;\n}\n","import { observable } from './observable';\nimport type { Observable, Observer } from './types';\n\nexport interface BehaviorSubject<TValue> extends Observable<TValue, never> {\n observable: Observable<TValue, never>;\n next: (value: TValue) => void;\n get: () => TValue;\n}\n\nexport interface ReadonlyBehaviorSubject<TValue> extends Omit<\n BehaviorSubject<TValue>,\n 'next'\n> {}\n\n/**\n * @internal\n * An observable that maintains and provides a \"current value\" to subscribers\n * @see https://www.learnrxjs.io/learn-rxjs/subjects/behaviorsubject\n */\nexport function behaviorSubject<TValue>(\n initialValue: TValue,\n): BehaviorSubject<TValue> {\n let value: TValue = initialValue;\n\n const observerList: Observer<TValue, never>[] = [];\n\n const addObserver = (observer: Observer<TValue, never>) => {\n if (value !== undefined) {\n observer.next(value);\n }\n observerList.push(observer);\n };\n const removeObserver = (observer: Observer<TValue, never>) => {\n observerList.splice(observerList.indexOf(observer), 1);\n };\n\n const obs = observable<TValue, never>((observer) => {\n addObserver(observer);\n return () => {\n removeObserver(observer);\n };\n }) as BehaviorSubject<TValue>;\n\n obs.next = (nextValue: TValue) => {\n if (value === nextValue) {\n return;\n }\n value = nextValue;\n for (const observer of observerList) {\n observer.next(nextValue);\n }\n };\n\n obs.get = () => value;\n\n return obs;\n}\n","import type { AnyRouter, ProcedureType } from '@trpc/server';\nimport { observable } from '@trpc/server/observable';\nimport type { TRPCErrorShape, TRPCResponse } from '@trpc/server/rpc';\nimport type { AnyClientTypes } from '@trpc/server/unstable-core-do-not-import';\nimport { jsonlStreamConsumer } from '@trpc/server/unstable-core-do-not-import';\nimport type { BatchLoader } from '../internals/dataLoader';\nimport { dataLoader } from '../internals/dataLoader';\nimport { allAbortSignals, raceAbortSignals } from '../internals/signals';\nimport type { NonEmptyArray } from '../internals/types';\nimport { TRPCClientError } from '../TRPCClientError';\nimport type { HTTPBatchLinkOptions } from './HTTPBatchLinkOptions';\nimport type { HTTPResult } from './internals/httpUtils';\nimport {\n fetchHTTPResponse,\n getBody,\n getUrl,\n resolveHTTPLinkOptions,\n} from './internals/httpUtils';\nimport type { Operation, TRPCLink } from './types';\n\nexport type HTTPBatchStreamLinkOptions<TRoot extends AnyClientTypes> =\n HTTPBatchLinkOptions<TRoot> & {\n /**\n * Which header to use to signal the server that the client wants a streaming response.\n * - `'trpc-accept'` (default): sends `trpc-accept: application/jsonl` header\n * - `'accept'`: sends `Accept: application/jsonl` header, which can avoid CORS preflight for cross-origin streaming queries. Be aware that `application/jsonl` is not an official MIME type and so this is not completely spec-compliant - you should test that your infrastructure supports this value.\n * @default 'trpc-accept'\n */\n streamHeader?: 'trpc-accept' | 'accept';\n };\n\n/**\n * @see https://trpc.io/docs/client/links/httpBatchStreamLink\n */\nexport function httpBatchStreamLink<TRouter extends AnyRouter>(\n opts: HTTPBatchStreamLinkOptions<TRouter['_def']['_config']['$types']>,\n): TRPCLink<TRouter> {\n const resolvedOpts = resolveHTTPLinkOptions(opts);\n const maxURLLength = opts.maxURLLength ?? Infinity;\n const maxItems = opts.maxItems ?? Infinity;\n\n return () => {\n const batchLoader = (\n type: ProcedureType,\n ): BatchLoader<Operation, HTTPResult> => {\n return {\n validate(batchOps) {\n if (maxURLLength === Infinity && maxItems === Infinity) {\n // escape hatch for quick calcs\n return true;\n }\n if (batchOps.length > maxItems) {\n return false;\n }\n const path = batchOps.map((op) => op.path).join(',');\n const inputs = batchOps.map((op) => op.input);\n\n const url = getUrl({\n ...resolvedOpts,\n type,\n path,\n inputs,\n signal: null,\n });\n\n return url.length <= maxURLLength;\n },\n async fetch(batchOps) {\n const path = batchOps.map((op) => op.path).join(',');\n const inputs = batchOps.map((op) => op.input);\n\n const batchSignals = allAbortSignals(\n ...batchOps.map((op) => op.signal),\n );\n const abortController = new AbortController();\n\n const responsePromise = fetchHTTPResponse({\n ...resolvedOpts,\n signal: raceAbortSignals(batchSignals, abortController.signal),\n type,\n contentTypeHeader: 'application/json',\n trpcAcceptHeader: 'application/jsonl',\n trpcAcceptHeaderKey: opts.streamHeader ?? 'trpc-accept',\n getUrl,\n getBody,\n inputs,\n path,\n headers() {\n if (!opts.headers) {\n return {};\n }\n if (typeof opts.headers === 'function') {\n return opts.headers({\n opList: batchOps as NonEmptyArray<Operation>,\n });\n }\n return opts.headers;\n },\n });\n\n const res = await responsePromise;\n\n if (!res.ok) {\n // Server returned a non-2xx response (e.g. batching disabled).\n // The body is plain JSON, not JSONL, so parse it directly and\n // propagate the same error to every operation in the batch.\n const json = (await res.json()) as TRPCResponse;\n if ('error' in json) {\n json.error = resolvedOpts.transformer.output.deserialize(\n json.error,\n );\n }\n\n return batchOps.map((): Promise<HTTPResult> =>\n Promise.resolve({\n json,\n meta: {\n response: res,\n },\n }),\n );\n }\n\n const [head] = await jsonlStreamConsumer<\n Record<string, Promise<any>>\n >({\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n from: res.body!,\n deserialize: (data) =>\n resolvedOpts.transformer.output.deserialize(data),\n // onError: console.error,\n formatError(opts) {\n const error = opts.error as TRPCErrorShape;\n return TRPCClientError.from({\n error,\n });\n },\n abortController,\n });\n const promises = Object.keys(batchOps).map(\n async (key): Promise<HTTPResult> => {\n let json: TRPCResponse = await Promise.resolve(head[key]);\n\n if ('result' in json) {\n /**\n * Not very pretty, but we need to unwrap nested data as promises\n * Our stream producer will only resolve top-level async values or async values that are directly nested in another async value\n */\n const result = await Promise.resolve(json.result);\n json = {\n result: {\n data: await Promise.resolve(result.data),\n },\n };\n }\n\n return {\n json,\n meta: {\n response: res,\n },\n };\n },\n );\n return promises;\n },\n };\n };\n\n const query = dataLoader(batchLoader('query'));\n const mutation = dataLoader(batchLoader('mutation'));\n\n const loaders = { query, mutation };\n return ({ op }) => {\n return observable((observer) => {\n /* istanbul ignore if -- @preserve */\n if (op.type === 'subscription') {\n throw new Error(\n 'Subscriptions are unsupported by `httpBatchStreamLink` - use `httpSubscriptionLink` or `wsLink`',\n );\n }\n const ac = new AbortController();\n const loader = loaders[op.type];\n const promise = loader.load({\n ...op,\n signal: raceAbortSignals(op.signal, ac.signal),\n });\n\n let isDone = false;\n let _res = undefined as HTTPResult | undefined;\n promise\n .then((res) => {\n isDone = true;\n _res = res;\n if ('error' in res.json) {\n observer.error(\n TRPCClientError.from(res.json, {\n meta: res.meta,\n }),\n );\n return;\n } else if ('result' in res.json) {\n observer.next({\n context: res.meta,\n result: res.json.result,\n });\n observer.complete();\n return;\n }\n\n observer.complete();\n })\n .catch((err) => {\n isDone = true;\n observer.error(\n TRPCClientError.from(err, {\n meta: _res?.meta,\n }),\n );\n });\n\n return () => {\n if (!isDone) {\n ac.abort();\n }\n };\n });\n };\n };\n}\n\n/**\n * @deprecated use {@link httpBatchStreamLink} instead\n */\nexport const unstable_httpBatchStreamLink = httpBatchStreamLink;\n","import { getHTTPStatusCodeFromError } from '../http/getHTTPStatusCode';\nimport type { ProcedureType } from '../procedure';\nimport type { AnyRootTypes, RootConfig } from '../rootConfig';\nimport { TRPC_ERROR_CODES_BY_KEY } from '../rpc';\nimport type { DefaultErrorShape } from './formatter';\nimport type { TRPCError } from './TRPCError';\n\n/**\n * @internal\n */\nexport function getErrorShape<TRoot extends AnyRootTypes>(opts: {\n config: RootConfig<TRoot>;\n error: TRPCError;\n type: ProcedureType | 'unknown';\n path: string | undefined;\n input: unknown;\n ctx: TRoot['ctx'] | undefined;\n}): TRoot['errorShape'] {\n const { path, error, config } = opts;\n const { code } = opts.error;\n const shape: DefaultErrorShape = {\n message: error.message,\n code: TRPC_ERROR_CODES_BY_KEY[code],\n data: {\n code,\n httpStatus: getHTTPStatusCodeFromError(error),\n },\n };\n if (config.isDev && typeof opts.error.stack === 'string') {\n shape.data.stack = opts.error.stack;\n }\n if (typeof path === 'string') {\n shape.data.path = path;\n }\n return config.errorFormatter({ ...opts, shape });\n}\n","import { behaviorSubject } from '@trpc/server/observable';\nimport type { UrlOptionsWithConnectionParams } from '../../internals/urlWithConnectionParams';\nimport type { Encoder } from './encoder';\nimport { buildConnectionMessage, prepareUrl, withResolvers } from './utils';\n\n/**\n * Opens a WebSocket connection asynchronously and returns a promise\n * that resolves when the connection is successfully established.\n * The promise rejects if an error occurs during the connection attempt.\n */\nfunction asyncWsOpen(ws: WebSocket) {\n const { promise, resolve, reject } = withResolvers<void>();\n\n ws.addEventListener('open', () => {\n ws.removeEventListener('error', reject);\n resolve();\n });\n ws.addEventListener('error', reject);\n\n return promise;\n}\n\ninterface PingPongOptions {\n /**\n * The interval (in milliseconds) between \"PING\" messages.\n */\n intervalMs: number;\n\n /**\n * The timeout (in milliseconds) to wait for a \"PONG\" response before closing the connection.\n */\n pongTimeoutMs: number;\n}\n\n/**\n * Sets up a periodic ping-pong mechanism to keep the WebSocket connection alive.\n *\n * - Sends \"PING\" messages at regular intervals defined by `intervalMs`.\n * - If a \"PONG\" response is not received within the `pongTimeoutMs`, the WebSocket is closed.\n * - The ping timer resets upon receiving any message to maintain activity.\n * - Automatically starts the ping process when the WebSocket connection is opened.\n * - Cleans up timers when the WebSocket is closed.\n *\n * @param ws - The WebSocket instance to manage.\n * @param options - Configuration options for ping-pong intervals and timeouts.\n */\nfunction setupPingInterval(\n ws: WebSocket,\n { intervalMs, pongTimeoutMs }: PingPongOptions,\n) {\n let pingTimeout: ReturnType<typeof setTimeout> | undefined;\n let pongTimeout: ReturnType<typeof setTimeout> | undefined;\n\n function start() {\n pingTimeout = setTimeout(() => {\n ws.send('PING');\n pongTimeout = setTimeout(() => {\n ws.close();\n }, pongTimeoutMs);\n }, intervalMs);\n }\n\n function reset() {\n clearTimeout(pingTimeout);\n start();\n }\n\n function pong() {\n clearTimeout(pongTimeout);\n reset();\n }\n\n ws.addEventListener('open', start);\n ws.addEventListener('message', ({ data }) => {\n clearTimeout(pingTimeout);\n start();\n\n if (data === 'PONG') {\n pong();\n }\n });\n ws.addEventListener('close', () => {\n clearTimeout(pingTimeout);\n clearTimeout(pongTimeout);\n });\n}\n\nexport interface WebSocketConnectionOptions {\n WebSocketPonyfill?: typeof WebSocket;\n urlOptions: UrlOptionsWithConnectionParams;\n keepAlive: PingPongOptions & {\n enabled: boolean;\n };\n encoder: Encoder;\n}\n\n/**\n * Manages a WebSocket connection with support for reconnection, keep-alive mechanisms,\n * and observable state tracking.\n */\nexport class WsConnection {\n static connectCount = 0;\n public id = ++WsConnection.connectCount;\n\n private readonly WebSocketPonyfill: typeof WebSocket;\n private readonly urlOptions: UrlOptionsWithConnectionParams;\n private readonly keepAliveOpts: WebSocketConnectionOptions['keepAlive'];\n private readonly encoder: Encoder;\n public readonly wsObservable = behaviorSubject<WebSocket | null>(null);\n\n constructor(opts: WebSocketConnectionOptions) {\n this.WebSocketPonyfill = opts.WebSocketPonyfill ?? WebSocket;\n if (!this.WebSocketPonyfill) {\n throw new Error(\n \"No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill\",\n );\n }\n\n this.urlOptions = opts.urlOptions;\n this.keepAliveOpts = opts.keepAlive;\n this.encoder = opts.encoder;\n }\n\n public get ws() {\n return this.wsObservable.get();\n }\n\n private set ws(ws) {\n this.wsObservable.next(ws);\n }\n\n /**\n * Checks if the WebSocket connection is open and ready to communicate.\n */\n public isOpen(): this is { ws: WebSocket } {\n return (\n !!this.ws &&\n this.ws.readyState === this.WebSocketPonyfill.OPEN &&\n !this.openPromise\n );\n }\n\n /**\n * Checks if the WebSocket connection is closed or in the process of closing.\n */\n public isClosed(): this is { ws: WebSocket } {\n return (\n !!this.ws &&\n (this.ws.readyState === this.WebSocketPonyfill.CLOSING ||\n this.ws.readyState === this.WebSocketPonyfill.CLOSED)\n );\n }\n\n /**\n * Manages the WebSocket opening process, ensuring that only one open operation\n * occurs at a time. Tracks the ongoing operation with `openPromise` to avoid\n * redundant calls and ensure proper synchronization.\n *\n * Sets up the keep-alive mechanism and necessary event listeners for the connection.\n *\n * @returns A promise that resolves once the WebSocket connection is successfully opened.\n */\n private openPromise: Promise<void> | null = null;\n public async open() {\n if (this.openPromise) return this.openPromise;\n\n this.id = ++WsConnection.connectCount;\n const wsPromise = prepareUrl(this.urlOptions).then(\n (url) => new this.WebSocketPonyfill(url),\n );\n this.openPromise = wsPromise.then(async (ws) => {\n this.ws = ws;\n\n // Set binaryType to handle both text and binary messages consistently\n ws.binaryType = 'arraybuffer';\n\n // Setup ping listener\n ws.addEventListener('message', function ({ data }) {\n if (data === 'PING') {\n this.send('PONG');\n }\n });\n\n if (this.keepAliveOpts.enabled) {\n setupPingInterval(ws, this.keepAliveOpts);\n }\n\n ws.addEventListener('close', () => {\n if (this.ws === ws) {\n this.ws = null;\n }\n });\n\n await asyncWsOpen(ws);\n\n if (this.urlOptions.connectionParams) {\n ws.send(\n await buildConnectionMessage(\n this.urlOptions.connectionParams,\n this.encoder,\n ),\n );\n }\n });\n\n try {\n await this.openPromise;\n } finally {\n this.openPromise = null;\n }\n }\n\n /**\n * Closes the WebSocket connection gracefully.\n * Waits for any ongoing open operation to complete before closing.\n */\n public async close() {\n try {\n await this.openPromise;\n } finally {\n this.ws?.close();\n }\n }\n}\n\n/**\n * Provides a backward-compatible representation of the connection state.\n */\nexport function backwardCompatibility(connection: WsConnection) {\n if (connection.isOpen()) {\n return {\n id: connection.id,\n state: 'open',\n ws: connection.ws,\n } as const;\n }\n\n if (connection.isClosed()) {\n return {\n id: connection.id,\n state: 'closed',\n ws: connection.ws,\n } as const;\n }\n\n if (!connection.ws) {\n return null;\n }\n\n return {\n id: connection.id,\n state: 'connecting',\n ws: connection.ws,\n } as const;\n}\n","import { isObject } from '../utils';\n\nexport function isAbortError(\n error: unknown,\n): error is DOMException | Error | { name: 'AbortError' } {\n return isObject(error) && error['name'] === 'AbortError';\n}\n\nexport function throwAbortError(message = 'AbortError'): never {\n throw new DOMException(message, 'AbortError');\n}\n","/*!\n * is-plain-object <https://github.com/jonschlinkert/is-plain-object>\n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\n\nfunction isObject(o: unknown): o is Record<string, unknown> {\n return Object.prototype.toString.call(o) === '[object Object]';\n}\n \nexport function isPlainObject(o: unknown): o is Record<string, unknown> {\n var ctor,prot;\n\n if (isObject(o) === false) return false;\n\n // If has modified constructor\n ctor = o.constructor;\n if (ctor === undefined) return true;\n\n // If has modified prototype\n prot = ctor.prototype;\n if (isObject(prot) === false) return false;\n\n // If constructor does not have an Object-specific method\n if (prot.hasOwnProperty('isPrototypeOf') === false) {\n return false;\n }\n\n // Most likely a plain Object\n return true;\n};\n","export function inputWithTrackedEventId(\n input: unknown,\n lastEventId: string | undefined,\n) {\n if (!lastEventId) {\n return input;\n }\n if (input != null && typeof input !== 'object') {\n return input;\n }\n return {\n ...(input ?? {}),\n lastEventId,\n };\n}\n","/* eslint-disable @typescript-eslint/unbound-method */\n \n \n\nimport type {\n PromiseExecutor,\n PromiseWithResolvers,\n ProxyPromise,\n SubscribedPromise,\n} from \"./types\";\n\n/** Memory safe (weakmapped) cache of the ProxyPromise for each Promise,\n * which is retained for the lifetime of the original Promise.\n */\nconst subscribableCache = new WeakMap<\n PromiseLike<unknown>,\n ProxyPromise<unknown>\n>();\n\n/** A NOOP function allowing a consistent interface for settled\n * SubscribedPromises (settled promises are not subscribed - they resolve\n * immediately). */\nconst NOOP = () => {\n // noop\n};\n\n/**\n * Every `Promise<T>` can be shadowed by a single `ProxyPromise<T>`. It is\n * created once, cached and reused throughout the lifetime of the Promise. Get a\n * Promise's ProxyPromise using `Unpromise.proxy(promise)`.\n *\n * The `ProxyPromise<T>` attaches handlers to the original `Promise<T>`\n * `.then()` and `.catch()` just once. Promises derived from it use a\n * subscription- (and unsubscription-) based mechanism that monitors these\n * handlers.\n *\n * Every time you call `.subscribe()`, `.then()` `.catch()` or `.finally()` on a\n * `ProxyPromise<T>` it returns a `SubscribedPromise<T>` having an additional\n * `unsubscribe()` method. Calling `unsubscribe()` detaches reference chains\n * from the original, potentially long-lived Promise, eliminating memory leaks.\n *\n * This approach can eliminate the memory leaks that otherwise come about from\n * repeated `race()` or `any()` calls invoking `.then()` and `.catch()` multiple\n * times on the same long-lived native Promise (subscriptions which can never be\n * cleaned up).\n *\n * `Unpromise.race(promises)` is a reference implementation of `Promise.race`\n * avoiding memory leaks when using long-lived unsettled Promises.\n *\n * `Unpromise.any(promises)` is a reference implementation of `Promise.any`\n * avoiding memory leaks when using long-lived unsettled Promises.\n *\n * `Unpromise.resolve(promise)` returns an ephemeral `SubscribedPromise<T>` for\n * any given `Promise<T>` facilitating arbitrary async/await patterns. Behind\n * the scenes, `resolve` is implemented simply as\n * `Unpromise.proxy(promise).subscribe()`. Don't forget to call `.unsubscribe()`\n * to tidy up!\n *\n */\nexport class Unpromise<T> implements ProxyPromise<T> {\n /** INSTANCE IMPLEMENTATION */\n\n /** The promise shadowed by this Unpromise<T> */\n protected readonly promise: Promise<T> | PromiseLike<T>;\n\n /** Promises expecting eventual settlement (unless unsubscribed first). This list is deleted\n * after the original promise settles - no further notifications will be issued. */\n protected subscribers: ReadonlyArray<PromiseWithResolvers<T>> | null = [];\n\n /** The Promise's settlement (recorded when it fulfils or rejects). This is consulted when\n * calling .subscribe() .then() .catch() .finally() to see if an immediately-resolving Promise\n * can be returned, and therefore subscription can be bypassed. */\n protected settlement: PromiseSettledResult<T> | null = null;\n\n /** Constructor accepts a normal Promise executor function like `new\n * Unpromise((resolve, reject) => {...})` or accepts a pre-existing Promise\n * like `new Unpromise(existingPromise)`. Adds `.then()` and `.catch()`\n * handlers to the Promise. These handlers pass fulfilment and rejection\n * notifications to downstream subscribers and maintains records of value\n * or error if the Promise ever settles. */\n protected constructor(promise: Promise<T>);\n protected constructor(promise: PromiseLike<T>);\n protected constructor(executor: PromiseExecutor<T>);\n protected constructor(arg: Promise<T> | PromiseLike<T> | PromiseExecutor<T>) {\n // handle either a Promise or a Promise executor function\n if (typeof arg === \"function\") {\n this.promise = new Promise(arg);\n } else {\n this.promise = arg;\n }\n\n // subscribe for eventual fulfilment and rejection\n\n // handle PromiseLike objects (that at least have .then)\n const thenReturn = this.promise.then((value) => {\n // atomically record fulfilment and detach subscriber list\n const { subscribers } = this;\n this.subscribers = null;\n this.settlement = {\n status: \"fulfilled\",\n value,\n };\n // notify fulfilment to subscriber list\n subscribers?.forEach(({ resolve }) => {\n resolve(value);\n });\n });\n\n // handle Promise (that also have a .catch behaviour)\n if (\"catch\" in thenReturn) {\n thenReturn.catch((reason) => {\n // atomically record rejection and detach subscriber list\n const { subscribers } = this;\n this.subscribers = null;\n this.settlement = {\n status: \"rejected\",\n reason,\n };\n // notify rejection to subscriber list\n subscribers?.forEach(({ reject }) => {\n reject(reason);\n });\n });\n }\n }\n\n /** Create a promise that mitigates uncontrolled subscription to a long-lived\n * Promise via .then() and .catch() - otherwise a source of memory leaks.\n *\n * The returned promise has an `unsubscribe()` method which can be called when\n * the Promise is no longer being tracked by application logic, and which\n * ensures that there is no reference chain from the original promise to the\n * new one, and therefore no memory leak.\n *\n * If original promise has not yet settled, this adds a new unique promise\n * that listens to then/catch events, along with an `unsubscribe()` method to\n * detach it.\n *\n * If original promise has settled, then creates a new Promise.resolve() or\n * Promise.reject() and provided unsubscribe is a noop.\n *\n * If you call `unsubscribe()` before the returned Promise has settled, it\n * will never settle.\n */\n subscribe(): SubscribedPromise<T> {\n // in all cases we will combine some promise with its unsubscribe function\n let promise: Promise<T>;\n let unsubscribe: () => void;\n\n const { settlement } = this;\n if (settlement === null) {\n // not yet settled - subscribe new promise. Expect eventual settlement\n if (this.subscribers === null) {\n // invariant - it is not settled, so it must have subscribers\n throw new Error(\"Unpromise settled but still has subscribers\");\n }\n const subscriber = withResolvers<T>();\n this.subscribers = listWithMember(this.subscribers, subscriber);\n promise = subscriber.promise;\n unsubscribe = () => {\n if (this.subscribers !== null) {\n this.subscribers = listWithoutMember(this.subscribers, subscriber);\n }\n };\n } else {\n // settled - don't create subscribed promise. Just resolve or reject\n const { status } = settlement;\n if (status === \"fulfilled\") {\n promise = Promise.resolve(settlement.value);\n } else {\n promise = Promise.reject(settlement.reason);\n }\n unsubscribe = NOOP;\n }\n\n // extend promise signature with the extra method\n return Object.assign(promise, { unsubscribe });\n }\n\n /** STANDARD PROMISE METHODS (but returning a SubscribedPromise) */\n\n then<TResult1 = T, TResult2 = never>(\n onfulfilled?:\n | ((value: T) => TResult1 | PromiseLike<TResult1>)\n | null\n ,\n onrejected?:\n | ((reason: any) => TResult2 | PromiseLike<TResult2>)\n | null\n \n ): SubscribedPromise<TResult1 | TResult2> {\n const subscribed = this.subscribe();\n const { unsubscribe } = subscribed;\n return Object.assign(subscribed.then(onfulfilled, onrejected), {\n unsubscribe,\n });\n }\n\n catch<TResult = never>(\n onrejected?:\n | ((reason: any) => TResult | PromiseLike<TResult>)\n | null\n \n ): SubscribedPromise<T | TResult> {\n const subscribed = this.subscribe();\n const { unsubscribe } = subscribed;\n return Object.assign(subscribed.catch(onrejected), {\n unsubscribe,\n });\n }\n\n finally(onfinally?: (() => void) | null ): SubscribedPromise<T> {\n const subscribed = this.subscribe();\n const { unsubscribe } = subscribed;\n return Object.assign(subscribed.finally(onfinally), {\n unsubscribe,\n });\n }\n\n /** TOSTRING SUPPORT */\n\n readonly [Symbol.toStringTag] = \"Unpromise\";\n\n /** Unpromise STATIC METHODS */\n\n /** Create or Retrieve the proxy Unpromise (a re-used Unpromise for the VM lifetime\n * of the provided Promise reference) */\n static proxy<T>(promise: PromiseLike<T>): ProxyPromise<T> {\n const cached = Unpromise.getSubscribablePromise(promise);\n return typeof cached !== \"undefined\"\n ? cached\n : Unpromise.createSubscribablePromise(promise);\n }\n\n /** Create and store an Unpromise keyed by an original Promise. */\n protected static createSubscribablePromise<T>(promise: PromiseLike<T>) {\n const created = new Unpromise<T>(promise);\n subscribableCache.set(promise, created as Unpromise<unknown>); // resolve promise to unpromise\n subscribableCache.set(created, created as Unpromise<unknown>); // resolve the unpromise to itself\n return created;\n }\n\n /** Retrieve a previously-created Unpromise keyed by an original Promise. */\n protected static getSubscribablePromise<T>(promise: PromiseLike<T>) {\n return subscribableCache.get(promise) as ProxyPromise<T> | undefined;\n }\n\n /** Promise STATIC METHODS */\n\n /** Lookup the Unpromise for this promise, and derive a SubscribedPromise from\n * it (that can be later unsubscribed to eliminate Memory leaks) */\n static resolve<T>(value: T | PromiseLike<T>) {\n const promise: PromiseLike<T> =\n typeof value === \"object\" &&\n value !== null &&\n \"then\" in value &&\n typeof value.then === \"function\"\n ? value\n : Promise.resolve(value);\n return Unpromise.proxy(promise).subscribe() as SubscribedPromise<\n Awaited<T>\n >;\n }\n\n /** Perform Promise.any() via SubscribedPromises, then unsubscribe them.\n * Equivalent to Promise.any but eliminates memory leaks from long-lived\n * promises accumulating .then() and .catch() subscribers. */\n static async any<T extends readonly unknown[] | []>(\n values: T\n ): Promise<Awaited<T[number]>>;\n static async any<T>(\n values: Iterable<T | PromiseLike<T>>\n ): Promise<Awaited<T>> {\n const valuesArray = Array.isArray(values) ? values : [...values];\n const subscribedPromises = valuesArray.map(Unpromise.resolve);\n try {\n return await Promise.any(subscribedPromises);\n } finally {\n subscribedPromises.forEach(({ unsubscribe }) => {\n unsubscribe();\n });\n }\n }\n\n /** Perform Promise.race via SubscribedPromises, then unsubscribe them.\n * Equivalent to Promise.race but eliminates memory leaks from long-lived\n * promises accumulating .then() and .catch() subscribers. */\n static async race<T extends readonly unknown[] | []>(\n values: T\n ): Promise<Awaited<T[number]>>;\n static async race<T>(\n values: Iterable<T | PromiseLike<T>>\n ): Promise<Awaited<T>> {\n const valuesArray = Array.isArray(values) ? values : [...values];\n const subscribedPromises = valuesArray.map(Unpromise.resolve);\n try {\n return await Promise.race(subscribedPromises);\n } finally {\n subscribedPromises.forEach(({ unsubscribe }) => {\n unsubscribe();\n });\n }\n }\n\n /** Create a race of SubscribedPromises that will fulfil to a single winning\n * Promise (in a 1-Tuple). Eliminates memory leaks from long-lived promises\n * accumulating .then() and .catch() subscribers. Allows simple logic to\n * consume the result, like...\n * ```ts\n * const [ winner ] = await Unpromise.race([ promiseA, promiseB ]);\n * if(winner === promiseB){\n * const result = await promiseB;\n * // do the thing\n * }\n * ```\n * */\n static async raceReferences<TPromise extends Promise<unknown>>(\n promises: readonly TPromise[]\n ) {\n // map each promise to an eventual 1-tuple containing itself\n const selfPromises = promises.map(resolveSelfTuple);\n\n // now race them. They will fulfil to a readonly [P] or reject.\n try {\n return await Promise.race(selfPromises);\n } finally {\n for (const promise of selfPromises) {\n // unsubscribe proxy promises when the race is over to mitigate memory leaks\n promise.unsubscribe();\n }\n }\n }\n}\n\n/** Promises a 1-tuple containing the original promise when it resolves. Allows\n * awaiting the eventual Promise ***reference*** (easy to destructure and\n * exactly compare with ===). Avoids resolving to the Promise ***value*** (which\n * may be ambiguous and therefore hard to identify as the winner of a race).\n * You can call unsubscribe on the Promise to mitigate memory leaks.\n * */\nexport function resolveSelfTuple<TPromise extends Promise<unknown>>(\n promise: TPromise\n): SubscribedPromise<readonly [TPromise]> {\n return Unpromise.proxy(promise).then(() => [promise] as const);\n}\n\n/** VENDORED (Future) PROMISE UTILITIES */\n\n/** Reference implementation of https://github.com/tc39/proposal-promise-with-resolvers */\nfunction withResolvers<T>(): PromiseWithResolvers<T> {\n let resolve!: PromiseWithResolvers<T>[\"resolve\"];\n let reject!: PromiseWithResolvers<T>[\"reject\"];\n const promise = new Promise<T>((_resolve, _reject) => {\n resolve = _resolve;\n reject = _reject;\n });\n return {\n promise,\n resolve,\n reject,\n };\n}\n\n/** IMMUTABLE LIST OPERATIONS */\n\nfunction listWithMember<T>(arr: readonly T[], member: T): readonly T[] {\n return [...arr, member];\n}\n\nfunction listWithoutIndex<T>(arr: readonly T[], index: number) {\n return [...arr.slice(0, index), ...arr.slice(index + 1)];\n}\n\nfunction listWithoutMember<T>(arr: readonly T[], member: unknown) {\n const index = arr.indexOf(member as T);\n if (index !== -1) {\n return listWithoutIndex(arr, index);\n }\n return arr;\n}\n","import { behaviorSubject, observable } from '@trpc/server/observable';\nimport type { TRPCErrorShape, TRPCResult } from '@trpc/server/rpc';\nimport type {\n AnyClientTypes,\n EventSourceLike,\n inferClientTypes,\n InferrableClientTypes,\n} from '@trpc/server/unstable-core-do-not-import';\nimport {\n retryableRpcCodes,\n run,\n sseStreamConsumer,\n} from '@trpc/server/unstable-core-do-not-import';\nimport { inputWithTrackedEventId } from '../internals/inputWithTrackedEventId';\nimport { raceAbortSignals } from '../internals/signals';\nimport { TRPCClientError } from '../TRPCClientError';\nimport type { TRPCConnectionState } from '../unstable-internals';\nimport { getTransformer, type TransformerOptions } from '../unstable-internals';\nimport { getUrl } from './internals/httpUtils';\nimport {\n resultOf,\n type UrlOptionsWithConnectionParams,\n} from './internals/urlWithConnectionParams';\nimport type { Operation, TRPCLink } from './types';\n\nasync function urlWithConnectionParams(\n opts: UrlOptionsWithConnectionParams,\n): Promise<string> {\n let url = await resultOf(opts.url);\n if (opts.connectionParams) {\n const params = await resultOf(opts.connectionParams);\n\n const prefix = url.includes('?') ? '&' : '?';\n url +=\n prefix + 'connectionParams=' + encodeURIComponent(JSON.stringify(params));\n }\n\n return url;\n}\n\ntype HTTPSubscriptionLinkOptions<\n TRoot extends AnyClientTypes,\n TEventSource extends EventSourceLike.AnyConstructor = typeof EventSource,\n> = {\n /**\n * EventSource ponyfill\n */\n EventSource?: TEventSource;\n /**\n * EventSource options or a callback that returns them\n */\n eventSourceOptions?:\n | EventSourceLike.InitDictOf<TEventSource>\n | ((opts: {\n op: Operation;\n }) =>\n | EventSourceLike.InitDictOf<TEventSource>\n | Promise<EventSourceLike.InitDictOf<TEventSource>>);\n} & TransformerOptions<TRoot> &\n UrlOptionsWithConnectionParams;\n\n/**\n * @see https://trpc.io/docs/client/links/httpSubscriptionLink\n */\nexport function httpSubscriptionLink<\n TInferrable extends InferrableClientTypes,\n TEventSource extends EventSourceLike.AnyConstructor,\n>(\n opts: HTTPSubscriptionLinkOptions<\n inferClientTypes<TInferrable>,\n TEventSource\n >,\n): TRPCLink<TInferrable> {\n const transformer = getTransformer(opts.transformer);\n\n return () => {\n return ({ op }) => {\n return observable((observer) => {\n const { type, path, input } = op;\n\n /* istanbul ignore if -- @preserve */\n if (type !== 'subscription') {\n throw new Error('httpSubscriptionLink only supports subscriptions');\n }\n\n let lastEventId: string | undefined = undefined;\n const ac = new AbortController();\n const signal = raceAbortSignals(op.signal, ac.signal);\n const eventSourceStream = sseStreamConsumer<{\n EventSource: TEventSource;\n data: Partial<{\n id?: string;\n data: unknown;\n }>;\n error: TRPCErrorShape;\n }>({\n url: async () =>\n getUrl({\n transformer,\n url: await urlWithConnectionParams(opts),\n input: inputWithTrackedEventId(input, lastEventId),\n path,\n type,\n signal: null,\n }),\n init: () => resultOf(opts.eventSourceOptions, { op }),\n signal,\n deserialize: (data) => transformer.output.deserialize(data),\n EventSource: opts.EventSource ?? (globalThis.EventSource as never),\n });\n\n const connectionState = behaviorSubject<\n TRPCConnectionState<TRPCClientError<any>>\n >({\n type: 'state',\n state: 'connecting',\n error: null,\n });\n\n const connectionSub = connectionState.subscribe({\n next(state) {\n observer.next({\n result: state,\n });\n },\n });\n run(async () => {\n for await (const chunk of eventSourceStream) {\n switch (chunk.type) {\n case 'ping':\n // do nothing\n break;\n case 'data':\n const chunkData = chunk.data;\n\n let result: TRPCResult<unknown>;\n if (chunkData.id) {\n // if the `tracked()`-helper is used, we always have an `id` field\n lastEventId = chunkData.id;\n result = {\n id: chunkData.id,\n data: chunkData,\n };\n } else {\n result = {\n data: chunkData.data,\n };\n }\n\n observer.next({\n result,\n context: {\n eventSource: chunk.eventSource,\n },\n });\n break;\n case 'connected': {\n observer.next({\n result: {\n type: 'started',\n },\n context: {\n eventSource: chunk.eventSource,\n },\n });\n connectionState.next({\n type: 'state',\n state: 'pending',\n error: null,\n });\n break;\n }\n case 'serialized-error': {\n const error = TRPCClientError.from({ error: chunk.error });\n\n if (retryableRpcCodes.includes(chunk.error.code)) {\n //\n connectionState.next({\n type: 'state',\n state: 'connecting',\n error,\n });\n break;\n }\n //\n // non-retryable error, cancel the subscription\n throw error;\n }\n case 'connecting': {\n const lastState = connectionState.get();\n\n const error = chunk.event && TRPCClientError.from(chunk.event);\n if (!error && lastState.state === 'connecting') {\n break;\n }\n\n connectionState.next({\n type: 'state',\n state: 'connecting',\n error,\n });\n break;\n }\n case 'timeout': {\n connectionState.next({\n type: 'state',\n state: 'connecting',\n error: new TRPCClientError(\n `Timeout of ${chunk.ms}ms reached while waiting for a response`,\n ),\n });\n }\n }\n }\n observer.next({\n result: {\n type: 'stopped',\n },\n });\n connectionState.next({\n type: 'state',\n state: 'idle',\n error: null,\n });\n observer.complete();\n }).catch((error) => {\n observer.error(TRPCClientError.from(error));\n });\n\n return () => {\n observer.complete();\n ac.abort();\n connectionSub.unsubscribe();\n };\n });\n };\n };\n}\n\n/**\n * @deprecated use {@link httpSubscriptionLink} instead\n */\nexport const unstable_httpSubscriptionLink = httpSubscriptionLink;\n","const trackedSymbol = Symbol();\n\ntype TrackedId = string & {\n __brand: 'TrackedId';\n};\nexport type TrackedEnvelope<TData> = [TrackedId, TData, typeof trackedSymbol];\n\nexport interface TrackedData<TData> {\n /**\n * The id of the message to keep track of in case the connection gets lost\n */\n id: string;\n /**\n * The data field of the message\n */\n data: TData;\n}\n/**\n * Produce a typed server-sent event message\n * @deprecated use `tracked(id, data)` instead\n */\nexport function sse<TData>(event: { id: string; data: TData }) {\n return tracked(event.id, event.data);\n}\n\nexport function isTrackedEnvelope<TData>(\n value: unknown,\n): value is TrackedEnvelope<TData> {\n return Array.isArray(value) && value[2] === trackedSymbol;\n}\n\n/**\n * Automatically track an event so that it can be resumed from a given id if the connection is lost\n */\nexport function tracked<TData>(\n id: string,\n data: TData,\n): TrackedEnvelope<TData> {\n if (id === '') {\n // This limitation could be removed by using different SSE event names / channels for tracked event and non-tracked event\n throw new Error(\n '`id` must not be an empty string as empty string is the same as not setting the id at all',\n );\n }\n return [id as TrackedId, data, trackedSymbol];\n}\n\nexport type inferTrackedOutput<TData> =\n TData extends TrackedEnvelope<infer $Data> ? TrackedData<$Data> : TData;\n","import type { AnyTRPCRouter } from '@trpc/server';\nimport type { BehaviorSubject } from '@trpc/server/observable';\nimport { behaviorSubject, observable } from '@trpc/server/observable';\nimport type {\n CombinedDataTransformer,\n TRPCClientIncomingMessage,\n TRPCClientIncomingRequest,\n TRPCClientOutgoingMessage,\n TRPCResponseMessage,\n} from '@trpc/server/unstable-core-do-not-import';\nimport {\n run,\n sleep,\n transformResult,\n} from '@trpc/server/unstable-core-do-not-import';\nimport { TRPCClientError } from '../../../TRPCClientError';\nimport type { TRPCConnectionState } from '../../internals/subscriptions';\nimport type { Operation, OperationResultEnvelope } from '../../types';\nimport type { Encoder } from './encoder';\nimport { jsonEncoder } from './encoder';\nimport type { WebSocketClientOptions } from './options';\nimport { exponentialBackoff, keepAliveDefaults, lazyDefaults } from './options';\nimport type { TCallbacks } from './requestManager';\nimport { RequestManager } from './requestManager';\nimport { ResettableTimeout, TRPCWebSocketClosedError } from './utils';\nimport { backwardCompatibility, WsConnection } from './wsConnection';\n\n/**\n * A WebSocket client for managing TRPC operations, supporting lazy initialization,\n * reconnection, keep-alive, and request management.\n */\nexport class WsClient {\n /**\n * Observable tracking the current connection state, including errors.\n */\n public readonly connectionState: BehaviorSubject<\n TRPCConnectionState<TRPCClientError<AnyTRPCRouter>>\n >;\n\n private allowReconnect = false;\n private requestManager = new RequestManager();\n private readonly activeConnection: WsConnection;\n private readonly reconnectRetryDelay: (attemptIndex: number) => number;\n private inactivityTimeout: ResettableTimeout;\n private readonly callbacks: Pick<\n WebSocketClientOptions,\n 'onOpen' | 'onClose' | 'onError'\n >;\n private readonly lazyMode: boolean;\n private readonly encoder: Encoder;\n\n constructor(opts: WebSocketClientOptions) {\n this.encoder = opts.experimental_encoder ?? jsonEncoder;\n // Initialize callbacks, connection parameters, and options.\n this.callbacks = {\n onOpen: opts.onOpen,\n onClose: opts.onClose,\n onError: opts.onError,\n };\n\n const lazyOptions = {\n ...lazyDefaults,\n ...opts.lazy,\n };\n\n // Set up inactivity timeout for lazy connections.\n this.inactivityTimeout = new ResettableTimeout(() => {\n if (\n this.requestManager.hasOutgoingRequests() ||\n this.requestManager.hasPendingRequests()\n ) {\n this.inactivityTimeout.reset();\n return;\n }\n\n this.close().catch(() => null);\n }, lazyOptions.closeMs);\n\n // Initialize the WebSocket connection.\n this.activeConnection = new WsConnection({\n WebSocketPonyfill: opts.WebSocket,\n urlOptions: opts,\n keepAlive: {\n ...keepAliveDefaults,\n ...opts.keepAlive,\n },\n encoder: this.encoder,\n });\n this.activeConnection.wsObservable.subscribe({\n next: (ws) => {\n if (!ws) return;\n this.setupWebSocketListeners(ws);\n },\n });\n this.reconnectRetryDelay = opts.retryDelayMs ?? exponentialBackoff;\n\n this.lazyMode = lazyOptions.enabled;\n\n this.connectionState = behaviorSubject<\n TRPCConnectionState<TRPCClientError<AnyTRPCRouter>>\n >({\n type: 'state',\n state: lazyOptions.enabled ? 'idle' : 'connecting',\n error: null,\n });\n\n // Automatically open the connection if lazy mode is disabled.\n if (!this.lazyMode) {\n this.open().catch(() => null);\n }\n }\n\n /**\n * Opens the WebSocket connection. Handles reconnection attempts and updates\n * the connection state accordingly.\n */\n private async open() {\n this.allowReconnect = true;\n if (this.connectionState.get().state === 'idle') {\n this.connectionState.next({\n type: 'state',\n state: 'connecting',\n error: null,\n });\n }\n\n try {\n await this.activeConnection.open();\n } catch (error) {\n this.reconnect(\n new TRPCWebSocketClosedError({\n message: 'Initialization error',\n cause: error,\n }),\n );\n return this.reconnecting;\n }\n }\n\n /**\n * Closes the WebSocket connection and stops managing requests.\n * Ensures all outgoing and pending requests are properly finalized.\n */\n public async close() {\n this.allowReconnect = false;\n this.inactivityTimeout.stop();\n\n const requestsToAwait: Promise<void>[] = [];\n for (const request of this.requestManager.getRequests()) {\n if (request.message.method === 'subscription') {\n request.callbacks.complete();\n } else if (request.state === 'outgoing') {\n request.callbacks.error(\n TRPCClientError.from(\n new TRPCWebSocketClosedError({\n message: 'Closed before connection was established',\n }),\n ),\n );\n } else {\n requestsToAwait.push(request.end);\n }\n }\n\n await Promise.all(requestsToAwait).catch(() => null);\n await this.activeConnection.close().catch(() => null);\n\n this.connectionState.next({\n type: 'state',\n state: 'idle',\n error: null,\n });\n }\n\n /**\n * Method to request the server.\n * Handles data transformation, batching of requests, and subscription lifecycle.\n *\n * @param op - The operation details including id, type, path, input and signal\n * @param transformer - Data transformer for serializing requests and deserializing responses\n * @param lastEventId - Optional ID of the last received event for subscriptions\n *\n * @returns An observable that emits operation results and handles cleanup\n */\n public request({\n op: { id, type, path, input, signal },\n transformer,\n lastEventId,\n }: {\n op: Pick<Operation, 'id' | 'type' | 'path' | 'input' | 'signal'>;\n transformer: CombinedDataTransformer;\n lastEventId?: string;\n }) {\n return observable<\n OperationResultEnvelope<unknown, TRPCClientError<AnyTRPCRouter>>,\n TRPCClientError<AnyTRPCRouter>\n >((observer) => {\n const abort = this.batchSend(\n {\n id,\n method: type,\n params: {\n input: transformer.input.serialize(input),\n path,\n lastEventId,\n },\n },\n {\n ...observer,\n next(event) {\n const transformed = transformResult(event, transformer.output);\n\n if (!transformed.ok) {\n observer.error(TRPCClientError.from(transformed.error));\n return;\n }\n\n observer.next({\n result: transformed.result,\n });\n },\n },\n );\n\n const onAbort = () => observer.complete();\n if (signal?.aborted) {\n onAbort();\n } else {\n signal?.addEventListener('abort', onAbort, { once: true });\n }\n\n return () => {\n abort();\n\n if (type === 'subscription' && this.activeConnection.isOpen()) {\n this.send({\n id,\n method: 'subscription.stop',\n });\n }\n\n signal?.removeEventListener('abort', onAbort);\n };\n });\n }\n\n public get connection() {\n return backwardCompatibility(this.activeConnection);\n }\n\n /**\n * Manages the reconnection process for the WebSocket using retry logic.\n * Ensures that only one reconnection attempt is active at a time by tracking the current\n * reconnection state in the `reconnecting` promise.\n */\n private reconnecting: Promise<void> | null = null;\n private reconnect(closedError: TRPCWebSocketClosedError) {\n this.connectionState.next({\n type: 'state',\n state: 'connecting',\n error: TRPCClientError.from(closedError),\n });\n if (this.reconnecting) return;\n\n const tryReconnect = async (attemptIndex: number) => {\n try {\n await sleep(this.reconnectRetryDelay(attemptIndex));\n if (this.allowReconnect) {\n await this.activeConnection.close();\n await this.activeConnection.open();\n\n if (this.requestManager.hasPendingRequests()) {\n this.send(\n this.requestManager\n .getPendingRequests()\n .map(({ message }) => message),\n );\n }\n }\n this.reconnecting = null;\n } catch {\n await tryReconnect(attemptIndex + 1);\n }\n };\n\n this.reconnecting = tryReconnect(0);\n }\n\n private setupWebSocketListeners(ws: WebSocket) {\n const handleCloseOrError = (cause: unknown) => {\n const reqs = this.requestManager.getPendingRequests();\n for (const { message, callbacks } of reqs) {\n if (message.method === 'subscription') continue;\n\n callbacks.error(\n TRPCClientError.from(\n cause ??\n new TRPCWebSocketClosedError({\n message: 'WebSocket closed',\n cause,\n }),\n ),\n );\n this.requestManager.delete(message.id);\n }\n };\n\n ws.addEventListener('open', () => {\n run(async () => {\n if (this.lazyMode) {\n this.inactivityTimeout.start();\n }\n\n this.callbacks.onOpen?.();\n\n this.connectionState.next({\n type: 'state',\n state: 'pending',\n error: null,\n });\n }).catch((error) => {\n ws.close(3000);\n handleCloseOrError(error);\n });\n });\n\n ws.addEventListener('message', ({ data }) => {\n this.inactivityTimeout.reset();\n\n // Handle PING/PONG as text regardless of encoder\n if (['PING', 'PONG'].includes(data)) return;\n\n const incomingMessage = this.encoder.decode(\n data,\n ) as TRPCClientIncomingMessage;\n if ('method' in incomingMessage) {\n this.handleIncomingRequest(incomingMessage);\n return;\n }\n\n this.handleResponseMessage(incomingMessage);\n });\n\n ws.addEventListener('close', (event) => {\n handleCloseOrError(event);\n this.callbacks.onClose?.(event);\n\n if (!this.lazyMode || this.requestManager.hasPendingSubscriptions()) {\n this.reconnect(\n new TRPCWebSocketClosedError({\n message: 'WebSocket closed',\n cause: event,\n }),\n );\n }\n });\n\n ws.addEventListener('error', (event) => {\n handleCloseOrError(event);\n this.callbacks.onError?.(event);\n\n this.reconnect(\n new TRPCWebSocketClosedError({\n message: 'WebSocket closed',\n cause: event,\n }),\n );\n });\n }\n\n private handleResponseMessage(message: TRPCResponseMessage) {\n const request = this.requestManager.getPendingRequest(message.id);\n if (!request) return;\n\n request.callbacks.next(message);\n\n let completed = true;\n if ('result' in message && request.message.method === 'subscription') {\n if (message.result.type === 'data') {\n request.message.params.lastEventId = message.result.id;\n }\n\n if (message.result.type !== 'stopped') {\n completed = false;\n }\n }\n\n if (completed) {\n request.callbacks.complete();\n this.requestManager.delete(message.id);\n }\n }\n\n private handleIncomingRequest(message: TRPCClientIncomingRequest) {\n if (message.method === 'reconnect') {\n this.reconnect(\n new TRPCWebSocketClosedError({\n message: 'Server requested reconnect',\n }),\n );\n }\n }\n\n /**\n * Sends a message or batch of messages directly to the server.\n */\n private send(\n messageOrMessages: TRPCClientOutgoingMessage | TRPCClientOutgoingMessage[],\n ) {\n if (!this.activeConnection.isOpen()) {\n throw new Error('Active connection is not open');\n }\n\n const messages =\n messageOrMessages instanceof Array\n ? messageOrMessages\n : [messageOrMessages];\n this.activeConnection.ws.send(\n this.encoder.encode(messages.length === 1 ? messages[0] : messages),\n );\n }\n\n /**\n * Groups requests for batch sending.\n *\n * @returns A function to abort the batched request.\n */\n private batchSend(message: TRPCClientOutgoingMessage, callbacks: TCallbacks) {\n this.inactivityTimeout.reset();\n\n run(async () => {\n if (!this.activeConnection.isOpen()) {\n await this.open();\n }\n await sleep(0);\n\n if (!this.requestManager.hasOutgoingRequests()) return;\n\n this.send(this.requestManager.flush().map(({ message }) => message));\n }).catch((err) => {\n this.requestManager.delete(message.id);\n callbacks.error(TRPCClientError.from(err));\n });\n\n return this.requestManager.register(message, callbacks);\n }\n}\n","/* istanbul ignore file -- @preserve */\n// We're not actually exporting this link\nimport type { Unsubscribable } from '@trpc/server/observable';\nimport { observable } from '@trpc/server/observable';\nimport type { InferrableClientTypes } from '@trpc/server/unstable-core-do-not-import';\nimport { inputWithTrackedEventId } from '../internals/inputWithTrackedEventId';\nimport type { TRPCClientError } from '../TRPCClientError';\nimport type { Operation, TRPCLink } from './types';\n\ninterface RetryLinkOptions<TInferrable extends InferrableClientTypes> {\n /**\n * The retry function\n */\n retry: (opts: RetryFnOptions<TInferrable>) => boolean;\n /**\n * The delay between retries in ms (defaults to 0)\n */\n retryDelayMs?: (attempt: number) => number;\n}\n\ninterface RetryFnOptions<TInferrable extends InferrableClientTypes> {\n /**\n * The operation that failed\n */\n op: Operation;\n /**\n * The error that occurred\n */\n error: TRPCClientError<TInferrable>;\n /**\n * The number of attempts that have been made (including the first call)\n */\n attempts: number;\n}\n\n/**\n * @see https://trpc.io/docs/v11/client/links/retryLink\n */\nexport function retryLink<TInferrable extends InferrableClientTypes>(\n opts: RetryLinkOptions<TInferrable>,\n): TRPCLink<TInferrable> {\n // initialized config\n return () => {\n // initialized in app\n return (callOpts) => {\n // initialized for request\n return observable((observer) => {\n let next$: Unsubscribable;\n let callNextTimeout: ReturnType<typeof setTimeout> | undefined =\n undefined;\n\n let lastEventId: string | undefined = undefined;\n\n attempt(1);\n\n function opWithLastEventId() {\n const op = callOpts.op;\n if (!lastEventId) {\n return op;\n }\n\n return {\n ...op,\n input: inputWithTrackedEventId(op.input, lastEventId),\n };\n }\n\n function attempt(attempts: number) {\n const op = opWithLastEventId();\n\n next$ = callOpts.next(op).subscribe({\n error(error) {\n const shouldRetry = opts.retry({\n op,\n attempts,\n error,\n });\n if (!shouldRetry) {\n observer.error(error);\n return;\n }\n const delayMs = opts.retryDelayMs?.(attempts) ?? 0;\n\n if (delayMs <= 0) {\n attempt(attempts + 1);\n return;\n }\n callNextTimeout = setTimeout(\n () => attempt(attempts + 1),\n delayMs,\n );\n },\n next(envelope) {\n //\n if (\n (!envelope.result.type || envelope.result.type === 'data') &&\n envelope.result.id\n ) {\n //\n lastEventId = envelope.result.id;\n }\n\n observer.next(envelope);\n },\n complete() {\n observer.complete();\n },\n });\n }\n return () => {\n next$.unsubscribe();\n clearTimeout(callNextTimeout);\n };\n });\n };\n };\n}\n","// @ts-expect-error - polyfilling symbol\n// eslint-disable-next-line no-restricted-syntax\nSymbol.dispose ??= Symbol();\n\n// @ts-expect-error - polyfilling symbol\n// eslint-disable-next-line no-restricted-syntax\nSymbol.asyncDispose ??= Symbol();\n\n/**\n * Takes a value and a dispose function and returns a new object that implements the Disposable interface.\n * The returned object is the original value augmented with a Symbol.dispose method.\n * @param thing The value to make disposable\n * @param dispose Function to call when disposing the resource\n * @returns The original value with Symbol.dispose method added\n */\nexport function makeResource<T>(thing: T, dispose: () => void): T & Disposable {\n const it = thing as T & Partial<Disposable>;\n\n // eslint-disable-next-line no-restricted-syntax\n const existing = it[Symbol.dispose];\n\n // eslint-disable-next-line no-restricted-syntax\n it[Symbol.dispose] = () => {\n dispose();\n existing?.call(it);\n };\n\n return it as T & Disposable;\n}\n\n/**\n * Takes a value and an async dispose function and returns a new object that implements the AsyncDisposable interface.\n * The returned object is the original value augmented with a Symbol.asyncDispose method.\n * @param thing The value to make async disposable\n * @param dispose Async function to call when disposing the resource\n * @returns The original value with Symbol.asyncDispose method added\n */\nexport function makeAsyncResource<T>(\n thing: T,\n dispose: () => Promise<void>,\n): T & AsyncDisposable {\n const it = thing as T & Partial<AsyncDisposable>;\n\n // eslint-disable-next-line no-restricted-syntax\n const existing = it[Symbol.asyncDispose];\n\n // eslint-disable-next-line no-restricted-syntax\n it[Symbol.asyncDispose] = async () => {\n await dispose();\n await existing?.call(it);\n };\n\n return it as T & AsyncDisposable;\n}\n","import { makeResource } from './disposable';\n\nexport const disposablePromiseTimerResult = Symbol();\n\nexport function timerResource(ms: number) {\n let timer: ReturnType<typeof setTimeout> | null = null;\n\n return makeResource(\n {\n start() {\n if (timer) {\n throw new Error('Timer already started');\n }\n\n const promise = new Promise<typeof disposablePromiseTimerResult>(\n (resolve) => {\n timer = setTimeout(() => resolve(disposablePromiseTimerResult), ms);\n },\n );\n return promise;\n },\n },\n () => {\n if (timer) {\n clearTimeout(timer);\n }\n },\n );\n}\n","import type { Encoder } from './wsClient/encoder';\nimport { jsonEncoder } from './wsClient/encoder';\nimport type { WebSocketClientOptions } from './wsClient/options';\nimport { WsClient } from './wsClient/wsClient';\n\nexport function createWSClient(opts: WebSocketClientOptions) {\n return new WsClient(opts);\n}\n\nexport type TRPCWebSocketClient = ReturnType<typeof createWSClient>;\n\nexport { jsonEncoder, type Encoder, type WebSocketClientOptions };\n","import { observable } from '@trpc/server/observable';\nimport type {\n AnyRouter,\n inferClientTypes,\n} from '@trpc/server/unstable-core-do-not-import';\nimport type { TransformerOptions } from '../../unstable-internals';\nimport { getTransformer } from '../../unstable-internals';\nimport type { TRPCLink } from '../types';\nimport type {\n Encoder,\n TRPCWebSocketClient,\n WebSocketClientOptions,\n} from './createWsClient';\nimport { createWSClient, jsonEncoder } from './createWsClient';\n\nexport type WebSocketLinkOptions<TRouter extends AnyRouter> = {\n client: TRPCWebSocketClient;\n} & TransformerOptions<inferClientTypes<TRouter>>;\n\nexport function wsLink<TRouter extends AnyRouter>(\n opts: WebSocketLinkOptions<TRouter>,\n): TRPCLink<TRouter> {\n const { client } = opts;\n const transformer = getTransformer(opts.transformer);\n return () => {\n return ({ op }) => {\n return observable((observer) => {\n const connStateSubscription =\n op.type === 'subscription'\n ? client.connectionState.subscribe({\n next(result) {\n observer.next({\n result,\n context: op.context,\n });\n },\n })\n : null;\n\n const requestSubscription = client\n .request({\n op,\n transformer,\n })\n .subscribe(observer);\n\n return () => {\n requestSubscription.unsubscribe();\n connStateSubscription?.unsubscribe();\n };\n });\n };\n };\n}\n\nexport {\n createWSClient,\n jsonEncoder,\n type Encoder,\n type TRPCWebSocketClient,\n type WebSocketClientOptions,\n};\n","import {\n getTRPCErrorFromUnknown,\n getTRPCErrorShape,\n isTrackedEnvelope,\n} from '@trpc/server';\nimport { behaviorSubject, observable } from '@trpc/server/observable';\nimport { TRPC_ERROR_CODES_BY_KEY, type TRPCResult } from '@trpc/server/rpc';\nimport {\n callProcedure,\n isAbortError,\n isAsyncIterable,\n iteratorResource,\n makeResource,\n retryableRpcCodes,\n run,\n type AnyRouter,\n type ErrorHandlerOptions,\n type inferClientTypes,\n type inferRouterContext,\n} from '@trpc/server/unstable-core-do-not-import';\nimport { inputWithTrackedEventId } from '../internals/inputWithTrackedEventId';\nimport { abortSignalToPromise, raceAbortSignals } from '../internals/signals';\nimport { getTransformer } from '../internals/transformer';\nimport type { TransformerOptions } from '../internals/transformer';\nimport { isTRPCClientError, TRPCClientError } from '../TRPCClientError';\nimport type { TRPCConnectionState } from './internals/subscriptions';\nimport type { TRPCLink } from './types';\n\nexport type LocalLinkOptions<TRouter extends AnyRouter> = {\n router: TRouter;\n createContext: () => Promise<inferRouterContext<TRouter>>;\n onError?: (opts: ErrorHandlerOptions<inferRouterContext<TRouter>>) => void;\n} & TransformerOptions<inferClientTypes<TRouter>>;\n\n/**\n * localLink is a terminating link that allows you to make tRPC procedure calls directly in your application without going through HTTP.\n *\n * @see https://trpc.io/docs/links/localLink\n */\nexport function unstable_localLink<TRouter extends AnyRouter>(\n opts: LocalLinkOptions<TRouter>,\n): TRPCLink<TRouter> {\n const transformer = getTransformer(opts.transformer);\n\n const transformChunk = (chunk: unknown) => {\n if (opts.transformer) {\n // assume transformer will do the right thing\n return chunk;\n }\n // Special case for undefined, because `JSON.stringify(undefined)` throws\n if (chunk === undefined) {\n return chunk;\n }\n const serialized = JSON.stringify(transformer.input.serialize(chunk));\n const deserialized = JSON.parse(transformer.output.deserialize(serialized));\n return deserialized;\n };\n\n return () =>\n ({ op }) =>\n observable((observer) => {\n let ctx: inferRouterContext<TRouter> | undefined = undefined;\n const ac = new AbortController();\n\n const signal = raceAbortSignals(op.signal, ac.signal);\n const signalPromise = abortSignalToPromise(signal);\n\n signalPromise.catch(() => {\n // prevent unhandled rejection\n });\n\n let input = op.input;\n async function runProcedure(newInput: unknown): Promise<unknown> {\n input = newInput;\n\n ctx = await opts.createContext();\n\n return callProcedure({\n router: opts.router,\n path: op.path,\n getRawInput: async () => newInput,\n ctx,\n type: op.type,\n signal,\n batchIndex: 0,\n });\n }\n\n function onErrorCallback(cause: unknown) {\n if (isAbortError(cause)) {\n return;\n }\n opts.onError?.({\n error: getTRPCErrorFromUnknown(cause),\n type: op.type,\n path: op.path,\n input,\n ctx,\n });\n }\n\n function coerceToTRPCClientError(cause: unknown) {\n if (isTRPCClientError<TRouter>(cause)) {\n return cause;\n }\n const error = getTRPCErrorFromUnknown(cause);\n\n const shape = getTRPCErrorShape({\n config: opts.router._def._config,\n ctx,\n error,\n input,\n path: op.path,\n type: op.type,\n });\n return TRPCClientError.from(\n { error: transformChunk(shape) },\n { cause: cause instanceof Error ? cause : undefined },\n );\n }\n\n run(async () => {\n switch (op.type) {\n case 'query':\n case 'mutation': {\n const result = await runProcedure(op.input);\n if (!isAsyncIterable(result)) {\n observer.next({\n result: { data: transformChunk(result) },\n });\n observer.complete();\n break;\n }\n\n observer.next({\n result: {\n data: (async function* () {\n await using iterator = iteratorResource(result);\n using _finally = makeResource({}, () => {\n observer.complete();\n });\n try {\n while (true) {\n const res = await Promise.race([\n iterator.next(),\n signalPromise,\n ]);\n if (res.done) {\n return transformChunk(res.value);\n }\n yield transformChunk(res.value);\n }\n } catch (cause) {\n onErrorCallback(cause);\n throw coerceToTRPCClientError(cause);\n }\n })(),\n },\n });\n break;\n }\n case 'subscription': {\n const connectionState = behaviorSubject<\n TRPCConnectionState<TRPCClientError<any>>\n >({\n type: 'state',\n state: 'connecting',\n error: null,\n });\n\n const connectionSub = connectionState.subscribe({\n next(state) {\n observer.next({\n result: state,\n });\n },\n });\n let lastEventId: string | undefined = undefined;\n\n using _finally = makeResource({}, async () => {\n observer.complete();\n\n connectionState.next({\n type: 'state',\n state: 'idle',\n error: null,\n });\n connectionSub.unsubscribe();\n });\n while (true) {\n const result = await runProcedure(\n inputWithTrackedEventId(op.input, lastEventId),\n );\n if (!isAsyncIterable(result)) {\n throw new Error('Expected an async iterable');\n }\n await using iterator = iteratorResource(result);\n\n observer.next({\n result: {\n type: 'started',\n },\n });\n connectionState.next({\n type: 'state',\n state: 'pending',\n error: null,\n });\n\n // Use a while loop to handle errors and reconnects\n while (true) {\n let res;\n try {\n res = await Promise.race([iterator.next(), signalPromise]);\n } catch (cause) {\n if (isAbortError(cause)) {\n return;\n }\n const error = getTRPCErrorFromUnknown(cause);\n\n if (\n !retryableRpcCodes.includes(\n TRPC_ERROR_CODES_BY_KEY[error.code],\n )\n ) {\n throw coerceToTRPCClientError(error);\n }\n\n onErrorCallback(error);\n connectionState.next({\n type: 'state',\n state: 'connecting',\n error: coerceToTRPCClientError(error),\n });\n\n break;\n }\n\n if (res.done) {\n return;\n }\n let chunk: TRPCResult<unknown>;\n if (isTrackedEnvelope(res.value)) {\n lastEventId = res.value[0];\n\n chunk = {\n id: res.value[0],\n data: {\n id: res.value[0],\n data: res.value[1],\n },\n };\n } else {\n chunk = {\n data: res.value,\n };\n }\n\n observer.next({\n result: {\n ...chunk,\n data: transformChunk(chunk.data),\n },\n });\n }\n }\n break;\n }\n }\n }).catch((cause) => {\n onErrorCallback(cause);\n observer.error(coerceToTRPCClientError(cause));\n });\n\n return () => {\n ac.abort();\n };\n });\n}\n/**\n * @deprecated Renamed to `unstable_localLink`. This alias will be removed in a future major release.\n */\nexport const experimental_localLink: typeof unstable_localLink =\n unstable_localLink;\n","import { Unpromise } from '../../../vendor/unpromise';\nimport { throwAbortError } from '../../http/abortError';\nimport { makeAsyncResource } from './disposable';\nimport { disposablePromiseTimerResult, timerResource } from './timerResource';\n\nexport function iteratorResource<TYield, TReturn, TNext>(\n iterable: AsyncIterable<TYield, TReturn, TNext>,\n): AsyncIterator<TYield, TReturn, TNext> & AsyncDisposable {\n const iterator = iterable[Symbol.asyncIterator]();\n\n // @ts-expect-error - this is added in node 24 which we don't officially support yet\n // eslint-disable-next-line no-restricted-syntax\n if (iterator[Symbol.asyncDispose]) {\n return iterator as AsyncIterator<TYield, TReturn, TNext> & AsyncDisposable;\n }\n\n return makeAsyncResource(iterator, async () => {\n await iterator.return?.();\n });\n}\n\n/**\n * Derives a new {@link AsyncGenerator} based of {@link iterable}, that yields its first\n * {@link count} values. Then, a grace period of {@link gracePeriodMs} is started in which further\n * values may still come through. After this period, the generator aborts.\n */\nexport async function* takeWithGrace<T>(\n iterable: AsyncIterable<T>,\n opts: {\n count: number;\n gracePeriodMs: number;\n },\n): AsyncGenerator<T> {\n await using iterator = iteratorResource(iterable);\n\n // declaration outside the loop for garbage collection reasons\n let result: null | IteratorResult<T> | typeof disposablePromiseTimerResult;\n\n using timer = timerResource(opts.gracePeriodMs);\n\n let count = opts.count;\n\n let timerPromise = new Promise<typeof disposablePromiseTimerResult>(() => {\n // never resolves\n });\n\n while (true) {\n result = await Unpromise.race([iterator.next(), timerPromise]);\n if (result === disposablePromiseTimerResult) {\n throwAbortError();\n }\n if (result.done) {\n return result.value;\n }\n yield result.value;\n if (--count === 0) {\n timerPromise = timer.start();\n }\n // free up reference for garbage collection\n result = null;\n }\n}\n","/* eslint-disable @typescript-eslint/no-non-null-assertion */\nexport function createDeferred<TValue = void>() {\n let resolve: (value: TValue) => void;\n let reject: (error: unknown) => void;\n const promise = new Promise<TValue>((res, rej) => {\n resolve = res;\n reject = rej;\n });\n\n return { promise, resolve: resolve!, reject: reject! };\n}\nexport type Deferred<TValue> = ReturnType<typeof createDeferred<TValue>>;\n","import { createDeferred } from './createDeferred';\nimport { makeAsyncResource } from './disposable';\n\ntype ManagedIteratorResult<TYield, TReturn> =\n | { status: 'yield'; value: TYield }\n | { status: 'return'; value: TReturn }\n | { status: 'error'; error: unknown };\nfunction createManagedIterator<TYield, TReturn>(\n iterable: AsyncIterable<TYield, TReturn>,\n onResult: (result: ManagedIteratorResult<TYield, TReturn>) => void,\n) {\n const iterator = iterable[Symbol.asyncIterator]();\n let state: 'idle' | 'pending' | 'done' = 'idle';\n\n function cleanup() {\n state = 'done';\n onResult = () => {\n // noop\n };\n }\n\n function pull() {\n if (state !== 'idle') {\n return;\n }\n state = 'pending';\n\n const next = iterator.next();\n next\n .then((result) => {\n if (result.done) {\n state = 'done';\n onResult({ status: 'return', value: result.value });\n cleanup();\n return;\n }\n state = 'idle';\n onResult({ status: 'yield', value: result.value });\n })\n .catch((cause) => {\n onResult({ status: 'error', error: cause });\n cleanup();\n });\n }\n\n return {\n pull,\n destroy: async () => {\n cleanup();\n await iterator.return?.();\n },\n };\n}\ntype ManagedIterator<TYield, TReturn> = ReturnType<\n typeof createManagedIterator<TYield, TReturn>\n>;\n\ninterface MergedAsyncIterables<TYield> extends AsyncIterable<\n TYield,\n void,\n unknown\n> {\n add(iterable: AsyncIterable<TYield>): void;\n}\n\n/**\n * Creates a new async iterable that merges multiple async iterables into a single stream.\n * Values from the input iterables are yielded in the order they resolve, similar to Promise.race().\n *\n * New iterables can be added dynamically using the returned {@link MergedAsyncIterables.add} method, even after iteration has started.\n *\n * If any of the input iterables throws an error, that error will be propagated through the merged stream.\n * Other iterables will not continue to be processed.\n *\n * @template TYield The type of values yielded by the input iterables\n */\nexport function mergeAsyncIterables<TYield>(): MergedAsyncIterables<TYield> {\n let state: 'idle' | 'pending' | 'done' = 'idle';\n let flushSignal = createDeferred();\n\n /**\n * used while {@link state} is `idle`\n */\n const iterables: AsyncIterable<TYield, void, unknown>[] = [];\n /**\n * used while {@link state} is `pending`\n */\n const iterators = new Set<ManagedIterator<TYield, void>>();\n\n const buffer: Array<\n [\n iterator: ManagedIterator<TYield, void>,\n result: Exclude<\n ManagedIteratorResult<TYield, void>,\n { status: 'return' }\n >,\n ]\n > = [];\n\n function initIterable(iterable: AsyncIterable<TYield, void, unknown>) {\n if (state !== 'pending') {\n // shouldn't happen\n return;\n }\n const iterator = createManagedIterator(iterable, (result) => {\n if (state !== 'pending') {\n // shouldn't happen\n return;\n }\n switch (result.status) {\n case 'yield':\n buffer.push([iterator, result]);\n break;\n case 'return':\n iterators.delete(iterator);\n break;\n case 'error':\n buffer.push([iterator, result]);\n iterators.delete(iterator);\n break;\n }\n flushSignal.resolve();\n });\n iterators.add(iterator);\n iterator.pull();\n }\n\n return {\n add(iterable: AsyncIterable<TYield, void, unknown>) {\n switch (state) {\n case 'idle':\n iterables.push(iterable);\n break;\n case 'pending':\n initIterable(iterable);\n break;\n case 'done': {\n // shouldn't happen\n break;\n }\n }\n },\n async *[Symbol.asyncIterator]() {\n if (state !== 'idle') {\n throw new Error('Cannot iterate twice');\n }\n state = 'pending';\n\n await using _finally = makeAsyncResource({}, async () => {\n state = 'done';\n\n const errors: unknown[] = [];\n await Promise.all(\n Array.from(iterators.values()).map(async (it) => {\n try {\n await it.destroy();\n } catch (cause) {\n errors.push(cause);\n }\n }),\n );\n buffer.length = 0;\n iterators.clear();\n flushSignal.resolve();\n\n if (errors.length > 0) {\n throw new AggregateError(errors);\n }\n });\n\n while (iterables.length > 0) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n initIterable(iterables.shift()!);\n }\n\n while (iterators.size > 0) {\n await flushSignal.promise;\n\n while (buffer.length > 0) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const [iterator, result] = buffer.shift()!;\n\n switch (result.status) {\n case 'yield':\n yield result.value;\n iterator.pull();\n break;\n case 'error':\n throw result.error;\n }\n }\n flushSignal = createDeferred();\n }\n },\n };\n}\n","/**\n * Creates a ReadableStream from an AsyncIterable.\n *\n * @param iterable - The source AsyncIterable to stream from\n * @returns A ReadableStream that yields values from the AsyncIterable\n */\nexport function readableStreamFrom<TYield>(\n iterable: AsyncIterable<TYield, void>,\n): ReadableStream<TYield> {\n const iterator = iterable[Symbol.asyncIterator]();\n\n return new ReadableStream({\n async cancel() {\n await iterator.return?.();\n },\n\n async pull(controller) {\n const result = await iterator.next();\n\n if (result.done) {\n controller.close();\n return;\n }\n\n controller.enqueue(result.value);\n },\n });\n}\n","import { Unpromise } from '../../../vendor/unpromise';\nimport { iteratorResource } from './asyncIterable';\nimport { disposablePromiseTimerResult, timerResource } from './timerResource';\n\nexport const PING_SYM = Symbol('ping');\n\n/**\n * Derives a new {@link AsyncGenerator} based of {@link iterable}, that yields {@link PING_SYM}\n * whenever no value has been yielded for {@link pingIntervalMs}.\n */\nexport async function* withPing<TValue>(\n iterable: AsyncIterable<TValue>,\n pingIntervalMs: number,\n): AsyncGenerator<TValue | typeof PING_SYM> {\n await using iterator = iteratorResource(iterable);\n\n // declaration outside the loop for garbage collection reasons\n let result:\n null | IteratorResult<TValue> | typeof disposablePromiseTimerResult;\n\n let nextPromise = iterator.next();\n\n while (true) {\n using pingPromise = timerResource(pingIntervalMs);\n\n result = await Unpromise.race([nextPromise, pingPromise.start()]);\n\n if (result === disposablePromiseTimerResult) {\n // cancelled\n\n yield PING_SYM;\n continue;\n }\n\n if (result.done) {\n return result.value;\n }\n\n nextPromise = iterator.next();\n yield result.value;\n\n // free up reference for garbage collection\n result = null;\n }\n}\n","import { isPlainObject } from '@trpc/server/vendor/is-plain-object';\nimport {\n emptyObject,\n isAsyncIterable,\n isFunction,\n isObject,\n run,\n} from '../utils';\nimport { iteratorResource } from './utils/asyncIterable';\nimport type { Deferred } from './utils/createDeferred';\nimport { createDeferred } from './utils/createDeferred';\nimport { makeResource } from './utils/disposable';\nimport { mergeAsyncIterables } from './utils/mergeAsyncIterables';\nimport { readableStreamFrom } from './utils/readableStreamFrom';\nimport { PING_SYM, withPing } from './utils/withPing';\n\n/**\n * A subset of the standard ReadableStream properties needed by tRPC internally.\n * @see ReadableStream from lib.dom.d.ts\n */\nexport type WebReadableStreamEsque = {\n getReader: () => ReadableStreamDefaultReader<Uint8Array>;\n};\n\nexport type NodeJSReadableStreamEsque = {\n on(\n eventName: string | symbol,\n listener: (...args: any[]) => void,\n ): NodeJSReadableStreamEsque;\n};\n\n// ---------- types\nconst CHUNK_VALUE_TYPE_PROMISE = 0;\ntype CHUNK_VALUE_TYPE_PROMISE = typeof CHUNK_VALUE_TYPE_PROMISE;\nconst CHUNK_VALUE_TYPE_ASYNC_ITERABLE = 1;\ntype CHUNK_VALUE_TYPE_ASYNC_ITERABLE = typeof CHUNK_VALUE_TYPE_ASYNC_ITERABLE;\n\nconst PROMISE_STATUS_FULFILLED = 0;\ntype PROMISE_STATUS_FULFILLED = typeof PROMISE_STATUS_FULFILLED;\nconst PROMISE_STATUS_REJECTED = 1;\ntype PROMISE_STATUS_REJECTED = typeof PROMISE_STATUS_REJECTED;\n\nconst ASYNC_ITERABLE_STATUS_RETURN = 0;\ntype ASYNC_ITERABLE_STATUS_RETURN = typeof ASYNC_ITERABLE_STATUS_RETURN;\nconst ASYNC_ITERABLE_STATUS_YIELD = 1;\ntype ASYNC_ITERABLE_STATUS_YIELD = typeof ASYNC_ITERABLE_STATUS_YIELD;\nconst ASYNC_ITERABLE_STATUS_ERROR = 2;\ntype ASYNC_ITERABLE_STATUS_ERROR = typeof ASYNC_ITERABLE_STATUS_ERROR;\n\ntype ChunkDefinitionKey =\n // root should be replaced\n | null\n // at array path\n | number\n // at key path\n | string;\n\ntype ChunkIndex = number & { __chunkIndex: true };\ntype ChunkValueType =\n CHUNK_VALUE_TYPE_PROMISE | CHUNK_VALUE_TYPE_ASYNC_ITERABLE;\ntype ChunkDefinition = [\n key: ChunkDefinitionKey,\n type: ChunkValueType,\n chunkId: ChunkIndex,\n];\ntype EncodedValue = [\n // data\n [unknown] | [],\n // chunk descriptions\n ...ChunkDefinition[],\n];\n\ntype Head = Record<string, EncodedValue>;\ntype PromiseChunk =\n | [\n chunkIndex: ChunkIndex,\n status: PROMISE_STATUS_FULFILLED,\n value: EncodedValue,\n ]\n | [chunkIndex: ChunkIndex, status: PROMISE_STATUS_REJECTED, error: unknown];\ntype IterableChunk =\n | [\n chunkIndex: ChunkIndex,\n status: ASYNC_ITERABLE_STATUS_RETURN,\n value: EncodedValue,\n ]\n | [\n chunkIndex: ChunkIndex,\n status: ASYNC_ITERABLE_STATUS_YIELD,\n value: EncodedValue,\n ]\n | [\n chunkIndex: ChunkIndex,\n status: ASYNC_ITERABLE_STATUS_ERROR,\n error: unknown,\n ];\ntype ChunkData = PromiseChunk | IterableChunk;\ntype PlaceholderValue = 0 & { __placeholder: true };\nexport function isPromise(value: unknown): value is Promise<unknown> {\n return (\n (isObject(value) || isFunction(value)) &&\n typeof value?.['then'] === 'function' &&\n typeof value?.['catch'] === 'function'\n );\n}\n\ntype Serialize = (value: any) => any;\ntype Deserialize = (value: any) => any;\n\ntype PathArray = readonly (string | number)[];\nexport type ProducerOnError = (opts: {\n error: unknown;\n path: PathArray;\n}) => void;\nexport interface JSONLProducerOptions {\n serialize?: Serialize;\n data: Record<string, unknown> | unknown[];\n onError?: ProducerOnError;\n formatError?: (opts: { error: unknown; path: PathArray }) => unknown;\n maxDepth?: number;\n /**\n * Interval in milliseconds to send a ping to the client to keep the connection alive\n * This will be sent as a whitespace character\n * @default undefined\n */\n pingMs?: number;\n}\n\nclass MaxDepthError extends Error {\n constructor(public path: (string | number)[]) {\n super('Max depth reached at path: ' + path.join('.'));\n }\n}\n\nasync function* createBatchStreamProducer(\n opts: JSONLProducerOptions,\n): AsyncIterable<Head | ChunkData | typeof PING_SYM, void> {\n const { data } = opts;\n let counter = 0 as ChunkIndex;\n const placeholder = 0 as PlaceholderValue;\n\n const mergedIterables = mergeAsyncIterables<ChunkData>();\n function registerAsync(\n callback: (idx: ChunkIndex) => AsyncIterable<ChunkData, void>,\n ) {\n const idx = counter++ as ChunkIndex;\n\n const iterable = callback(idx);\n mergedIterables.add(iterable);\n\n return idx;\n }\n\n function encodePromise(promise: Promise<unknown>, path: (string | number)[]) {\n return registerAsync(async function* (idx) {\n const error = checkMaxDepth(path);\n if (error) {\n // Catch any errors from the original promise to ensure they're reported\n promise.catch((cause) => {\n opts.onError?.({ error: cause, path });\n });\n // Replace the promise with a rejected one containing the max depth error\n promise = Promise.reject(error);\n }\n try {\n const next = await promise;\n yield [idx, PROMISE_STATUS_FULFILLED, encode(next, path)];\n } catch (cause) {\n opts.onError?.({ error: cause, path });\n yield [\n idx,\n PROMISE_STATUS_REJECTED,\n opts.formatError?.({ error: cause, path }),\n ];\n }\n });\n }\n function encodeAsyncIterable(\n iterable: AsyncIterable<unknown>,\n path: (string | number)[],\n ) {\n return registerAsync(async function* (idx) {\n const error = checkMaxDepth(path);\n if (error) {\n throw error;\n }\n await using iterator = iteratorResource(iterable);\n\n try {\n while (true) {\n const next = await iterator.next();\n if (next.done) {\n yield [idx, ASYNC_ITERABLE_STATUS_RETURN, encode(next.value, path)];\n break;\n }\n yield [idx, ASYNC_ITERABLE_STATUS_YIELD, encode(next.value, path)];\n }\n } catch (cause) {\n opts.onError?.({ error: cause, path });\n\n yield [\n idx,\n ASYNC_ITERABLE_STATUS_ERROR,\n opts.formatError?.({ error: cause, path }),\n ];\n }\n });\n }\n function checkMaxDepth(path: (string | number)[]) {\n if (opts.maxDepth && path.length > opts.maxDepth) {\n return new MaxDepthError(path);\n }\n return null;\n }\n function encodeAsync(\n value: unknown,\n path: (string | number)[],\n ): null | [type: ChunkValueType, chunkId: ChunkIndex] {\n if (isPromise(value)) {\n return [CHUNK_VALUE_TYPE_PROMISE, encodePromise(value, path)];\n }\n if (isAsyncIterable(value)) {\n if (opts.maxDepth && path.length >= opts.maxDepth) {\n throw new Error('Max depth reached');\n }\n return [\n CHUNK_VALUE_TYPE_ASYNC_ITERABLE,\n encodeAsyncIterable(value, path),\n ];\n }\n return null;\n }\n function encode(value: unknown, path: (string | number)[]): EncodedValue {\n if (value === undefined) {\n return [[]];\n }\n const reg = encodeAsync(value, path);\n if (reg) {\n return [[placeholder], [null, ...reg]];\n }\n\n if (!isPlainObject(value)) {\n return [[value]];\n }\n\n const newObj: Record<string, unknown> = emptyObject();\n const asyncValues: ChunkDefinition[] = [];\n for (const [key, item] of Object.entries(value)) {\n const transformed = encodeAsync(item, [...path, key]);\n if (!transformed) {\n newObj[key] = item;\n continue;\n }\n newObj[key] = placeholder;\n asyncValues.push([key, ...transformed]);\n }\n return [[newObj], ...asyncValues];\n }\n\n const newHead: Head = emptyObject();\n for (const [key, item] of Object.entries(data)) {\n newHead[key] = encode(item, [key]);\n }\n\n yield newHead;\n\n let iterable: AsyncIterable<ChunkData | typeof PING_SYM, void> =\n mergedIterables;\n if (opts.pingMs) {\n iterable = withPing(mergedIterables, opts.pingMs);\n }\n\n for await (const value of iterable) {\n yield value;\n }\n}\n/**\n * JSON Lines stream producer\n * @see https://jsonlines.org/\n */\nexport function jsonlStreamProducer(opts: JSONLProducerOptions) {\n let stream = readableStreamFrom(createBatchStreamProducer(opts));\n\n const { serialize } = opts;\n if (serialize) {\n stream = stream.pipeThrough(\n new TransformStream({\n transform(chunk, controller) {\n if (chunk === PING_SYM) {\n controller.enqueue(PING_SYM);\n } else {\n controller.enqueue(serialize(chunk));\n }\n },\n }),\n );\n }\n\n return stream\n .pipeThrough(\n new TransformStream({\n transform(chunk, controller) {\n if (chunk === PING_SYM) {\n controller.enqueue(' ');\n } else {\n controller.enqueue(JSON.stringify(chunk) + '\\n');\n }\n },\n }),\n )\n .pipeThrough(new TextEncoderStream());\n}\n\nclass AsyncError extends Error {\n constructor(public readonly data: unknown) {\n super('Received error from server');\n }\n}\nexport type ConsumerOnError = (opts: { error: unknown }) => void;\n\nconst nodeJsStreamToReaderEsque = (source: NodeJSReadableStreamEsque) => {\n return {\n getReader() {\n const stream = new ReadableStream<Uint8Array>({\n start(controller) {\n source.on('data', (chunk) => {\n controller.enqueue(chunk);\n });\n source.on('end', () => {\n controller.close();\n });\n source.on('error', (error) => {\n controller.error(error);\n });\n },\n });\n return stream.getReader();\n },\n };\n};\n\nfunction createLineAccumulator(\n from: NodeJSReadableStreamEsque | WebReadableStreamEsque,\n) {\n const reader =\n 'getReader' in from\n ? from.getReader()\n : nodeJsStreamToReaderEsque(from).getReader();\n\n let lineAggregate = '';\n\n return new ReadableStream({\n async pull(controller) {\n const { done, value } = await reader.read();\n\n if (done) {\n controller.close();\n } else {\n controller.enqueue(value);\n }\n },\n cancel() {\n return reader.cancel();\n },\n })\n .pipeThrough(new TextDecoderStream())\n .pipeThrough(\n new TransformStream<string, string>({\n transform(chunk, controller) {\n lineAggregate += chunk;\n const parts = lineAggregate.split('\\n');\n lineAggregate = parts.pop() ?? '';\n for (const part of parts) {\n controller.enqueue(part);\n }\n },\n }),\n );\n}\nfunction createConsumerStream<THead>(\n from: NodeJSReadableStreamEsque | WebReadableStreamEsque,\n) {\n const stream = createLineAccumulator(from);\n\n let sentHead = false;\n return stream.pipeThrough(\n new TransformStream<string, ChunkData | THead>({\n transform(line, controller) {\n if (!sentHead) {\n const head = JSON.parse(line);\n controller.enqueue(head as THead);\n sentHead = true;\n } else {\n const chunk: ChunkData = JSON.parse(line);\n controller.enqueue(chunk);\n }\n },\n }),\n );\n}\n\n/**\n * Creates a handler for managing stream controllers and their lifecycle\n */\nfunction createStreamsManager(abortController: AbortController) {\n const controllerMap = new Map<\n ChunkIndex,\n ReturnType<typeof createStreamController>\n >();\n\n /**\n * Checks if there are no pending controllers or deferred promises\n */\n function isEmpty() {\n return Array.from(controllerMap.values()).every((c) => c.closed);\n }\n\n /**\n * Creates a stream controller\n */\n function createStreamController() {\n let originalController: ReadableStreamDefaultController<ChunkData>;\n const stream = new ReadableStream<ChunkData>({\n start(controller) {\n originalController = controller;\n },\n });\n\n const streamController = {\n enqueue: (v: ChunkData) => originalController.enqueue(v),\n close: () => {\n originalController.close();\n\n clear();\n\n if (isEmpty()) {\n abortController.abort();\n }\n },\n closed: false,\n getReaderResource: () => {\n const reader = stream.getReader();\n\n return makeResource(reader, () => {\n streamController.close();\n reader.releaseLock();\n });\n },\n error: (reason: unknown) => {\n originalController.error(reason);\n\n clear();\n },\n };\n function clear() {\n Object.assign(streamController, {\n closed: true,\n close: () => {\n // noop\n },\n enqueue: () => {\n // noop\n },\n getReaderResource: null,\n error: () => {\n // noop\n },\n });\n }\n\n return streamController;\n }\n\n /**\n * Gets or creates a stream controller\n */\n function getOrCreate(chunkId: ChunkIndex) {\n let c = controllerMap.get(chunkId);\n if (!c) {\n c = createStreamController();\n controllerMap.set(chunkId, c);\n }\n return c;\n }\n\n /**\n * Cancels all pending controllers and rejects deferred promises\n */\n function cancelAll(reason: unknown) {\n for (const controller of controllerMap.values()) {\n controller.error(reason);\n }\n }\n\n /**\n * Closes all pending controllers to preserve buffered data\n */\n function closeAll() {\n for (const controller of controllerMap.values()) {\n controller.close();\n }\n }\n\n return {\n getOrCreate,\n cancelAll,\n closeAll,\n };\n}\n\n/**\n * JSON Lines stream consumer\n * @see https://jsonlines.org/\n */\nexport async function jsonlStreamConsumer<THead>(opts: {\n from: NodeJSReadableStreamEsque | WebReadableStreamEsque;\n deserialize?: Deserialize;\n onError?: ConsumerOnError;\n formatError?: (opts: { error: unknown }) => Error;\n /**\n * This `AbortController` will be triggered when there are no more listeners to the stream.\n */\n abortController: AbortController;\n}) {\n const { deserialize = (v) => v } = opts;\n\n let source = createConsumerStream<Head>(opts.from);\n if (deserialize) {\n source = source.pipeThrough(\n new TransformStream({\n transform(chunk, controller) {\n controller.enqueue(deserialize(chunk));\n },\n }),\n );\n }\n let headDeferred: null | Deferred<THead> = createDeferred();\n\n const streamManager = createStreamsManager(opts.abortController);\n\n function decodeChunkDefinition(value: ChunkDefinition) {\n const [_path, type, chunkId] = value;\n\n const controller = streamManager.getOrCreate(chunkId);\n\n switch (type) {\n case CHUNK_VALUE_TYPE_PROMISE: {\n return run(async () => {\n using reader = controller.getReaderResource();\n\n const { value } = await reader.read();\n const [_chunkId, status, data] = value as PromiseChunk;\n switch (status) {\n case PROMISE_STATUS_FULFILLED:\n return decode(data);\n case PROMISE_STATUS_REJECTED:\n throw opts.formatError?.({ error: data }) ?? new AsyncError(data);\n }\n });\n }\n case CHUNK_VALUE_TYPE_ASYNC_ITERABLE: {\n return run(async function* () {\n using reader = controller.getReaderResource();\n\n while (true) {\n const { value } = await reader.read();\n\n const [_chunkId, status, data] = value as IterableChunk;\n\n switch (status) {\n case ASYNC_ITERABLE_STATUS_YIELD:\n yield decode(data);\n break;\n case ASYNC_ITERABLE_STATUS_RETURN:\n return decode(data);\n case ASYNC_ITERABLE_STATUS_ERROR:\n throw (\n opts.formatError?.({ error: data }) ?? new AsyncError(data)\n );\n }\n }\n });\n }\n }\n }\n\n function decode(value: EncodedValue): unknown {\n const [[data], ...asyncProps] = value;\n\n for (const value of asyncProps) {\n const [key] = value;\n const decoded = decodeChunkDefinition(value);\n\n if (key === null) {\n return decoded;\n }\n\n (data as any)[key] = decoded;\n }\n return data;\n }\n\n const handleClose = () => {\n // If the stream closes before emitting any head data,\n // we need to reject the headDeferred to prevent hanging\n if (headDeferred) {\n headDeferred.reject(new Error('Stream closed before head was received'));\n headDeferred = null;\n }\n // Close stream controllers (not error them)\n // to preserve any buffered chunks\n streamManager.closeAll();\n };\n\n const handleAbort = (reason?: unknown) => {\n headDeferred?.reject(reason);\n headDeferred = null;\n streamManager.cancelAll(reason);\n };\n\n source\n .pipeTo(\n new WritableStream({\n write(chunkOrHead) {\n if (headDeferred) {\n const head = chunkOrHead as Record<number | string, unknown>;\n\n for (const [key, value] of Object.entries(chunkOrHead)) {\n const parsed = decode(value as any);\n head[key] = parsed;\n }\n headDeferred.resolve(head as THead);\n headDeferred = null;\n\n return;\n }\n const chunk = chunkOrHead as ChunkData;\n const [idx] = chunk;\n\n const controller = streamManager.getOrCreate(idx);\n controller.enqueue(chunk);\n },\n close: handleClose,\n abort: handleAbort,\n }),\n )\n .catch((error) => {\n opts.onError?.({ error });\n handleAbort(error);\n });\n\n return [await headDeferred.promise] as const;\n}\n","import { Unpromise } from '../../vendor/unpromise';\nimport { getTRPCErrorFromUnknown } from '../error/TRPCError';\nimport { isAbortError } from '../http/abortError';\nimport type { MaybePromise } from '../types';\nimport { emptyObject, identity, run } from '../utils';\nimport type { EventSourceLike } from './sse.types';\nimport type { inferTrackedOutput } from './tracked';\nimport { isTrackedEnvelope } from './tracked';\nimport { takeWithGrace } from './utils/asyncIterable';\nimport { makeAsyncResource } from './utils/disposable';\nimport { readableStreamFrom } from './utils/readableStreamFrom';\nimport {\n disposablePromiseTimerResult,\n timerResource,\n} from './utils/timerResource';\nimport { PING_SYM, withPing } from './utils/withPing';\n\ntype Serialize = (value: any) => any;\ntype Deserialize = (value: any) => any;\n\n/**\n * @internal\n */\nexport interface SSEPingOptions {\n /**\n * Enable ping comments sent from the server\n * @default false\n */\n enabled: boolean;\n /**\n * Interval in milliseconds\n * @default 1000\n */\n intervalMs?: number;\n}\n\nexport interface SSEClientOptions {\n /**\n * Timeout and reconnect after inactivity in milliseconds\n * @default undefined\n */\n reconnectAfterInactivityMs?: number;\n}\n\nexport interface SSEStreamProducerOptions<TValue = unknown> {\n serialize?: Serialize;\n data: AsyncIterable<TValue>;\n\n maxDepth?: number;\n ping?: SSEPingOptions;\n /**\n * Maximum duration in milliseconds for the request before ending the stream\n * @default undefined\n */\n maxDurationMs?: number;\n /**\n * End the request immediately after data is sent\n * Only useful for serverless runtimes that do not support streaming responses\n * @default false\n */\n emitAndEndImmediately?: boolean;\n formatError?: (opts: { error: unknown }) => unknown;\n /**\n * Client-specific options - these will be sent to the client as part of the first message\n * @default {}\n */\n client?: SSEClientOptions;\n}\n\nconst PING_EVENT = 'ping';\nconst SERIALIZED_ERROR_EVENT = 'serialized-error';\nconst CONNECTED_EVENT = 'connected';\nconst RETURN_EVENT = 'return';\n\ninterface SSEvent {\n id?: string;\n data: unknown;\n comment?: string;\n event?: string;\n}\n/**\n *\n * @see https://html.spec.whatwg.org/multipage/server-sent-events.html\n */\nexport function sseStreamProducer<TValue = unknown>(\n opts: SSEStreamProducerOptions<TValue>,\n) {\n const { serialize = identity } = opts;\n\n const ping: Required<SSEPingOptions> = {\n enabled: opts.ping?.enabled ?? false,\n intervalMs: opts.ping?.intervalMs ?? 1000,\n };\n const client: SSEClientOptions = opts.client ?? {};\n\n if (\n ping.enabled &&\n client.reconnectAfterInactivityMs &&\n ping.intervalMs > client.reconnectAfterInactivityMs\n ) {\n throw new Error(\n `Ping interval must be less than client reconnect interval to prevent unnecessary reconnection - ping.intervalMs: ${ping.intervalMs} client.reconnectAfterInactivityMs: ${client.reconnectAfterInactivityMs}`,\n );\n }\n\n async function* generator(): AsyncIterable<SSEvent, void> {\n yield {\n event: CONNECTED_EVENT,\n data: JSON.stringify(client),\n };\n\n type TIteratorValue = Awaited<TValue> | typeof PING_SYM;\n\n let iterable: AsyncIterable<TValue | typeof PING_SYM> = opts.data;\n\n if (opts.emitAndEndImmediately) {\n iterable = takeWithGrace(iterable, {\n count: 1,\n gracePeriodMs: 1,\n });\n }\n\n if (ping.enabled && ping.intervalMs !== Infinity && ping.intervalMs > 0) {\n iterable = withPing(iterable, ping.intervalMs);\n }\n\n // We need those declarations outside the loop for garbage collection reasons. If they were\n // declared inside, they would not be freed until the next value is present.\n let value: null | TIteratorValue;\n let chunk: null | SSEvent;\n\n for await (value of iterable) {\n if (value === PING_SYM) {\n yield { event: PING_EVENT, data: '' };\n continue;\n }\n\n chunk = isTrackedEnvelope(value)\n ? { id: value[0], data: value[1] }\n : { data: value };\n\n chunk.data = JSON.stringify(serialize(chunk.data));\n\n yield chunk;\n\n // free up references for garbage collection\n value = null;\n chunk = null;\n }\n }\n\n async function* generatorWithErrorHandling(): AsyncIterable<SSEvent, void> {\n try {\n yield* generator();\n\n yield {\n event: RETURN_EVENT,\n data: '',\n };\n } catch (cause) {\n if (isAbortError(cause)) {\n // ignore abort errors, send any other errors\n return;\n }\n // `err` must be caused by `opts.data`, `JSON.stringify` or `serialize`.\n // So, a user error in any case.\n const error = getTRPCErrorFromUnknown(cause);\n const data = opts.formatError?.({ error }) ?? null;\n yield {\n event: SERIALIZED_ERROR_EVENT,\n data: JSON.stringify(serialize(data)),\n };\n }\n }\n\n const stream = readableStreamFrom(generatorWithErrorHandling());\n\n return stream\n .pipeThrough(\n new TransformStream({\n transform(chunk, controller: TransformStreamDefaultController<string>) {\n if ('event' in chunk) {\n controller.enqueue(`event: ${chunk.event}\\n`);\n }\n if ('data' in chunk) {\n controller.enqueue(`data: ${chunk.data}\\n`);\n }\n if ('id' in chunk) {\n controller.enqueue(`id: ${chunk.id}\\n`);\n }\n if ('comment' in chunk) {\n controller.enqueue(`: ${chunk.comment}\\n`);\n }\n controller.enqueue('\\n\\n');\n },\n }),\n )\n .pipeThrough(new TextEncoderStream());\n}\n\ninterface ConsumerStreamResultBase<TConfig extends ConsumerConfig> {\n eventSource: InstanceType<TConfig['EventSource']> | null;\n}\n\ninterface ConsumerStreamResultData<\n TConfig extends ConsumerConfig,\n> extends ConsumerStreamResultBase<TConfig> {\n type: 'data';\n data: inferTrackedOutput<TConfig['data']>;\n}\n\ninterface ConsumerStreamResultError<\n TConfig extends ConsumerConfig,\n> extends ConsumerStreamResultBase<TConfig> {\n type: 'serialized-error';\n error: TConfig['error'];\n}\n\ninterface ConsumerStreamResultConnecting<\n TConfig extends ConsumerConfig,\n> extends ConsumerStreamResultBase<TConfig> {\n type: 'connecting';\n event: EventSourceLike.EventOf<TConfig['EventSource']> | null;\n}\ninterface ConsumerStreamResultTimeout<\n TConfig extends ConsumerConfig,\n> extends ConsumerStreamResultBase<TConfig> {\n type: 'timeout';\n ms: number;\n}\ninterface ConsumerStreamResultPing<\n TConfig extends ConsumerConfig,\n> extends ConsumerStreamResultBase<TConfig> {\n type: 'ping';\n}\n\ninterface ConsumerStreamResultConnected<\n TConfig extends ConsumerConfig,\n> extends ConsumerStreamResultBase<TConfig> {\n type: 'connected';\n options: SSEClientOptions;\n}\n\ntype ConsumerStreamResult<TConfig extends ConsumerConfig> =\n | ConsumerStreamResultData<TConfig>\n | ConsumerStreamResultError<TConfig>\n | ConsumerStreamResultConnecting<TConfig>\n | ConsumerStreamResultTimeout<TConfig>\n | ConsumerStreamResultPing<TConfig>\n | ConsumerStreamResultConnected<TConfig>;\n\nexport interface SSEStreamConsumerOptions<TConfig extends ConsumerConfig> {\n url: () => MaybePromise<string>;\n init: () =>\n | MaybePromise<EventSourceLike.InitDictOf<TConfig['EventSource']>>\n | undefined;\n signal: AbortSignal;\n deserialize?: Deserialize;\n EventSource: TConfig['EventSource'];\n}\n\ninterface ConsumerConfig {\n data: unknown;\n error: unknown;\n EventSource: EventSourceLike.AnyConstructor;\n}\n\nasync function withTimeout<T>(opts: {\n promise: Promise<T>;\n timeoutMs: number;\n onTimeout: () => Promise<NoInfer<T>>;\n}): Promise<T> {\n using timeoutPromise = timerResource(opts.timeoutMs);\n const res = await Unpromise.race([opts.promise, timeoutPromise.start()]);\n\n if (res === disposablePromiseTimerResult) {\n return await opts.onTimeout();\n }\n return res;\n}\n\n/**\n * @see https://html.spec.whatwg.org/multipage/server-sent-events.html\n */\nexport function sseStreamConsumer<TConfig extends ConsumerConfig>(\n opts: SSEStreamConsumerOptions<TConfig>,\n): AsyncIterable<ConsumerStreamResult<TConfig>> {\n const { deserialize = (v) => v } = opts;\n\n let clientOptions: SSEClientOptions = emptyObject();\n\n const signal = opts.signal;\n\n let _es: InstanceType<TConfig['EventSource']> | null = null;\n\n const createStream = () =>\n new ReadableStream<ConsumerStreamResult<TConfig>>({\n async start(controller) {\n const [url, init] = await Promise.all([opts.url(), opts.init()]);\n const eventSource = (_es = new opts.EventSource(\n url,\n init,\n ) as InstanceType<TConfig['EventSource']>);\n\n controller.enqueue({\n type: 'connecting',\n eventSource: _es,\n event: null,\n });\n\n eventSource.addEventListener(CONNECTED_EVENT, (_msg) => {\n const msg = _msg as EventSourceLike.MessageEvent;\n\n const options: SSEClientOptions = JSON.parse(msg.data);\n\n clientOptions = options;\n controller.enqueue({\n type: 'connected',\n options,\n eventSource,\n });\n });\n\n eventSource.addEventListener(SERIALIZED_ERROR_EVENT, (_msg) => {\n const msg = _msg as EventSourceLike.MessageEvent;\n\n controller.enqueue({\n type: 'serialized-error',\n error: deserialize(JSON.parse(msg.data)),\n eventSource,\n });\n });\n eventSource.addEventListener(PING_EVENT, () => {\n controller.enqueue({\n type: 'ping',\n eventSource,\n });\n });\n eventSource.addEventListener(RETURN_EVENT, () => {\n eventSource.close();\n controller.close();\n _es = null;\n });\n eventSource.addEventListener('error', (event) => {\n if (eventSource.readyState === eventSource.CLOSED) {\n controller.error(event);\n } else {\n controller.enqueue({\n type: 'connecting',\n eventSource,\n event,\n });\n }\n });\n eventSource.addEventListener('message', (_msg) => {\n const msg = _msg as EventSourceLike.MessageEvent;\n\n const chunk = deserialize(JSON.parse(msg.data));\n\n const def: SSEvent = {\n data: chunk,\n };\n if (msg.lastEventId) {\n def.id = msg.lastEventId;\n }\n controller.enqueue({\n type: 'data',\n data: def as inferTrackedOutput<TConfig['data']>,\n eventSource,\n });\n });\n\n const onAbort = () => {\n try {\n eventSource.close();\n controller.close();\n } catch {\n // ignore errors in case the controller is already closed\n }\n };\n if (signal.aborted) {\n onAbort();\n } else {\n signal.addEventListener('abort', onAbort);\n }\n },\n cancel() {\n _es?.close();\n },\n });\n\n const getStreamResource = () => {\n let stream = createStream();\n let reader = stream.getReader();\n\n async function dispose() {\n await reader.cancel();\n _es = null;\n }\n\n return makeAsyncResource(\n {\n read() {\n return reader.read();\n },\n async recreate() {\n await dispose();\n\n stream = createStream();\n reader = stream.getReader();\n },\n },\n dispose,\n );\n };\n\n return run(async function* () {\n await using stream = getStreamResource();\n\n while (true) {\n let promise = stream.read();\n\n const timeoutMs = clientOptions.reconnectAfterInactivityMs;\n if (timeoutMs) {\n promise = withTimeout({\n promise,\n timeoutMs,\n onTimeout: async () => {\n const res: Awaited<typeof promise> = {\n value: {\n type: 'timeout',\n ms: timeoutMs,\n eventSource: _es,\n },\n done: false,\n };\n // Close and release old reader\n await stream.recreate();\n\n return res;\n },\n });\n }\n\n const result = await promise;\n\n if (result.done) {\n return result.value;\n }\n yield result.value;\n }\n });\n}\n\nexport const sseHeaders = {\n 'Content-Type': 'text/event-stream',\n 'Cache-Control': 'no-cache, no-transform',\n 'X-Accel-Buffering': 'no',\n Connection: 'keep-alive',\n} as const;\n","/* eslint-disable @typescript-eslint/no-non-null-assertion */\nimport {\n isObservable,\n observableToAsyncIterable,\n} from '../../observable/observable';\nimport { getErrorShape } from '../error/getErrorShape';\nimport { getTRPCErrorFromUnknown, TRPCError } from '../error/TRPCError';\nimport type { ProcedureType } from '../procedure';\nimport {\n type AnyRouter,\n type inferRouterContext,\n type inferRouterError,\n} from '../router';\nimport type { TRPCResponse } from '../rpc';\nimport { isPromise, jsonlStreamProducer } from '../stream/jsonl';\nimport { sseHeaders, sseStreamProducer } from '../stream/sse';\nimport { transformTRPCResponse } from '../transformer';\nimport {\n abortSignalsAnyPonyfill,\n isAsyncIterable,\n isObject,\n run,\n} from '../utils';\nimport { getAcceptHeader, getRequestInfo } from './contentType';\nimport { getHTTPStatusCode } from './getHTTPStatusCode';\nimport type {\n HTTPBaseHandlerOptions,\n ResolveHTTPRequestOptionsContextFn,\n TRPCRequestInfo,\n} from './types';\n\nfunction errorToAsyncIterable(err: TRPCError): AsyncIterable<never> {\n return run(async function* () {\n throw err;\n });\n}\ntype HTTPMethods =\n 'GET' | 'POST' | 'HEAD' | 'OPTIONS' | 'PUT' | 'DELETE' | 'PATCH';\n\nfunction combinedAbortController(signal: AbortSignal) {\n const controller = new AbortController();\n const combinedSignal = abortSignalsAnyPonyfill([signal, controller.signal]);\n return {\n signal: combinedSignal,\n controller,\n };\n}\n\nconst TYPE_ACCEPTED_METHOD_MAP: Record<ProcedureType, HTTPMethods[]> = {\n mutation: ['POST'],\n query: ['GET'],\n subscription: ['GET'],\n};\nconst TYPE_ACCEPTED_METHOD_MAP_WITH_METHOD_OVERRIDE: Record<\n ProcedureType,\n HTTPMethods[]\n> = {\n // never allow GET to do a mutation\n mutation: ['POST'],\n query: ['GET', 'POST'],\n subscription: ['GET', 'POST'],\n};\n\ninterface ResolveHTTPRequestOptions<\n TRouter extends AnyRouter,\n> extends HTTPBaseHandlerOptions<TRouter, Request> {\n createContext: ResolveHTTPRequestOptionsContextFn<TRouter>;\n req: Request;\n path: string;\n /**\n * If the request had an issue before reaching the handler\n */\n error: TRPCError | null;\n}\n\nfunction initResponse<TRouter extends AnyRouter, TRequest>(initOpts: {\n ctx: inferRouterContext<TRouter> | undefined;\n info: TRPCRequestInfo | undefined;\n responseMeta?: HTTPBaseHandlerOptions<TRouter, TRequest>['responseMeta'];\n untransformedJSON:\n | TRPCResponse<unknown, inferRouterError<TRouter>>\n | TRPCResponse<unknown, inferRouterError<TRouter>>[]\n | null;\n errors: TRPCError[];\n headers: Headers;\n}) {\n const {\n ctx,\n info,\n responseMeta,\n untransformedJSON,\n errors = [],\n headers,\n } = initOpts;\n\n let status = untransformedJSON ? getHTTPStatusCode(untransformedJSON) : 200;\n\n const eagerGeneration = !untransformedJSON;\n const data = eagerGeneration\n ? []\n : Array.isArray(untransformedJSON)\n ? untransformedJSON\n : [untransformedJSON];\n\n const meta =\n responseMeta?.({\n ctx,\n info,\n paths: info?.calls.map((call) => call.path),\n data,\n errors,\n eagerGeneration,\n type:\n info?.calls.find((call) => call.procedure?._def.type)?.procedure?._def\n .type ?? 'unknown',\n }) ?? {};\n\n if (meta.headers) {\n if (meta.headers instanceof Headers) {\n for (const [key, value] of meta.headers.entries()) {\n headers.append(key, value);\n }\n } else {\n /**\n * @deprecated, delete in v12\n */\n for (const [key, value] of Object.entries(meta.headers)) {\n if (Array.isArray(value)) {\n for (const v of value) {\n headers.append(key, v);\n }\n } else if (typeof value === 'string') {\n headers.set(key, value);\n }\n }\n }\n }\n if (meta.status) {\n status = meta.status;\n }\n\n return {\n status,\n };\n}\n\nfunction caughtErrorToData<TRouter extends AnyRouter>(\n cause: unknown,\n errorOpts: {\n opts: Pick<\n ResolveHTTPRequestOptions<TRouter>,\n 'onError' | 'req' | 'router'\n >;\n ctx: inferRouterContext<TRouter> | undefined;\n type: ProcedureType | 'unknown';\n path?: string;\n input?: unknown;\n },\n) {\n const { router, req, onError } = errorOpts.opts;\n const error = getTRPCErrorFromUnknown(cause);\n onError?.({\n error,\n path: errorOpts.path,\n input: errorOpts.input,\n ctx: errorOpts.ctx,\n type: errorOpts.type,\n req,\n });\n const untransformedJSON = {\n error: getErrorShape({\n config: router._def._config,\n error,\n type: errorOpts.type,\n path: errorOpts.path,\n input: errorOpts.input,\n ctx: errorOpts.ctx,\n }),\n };\n const transformedJSON = transformTRPCResponse(\n router._def._config,\n untransformedJSON,\n );\n const body = JSON.stringify(transformedJSON);\n return {\n error,\n untransformedJSON,\n body,\n };\n}\n\n/**\n * Check if a value is a stream-like object\n * - if it's an async iterable\n * - if it's an object with async iterables or promises\n */\nfunction isDataStream(v: unknown) {\n if (!isObject(v)) {\n return false;\n }\n\n if (isAsyncIterable(v)) {\n return true;\n }\n\n return (\n Object.values(v).some(isPromise) || Object.values(v).some(isAsyncIterable)\n );\n}\n\ntype ResultTuple<T> = [undefined, T] | [TRPCError, undefined];\n\nexport async function resolveResponse<TRouter extends AnyRouter>(\n opts: ResolveHTTPRequestOptions<TRouter>,\n): Promise<Response> {\n const { router, req } = opts;\n const headers = new Headers([['vary', 'trpc-accept, accept']]);\n const config = router._def._config;\n\n const url = new URL(req.url);\n\n if (req.method === 'HEAD') {\n // can be used for lambda warmup\n return new Response(null, {\n status: 204,\n });\n }\n\n const allowBatching = opts.allowBatching ?? opts.batching?.enabled ?? true;\n const allowMethodOverride =\n (opts.allowMethodOverride ?? false) && req.method === 'POST';\n\n type $Context = inferRouterContext<TRouter>;\n\n const infoTuple: ResultTuple<TRPCRequestInfo> = await run(async () => {\n try {\n return [\n undefined,\n await getRequestInfo({\n req,\n path: decodeURIComponent(opts.path),\n router,\n searchParams: url.searchParams,\n headers: opts.req.headers,\n url,\n maxBatchSize: opts.maxBatchSize,\n }),\n ];\n } catch (cause) {\n return [getTRPCErrorFromUnknown(cause), undefined];\n }\n });\n\n interface ContextManager {\n valueOrUndefined: () => $Context | undefined;\n value: () => $Context;\n create: (info: TRPCRequestInfo) => Promise<void>;\n }\n const ctxManager: ContextManager = run(() => {\n let result: ResultTuple<$Context> | undefined = undefined;\n return {\n valueOrUndefined: () => {\n if (!result) {\n return undefined;\n }\n return result[1];\n },\n value: () => {\n const [err, ctx] = result!;\n if (err) {\n throw err;\n }\n return ctx;\n },\n create: async (info) => {\n if (result) {\n throw new Error(\n 'This should only be called once - report a bug in tRPC',\n );\n }\n try {\n const ctx = await opts.createContext({\n info,\n });\n result = [undefined, ctx];\n } catch (cause) {\n result = [getTRPCErrorFromUnknown(cause), undefined];\n }\n },\n };\n });\n\n const methodMapper = allowMethodOverride\n ? TYPE_ACCEPTED_METHOD_MAP_WITH_METHOD_OVERRIDE\n : TYPE_ACCEPTED_METHOD_MAP;\n\n /**\n * @deprecated\n */\n const isStreamCall = getAcceptHeader(req.headers) === 'application/jsonl';\n\n const experimentalSSE = config.sse?.enabled ?? true;\n try {\n const [infoError, info] = infoTuple;\n if (infoError) {\n throw infoError;\n }\n if (info.isBatchCall && !allowBatching) {\n throw new TRPCError({\n code: 'BAD_REQUEST',\n message: `Batching is not enabled on the server`,\n });\n }\n /* istanbul ignore if -- @preserve */\n if (isStreamCall && !info.isBatchCall) {\n throw new TRPCError({\n message: `Streaming requests must be batched (you can do a batch of 1)`,\n code: 'BAD_REQUEST',\n });\n }\n await ctxManager.create(info);\n\n interface RPCResultOk {\n data: unknown;\n signal?: AbortSignal;\n }\n type RPCResult = ResultTuple<RPCResultOk>;\n const rpcCalls = info.calls.map(async (call): Promise<RPCResult> => {\n const proc = call.procedure;\n const combinedAbort = combinedAbortController(opts.req.signal);\n try {\n if (opts.error) {\n throw opts.error;\n }\n\n if (!proc) {\n throw new TRPCError({\n code: 'NOT_FOUND',\n message: `No procedure found on path \"${call.path}\"`,\n });\n }\n\n if (!methodMapper[proc._def.type].includes(req.method as HTTPMethods)) {\n throw new TRPCError({\n code: 'METHOD_NOT_SUPPORTED',\n message: `Unsupported ${req.method}-request to ${proc._def.type} procedure at path \"${call.path}\"`,\n });\n }\n\n if (proc._def.type === 'subscription') {\n /* istanbul ignore if -- @preserve */\n if (info.isBatchCall) {\n throw new TRPCError({\n code: 'BAD_REQUEST',\n message: `Cannot batch subscription calls`,\n });\n }\n\n if (config.sse?.maxDurationMs) {\n function cleanup() {\n clearTimeout(timer);\n combinedAbort.signal.removeEventListener('abort', cleanup);\n\n combinedAbort.controller.abort();\n }\n const timer = setTimeout(cleanup, config.sse.maxDurationMs);\n combinedAbort.signal.addEventListener('abort', cleanup);\n }\n }\n const data: unknown = await proc({\n path: call.path,\n getRawInput: call.getRawInput,\n ctx: ctxManager.value(),\n type: proc._def.type,\n signal: combinedAbort.signal,\n batchIndex: call.batchIndex,\n });\n return [\n undefined,\n {\n data,\n signal:\n proc._def.type === 'subscription'\n ? combinedAbort.signal\n : undefined,\n },\n ];\n } catch (cause) {\n const error = getTRPCErrorFromUnknown(cause);\n const input = call.result();\n\n opts.onError?.({\n error,\n path: call.path,\n input,\n ctx: ctxManager.valueOrUndefined(),\n type: call.procedure?._def.type ?? 'unknown',\n req: opts.req,\n });\n\n return [error, undefined];\n }\n });\n\n // ----------- response handlers -----------\n if (!info.isBatchCall) {\n const [call] = info.calls;\n const [error, result] = await rpcCalls[0]!;\n\n switch (info.type) {\n case 'unknown':\n case 'mutation':\n case 'query': {\n // httpLink\n headers.set('content-type', 'application/json');\n\n if (isDataStream(result?.data)) {\n throw new TRPCError({\n code: 'UNSUPPORTED_MEDIA_TYPE',\n message:\n 'Cannot use stream-like response in non-streaming request - use httpBatchStreamLink',\n });\n }\n const res: TRPCResponse<unknown, inferRouterError<TRouter>> = error\n ? {\n error: getErrorShape({\n config,\n ctx: ctxManager.valueOrUndefined(),\n error,\n input: call!.result(),\n path: call!.path,\n type: info.type,\n }),\n }\n : { result: { data: result.data } };\n\n const headResponse = initResponse({\n ctx: ctxManager.valueOrUndefined(),\n info,\n responseMeta: opts.responseMeta,\n errors: error ? [error] : [],\n headers,\n untransformedJSON: [res],\n });\n return new Response(\n JSON.stringify(transformTRPCResponse(config, res)),\n {\n status: headResponse.status,\n headers,\n },\n );\n }\n case 'subscription': {\n // httpSubscriptionLink\n\n const iterable: AsyncIterable<unknown> = run(() => {\n if (error) {\n return errorToAsyncIterable(error);\n }\n if (!experimentalSSE) {\n return errorToAsyncIterable(\n new TRPCError({\n code: 'METHOD_NOT_SUPPORTED',\n message: 'Missing experimental flag \"sseSubscriptions\"',\n }),\n );\n }\n\n if (!isObservable(result.data) && !isAsyncIterable(result.data)) {\n return errorToAsyncIterable(\n new TRPCError({\n message: `Subscription ${\n call!.path\n } did not return an observable or a AsyncGenerator`,\n code: 'INTERNAL_SERVER_ERROR',\n }),\n );\n }\n const dataAsIterable = isObservable(result.data)\n ? observableToAsyncIterable(result.data, opts.req.signal)\n : result.data;\n return dataAsIterable;\n });\n\n const stream = sseStreamProducer({\n ...config.sse,\n data: iterable,\n serialize: (v) => config.transformer.output.serialize(v),\n formatError(errorOpts) {\n const error = getTRPCErrorFromUnknown(errorOpts.error);\n const input = call?.result();\n const path = call?.path;\n const type = call?.procedure?._def.type ?? 'unknown';\n\n opts.onError?.({\n error,\n path,\n input,\n ctx: ctxManager.valueOrUndefined(),\n req: opts.req,\n type,\n });\n\n const shape = getErrorShape({\n config,\n ctx: ctxManager.valueOrUndefined(),\n error,\n input,\n path,\n type,\n });\n\n return shape;\n },\n });\n for (const [key, value] of Object.entries(sseHeaders)) {\n headers.set(key, value);\n }\n\n const headResponse = initResponse({\n ctx: ctxManager.valueOrUndefined(),\n info,\n responseMeta: opts.responseMeta,\n errors: [],\n headers,\n untransformedJSON: null,\n });\n\n const abortSignal = result?.signal;\n let responseBody: ReadableStream<Uint8Array> = stream;\n\n // Fixes: https://github.com/trpc/trpc/issues/7094\n if (abortSignal) {\n const reader = stream.getReader();\n const onAbort = () => void reader.cancel();\n if (abortSignal.aborted) {\n onAbort();\n } else {\n abortSignal.addEventListener('abort', onAbort, { once: true });\n }\n\n responseBody = new ReadableStream({\n async pull(controller) {\n const chunk = await reader.read();\n if (chunk.done) {\n abortSignal.removeEventListener('abort', onAbort);\n controller.close();\n } else {\n controller.enqueue(chunk.value);\n }\n },\n cancel() {\n abortSignal.removeEventListener('abort', onAbort);\n return reader.cancel();\n },\n });\n }\n\n return new Response(responseBody, {\n headers,\n status: headResponse.status,\n });\n }\n }\n }\n\n // batch response handlers\n if (info.accept === 'application/jsonl') {\n // httpBatchStreamLink\n headers.set('content-type', 'application/json');\n headers.set('transfer-encoding', 'chunked');\n const headResponse = initResponse({\n ctx: ctxManager.valueOrUndefined(),\n info,\n responseMeta: opts.responseMeta,\n errors: [],\n headers,\n untransformedJSON: null,\n });\n const stream = jsonlStreamProducer({\n ...config.jsonl,\n /**\n * Example structure for `maxDepth: 4`:\n * {\n * // 1\n * 0: {\n * // 2\n * result: {\n * // 3\n * data: // 4\n * }\n * }\n * }\n */\n maxDepth: Infinity,\n data: rpcCalls.map(async (res, index) => {\n const [error, result] = await res;\n\n const call = info.calls[index];\n\n if (error) {\n return {\n error: getErrorShape({\n config,\n ctx: ctxManager.valueOrUndefined(),\n error,\n input: call!.result(),\n path: call!.path,\n type: call!.procedure?._def.type ?? 'unknown',\n }),\n };\n }\n\n /**\n * Not very pretty, but we need to wrap nested data in promises\n * Our stream producer will only resolve top-level async values or async values that are directly nested in another async value\n */\n const iterable = isObservable(result.data)\n ? observableToAsyncIterable(result.data, opts.req.signal)\n : Promise.resolve(result.data);\n return {\n result: Promise.resolve({\n data: iterable,\n }),\n };\n }),\n serialize: (data) => config.transformer.output.serialize(data),\n onError: (cause) => {\n opts.onError?.({\n error: getTRPCErrorFromUnknown(cause.error),\n path: undefined,\n input: undefined,\n ctx: ctxManager.valueOrUndefined(),\n req: opts.req,\n type: info?.type ?? 'unknown',\n });\n },\n\n formatError(errorOpts) {\n const call = info?.calls[errorOpts.path[0] as any];\n\n const error = getTRPCErrorFromUnknown(errorOpts.error);\n const input = call?.result();\n const path = call?.path;\n const type = call?.procedure?._def.type ?? 'unknown';\n\n // no need to call `onError` here as it will be propagated through the stream itself\n\n const shape = getErrorShape({\n config,\n ctx: ctxManager.valueOrUndefined(),\n error,\n input,\n path,\n type,\n });\n\n return shape;\n },\n });\n\n return new Response(stream, {\n headers,\n status: headResponse.status,\n });\n }\n\n // httpBatchLink\n /**\n * Non-streaming response:\n * - await all responses in parallel, blocking on the slowest one\n * - create headers with known response body\n * - return a complete HTTPResponse\n */\n headers.set('content-type', 'application/json');\n const results: RPCResult[] = (await Promise.all(rpcCalls)).map(\n (res): RPCResult => {\n const [error, result] = res;\n if (error) {\n return res;\n }\n\n if (isDataStream(result.data)) {\n return [\n new TRPCError({\n code: 'UNSUPPORTED_MEDIA_TYPE',\n message:\n 'Cannot use stream-like response in non-streaming request - use httpBatchStreamLink',\n }),\n undefined,\n ];\n }\n return res;\n },\n );\n const resultAsRPCResponse = results.map(\n (\n [error, result],\n index,\n ): TRPCResponse<unknown, inferRouterError<TRouter>> => {\n const call = info.calls[index]!;\n if (error) {\n return {\n error: getErrorShape({\n config,\n ctx: ctxManager.valueOrUndefined(),\n error,\n input: call.result(),\n path: call.path,\n type: call.procedure?._def.type ?? 'unknown',\n }),\n };\n }\n return {\n result: { data: result.data },\n };\n },\n );\n\n const errors = results\n .map(([error]) => error)\n .filter(Boolean) as TRPCError[];\n\n const headResponse = initResponse({\n ctx: ctxManager.valueOrUndefined(),\n info,\n responseMeta: opts.responseMeta,\n untransformedJSON: resultAsRPCResponse,\n errors,\n headers,\n });\n\n return new Response(\n JSON.stringify(transformTRPCResponse(config, resultAsRPCResponse)),\n {\n status: headResponse.status,\n headers,\n },\n );\n } catch (cause) {\n const [_infoError, info] = infoTuple;\n const ctx = ctxManager.valueOrUndefined();\n // we get here if\n // - batching is called when it's not enabled\n // - `createContext()` throws\n // - `router._def._config.transformer.output.serialize()` throws\n // - post body is too large\n // - input deserialization fails\n // - `errorFormatter` return value is malformed\n const { error, untransformedJSON, body } = caughtErrorToData(cause, {\n opts,\n ctx: ctxManager.valueOrUndefined(),\n type: info?.type ?? 'unknown',\n });\n\n const headResponse = initResponse({\n ctx,\n info,\n responseMeta: opts.responseMeta,\n untransformedJSON,\n errors: [error],\n headers,\n });\n\n return new Response(body, {\n status: headResponse.status,\n headers,\n });\n }\n}\n","(()=>{\"use strict\";var e={912:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.ContextAPI=void 0;const n=r(108);const a=r(221);const o=r(44);const i=\"context\";const c=new n.NoopContextManager;class ContextAPI{constructor(){}static getInstance(){if(!this._instance){this._instance=new ContextAPI}return this._instance}setGlobalContextManager(e){return(0,a.registerGlobal)(i,e,o.DiagAPI.instance())}active(){return this._getContextManager().active()}with(e,t,r,...n){return this._getContextManager().with(e,t,r,...n)}bind(e,t){return this._getContextManager().bind(e,t)}_getContextManager(){return(0,a.getGlobal)(i)||c}disable(){this._getContextManager().disable();(0,a.unregisterGlobal)(i,o.DiagAPI.instance())}}t.ContextAPI=ContextAPI},44:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.DiagAPI=void 0;const n=r(757);const a=r(412);const o=r(711);const i=r(221);const c=\"diag\";class DiagAPI{constructor(){function _logProxy(e){return function(...t){const r=(0,i.getGlobal)(\"diag\");if(!r)return;return r[e](...t)}}const e=this;const setLogger=(t,r={logLevel:o.DiagLogLevel.INFO})=>{var n,c,s;if(t===e){const t=new Error(\"Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation\");e.error((n=t.stack)!==null&&n!==void 0?n:t.message);return false}if(typeof r===\"number\"){r={logLevel:r}}const u=(0,i.getGlobal)(\"diag\");const l=(0,a.createLogLevelDiagLogger)((c=r.logLevel)!==null&&c!==void 0?c:o.DiagLogLevel.INFO,t);if(u&&!r.suppressOverrideMessage){const e=(s=(new Error).stack)!==null&&s!==void 0?s:\"<failed to generate stacktrace>\";u.warn(`Current logger will be overwritten from ${e}`);l.warn(`Current logger will overwrite one already registered from ${e}`)}return(0,i.registerGlobal)(\"diag\",l,e,true)};e.setLogger=setLogger;e.disable=()=>{(0,i.unregisterGlobal)(c,e)};e.createComponentLogger=e=>new n.DiagComponentLogger(e);e.verbose=_logProxy(\"verbose\");e.debug=_logProxy(\"debug\");e.info=_logProxy(\"info\");e.warn=_logProxy(\"warn\");e.error=_logProxy(\"error\")}static instance(){if(!this._instance){this._instance=new DiagAPI}return this._instance}}t.DiagAPI=DiagAPI},262:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.MetricsAPI=void 0;const n=r(586);const a=r(221);const o=r(44);const i=\"metrics\";class MetricsAPI{constructor(){}static getInstance(){if(!this._instance){this._instance=new MetricsAPI}return this._instance}setGlobalMeterProvider(e){return(0,a.registerGlobal)(i,e,o.DiagAPI.instance())}getMeterProvider(){return(0,a.getGlobal)(i)||n.NOOP_METER_PROVIDER}getMeter(e,t,r){return this.getMeterProvider().getMeter(e,t,r)}disable(){(0,a.unregisterGlobal)(i,o.DiagAPI.instance())}}t.MetricsAPI=MetricsAPI},25:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.PropagationAPI=void 0;const n=r(221);const a=r(19);const o=r(92);const i=r(398);const c=r(504);const s=r(44);const u=\"propagation\";const l=new a.NoopTextMapPropagator;class PropagationAPI{constructor(){this.createBaggage=c.createBaggage;this.getBaggage=i.getBaggage;this.getActiveBaggage=i.getActiveBaggage;this.setBaggage=i.setBaggage;this.deleteBaggage=i.deleteBaggage}static getInstance(){if(!this._instance){this._instance=new PropagationAPI}return this._instance}setGlobalPropagator(e){return(0,n.registerGlobal)(u,e,s.DiagAPI.instance())}inject(e,t,r=o.defaultTextMapSetter){return this._getGlobalPropagator().inject(e,t,r)}extract(e,t,r=o.defaultTextMapGetter){return this._getGlobalPropagator().extract(e,t,r)}fields(){return this._getGlobalPropagator().fields()}disable(){(0,n.unregisterGlobal)(u,s.DiagAPI.instance())}_getGlobalPropagator(){return(0,n.getGlobal)(u)||l}}t.PropagationAPI=PropagationAPI},397:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.TraceAPI=void 0;const n=r(221);const a=r(498);const o=r(477);const i=r(793);const c=r(44);const s=\"trace\";class TraceAPI{constructor(){this._proxyTracerProvider=new a.ProxyTracerProvider;this.wrapSpanContext=o.wrapSpanContext;this.isSpanContextValid=o.isSpanContextValid;this.deleteSpan=i.deleteSpan;this.getSpan=i.getSpan;this.getActiveSpan=i.getActiveSpan;this.getSpanContext=i.getSpanContext;this.setSpan=i.setSpan;this.setSpanContext=i.setSpanContext}static getInstance(){if(!this._instance){this._instance=new TraceAPI}return this._instance}setGlobalTracerProvider(e){const t=(0,n.registerGlobal)(s,this._proxyTracerProvider,c.DiagAPI.instance());if(t){this._proxyTracerProvider.setDelegate(e)}return t}getTracerProvider(){return(0,n.getGlobal)(s)||this._proxyTracerProvider}getTracer(e,t){return this.getTracerProvider().getTracer(e,t)}disable(){(0,n.unregisterGlobal)(s,c.DiagAPI.instance());this._proxyTracerProvider=new a.ProxyTracerProvider}}t.TraceAPI=TraceAPI},398:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.deleteBaggage=t.setBaggage=t.getActiveBaggage=t.getBaggage=void 0;const n=r(912);const a=r(23);const o=(0,a.createContextKey)(\"OpenTelemetry Baggage Key\");function getBaggage(e){return e.getValue(o)||undefined}t.getBaggage=getBaggage;function getActiveBaggage(){return getBaggage(n.ContextAPI.getInstance().active())}t.getActiveBaggage=getActiveBaggage;function setBaggage(e,t){return e.setValue(o,t)}t.setBaggage=setBaggage;function deleteBaggage(e){return e.deleteValue(o)}t.deleteBaggage=deleteBaggage},152:(e,t)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.BaggageImpl=void 0;class BaggageImpl{constructor(e){this._entries=e?new Map(e):new Map}getEntry(e){const t=this._entries.get(e);if(!t){return undefined}return Object.assign({},t)}getAllEntries(){return Array.from(this._entries.entries()).map((([e,t])=>[e,t]))}setEntry(e,t){const r=new BaggageImpl(this._entries);r._entries.set(e,t);return r}removeEntry(e){const t=new BaggageImpl(this._entries);t._entries.delete(e);return t}removeEntries(...e){const t=new BaggageImpl(this._entries);for(const r of e){t._entries.delete(r)}return t}clear(){return new BaggageImpl}}t.BaggageImpl=BaggageImpl},647:(e,t)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.baggageEntryMetadataSymbol=void 0;t.baggageEntryMetadataSymbol=Symbol(\"BaggageEntryMetadata\")},504:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.baggageEntryMetadataFromString=t.createBaggage=void 0;const n=r(44);const a=r(152);const o=r(647);const i=n.DiagAPI.instance();function createBaggage(e={}){return new a.BaggageImpl(new Map(Object.entries(e)))}t.createBaggage=createBaggage;function baggageEntryMetadataFromString(e){if(typeof e!==\"string\"){i.error(`Cannot create baggage metadata from unknown type: ${typeof e}`);e=\"\"}return{__TYPE__:o.baggageEntryMetadataSymbol,toString(){return e}}}t.baggageEntryMetadataFromString=baggageEntryMetadataFromString},778:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.context=void 0;const n=r(912);t.context=n.ContextAPI.getInstance()},108:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.NoopContextManager=void 0;const n=r(23);class NoopContextManager{active(){return n.ROOT_CONTEXT}with(e,t,r,...n){return t.call(r,...n)}bind(e,t){return t}enable(){return this}disable(){return this}}t.NoopContextManager=NoopContextManager},23:(e,t)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.ROOT_CONTEXT=t.createContextKey=void 0;function createContextKey(e){return Symbol.for(e)}t.createContextKey=createContextKey;class BaseContext{constructor(e){const t=this;t._currentContext=e?new Map(e):new Map;t.getValue=e=>t._currentContext.get(e);t.setValue=(e,r)=>{const n=new BaseContext(t._currentContext);n._currentContext.set(e,r);return n};t.deleteValue=e=>{const r=new BaseContext(t._currentContext);r._currentContext.delete(e);return r}}}t.ROOT_CONTEXT=new BaseContext},304:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.diag=void 0;const n=r(44);t.diag=n.DiagAPI.instance()},757:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.DiagComponentLogger=void 0;const n=r(221);class DiagComponentLogger{constructor(e){this._namespace=e.namespace||\"DiagComponentLogger\"}debug(...e){return logProxy(\"debug\",this._namespace,e)}error(...e){return logProxy(\"error\",this._namespace,e)}info(...e){return logProxy(\"info\",this._namespace,e)}warn(...e){return logProxy(\"warn\",this._namespace,e)}verbose(...e){return logProxy(\"verbose\",this._namespace,e)}}t.DiagComponentLogger=DiagComponentLogger;function logProxy(e,t,r){const a=(0,n.getGlobal)(\"diag\");if(!a){return}r.unshift(t);return a[e](...r)}},83:(e,t)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.DiagConsoleLogger=void 0;const r=[{n:\"error\",c:\"error\"},{n:\"warn\",c:\"warn\"},{n:\"info\",c:\"info\"},{n:\"debug\",c:\"debug\"},{n:\"verbose\",c:\"trace\"}];class DiagConsoleLogger{constructor(){function _consoleFunc(e){return function(...t){if(console){let r=console[e];if(typeof r!==\"function\"){r=console.log}if(typeof r===\"function\"){return r.apply(console,t)}}}}for(let e=0;e<r.length;e++){this[r[e].n]=_consoleFunc(r[e].c)}}}t.DiagConsoleLogger=DiagConsoleLogger},412:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.createLogLevelDiagLogger=void 0;const n=r(711);function createLogLevelDiagLogger(e,t){if(e<n.DiagLogLevel.NONE){e=n.DiagLogLevel.NONE}else if(e>n.DiagLogLevel.ALL){e=n.DiagLogLevel.ALL}t=t||{};function _filterFunc(r,n){const a=t[r];if(typeof a===\"function\"&&e>=n){return a.bind(t)}return function(){}}return{error:_filterFunc(\"error\",n.DiagLogLevel.ERROR),warn:_filterFunc(\"warn\",n.DiagLogLevel.WARN),info:_filterFunc(\"info\",n.DiagLogLevel.INFO),debug:_filterFunc(\"debug\",n.DiagLogLevel.DEBUG),verbose:_filterFunc(\"verbose\",n.DiagLogLevel.VERBOSE)}}t.createLogLevelDiagLogger=createLogLevelDiagLogger},711:(e,t)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.DiagLogLevel=void 0;var r;(function(e){e[e[\"NONE\"]=0]=\"NONE\";e[e[\"ERROR\"]=30]=\"ERROR\";e[e[\"WARN\"]=50]=\"WARN\";e[e[\"INFO\"]=60]=\"INFO\";e[e[\"DEBUG\"]=70]=\"DEBUG\";e[e[\"VERBOSE\"]=80]=\"VERBOSE\";e[e[\"ALL\"]=9999]=\"ALL\"})(r=t.DiagLogLevel||(t.DiagLogLevel={}))},221:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.unregisterGlobal=t.getGlobal=t.registerGlobal=void 0;const n=r(678);const a=r(652);const o=r(662);const i=a.VERSION.split(\".\")[0];const c=Symbol.for(`opentelemetry.js.api.${i}`);const s=n._globalThis;function registerGlobal(e,t,r,n=false){var o;const i=s[c]=(o=s[c])!==null&&o!==void 0?o:{version:a.VERSION};if(!n&&i[e]){const t=new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);r.error(t.stack||t.message);return false}if(i.version!==a.VERSION){const t=new Error(`@opentelemetry/api: Registration of version v${i.version} for ${e} does not match previously registered API v${a.VERSION}`);r.error(t.stack||t.message);return false}i[e]=t;r.debug(`@opentelemetry/api: Registered a global for ${e} v${a.VERSION}.`);return true}t.registerGlobal=registerGlobal;function getGlobal(e){var t,r;const n=(t=s[c])===null||t===void 0?void 0:t.version;if(!n||!(0,o.isCompatible)(n)){return}return(r=s[c])===null||r===void 0?void 0:r[e]}t.getGlobal=getGlobal;function unregisterGlobal(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${a.VERSION}.`);const r=s[c];if(r){delete r[e]}}t.unregisterGlobal=unregisterGlobal},662:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.isCompatible=t._makeCompatibilityCheck=void 0;const n=r(652);const a=/^(\\d+)\\.(\\d+)\\.(\\d+)(-(.+))?$/;function _makeCompatibilityCheck(e){const t=new Set([e]);const r=new Set;const n=e.match(a);if(!n){return()=>false}const o={major:+n[1],minor:+n[2],patch:+n[3],prerelease:n[4]};if(o.prerelease!=null){return function isExactmatch(t){return t===e}}function _reject(e){r.add(e);return false}function _accept(e){t.add(e);return true}return function isCompatible(e){if(t.has(e)){return true}if(r.has(e)){return false}const n=e.match(a);if(!n){return _reject(e)}const i={major:+n[1],minor:+n[2],patch:+n[3],prerelease:n[4]};if(i.prerelease!=null){return _reject(e)}if(o.major!==i.major){return _reject(e)}if(o.major===0){if(o.minor===i.minor&&o.patch<=i.patch){return _accept(e)}return _reject(e)}if(o.minor<=i.minor){return _accept(e)}return _reject(e)}}t._makeCompatibilityCheck=_makeCompatibilityCheck;t.isCompatible=_makeCompatibilityCheck(n.VERSION)},120:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.metrics=void 0;const n=r(262);t.metrics=n.MetricsAPI.getInstance()},532:(e,t)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.ValueType=void 0;var r;(function(e){e[e[\"INT\"]=0]=\"INT\";e[e[\"DOUBLE\"]=1]=\"DOUBLE\"})(r=t.ValueType||(t.ValueType={}))},440:(e,t)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.createNoopMeter=t.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=t.NOOP_OBSERVABLE_GAUGE_METRIC=t.NOOP_OBSERVABLE_COUNTER_METRIC=t.NOOP_UP_DOWN_COUNTER_METRIC=t.NOOP_HISTOGRAM_METRIC=t.NOOP_COUNTER_METRIC=t.NOOP_METER=t.NoopObservableUpDownCounterMetric=t.NoopObservableGaugeMetric=t.NoopObservableCounterMetric=t.NoopObservableMetric=t.NoopHistogramMetric=t.NoopUpDownCounterMetric=t.NoopCounterMetric=t.NoopMetric=t.NoopMeter=void 0;class NoopMeter{constructor(){}createHistogram(e,r){return t.NOOP_HISTOGRAM_METRIC}createCounter(e,r){return t.NOOP_COUNTER_METRIC}createUpDownCounter(e,r){return t.NOOP_UP_DOWN_COUNTER_METRIC}createObservableGauge(e,r){return t.NOOP_OBSERVABLE_GAUGE_METRIC}createObservableCounter(e,r){return t.NOOP_OBSERVABLE_COUNTER_METRIC}createObservableUpDownCounter(e,r){return t.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC}addBatchObservableCallback(e,t){}removeBatchObservableCallback(e){}}t.NoopMeter=NoopMeter;class NoopMetric{}t.NoopMetric=NoopMetric;class NoopCounterMetric extends NoopMetric{add(e,t){}}t.NoopCounterMetric=NoopCounterMetric;class NoopUpDownCounterMetric extends NoopMetric{add(e,t){}}t.NoopUpDownCounterMetric=NoopUpDownCounterMetric;class NoopHistogramMetric extends NoopMetric{record(e,t){}}t.NoopHistogramMetric=NoopHistogramMetric;class NoopObservableMetric{addCallback(e){}removeCallback(e){}}t.NoopObservableMetric=NoopObservableMetric;class NoopObservableCounterMetric extends NoopObservableMetric{}t.NoopObservableCounterMetric=NoopObservableCounterMetric;class NoopObservableGaugeMetric extends NoopObservableMetric{}t.NoopObservableGaugeMetric=NoopObservableGaugeMetric;class NoopObservableUpDownCounterMetric extends NoopObservableMetric{}t.NoopObservableUpDownCounterMetric=NoopObservableUpDownCounterMetric;t.NOOP_METER=new NoopMeter;t.NOOP_COUNTER_METRIC=new NoopCounterMetric;t.NOOP_HISTOGRAM_METRIC=new NoopHistogramMetric;t.NOOP_UP_DOWN_COUNTER_METRIC=new NoopUpDownCounterMetric;t.NOOP_OBSERVABLE_COUNTER_METRIC=new NoopObservableCounterMetric;t.NOOP_OBSERVABLE_GAUGE_METRIC=new NoopObservableGaugeMetric;t.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=new NoopObservableUpDownCounterMetric;function createNoopMeter(){return t.NOOP_METER}t.createNoopMeter=createNoopMeter},586:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.NOOP_METER_PROVIDER=t.NoopMeterProvider=void 0;const n=r(440);class NoopMeterProvider{getMeter(e,t,r){return n.NOOP_METER}}t.NoopMeterProvider=NoopMeterProvider;t.NOOP_METER_PROVIDER=new NoopMeterProvider},678:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var a=this&&this.__exportStar||function(e,t){for(var r in e)if(r!==\"default\"&&!Object.prototype.hasOwnProperty.call(t,r))n(t,e,r)};Object.defineProperty(t,\"__esModule\",{value:true});a(r(59),t)},460:(e,t)=>{Object.defineProperty(t,\"__esModule\",{value:true});t._globalThis=void 0;t._globalThis=typeof globalThis===\"object\"?globalThis:global},59:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var a=this&&this.__exportStar||function(e,t){for(var r in e)if(r!==\"default\"&&!Object.prototype.hasOwnProperty.call(t,r))n(t,e,r)};Object.defineProperty(t,\"__esModule\",{value:true});a(r(460),t)},27:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.propagation=void 0;const n=r(25);t.propagation=n.PropagationAPI.getInstance()},19:(e,t)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.NoopTextMapPropagator=void 0;class NoopTextMapPropagator{inject(e,t){}extract(e,t){return e}fields(){return[]}}t.NoopTextMapPropagator=NoopTextMapPropagator},92:(e,t)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.defaultTextMapSetter=t.defaultTextMapGetter=void 0;t.defaultTextMapGetter={get(e,t){if(e==null){return undefined}return e[t]},keys(e){if(e==null){return[]}return Object.keys(e)}};t.defaultTextMapSetter={set(e,t,r){if(e==null){return}e[t]=r}}},816:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.trace=void 0;const n=r(397);t.trace=n.TraceAPI.getInstance()},374:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.NonRecordingSpan=void 0;const n=r(546);class NonRecordingSpan{constructor(e=n.INVALID_SPAN_CONTEXT){this._spanContext=e}spanContext(){return this._spanContext}setAttribute(e,t){return this}setAttributes(e){return this}addEvent(e,t){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return false}recordException(e,t){}}t.NonRecordingSpan=NonRecordingSpan},637:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.NoopTracer=void 0;const n=r(912);const a=r(793);const o=r(374);const i=r(477);const c=n.ContextAPI.getInstance();class NoopTracer{startSpan(e,t,r=c.active()){const n=Boolean(t===null||t===void 0?void 0:t.root);if(n){return new o.NonRecordingSpan}const s=r&&(0,a.getSpanContext)(r);if(isSpanContext(s)&&(0,i.isSpanContextValid)(s)){return new o.NonRecordingSpan(s)}else{return new o.NonRecordingSpan}}startActiveSpan(e,t,r,n){let o;let i;let s;if(arguments.length<2){return}else if(arguments.length===2){s=t}else if(arguments.length===3){o=t;s=r}else{o=t;i=r;s=n}const u=i!==null&&i!==void 0?i:c.active();const l=this.startSpan(e,o,u);const g=(0,a.setSpan)(u,l);return c.with(g,s,undefined,l)}}t.NoopTracer=NoopTracer;function isSpanContext(e){return typeof e===\"object\"&&typeof e[\"spanId\"]===\"string\"&&typeof e[\"traceId\"]===\"string\"&&typeof e[\"traceFlags\"]===\"number\"}},76:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.NoopTracerProvider=void 0;const n=r(637);class NoopTracerProvider{getTracer(e,t,r){return new n.NoopTracer}}t.NoopTracerProvider=NoopTracerProvider},779:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.ProxyTracer=void 0;const n=r(637);const a=new n.NoopTracer;class ProxyTracer{constructor(e,t,r,n){this._provider=e;this.name=t;this.version=r;this.options=n}startSpan(e,t,r){return this._getTracer().startSpan(e,t,r)}startActiveSpan(e,t,r,n){const a=this._getTracer();return Reflect.apply(a.startActiveSpan,a,arguments)}_getTracer(){if(this._delegate){return this._delegate}const e=this._provider.getDelegateTracer(this.name,this.version,this.options);if(!e){return a}this._delegate=e;return this._delegate}}t.ProxyTracer=ProxyTracer},498:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.ProxyTracerProvider=void 0;const n=r(779);const a=r(76);const o=new a.NoopTracerProvider;class ProxyTracerProvider{getTracer(e,t,r){var a;return(a=this.getDelegateTracer(e,t,r))!==null&&a!==void 0?a:new n.ProxyTracer(this,e,t,r)}getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:o}setDelegate(e){this._delegate=e}getDelegateTracer(e,t,r){var n;return(n=this._delegate)===null||n===void 0?void 0:n.getTracer(e,t,r)}}t.ProxyTracerProvider=ProxyTracerProvider},312:(e,t)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.SamplingDecision=void 0;var r;(function(e){e[e[\"NOT_RECORD\"]=0]=\"NOT_RECORD\";e[e[\"RECORD\"]=1]=\"RECORD\";e[e[\"RECORD_AND_SAMPLED\"]=2]=\"RECORD_AND_SAMPLED\"})(r=t.SamplingDecision||(t.SamplingDecision={}))},793:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.getSpanContext=t.setSpanContext=t.deleteSpan=t.setSpan=t.getActiveSpan=t.getSpan=void 0;const n=r(23);const a=r(374);const o=r(912);const i=(0,n.createContextKey)(\"OpenTelemetry Context Key SPAN\");function getSpan(e){return e.getValue(i)||undefined}t.getSpan=getSpan;function getActiveSpan(){return getSpan(o.ContextAPI.getInstance().active())}t.getActiveSpan=getActiveSpan;function setSpan(e,t){return e.setValue(i,t)}t.setSpan=setSpan;function deleteSpan(e){return e.deleteValue(i)}t.deleteSpan=deleteSpan;function setSpanContext(e,t){return setSpan(e,new a.NonRecordingSpan(t))}t.setSpanContext=setSpanContext;function getSpanContext(e){var t;return(t=getSpan(e))===null||t===void 0?void 0:t.spanContext()}t.getSpanContext=getSpanContext},285:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.TraceStateImpl=void 0;const n=r(240);const a=32;const o=512;const i=\",\";const c=\"=\";class TraceStateImpl{constructor(e){this._internalState=new Map;if(e)this._parse(e)}set(e,t){const r=this._clone();if(r._internalState.has(e)){r._internalState.delete(e)}r._internalState.set(e,t);return r}unset(e){const t=this._clone();t._internalState.delete(e);return t}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce(((e,t)=>{e.push(t+c+this.get(t));return e}),[]).join(i)}_parse(e){if(e.length>o)return;this._internalState=e.split(i).reverse().reduce(((e,t)=>{const r=t.trim();const a=r.indexOf(c);if(a!==-1){const o=r.slice(0,a);const i=r.slice(a+1,t.length);if((0,n.validateKey)(o)&&(0,n.validateValue)(i)){e.set(o,i)}else{}}return e}),new Map);if(this._internalState.size>a){this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,a))}}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){const e=new TraceStateImpl;e._internalState=new Map(this._internalState);return e}}t.TraceStateImpl=TraceStateImpl},240:(e,t)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.validateValue=t.validateKey=void 0;const r=\"[_0-9a-z-*/]\";const n=`[a-z]${r}{0,255}`;const a=`[a-z0-9]${r}{0,240}@[a-z]${r}{0,13}`;const o=new RegExp(`^(?:${n}|${a})$`);const i=/^[ -~]{0,255}[!-~]$/;const c=/,|=/;function validateKey(e){return o.test(e)}t.validateKey=validateKey;function validateValue(e){return i.test(e)&&!c.test(e)}t.validateValue=validateValue},87:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.createTraceState=void 0;const n=r(285);function createTraceState(e){return new n.TraceStateImpl(e)}t.createTraceState=createTraceState},546:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.INVALID_SPAN_CONTEXT=t.INVALID_TRACEID=t.INVALID_SPANID=void 0;const n=r(731);t.INVALID_SPANID=\"0000000000000000\";t.INVALID_TRACEID=\"00000000000000000000000000000000\";t.INVALID_SPAN_CONTEXT={traceId:t.INVALID_TRACEID,spanId:t.INVALID_SPANID,traceFlags:n.TraceFlags.NONE}},613:(e,t)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.SpanKind=void 0;var r;(function(e){e[e[\"INTERNAL\"]=0]=\"INTERNAL\";e[e[\"SERVER\"]=1]=\"SERVER\";e[e[\"CLIENT\"]=2]=\"CLIENT\";e[e[\"PRODUCER\"]=3]=\"PRODUCER\";e[e[\"CONSUMER\"]=4]=\"CONSUMER\"})(r=t.SpanKind||(t.SpanKind={}))},477:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.wrapSpanContext=t.isSpanContextValid=t.isValidSpanId=t.isValidTraceId=void 0;const n=r(546);const a=r(374);const o=/^([0-9a-f]{32})$/i;const i=/^[0-9a-f]{16}$/i;function isValidTraceId(e){return o.test(e)&&e!==n.INVALID_TRACEID}t.isValidTraceId=isValidTraceId;function isValidSpanId(e){return i.test(e)&&e!==n.INVALID_SPANID}t.isValidSpanId=isValidSpanId;function isSpanContextValid(e){return isValidTraceId(e.traceId)&&isValidSpanId(e.spanId)}t.isSpanContextValid=isSpanContextValid;function wrapSpanContext(e){return new a.NonRecordingSpan(e)}t.wrapSpanContext=wrapSpanContext},854:(e,t)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.SpanStatusCode=void 0;var r;(function(e){e[e[\"UNSET\"]=0]=\"UNSET\";e[e[\"OK\"]=1]=\"OK\";e[e[\"ERROR\"]=2]=\"ERROR\"})(r=t.SpanStatusCode||(t.SpanStatusCode={}))},731:(e,t)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.TraceFlags=void 0;var r;(function(e){e[e[\"NONE\"]=0]=\"NONE\";e[e[\"SAMPLED\"]=1]=\"SAMPLED\"})(r=t.TraceFlags||(t.TraceFlags={}))},652:(e,t)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.VERSION=void 0;t.VERSION=\"1.6.0\"}};var t={};function __nccwpck_require__(r){var n=t[r];if(n!==undefined){return n.exports}var a=t[r]={exports:{}};var o=true;try{e[r].call(a.exports,a,a.exports,__nccwpck_require__);o=false}finally{if(o)delete t[r]}return a.exports}if(typeof __nccwpck_require__!==\"undefined\")__nccwpck_require__.ab=__dirname+\"/\";var r={};(()=>{var e=r;Object.defineProperty(e,\"__esModule\",{value:true});e.trace=e.propagation=e.metrics=e.diag=e.context=e.INVALID_SPAN_CONTEXT=e.INVALID_TRACEID=e.INVALID_SPANID=e.isValidSpanId=e.isValidTraceId=e.isSpanContextValid=e.createTraceState=e.TraceFlags=e.SpanStatusCode=e.SpanKind=e.SamplingDecision=e.ProxyTracerProvider=e.ProxyTracer=e.defaultTextMapSetter=e.defaultTextMapGetter=e.ValueType=e.createNoopMeter=e.DiagLogLevel=e.DiagConsoleLogger=e.ROOT_CONTEXT=e.createContextKey=e.baggageEntryMetadataFromString=void 0;var t=__nccwpck_require__(504);Object.defineProperty(e,\"baggageEntryMetadataFromString\",{enumerable:true,get:function(){return t.baggageEntryMetadataFromString}});var n=__nccwpck_require__(23);Object.defineProperty(e,\"createContextKey\",{enumerable:true,get:function(){return n.createContextKey}});Object.defineProperty(e,\"ROOT_CONTEXT\",{enumerable:true,get:function(){return n.ROOT_CONTEXT}});var a=__nccwpck_require__(83);Object.defineProperty(e,\"DiagConsoleLogger\",{enumerable:true,get:function(){return a.DiagConsoleLogger}});var o=__nccwpck_require__(711);Object.defineProperty(e,\"DiagLogLevel\",{enumerable:true,get:function(){return o.DiagLogLevel}});var i=__nccwpck_require__(440);Object.defineProperty(e,\"createNoopMeter\",{enumerable:true,get:function(){return i.createNoopMeter}});var c=__nccwpck_require__(532);Object.defineProperty(e,\"ValueType\",{enumerable:true,get:function(){return c.ValueType}});var s=__nccwpck_require__(92);Object.defineProperty(e,\"defaultTextMapGetter\",{enumerable:true,get:function(){return s.defaultTextMapGetter}});Object.defineProperty(e,\"defaultTextMapSetter\",{enumerable:true,get:function(){return s.defaultTextMapSetter}});var u=__nccwpck_require__(779);Object.defineProperty(e,\"ProxyTracer\",{enumerable:true,get:function(){return u.ProxyTracer}});var l=__nccwpck_require__(498);Object.defineProperty(e,\"ProxyTracerProvider\",{enumerable:true,get:function(){return l.ProxyTracerProvider}});var g=__nccwpck_require__(312);Object.defineProperty(e,\"SamplingDecision\",{enumerable:true,get:function(){return g.SamplingDecision}});var p=__nccwpck_require__(613);Object.defineProperty(e,\"SpanKind\",{enumerable:true,get:function(){return p.SpanKind}});var d=__nccwpck_require__(854);Object.defineProperty(e,\"SpanStatusCode\",{enumerable:true,get:function(){return d.SpanStatusCode}});var _=__nccwpck_require__(731);Object.defineProperty(e,\"TraceFlags\",{enumerable:true,get:function(){return _.TraceFlags}});var f=__nccwpck_require__(87);Object.defineProperty(e,\"createTraceState\",{enumerable:true,get:function(){return f.createTraceState}});var b=__nccwpck_require__(477);Object.defineProperty(e,\"isSpanContextValid\",{enumerable:true,get:function(){return b.isSpanContextValid}});Object.defineProperty(e,\"isValidTraceId\",{enumerable:true,get:function(){return b.isValidTraceId}});Object.defineProperty(e,\"isValidSpanId\",{enumerable:true,get:function(){return b.isValidSpanId}});var v=__nccwpck_require__(546);Object.defineProperty(e,\"INVALID_SPANID\",{enumerable:true,get:function(){return v.INVALID_SPANID}});Object.defineProperty(e,\"INVALID_TRACEID\",{enumerable:true,get:function(){return v.INVALID_TRACEID}});Object.defineProperty(e,\"INVALID_SPAN_CONTEXT\",{enumerable:true,get:function(){return v.INVALID_SPAN_CONTEXT}});const O=__nccwpck_require__(778);Object.defineProperty(e,\"context\",{enumerable:true,get:function(){return O.context}});const P=__nccwpck_require__(304);Object.defineProperty(e,\"diag\",{enumerable:true,get:function(){return P.diag}});const N=__nccwpck_require__(120);Object.defineProperty(e,\"metrics\",{enumerable:true,get:function(){return N.metrics}});const S=__nccwpck_require__(27);Object.defineProperty(e,\"propagation\",{enumerable:true,get:function(){return S.propagation}});const C=__nccwpck_require__(816);Object.defineProperty(e,\"trace\",{enumerable:true,get:function(){return C.trace}});e[\"default\"]={context:O.context,diag:P.diag,metrics:N.metrics,propagation:S.propagation,trace:C.trace}})();module.exports=r})();","(()=>{\"use strict\";if(typeof __nccwpck_require__!==\"undefined\")__nccwpck_require__.ab=__dirname+\"/\";var e={};(()=>{var r=e;\n/*!\n * cookie\n * Copyright(c) 2012-2014 Roman Shtylman\n * Copyright(c) 2015 Douglas Christopher Wilson\n * MIT Licensed\n */r.parse=parse;r.serialize=serialize;var i=decodeURIComponent;var t=encodeURIComponent;var a=/; */;var n=/^[\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+$/;function parse(e,r){if(typeof e!==\"string\"){throw new TypeError(\"argument str must be a string\")}var t={};var n=r||{};var o=e.split(a);var s=n.decode||i;for(var p=0;p<o.length;p++){var f=o[p];var u=f.indexOf(\"=\");if(u<0){continue}var v=f.substr(0,u).trim();var c=f.substr(++u,f.length).trim();if('\"'==c[0]){c=c.slice(1,-1)}if(undefined==t[v]){t[v]=tryDecode(c,s)}}return t}function serialize(e,r,i){var a=i||{};var o=a.encode||t;if(typeof o!==\"function\"){throw new TypeError(\"option encode is invalid\")}if(!n.test(e)){throw new TypeError(\"argument name is invalid\")}var s=o(r);if(s&&!n.test(s)){throw new TypeError(\"argument val is invalid\")}var p=e+\"=\"+s;if(null!=a.maxAge){var f=a.maxAge-0;if(isNaN(f)||!isFinite(f)){throw new TypeError(\"option maxAge is invalid\")}p+=\"; Max-Age=\"+Math.floor(f)}if(a.domain){if(!n.test(a.domain)){throw new TypeError(\"option domain is invalid\")}p+=\"; Domain=\"+a.domain}if(a.path){if(!n.test(a.path)){throw new TypeError(\"option path is invalid\")}p+=\"; Path=\"+a.path}if(a.expires){if(typeof a.expires.toUTCString!==\"function\"){throw new TypeError(\"option expires is invalid\")}p+=\"; Expires=\"+a.expires.toUTCString()}if(a.httpOnly){p+=\"; HttpOnly\"}if(a.secure){p+=\"; Secure\"}if(a.sameSite){var u=typeof a.sameSite===\"string\"?a.sameSite.toLowerCase():a.sameSite;switch(u){case true:p+=\"; SameSite=Strict\";break;case\"lax\":p+=\"; SameSite=Lax\";break;case\"strict\":p+=\"; SameSite=Strict\";break;case\"none\":p+=\"; SameSite=None\";break;default:throw new TypeError(\"option sameSite is invalid\")}}return p}function tryDecode(e,r){try{return r(e)}catch(r){return e}}})();module.exports=e})();","if (process.env.NEXT_RUNTIME === 'edge') {\n module.exports = require('next/dist/server/route-modules/app-route/module.js')\n} else {\n if (process.env.__NEXT_EXPERIMENTAL_REACT) {\n if (process.env.NODE_ENV === 'development') {\n if (process.env.TURBOPACK) {\n module.exports = require('next/dist/compiled/next-server/app-route-turbo-experimental.runtime.dev.js')\n } else {\n module.exports = require('next/dist/compiled/next-server/app-route-experimental.runtime.dev.js')\n }\n } else {\n if (process.env.TURBOPACK) {\n module.exports = require('next/dist/compiled/next-server/app-route-turbo-experimental.runtime.prod.js')\n } else {\n module.exports = require('next/dist/compiled/next-server/app-route-experimental.runtime.prod.js')\n }\n }\n } else {\n if (process.env.NODE_ENV === 'development') {\n if (process.env.TURBOPACK) {\n module.exports = require('next/dist/compiled/next-server/app-route-turbo.runtime.dev.js')\n } else {\n module.exports = require('next/dist/compiled/next-server/app-route.runtime.dev.js')\n }\n } else {\n if (process.env.TURBOPACK) {\n module.exports = require('next/dist/compiled/next-server/app-route-turbo.runtime.prod.js')\n } else {\n module.exports = require('next/dist/compiled/next-server/app-route.runtime.prod.js')\n }\n }\n }\n}\n","module.exports.cookies = require('./dist/server/request/cookies').cookies\nmodule.exports.headers = require('./dist/server/request/headers').headers\nmodule.exports.draftMode = require('./dist/server/request/draft-mode').draftMode\n"],"names":["forbidden","DIGEST","HTTP_ERROR_FALLBACK_ERROR_CODE","process","env","__NEXT_EXPERIMENTAL_AUTH_INTERRUPTS","Error","error","digest","DynamicServerError","isDynamicServerError","DYNAMIC_ERROR_CODE","constructor","description","err","HTTPAccessErrorStatus","getAccessFallbackErrorTypeByStatus","getAccessFallbackHTTPStatus","isHTTPAccessFallbackError","NOT_FOUND","FORBIDDEN","UNAUTHORIZED","ALLOWED_CODES","Set","Object","values","prefix","httpStatus","split","has","Number","status","isNextRouterError","isRedirectError","ReadonlyURLSearchParams","RedirectType","notFound","permanentRedirect","redirect","unauthorized","unstable_isUnrecognizedActionError","unstable_rethrow","push","replace","ReadonlyURLSearchParamsError","URLSearchParams","append","delete","set","sort","REDIRECT_ERROR_CODE","errorCode","type","destination","slice","join","at","statusCode","isNaN","RedirectStatusCode","getRedirectError","getRedirectStatusCodeFromError","getRedirectTypeFromError","getURLFromRedirectError","url","TemporaryRedirect","actionAsyncStorage","getStore","isAction","PermanentRedirect","workAsyncStorage","workUnitAsyncStorage","StaticGenBailoutError","isStaticGenBailoutError","NEXT_STATIC_GEN_BAILOUT","code","isBailoutToCSRError","isHangingPromiseRejectionError","isPrerenderInterruptedError","cause","__defProp","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toCommonJS","mod","value","src_exports","RequestCookies","ResponseCookies","parseCookie","parseSetCookie","stringifyCookie","module","exports","c","_a","attrs","path","expires","Date","toUTCString","maxAge","domain","secure","httpOnly","sameSite","partitioned","priority","filter","Boolean","stringified","encodeURIComponent","length","cookie","map","Map","pair","splitAt","indexOf","decodeURIComponent","setCookie","attributes","httponly","maxage","samesite","fromEntries","value2","toLowerCase","parseSameSite","parsePriority","compact","t","newT","SAME_SITE","string","includes","PRIORITY","splitCookiesString","cookiesString","cookiesStrings","pos","start","ch","lastComma","nextStart","cookiesSeparatorFound","skipWhitespace","test","charAt","notSpecialChar","substring","requestHeaders","_parsed","_headers","header","parsed","Symbol","iterator","size","args","getAll","Array","_","n","names","result","isArray","clear","keys","for","JSON","stringify","toString","v","responseHeaders","_b","_c","getSetCookie","cookieStrings","cookieString","normalizeCookie","options","bag","headers","serialized","now","RouteKind","METADATA_BOUNDARY_NAME","OUTLET_BOUNDARY_NAME","ROOT_LAYOUT_BOUNDARY_NAME","VIEWPORT_BOUNDARY_NAME","atLeastOneTask","scheduleImmediate","scheduleOnNextTick","waitAtLeastOneReactRenderTask","cb","Promise","resolve","then","NEXT_RUNTIME","setTimeout","nextTick","setImmediate","r","createDynamicBodyError","createDynamicBodyErrorInNavigation","createDynamicBodyErrorInStaticRoute","createDynamicMetadataError","createDynamicMetadataErrorInStaticRoute","createDynamicOrRuntimeBodyError","createDynamicOrRuntimeMetadataError","createDynamicOrRuntimeViewportError","createDynamicViewportError","createDynamicViewportErrorInStaticRoute","createLinkBodyErrorInNavigation","createLinkMetadataError","createLinkViewportError","createNavigationBodyErrorInNavigation","createNavigationMetadataError","createNavigationViewportError","createNonPrerenderableBodyErrorInStaticRoute","createNonPrerenderableMetadataErrorInStaticRoute","createNonPrerenderableViewportErrorInStaticRoute","createPrefetchBodyErrorInNavigation","createPrefetchMetadataError","createPrefetchViewportError","createRuntimeBodyError","createRuntimeBodyErrorInNavigation","createRuntimeBodyErrorInStaticRoute","createRuntimeMetadataError","createRuntimeMetadataErrorInStaticRoute","createRuntimeViewportError","createRuntimeViewportErrorInStaticRoute","logBuildDebugHint","route","NODE_ENV","console","__NEXT_DEV_SERVER","DynamicHoleKind","PreludeState","abortAndThrowOnSynchronousRequestDataAccess","abortOnSynchronousPlatformIOAccess","accessedDynamicData","annotateDynamicAccess","consumeDynamicAccess","createDynamicTrackingState","createDynamicValidationState","createHangingInputAbortSignal","createInstantValidationState","formatDynamicAPIAccesses","getDisallowedReasonsInStaticRoute","getFirstDynamicReason","getNavigationDisallowedDynamicReasons","getStaticShellDisallowedDynamicReasons","logDisallowedDynamicError","markCurrentScopeAsDynamic","throwIfDisallowedDynamic","throwIfDisallowedDynamicInStaticRoute","throwIfSyncIOUsed","throwToInterruptStaticGeneration","trackAllowedDynamicAccess","trackDynamicAccessInStaticRoute","trackDynamicDataInDynamicRender","trackDynamicHoleInNavigation","trackDynamicHoleInStaticShell","trackThrownErrorInNavigation","isDebugDynamicAccesses","dynamicAccesses","syncDynamicErrorWithStack","syncDynamicErrorWithStackPostMicrotask","hasSuspenseAboveBody","hasDynamicMetadata","dynamicMetadata","hasDynamicViewport","hasAllowedDynamic","dynamicErrors","getPendingClientSyncDynamicError","clientDynamic","trackingState","expression","store","workUnitStore","forceDynamic","forceStatic","dynamicShouldError","revalidate","dynamicUsageDescription","dynamicUsageStack","stack","markRequestStoreAsDynamic","prerenderStore","requestStore","phase","usedDynamic","abortOnSynchronousDynamicDataAccess","reason","createPrerenderInterruptedError","controller","abort","dynamicTracking","undefined","errorWithStack","queueMicrotask","prerenderSignal","signal","aborted","NEXT_PRERENDER_INTERRUPTED","message","serverDynamic","access","line","AbortController","cacheSignal","inputReady","stagedRendering","getStagedRenderingController","finalStage","waitForStage","noop","hasSuspenseRegex","bodyAndImplicitTags","hasSuspenseBeforeRootLayoutWithoutBodyOrImplicitBodyRegex","RegExp","hasMetadataRegex","hasViewportRegex","hasOutletRegex","hasInstantValidationBoundaryRegex","INSTANT_VALIDATION_BOUNDARY_NAME","slotMarkerRegex","INSTANT_SLOT_MARKER_PREFIX","INSTANT_SLOT_MARKER_SUFFIX","resolveInstantStack","componentStack","dynamicValidation","slotStacks","match","exec","slotIndex","parseInt","slotStack","trackOutletSuspenseAboveBody","dynamicReason","workStore","isServerPartial","kind","syncDynamicError","addErrorContext","createMetadataErrorInStaticRoute","createViewportErrorInStaticRoute","hasSuspense","isClientHookDynamicError","createBodyErrorInStaticRoute","createBodyError","dynamicHoleKind","hasAllowedClientDynamicAboveBoundary","validationPreventingErrors","thrownErrorsOutsideBoundary","boundaryState","effectiveCreateInstantStack","createMetadataError","createViewportError","boundaryLocation","allRequiredBoundariesRendered","suspenseLocation","index","createBodyErrorInNavigation","thrownValue","reactBrowserBailout","browserBailoutReason","getReactBrowserBailoutReason","browserBailoutError","createInstantStack","ownerStack","React","captureOwnerStack","prelude","allowEmptyStaticShell","i","isFallbackShell","reasons","InvariantError","validationSampleTracking","devRenderDidError","missingSampleErrors","rootInstantStack","missingFiles","id","filePaths","requiredIds","renderedIds","filePath","normalized","cwd","createUnrenderedSegmentError","AggregateError","createValidationBoundaryTracking","matchPrevious","state","EnsureStaticLevel","resolveEnsureStaticConfig","resolveEnsureStaticLevel","getEnsureStaticLevel","ensureStatic","tree","partialPrefetching","config","resolveEnsureStaticConfigImpl","originalConfig","warn","formatEnsureStaticExport","layoutOrPageMod","getLayoutOrPageModule","getEnsureStaticConfigForModule","parentResult","slotsResult","slotResultKey","parallelRoutes","parseLoaderTree","parallelRouteKey","parallelRoute","childResult","compareEnsureStatic","formatParallelSlot","comparison","slot","Comparison","ENSURE_STATIC_ORDER","left","right","leftSort","rightSort","RENDER_STAGE_ADVANCE_ORDER","RenderStage","StagedRenderingController","SyncIOMode","getNextStage","isAdvanceableRenderStage","stage","abortSignal","abandonController","syncIO","currentStage","syncInterruptReason","triggers","createAdvanceableStageTriggers","syncIOMode","addEventListener","trigger","cancelStageTrigger","once","abandonRender","onStage","callback","addSyncTriggerListener","shouldTrackSyncInterrupt","syncInterruptCurrentStageWithReason","advanceStage","getSyncInterruptReason","getStageEndTime","triggeredAt","Infinity","nextStageIx","dynamicStageIx","resolveStage","targetStage","targetStageIx","fireStageTrigger","getStagePromise","promise","delayUntilStage","displayName","resolvedValue","stagePromise","makeDevtoolsIOPromiseFromIOTrigger","catch","ignoreReject","createStageTrigger","ioTrigger","reject","bind","listener","_listeners","createPromiseWithResolvers","_resolvePromise","_rejectPromise","performance","timeOrigin","listeners","createDedupedByCallsiteServerErrorLoggerDev","errorRef","current","cache","fn","logErrorOrWarn","__NEXT_CACHE_COMPONENTS","flushCurrentErrorIfNew","getMessage","logDedupedError","callStackFrames","ClientHookDynamicError","RENDER_STAGES_BY_DATA_KIND","applyOwnerStack","createPrerenderDataTracking","finishPrerenderDataTracking","makeClientHookHangingPromise","makeDevtoolsIOAwarePromise","makeDynamicHangingPromise","makeFallbackParamsHangingPromise","makePrefetchHangingPromise","makePromiseFromTrigger","makeSessionDataHangingPromise","makeURLDataHangingPromise","makeUnknownRuntimeDataHangingPromise","makeUntrackedHangingPromise","trackFallbackParamsAccessed","trackIncompatibleShellContent","trackPromiseUsed","trackURLDataAccessed","HANGING_PROMISE_REJECTION","HangingPromiseRejectionError","CLIENT_HOOK_DYNAMIC","abortListenersBySignal","WeakMap","makeHangingPromiseWithError","trackSessionDataAccessed","runtimeDataAccessed","shouldAttemptStaticShell","shouldAttemptStaticPrefetch","prerenderDataTracking","trackRuntimeDataAccessed","dataKind","Before","NavigationStatic","ensureStaticLevel","None","firstAffectedStage","ShellStatic","Shell","logRuntimeDeopt","PrefetchStatic","Prefetch","markRuntimeDataAccessWhenStageReached","isFallbackUpgradeable","logRuntimeUpgradeableFallback","stageController","NEXT_PRIVATE_DEBUG_RUNTIME_DATA","log","Dynamic","Abandoned","NEXT_PRIVATE_DEBUG_VALIDATION","hasIncompatibleShellContent","hangingPromise","boundRejection","currentListeners","underlying","onUse","TrackedPromise","species","tracked","onFulfilled","onRejected","sessionData","ShellRuntime","staticUrlData","prefetchApi","static","PrefetchStatic_prefetchApi","runtime","PrefetchRuntime_prefetchApi","PrefetchRuntime","runtimeUrlData","getClientReact","getServerReact","innerOwnerStack","outerOwnerStack","frames","frame","getComponentTypeModule","loaderTree","layout","page","defaultPage","isLayout","isPage","isDefaultPage","DEFAULT_SEGMENT_KEY","modType","moduleType","cookies","callingExpression","isRequestApiAllowedInCurrentPhase","underlyingCookies","createEmptyCookies","makeUntrackedCookies","createCookiesInUseCacheError","captureStackTrace","invalidDynamicUsageError","createCookiesInUnstableCacheError","functionName","makeHangingCookies","exportName","areCookiesMutableInCurrentPhase","userspaceMutableCookies","makeUntrackedCookiesWithDevWarnings","asyncApiPromises","mutableCookies","throwForMissingRequestStore","RequestCookiesAdapter","seal","Headers","CachedCookies","cachedPromise","renderSignal","cachedCookies","instrumentCookiesPromiseWithDevWarnings","proxiedPromise","warnForSyncAccess","createCookiesAccessError","defineProperties","replaceableWarningDescriptorForSymbolIterator","replaceableWarningDescriptor","prop","writable","configurable","draftMode","DraftMode","createOrGetCachedDraftMode","draftModeProvider","getDraftModeProviderForCacheScope","cacheKey","NullDraftMode","cachedDraftMode","CachedDraftModes","isPrefetchRequest","createDraftModeWithDevWarnings","underlyingProvider","instance","Proxy","receiver","ReflectAdapter","provider","_provider","isEnabled","enable","trackDynamicDraftMode","disable","createDraftModeAccessError","constructorOpt","createDraftModeMutationInUseCacheError","createDraftModeMutationInUnstableCacheError","underlyingHeaders","HeadersAdapter","makeUntrackedHeaders","createHeadersInUseCacheError","createHeadersInUnstableCacheError","makeHangingHeaders","makeUntrackedHeadersWithDevWarnings","CachedHeaders","cachedHeaders","instrumentHeadersPromiseWithDevWarnings","createHeadersAccessError","forEach","entries","throwForSearchParamsAccessInUseCache","throwWithStaticGenerationBailoutErrorWithDynamicError","createSearchParamsInUseCacheError","actionStore","isAppRoute","afterTaskStore","afterTaskAsyncStorage","rootTaskSpawnPhase","require","__NEXT_EXPERIMENTAL_REACT","TURBOPACK","vendored","createCacheLifeOutsideUseCacheError","createCacheTagOutsideUseCacheError","createConnectionInPrivateUseCacheError","createConnectionInPublicUseCacheError","createConnectionInUnstableCacheError","createNestedCacheShortExpireError","createNestedCacheZeroRevalidateError","createRevalidateDuringRenderError","createRevalidateInBuildTimeGeneratorError","createRevalidateInCachedFunctionError","createRouteHandlerRequestInUnstableCacheError","createRouteHandlerRequestInUseCacheError","createUseCachePrivateInsidePublicUseCacheError","createUseCachePrivateInsideUnstableCacheError","createUseCachePrivateOutsideRequestContextError","NEXT_REQUEST_IN_USE_CACHE","UNSTABLE_CACHE_API_DOCS","USE_CACHE_PRIVATE_API_DOCS","CACHE_TAG_OUTSIDE_USE_CACHE","CACHE_LIFE_OUTSIDE_USE_CACHE","USE_CACHE_PRIVATE_COMPOSITION","REVALIDATE_IN_USE_CACHE","NESTED_USE_CACHE_NO_EXPLICIT_CACHELIFE","generatorName","routePrefix","ReadonlyHeadersError","callable","createPassThroughMethods","sealed","callbackfn","thisArg","createHidingMethods","isHidden","entry","lowercased","original","find","o","deleteProperty","hidden","methods","fresh","merge","existing","Reflect","MutableRequestCookiesAdapter","ReadonlyRequestCookiesError","appendMutableCookies","createCookiesWithMutableAccessCheck","getModifiedCookieValues","responseCookiesToRequestCookies","SYMBOL_MODIFY_COOKIE_VALUES","modified","modifiedCookieValues","resCookies","returnedCookies","wrap","onUpdateCookies","responseCookies","modifiedValues","modifiedCookies","updateResponseCookies","pathWasRevalidated","ActionDidRevalidateStaticAndDynamic","allCookies","serializedCookies","tempCookies","wrappedCookies","add","ensureCookiesAreStillMutable","_callingExpression","requestCookies","ActionDidNotRevalidate","ActionDidRevalidateDynamicOnly","createLinkPrefetchPartialError","label","p","pathname","endsWith","BailoutToCSRError","BAILOUT_TO_CSR","createReactBrowserBailoutReason","isNextBrowserBailoutError","REACT_BROWSER_BAILOUT_REASON","$$typeof","res","rej","segment","modules","staticSiblings","template","conventionPath","NOT_FOUND_SEGMENT_KEY","PAGE_SEGMENT_KEY","computeSelectedLayoutSegment","getSegmentValue","getSelectedLayoutSegmentPath","isGroupSegment","isParallelRouteSegment","startsWith","segments","rawSegment","first","segmentPath","node","children","segmentValue","assertEqual","val","toZod","assertNotEqual","schema","_x","_arg","assert","numericValues","k","getEnumValues","assertIs","assertNever","array","jsonStringifyReplacer","joinValues","separator","Cached","stringifyPrimitive","_getter","getter","end","_value","input","cached","source","nullish","ratio","step","round","abs","Math","floatSafeRemainder","EVALUATING","max","tolerance","cleanRegex","object","mirrorShape","roundedRatio","EPSILON","defineLazy","obj","getPrototypeOf","objectClone","create","getOwnPropertyDescriptors","shape","navigator","raw","assignProp","deferProp","def","rawShape","_zod","keyCount","getParsedType","data","sourceShape","putProp","ownKeys","mirrorProps","mergedDescriptors","mergeDefs","inst","descriptors","resolvedObj","chars","acc","results","getElementAtPath","promisesObj","cloneDef","str","promises","defs","isObject","assign","globalConfig","reduce","trim","promiseAllObject","ctor","userAgent","randomString","floor","random","esc","slugify","_args","allowsEval","jitless","numKeys","F","Function","shallowClone","isPlainObject","prot","params","File","createTransparentProxy","cl","parent","normalizeParams","_params","safeint","checks","propertyKeyTypes","primitiveTypes","currDef","escapeRegex","mask","clone","constr","descriptor","MIN_SAFE_INTEGER","BigInt","hasChecks","b","a","MAX_SAFE_INTEGER","maskedKeys","newShape","String","existingShape","optionalKeys","optin","optout","NUMBER_FORMAT_RANGES","extended","int32","uint32","float32","float64","MAX_VALUE","BIGINT_FORMAT_RANGES","int64","uint64","pick","x","prefixIssues","omit","omitted","extend","selected","d","issues","Class","traits","iss","continue","safeExtend","customError","catchall","explicitlyAborted","startIndex","partial","innerType","required","units","highSurrogate","charCodeAt","unshift","unwrapMessage","sizeCaps","defChecks","caps","getSizableOrigin","check","base64","maximum","bytes","attachSchema","finalizeIssue","ctx","Uint8Array","schemaError","full","padStart","localeError","reportInput","count","padding","proto","codePointLength","parsedType","own","getLengthableOrigin","table","compute","atob","issue","uint8ArrayToBase64","cleanEnum","el","base64ToUint8Array","binaryString","cleanHex","fromCharCode","btoa","base64urlToUint8Array","base64url","repeat","uint8ArrayToBase64url","hexToUint8Array","hex","uint8ArrayToHex","members","defineBound","breaker","broke","hide","derived","computes","claim","sentinel","installing","defineLazyInternal","outer","installLazyProp","make","CONSTANT_CATCH","constantCatch","msg","e","ContextAPI","NoopContextManager","getInstance","_instance","setGlobalContextManager","registerGlobal","DiagAPI","active","_getContextManager","with","getGlobal","unregisterGlobal","_logProxy","setLogger","logLevel","DiagLogLevel","INFO","s","u","l","createLogLevelDiagLogger","suppressOverrideMessage","createComponentLogger","DiagComponentLogger","verbose","debug","info","MetricsAPI","setGlobalMeterProvider","getMeterProvider","NOOP_METER_PROVIDER","getMeter","PropagationAPI","NoopTextMapPropagator","createBaggage","getBaggage","getActiveBaggage","setBaggage","deleteBaggage","setGlobalPropagator","inject","defaultTextMapSetter","_getGlobalPropagator","extract","defaultTextMapGetter","fields","TraceAPI","_proxyTracerProvider","ProxyTracerProvider","wrapSpanContext","isSpanContextValid","deleteSpan","getSpan","getActiveSpan","getSpanContext","setSpan","setSpanContext","setGlobalTracerProvider","setDelegate","getTracerProvider","getTracer","createContextKey","getValue","setValue","deleteValue","BaggageImpl","_entries","getEntry","getAllEntries","setEntry","removeEntry","removeEntries","baggageEntryMetadataSymbol","baggageEntryMetadataFromString","__TYPE__","context","ROOT_CONTEXT","BaseContext","_currentContext","diag","_namespace","namespace","logProxy","DiagConsoleLogger","_consoleFunc","apply","NONE","ALL","_filterFunc","ERROR","WARN","DEBUG","VERBOSE","VERSION","_globalThis","version","isCompatible","_makeCompatibilityCheck","major","minor","patch","prerelease","isExactmatch","_reject","_accept","metrics","ValueType","createNoopMeter","NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC","NOOP_OBSERVABLE_GAUGE_METRIC","NOOP_OBSERVABLE_COUNTER_METRIC","NOOP_UP_DOWN_COUNTER_METRIC","NOOP_HISTOGRAM_METRIC","NOOP_COUNTER_METRIC","NOOP_METER","NoopObservableUpDownCounterMetric","NoopObservableGaugeMetric","NoopObservableCounterMetric","NoopObservableMetric","NoopHistogramMetric","NoopUpDownCounterMetric","NoopCounterMetric","NoopMetric","NoopMeter","createHistogram","createCounter","createUpDownCounter","createObservableGauge","createObservableCounter","createObservableUpDownCounter","addBatchObservableCallback","removeBatchObservableCallback","record","addCallback","removeCallback","NoopMeterProvider","__createBinding","__exportStar","globalThis","propagation","trace","NonRecordingSpan","INVALID_SPAN_CONTEXT","_spanContext","spanContext","setAttribute","setAttributes","addEvent","setStatus","updateName","isRecording","recordException","NoopTracer","startSpan","root","isSpanContext","startActiveSpan","arguments","g","NoopTracerProvider","ProxyTracer","_getTracer","_delegate","getDelegateTracer","getDelegate","SamplingDecision","TraceStateImpl","_internalState","_parse","_clone","unset","serialize","_keys","reverse","validateKey","validateValue","createTraceState","INVALID_TRACEID","INVALID_SPANID","traceId","spanId","traceFlags","TraceFlags","SpanKind","isValidSpanId","isValidTraceId","SpanStatusCode","__nccwpck_require__","ab","f","O","P","N","S","C","parse","TypeError","decode","substr","tryDecode","encode","isFinite"],"mappings":"iCAqBO,SAASA,IAEZ,MAAM,AAAIM,MACR,CAAC,6GAOP,EAPsH,CAAC,uEAHvGN,YAAAA,qCAAAA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E,CAA2D,GAAvDiyB,EAAE7xB,QAAQ,EAAC,CAACuoB,GAAG,YAAA,EAAgBsJ,EAAE9xB,MAAM,EAAC,CAACwoB,GAAG,UAAA,EAAcsJ,EAAE5xB,QAAQ,CAAyE,CAAxE,MAA2B,AAAoDw5B,UAAxE,OAAO5H,EAAE5xB,QAAQ,CAAY4xB,EAAE5xB,QAAQ,CAACsB,WAAW,GAAGswB,EAAE5xB,QAAQ,EAAW,KAAK,EAAsE,IAAI,SAArEsoB,GAAG,oBAAoB,KAAM,KAAI,MAAMA,GAAG,iBAAiB,KAAgD,KAAI,OAAOA,GAAG,kBAAkB,KAAM,SAAQ,MAAM,AAAIoc,UAAU,6BAA6B,CAAE,OAAOpc,CAAC,EAA9lDtX,EAAElQ,mBAAuBY,EAAEpB,mBAAuBsxB,EAAE,MAAUluB,EAAE,wCAA+lDvE,EAAOC,OAAO,CAACi5B,EAAC,CAAC,oBCoBntDl5B,EAAOC,OAAO,CAAGkkB,EAAQ,CAAA,CAAA,IAAA,oBC1BjCnkB,EAAOC,OAAO,CAAC+e,OAAO,CAAG,EAAA,CAAA,CAAA,MAAyCA,OAAO,CACzEhf,EAAOC,OAAO,CAAC0F,OAAO,CAAG,EAAA,CAAA,CAAA,OAAyCA,OAAO,CACzE3F,EAAOC,OAAO,CAACmhB,SAAS,CAAG,EAAA,CAAA,CAAA,OAA4CA,SAAS","ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,135,136,137,138,139,140,141,142,143,144,145,146,147,149,150,151,152,153,154,155,156,157,158,161,162,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209]}
|